Merge pull request #862 from NoRedInk/jutessa/add-elm-review

Jutessa/add elm review
This commit is contained in:
Tessa 2022-03-15 11:56:39 -07:00 committed by GitHub
commit bcc4f319b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
94 changed files with 248 additions and 648 deletions

View File

@ -48,6 +48,8 @@ main = do
"tests/elm-verify-examples.json",
"log/elm-verify-examples.txt",
"log/elm-test.txt",
"log/elm-review.txt",
"log/elm-review-styleguide.txt",
"log/axe-report.txt",
"log/percy-tests.txt",
"log/forbidden-imports-report.txt",
@ -83,6 +85,16 @@ main = do
need (["package.json", "elm.json"] ++ elmFiles)
cmd (WithStdout True) (FileStdout out) "elm-test"
"log/elm-review.txt" %> \out -> do
elmFiles <- getDirectoryFiles "." ["src/**/*.elm", "tests/**/*.elm"]
need (["package.json", "elm.json"] ++ elmFiles)
cmd (WithStdout True) (FileStdout out) "elm-review"
"log/elm-review-styleguide.txt" %> \out -> do
elmFiles <- getDirectoryFiles "." ["styleguide-app/**/*.elm"]
need (["package.json", "elm.json", "styleguide-app/elm.json"] ++ elmFiles)
cmd (Cwd "styleguide-app") (WithStdout True) (FileStdout out) "elm-review"
"log/elm-verify-examples.txt" %> \out -> do
elmFiles <- getDirectoryFiles "." ["src/**/*.elm"]
need (["tests/elm-verify-examples.json"] ++ elmFiles)

View File

@ -78,7 +78,6 @@
"Gizra/elm-keyboard-event": "1.0.1 <= v < 2.0.0",
"elm/browser": "1.0.2 <= v < 2.0.0",
"elm/core": "1.0.1 <= v < 2.0.0",
"elm/html": "1.0.0 <= v < 2.0.0",
"elm/http": "2.0.0 <= v < 3.0.0",
"elm/json": "1.1.3 <= v < 2.0.0",
"elm/random": "1.0.0 <= v < 2.0.0",
@ -93,6 +92,7 @@
},
"test-dependencies": {
"avh4/elm-program-test": "3.3.0 <= v < 4.0.0",
"elm/html": "1.0.0 <= v < 2.0.0",
"elm-explorations/test": "1.2.2 <= v < 2.0.0",
"tesk9/accessible-html": "4.1.0 <= v < 5.0.0"
}

35
review/elm.json Normal file
View File

@ -0,0 +1,35 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/core": "1.0.5",
"elm/json": "1.1.3",
"elm/project-metadata-utils": "1.0.2",
"jfmengels/elm-review": "2.7.0",
"jfmengels/elm-review-unused": "1.1.20",
"stil4m/elm-syntax": "7.2.9"
},
"indirect": {
"elm/html": "1.0.0",
"elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
"elm-community/list-extra": "8.5.2",
"elm-explorations/test": "1.2.2",
"miniBill/elm-unicode": "1.0.2",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
},
"indirect": {}
}
}

View File

@ -0,0 +1,41 @@
module ReviewConfig exposing (config)
{-| Do not rename the ReviewConfig module or the config function, because
`elm-review` will look for these.
To add packages that contain rules, add them to this review project using
`elm install author/packagename`
when inside the directory containing this file.
-}
import NoUnused.CustomTypeConstructorArgs
import NoUnused.CustomTypeConstructors
import NoUnused.Dependencies
import NoUnused.Exports
import NoUnused.Modules
import NoUnused.Parameters
import NoUnused.Patterns
import NoUnused.Variables
import Review.Rule exposing (Rule)
config : List Rule
config =
[ NoUnused.CustomTypeConstructors.rule []
-- sometimes we just want to build a value without extracting it
-- , NoUnused.CustomTypeConstructorArgs.rule
, NoUnused.Dependencies.rule
-- We want to include all functions even if they're unused in this repository.
-- , NoUnused.Exports.rule
, NoUnused.Modules.rule
-- We like to keep parameters around for readability.
-- , NoUnused.Parameters.rule
-- , NoUnused.Patterns.rule
, NoUnused.Variables.rule
]

View File

@ -1,6 +1,9 @@
let
sources = import ./nix/sources.nix;
system = if builtins.currentSystem == "aarch64-darwin" then "x86_64-darwin" else builtins.currentSystem;
system = if builtins.currentSystem == "aarch64-darwin" then
"x86_64-darwin"
else
builtins.currentSystem;
nixpkgs = import sources.nixpkgs { inherit system; };
niv = nixpkgs.callPackage sources.niv { };
in with nixpkgs;
@ -25,6 +28,8 @@ stdenv.mkDerivation {
elmPackages.elm-format
elmPackages.elm-test
elmPackages.elm-verify-examples
elmPackages.elm-review
elmPackages.elm-json
(pkgs.callPackage sources.elm-forbid-import { })
# preview dependencies

View File

@ -19,7 +19,7 @@ import Html.Styled exposing (Attribute)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
import Json.Decode
import Nri.Ui.Html.Attributes.V2 as AttributeExtras exposing (targetBlank)
import Nri.Ui.Html.Attributes.V2 exposing (targetBlank)
{-| -}

View File

@ -15,7 +15,7 @@ module InputErrorAndGuidanceInternal exposing
-}
import Accessibility.Styled.Aria as Aria
import Css exposing (Style)
import Css
import Html.Styled as Html exposing (Html)
import Nri.Ui.Html.Attributes.V2
import Nri.Ui.Message.V3 as Message

View File

@ -11,7 +11,6 @@ import Accessibility.Styled.Style as Accessibility
import Css
import Html.Styled.Attributes as Attributes
import InputErrorAndGuidanceInternal exposing (ErrorState)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.InputStyles.V3 as InputStyles exposing (Theme)

View File

@ -13,7 +13,6 @@ module Nri.Ui.Accordion.V1 exposing
-}
import Accessibility.Styled exposing (Attribute, Html, button, div, text)
import Accessibility.Styled.Role as Role
import Css exposing (..)
import Css.Global
import Html.Styled.Attributes as Attributes

View File

@ -59,10 +59,9 @@ module Nri.Ui.Accordion.V3 exposing
-}
import Accessibility.Styled exposing (Attribute, Html, button, div, section, text)
import Accessibility.Styled exposing (Html, button, div, section)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Key as Key
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import Css.Global
@ -70,7 +69,6 @@ import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events exposing (onClick)
import Html.Styled.Keyed
import Json.Decode as Decode
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as AttributesExtra

View File

@ -1,17 +0,0 @@
module Nri.Ui.AssetPath.Css exposing (url)
{-| Helper for constructing commonly-used CSS functions
that reference assets.
@docs url
-}
import Nri.Ui.AssetPath as AssetPath exposing (Asset)
{-| Given an `Asset`, wrap its URL in a call to `url()`.
-}
url : Asset -> String
url asset =
"url(" ++ AssetPath.url asset ++ ")"

View File

@ -84,7 +84,6 @@ adding a span around the text could potentially lead to regressions.
import Accessibility.Styled as Html exposing (Html)
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Style exposing (invisibleStyle)
import Accessibility.Styled.Widget as Widget
import ClickableAttributes exposing (ClickableAttributes)
import Css exposing (Style)

View File

@ -28,19 +28,16 @@ module Nri.Ui.Checkbox.V5 exposing
-}
import Accessibility.Styled as Html
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Style
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import Css.Global
import Html.Events
import Html.Styled
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Events as Events
import Json.Decode
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.V3 as HtmlExtra exposing (defaultOptions)
import Nri.Ui.Svg.V1 exposing (Svg)
import Svg.Styled as Svg
import Svg.Styled.Attributes as SvgAttributes

View File

@ -491,15 +491,6 @@ renderButton ((ButtonOrLink config) as button_) =
]
type Link
= Default
| WithTracking
| SinglePageApp
| WithMethod String
| External
| ExternalWithTracking
renderLink : ButtonOrLink msg -> Html msg
renderLink ((ButtonOrLink config) as link_) =
let

View File

@ -57,7 +57,7 @@ consider [elm-color-extra](http://package.elm-lang.org/packages/eskimoblood/elm-
-}
import Css exposing (hex, rgba)
import Css exposing (hex)
import Nri.Ui.Colors.Extra exposing (withAlpha)

View File

@ -54,7 +54,6 @@ import Nri.Ui
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.MediaQuery.V1 exposing (mobile)
import Nri.Ui.Text.V6 as Text
{-| -}

View File

@ -1,269 +0,0 @@
module Nri.Ui.CssFlexBoxWithVendorPrefix exposing
( displayFlex, displayInlineFlex, flexDirection, justifyContent, alignItems, alignSelf, flexBasis
, flexGrow, flexShrink, row, rowReverse, column, columnReverse, flexStart, flexEnd, baseline, stretch, center, spaceBetween, spaceAround, flexWrap, nowrap, wrap, wrapReverse
)
{-|
@docs displayFlex, displayInlineFlex, flexDirection, justifyContent, alignItems, alignSelf, flexBasis
@docs flexGrow, flexShrink, row, rowReverse, column, columnReverse, flexStart, flexEnd, baseline, stretch, center, spaceBetween, spaceAround, flexWrap, nowrap, wrap, wrapReverse
-}
import Css exposing (Style, batch, property)
{-| -}
displayFlex : Style
displayFlex =
batch
[ property "display" "-webkit-box" -- OLD - iOS 6-, Safari 3.1-6
, property "display" "-moz-box" -- OLD - Firefox 19- (buggy but mostly works)
, property "display" "-ms-flexbox" -- TWEENER - IE 10
, property "display" "-webkit-flex" -- NEW - Chrome
, property "display" "flex" -- NEW, Spec - Opera 12.1, Firefox 20+
]
{-| -}
displayInlineFlex : Style
displayInlineFlex =
batch
[ property "display" "-webkit-inline-box" -- OLD - iOS 6-, Safari 3.1-6
, property "display" "-moz-inline-box" -- OLD - Firefox 19- (buggy but mostly works)
, property "display" "-ms-inline-flexbox" -- TWEENER - IE 10
, property "display" "-webkit-inline-flex" -- NEW - Chrome
, property "display" "inline-flex" -- NEW, Spec - Opera 12.1, Firefox 20+
]
{-| -}
flexDirection : Direction -> Style
flexDirection direction =
addPrefix "flex-direction" <|
case direction of
Row ->
"row"
RowReverse ->
"row-reverse"
Column ->
"column"
ColumnReverse ->
"column-reverse"
type Direction
= Row
| RowReverse
| Column
| ColumnReverse
{-| Direction row.
-}
row : Direction
row =
Row
{-| Direction rowReverse.
-}
rowReverse : Direction
rowReverse =
RowReverse
{-| Direction column.
-}
column : Direction
column =
Column
{-| Direction columnReverse.
-}
columnReverse : Direction
columnReverse =
ColumnReverse
{-| -}
justifyContent : Alignment JustifyContent a -> Style
justifyContent =
addPrefix "justify-content" << alignmentToString
{-| -}
alignItems : Alignment a AlignItems -> Style
alignItems =
addPrefix "align-items" << alignmentToString
{-| -}
alignSelf : Alignment a AlignItems -> Style
alignSelf =
addPrefix "align-self" << alignmentToString
{-| -}
flexBasis : Css.Length compatible units -> Style
flexBasis =
addPrefix "flex-basis" << .value
{-| -}
flexGrow : Float -> Style
flexGrow value =
addPrefix "flex-grow" (toString value)
{-| -}
flexShrink : Float -> Style
flexShrink value =
addPrefix "flex-shrink" (toString value)
{-| -}
flexWrap : Wrap -> Style
flexWrap value =
addPrefix "flex-wrap" <|
case value of
Nowrap ->
"nowrap"
Wrap ->
"wrap"
WrapReverse ->
"wrap-reverse"
type Wrap
= Nowrap
| Wrap
| WrapReverse
{-| flex-wrap nowrap
-}
nowrap : Wrap
nowrap =
Nowrap
{-| flex-wrap wrap
-}
wrap : Wrap
wrap =
Wrap
{-| flex-wrap wrapReverse
-}
wrapReverse : Wrap
wrapReverse =
WrapReverse
type Alignment justify align
= FlexStart justify align
| FlexEnd justify align
| Center justify align
| SpaceBetween justify
| SpaceAround justify
| Baseline align
| Stretch align
alignmentToString : Alignment a b -> String
alignmentToString value =
case value of
FlexStart _ _ ->
"flex-start"
FlexEnd _ _ ->
"flex-end"
Center _ _ ->
"center"
SpaceBetween _ ->
"space-between"
SpaceAround _ ->
"space-around"
Baseline _ ->
"baseline"
Stretch _ ->
"stretch"
type JustifyContent
= JustifyContent
type AlignItems
= AlignItems
{-| align-items/justify-content flexStart
-}
flexStart : Alignment JustifyContent AlignItems
flexStart =
FlexStart JustifyContent AlignItems
{-| align-items/justify-content flexEnd
-}
flexEnd : Alignment JustifyContent AlignItems
flexEnd =
FlexEnd JustifyContent AlignItems
{-| align-items/justify-content center
-}
center : Alignment JustifyContent AlignItems
center =
Center JustifyContent AlignItems
{-| justify-content spaceBetween
-}
spaceBetween : Alignment JustifyContent Never
spaceBetween =
SpaceBetween JustifyContent
{-| justify-content spaceAround
-}
spaceAround : Alignment JustifyContent Never
spaceAround =
SpaceAround JustifyContent
{-| align-items baseline
-}
baseline : Alignment Never AlignItems
baseline =
Baseline AlignItems
{-| align-items stretch
-}
stretch : Alignment Never AlignItems
stretch =
Stretch AlignItems
addPrefix : String -> String -> Style
addPrefix propertyName value =
batch
[ property ("-webkit-" ++ propertyName) value
, property propertyName value
, property ("-ms-" ++ propertyName) value
]

View File

@ -1,35 +0,0 @@
module Nri.Ui.DatePickerConstants exposing
( datePickerTag
, dialogTag
, footerTag
)
{-|
@docs datePickerTag
@docs dialogTag
@docs footerTag
-}
{-| The class of the entire date picker
-}
datePickerTag : String
datePickerTag =
"date-time-picker"
{-| The class of just the dialog that shows up when you open the datepicker
-}
dialogTag : String
dialogTag =
"date-time-picker-dialog"
{-| The class of the footer in the dialog.
This is where the pretty-printed date is displayed.
-}
footerTag : String
footerTag =
"date-time-picker-footer"

View File

@ -20,7 +20,7 @@ A caret that indicates that a section can expand and collapse. When `isOpen` is
-}
import Css exposing (..)
import Html.Styled as Html exposing (..)
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.SpriteSheet exposing (arrowLeft)

View File

@ -6,14 +6,9 @@ module Nri.Ui.FocusTrap.V1 exposing (FocusTrap, toAttribute)
-}
import Accessibility.Styled as Html exposing (..)
import Accessibility.Styled.Key as Key
import Browser.Dom as Dom
import Browser.Events
import Html.Styled.Attributes as Attributes exposing (class, id)
import Html.Styled.Events as Events exposing (onClick)
import Accessibility.Styled as Html
import Html.Styled.Events as Events
import Json.Decode as Decode exposing (Decoder)
import Task
{-| Defines how focus will wrap in reponse to tab keypresses in a part of the UI.

View File

@ -25,7 +25,7 @@ Headings with customization options for accessibility.
import Css exposing (..)
import Html.Styled exposing (..)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes as Attributes
import Nri.Ui.Colors.V1 exposing (..)
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes

View File

@ -10,9 +10,7 @@ module Nri.Ui.Html.V3 exposing
-}
import Char
import Html.Styled as Html exposing (Attribute, Html, span, text)
import Html.Styled.Attributes exposing (..)
import Html.Styled as Html exposing (Attribute, Html)
import Html.Styled.Events as Events exposing (..)
import Json.Decode

View File

@ -10,14 +10,14 @@ module Nri.Ui.Loading.V1 exposing
-}
import Css exposing (..)
import Css
import Css.Animations
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Svg.V1
import Nri.Ui.UiIcon.V1 as UiIcon
import Svg.Styled as Svg exposing (Svg)
import Svg.Styled as Svg
import Svg.Styled.Attributes as SvgAttributes

View File

@ -47,9 +47,8 @@ import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1
import Nri.Ui.Html.Attributes.V2 as AttributesExtra
import Nri.Ui.Html.V3 exposing (viewJust)
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.UiIcon.V1 as UiIcon
import String.Extra
@ -487,19 +486,6 @@ viewEntry focusAndToggle { upId, downId, entry_ } =
-- STYLES
buttonLinkResets : List Style
buttonLinkResets =
[ boxSizing borderBox
, border zero
, padding zero
, margin zero
, backgroundColor transparent
, cursor pointer
, display inlineBlock
, verticalAlign middle
]
{-| -}
styleInnerContainer : List (Attribute msg)
styleInnerContainer =

View File

@ -63,12 +63,10 @@ Changes from V2:
import Accessibility.Styled as Html exposing (..)
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Style exposing (invisibleStyle)
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import Css.Global
import Css.Media exposing (MediaQuery)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events exposing (onClick)
import Http
import Markdown
import Nri.Ui

View File

@ -162,7 +162,6 @@ import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Key as Key
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Widget as Widget
import Browser
import Browser.Dom as Dom
import Browser.Events
import Css exposing (..)
@ -170,8 +169,7 @@ import Css.Media
import Css.Transitions
import Html.Styled as Root
import Html.Styled.Attributes as Attrs exposing (id)
import Html.Styled.Events as Events exposing (onClick)
import Json.Decode as Decode exposing (Decoder)
import Html.Styled.Events exposing (onClick)
import Nri.Ui.Colors.Extra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.FocusTrap.V1 as FocusTrap exposing (FocusTrap)
@ -181,7 +179,6 @@ import Nri.Ui.MediaQuery.V1 exposing (mobile)
import Nri.Ui.SpriteSheet
import Nri.Ui.Svg.V1
import Task
import TransparentColor as Transparent
{-| -}
@ -237,7 +234,6 @@ isOpen model =
type Msg
= CloseButtonClicked
| EscOrOverlayClicked
| Focus String
| Focused (Result Dom.Error ())
@ -267,9 +263,6 @@ update { dismissOnEscAndOverlayClick } msg model =
else
( model, Cmd.none )
Focus id ->
( model, Task.attempt Focused (Dom.focus id) )
Focused _ ->
-- TODO: consider adding error handling when we didn't successfully
-- fous an element

View File

@ -10,7 +10,7 @@ module Nri.Ui.Palette.V1 exposing
-}
import Css exposing (..)
import Css
import Nri.Ui.Colors.V1 as Colors

View File

@ -22,7 +22,7 @@ content to be "checked"!
import Accessibility.Styled as Html exposing (Html)
import Css
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.Pennant.V2 exposing (premiumFlag)
import Nri.Ui.Svg.V1 as Svg

View File

@ -32,7 +32,7 @@ module Nri.Ui.PremiumCheckbox.V7 exposing
import Accessibility.Styled as Html exposing (Html)
import Css
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel)
import Nri.Ui.Pennant.V2 exposing (premiumFlag)

View File

@ -10,15 +10,12 @@ module Nri.Ui.RadioButton.V2 exposing (view, premium)
-}
import Accessibility.Styled exposing (..)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Style as Style
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import Css.Global
import Html.Styled as Html
import Html.Styled.Attributes exposing (..)
import Html.Styled.Events exposing (onClick, stopPropagationOn)
import Json.Decode
import Html.Styled.Events exposing (onClick)
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel)
@ -26,7 +23,7 @@ import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as Attributes
import Nri.Ui.Html.V3 exposing (viewIf)
import Nri.Ui.Pennant.V2 as Pennant
import Nri.Ui.Svg.V1 exposing (Svg, fromHtml)
import Nri.Ui.Svg.V1 exposing (Svg)
import String exposing (toLower)
import String.Extra exposing (dasherize)
import Svg.Styled as Svg
@ -234,19 +231,6 @@ internalView config =
]
onEnterAndSpacePreventDefault : msg -> Attribute msg
onEnterAndSpacePreventDefault msg =
Nri.Ui.Html.V3.onKeyUp
{ stopPropagation = False, preventDefault = True }
(\code ->
if code == 13 || code == 32 then
Just msg
else
Nothing
)
radioInputIcon :
{ isChecked : Bool
, isLocked : Bool

View File

@ -41,23 +41,20 @@ module Nri.Ui.RadioButton.V3 exposing
import Accessibility.Styled exposing (..)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Style as Style
import Accessibility.Styled.Widget as Widget
import Css as Css exposing (..)
import Css exposing (..)
import Css.Global
import Html.Styled as Html
import Html.Styled.Attributes as Attributes exposing (class, classList, css, for)
import Html.Styled.Events exposing (onClick, stopPropagationOn)
import Html.Styled.Events exposing (onClick)
import InputErrorAndGuidanceInternal exposing (ErrorState, Guidance)
import Json.Decode
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel)
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as Extra
import Nri.Ui.Html.V3 exposing (viewJust)
import Nri.Ui.Pennant.V2 as Pennant
import Nri.Ui.Svg.V1 exposing (Svg, fromHtml)
import Nri.Ui.Svg.V1 exposing (Svg)
import String exposing (toLower)
import String.Extra exposing (dasherize)
import Svg.Styled as Svg
@ -259,13 +256,6 @@ applyConfig attributes beginningConfig =
attributes
maybeAttr : (a -> Html.Attribute msg) -> Maybe a -> Html.Attribute msg
maybeAttr attr maybeValue =
maybeValue
|> Maybe.map attr
|> Maybe.withDefault Extra.none
{-| View a single radio button.
-}
view :
@ -315,9 +305,6 @@ view { label, name, value, valueToString, selectedValue } attributes =
isInError =
InputErrorAndGuidanceInternal.getIsInError config.error
errorMessage_ =
InputErrorAndGuidanceInternal.getErrorMessage config.error
in
Html.span
[ Attributes.id (idValue ++ "-container")

View File

@ -40,7 +40,7 @@ module Nri.Ui.RadioButton.V4 exposing
import Accessibility.Styled exposing (..)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Widget as Widget
import Css as Css exposing (..)
import Css exposing (..)
import Css.Global
import Html.Styled as Html
import Html.Styled.Attributes as Attributes exposing (class, classList, css, for)

View File

@ -18,18 +18,13 @@ import Accessibility.Styled exposing (..)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Style as Style
import Accessibility.Styled.Widget as Widget
import Css exposing (..)
import EventExtras
import Html.Styled
import Html.Styled.Attributes as Attributes exposing (css, href)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Events as Events
import Json.Encode as Encode
import Nri.Ui
import Nri.Ui.Colors.Extra exposing (withAlpha)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as AttributesExtra
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.Tooltip.V2 as Tooltip
import Nri.Ui.Util exposing (dashify)

View File

@ -48,14 +48,13 @@ import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Events as Events
import InputErrorAndGuidanceInternal exposing (ErrorState, Guidance)
import InputLabelInternal
import Json.Decode exposing (Decoder)
import Json.Decode
import Nri.Ui
import Nri.Ui.Colors.Extra as ColorsExtra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.CssVendorPrefix.V1 as VendorPrefixed
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Html.Attributes.V2 as Extra
import Nri.Ui.Html.V3 exposing (viewJust)
import Nri.Ui.InputStyles.V3 as InputStyles
import Nri.Ui.Util
import SolidColor

View File

@ -36,9 +36,8 @@ import Accessibility.Styled exposing (..)
import Accessibility.Styled.Style as Style
import ClickableAttributes exposing (ClickableAttributes)
import Css exposing (..)
import Css.Media as Media
import Html.Styled
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
import Nri.Ui
import Nri.Ui.ClickableText.V3 as ClickableText
@ -49,8 +48,6 @@ import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.Html.V3 exposing (viewJust)
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.UiIcon.V1 as UiIcon
import String exposing (toLower)
import String.Extra exposing (dasherize)
{-| Use `entry` to create a sidebar entry.

View File

@ -20,12 +20,10 @@ import Accessibility.Styled.Widget as Widget
import Css
import Css.Animations
import Css.Global
import Html.Styled
import Html.Styled.Attributes exposing (css)
import Html.Styled.Events exposing (onClick)
import Html.Styled.Keyed as Keyed
import Nri.Ui
import Nri.Ui.AssetPath exposing (Asset(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.Extra
import Nri.Ui.Colors.V1 as Colors

View File

@ -15,7 +15,6 @@ module Nri.Ui.SortableTable.V2 exposing
-}
import Css exposing (..)
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import Html.Styled.Events
@ -24,7 +23,7 @@ import Nri.Ui.Colors.V1
import Nri.Ui.CssVendorPrefix.V1 as CssVendorPrefix
import Nri.Ui.Table.V5
import SolidColor
import Svg.Styled as Svg exposing (Svg)
import Svg.Styled as Svg
import Svg.Styled.Attributes as SvgAttributes

View File

@ -16,7 +16,7 @@ module Nri.Ui.Tabs.V6 exposing
-}
import Css exposing (..)
import Html.Styled as Html exposing (Attribute, Html)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Nri.Ui
import Nri.Ui.Colors.Extra exposing (withAlpha)

View File

@ -22,7 +22,6 @@ module Nri.Ui.Tabs.V7 exposing
-}
import Accessibility.Styled.Aria as Aria
import Css exposing (..)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes

View File

@ -54,7 +54,7 @@ You're in the wrong place! Headings live in Nri.Ui.Heading.V2.
import Accessibility.Styled as Html exposing (..)
import Css exposing (..)
import Css.Global exposing (a, descendants)
import Css.Global
import Html.Styled.Attributes as Attributes
import Markdown
import Nri.Ui.Colors.V1 exposing (..)

View File

@ -24,7 +24,7 @@ custom element, or else autosizing will break! This means doing the following:
-}
import Accessibility.Styled.Style
import Css exposing (plus, px)
import Css exposing (px)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
@ -32,8 +32,6 @@ import Nri.Ui.Html.Attributes.V2 as Extra
import Nri.Ui.InputStyles.V3 as InputStyles
exposing
( Theme(..)
, input
, label
)
import Nri.Ui.Util exposing (dashify, removePunctuation)

View File

@ -51,8 +51,6 @@ module Nri.Ui.TextInput.V7 exposing
-}
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Style as Accessibility
import Css exposing (center, num, position, px, relative, textAlign)
import Css.Global
import Html.Styled as Html exposing (..)
@ -60,12 +58,11 @@ import Html.Styled.Attributes as Attributes exposing (..)
import Html.Styled.Events as Events
import InputErrorAndGuidanceInternal exposing (ErrorState, Guidance)
import InputLabelInternal
import Keyboard.Event exposing (KeyboardEvent)
import Keyboard.Event
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Html.Attributes.V2 as Extra
import Nri.Ui.Html.V3 exposing (viewJust)
import Nri.Ui.InputStyles.V3 as InputStyles exposing (defaultMarginTop)
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.UiIcon.V1 as UiIcon
@ -585,9 +582,6 @@ view label attributes =
isInError =
InputErrorAndGuidanceInternal.getIsInError config.error
errorMessage_ =
InputErrorAndGuidanceInternal.getErrorMessage config.error
( opacity, disabled_ ) =
case ( config.disabled, config.loading ) of
( False, False ) ->

View File

@ -55,7 +55,7 @@ Example usage:
-}
import Accessibility.Styled as Html exposing (Attribute, Html, text)
import Accessibility.Styled as Html exposing (Attribute, Html)
import Accessibility.Styled.Aria as Aria
import Accessibility.Styled.Role as Role
import Accessibility.Styled.Widget as Widget

View File

@ -3,8 +3,8 @@ module CommonControls exposing
, choice
, icon, iconNotCheckedByDefault, uiIcon
, content
, quickBrownFox, longPangrams, romeoAndJulietQuotation, markdown, exampleHtml, httpError
, disabledListItem, premiumDisplay, premiumLevel
, romeoAndJulietQuotation, httpError
, disabledListItem, premiumDisplay
)
{-|
@ -17,7 +17,7 @@ module CommonControls exposing
### Content
@docs content
@docs quickBrownFox, longPangrams, romeoAndJulietQuotation, markdown, exampleHtml, httpError
@docs romeoAndJulietQuotation, httpError
-}
@ -25,24 +25,14 @@ import Css
import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Http
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Data.PremiumDisplay as PremiumDisplay exposing (PremiumDisplay)
import Nri.Ui.Data.PremiumLevel exposing (PremiumLevel(..))
import Nri.Ui.Svg.V1 exposing (Svg)
import Nri.Ui.UiIcon.V1 as UiIcon
premiumLevel : Control ( String, PremiumLevel )
premiumLevel =
choice "PremiumLevel"
[ ( "Free", Free )
, ( "PremiumWithWriting", PremiumWithWriting )
]
premiumDisplay : Control ( String, PremiumDisplay )
premiumDisplay =
Control.choice

View File

@ -2,7 +2,7 @@ module Example exposing (Example, preview, view, wrapMsg, wrapState)
import Category exposing (Category)
import Css exposing (..)
import Css.Global exposing (a, descendants)
import Css.Global exposing (descendants)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
@ -10,11 +10,10 @@ import Html.Styled.Lazy as Lazy
import KeyboardSupport exposing (KeyboardSupport)
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.V1 as Colors exposing (..)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Container.V2 as Container
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Html.Attributes.V2 as AttributeExtras exposing (targetBlank)
import Nri.Ui.UiIcon.V1 as UiIcon
import Routes exposing (Route)

View File

@ -17,12 +17,11 @@ import Css exposing (..)
import Css.Global
import Example exposing (Example)
import Html.Styled.Attributes as Attributes exposing (css, src)
import KeyboardSupport exposing (Direction(..), Key(..))
import KeyboardSupport exposing (Key(..))
import Nri.Ui.Accordion.V3 as Accordion exposing (AccordionEntry(..))
import Nri.Ui.Colors.Extra as ColorsExtra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.DisclosureIndicator.V2 as DisclosureIndicator
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.Text.V6 as Text

View File

@ -9,7 +9,6 @@ module Examples.AssignmentIcon exposing (example, State, Msg)
import Category exposing (Category(..))
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.AssignmentIcon.V2 as AssignmentIcon

View File

@ -11,12 +11,9 @@ import Css
import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import Html.Styled exposing (Html, div, fromUnstyled, text)
import Html.Styled exposing (Html, fromUnstyled, text)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Balloon.V1 as Balloon
import Nri.Ui.Colors.V1 as Colors
{-| -}

View File

@ -15,11 +15,9 @@ import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import Example exposing (Example)
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css, id)
import KeyboardSupport exposing (Direction(..), Key(..))
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.UiIcon.V1 as UiIcon
import Set exposing (Set)
@ -88,7 +86,6 @@ type Msg
= SetDebugControlsState (Control Model)
| ShowItWorked String String
| ToggleToggleButton Int
| NoOp
{-| -}
@ -101,11 +98,7 @@ update msg state =
)
ShowItWorked group message ->
let
_ =
Debug.log group message
in
( state, Cmd.none )
( Debug.log group message |> always state, Cmd.none )
ToggleToggleButton id ->
( { state
@ -119,9 +112,6 @@ update msg state =
, Cmd.none
)
NoOp ->
( state, Cmd.none )
-- INTERNAL

View File

@ -11,9 +11,9 @@ import Css
import Example exposing (Example)
import Html.Styled as Html exposing (..)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import KeyboardSupport exposing (Key(..))
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.Data.PremiumDisplay as PremiumDisplay exposing (PremiumDisplay)
import Nri.Ui.Data.PremiumDisplay as PremiumDisplay
import Nri.Ui.PremiumCheckbox.V8 as PremiumCheckbox
import Set exposing (Set)

View File

@ -15,16 +15,11 @@ import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import EventExtras
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.Colors.Extra exposing (fromCssColor, toCssColor)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.Svg.V1 exposing (Svg)
import Nri.Ui.Tooltip.V2 as Tooltip
import Nri.Ui.UiIcon.V1 as UiIcon
@ -231,7 +226,6 @@ init =
type Msg
= ShowItWorked String
| SetPreviewTooltip Bool
| SetShareTooltip Bool
| SetControls (Control (Settings Msg))
@ -240,18 +234,11 @@ update : Msg -> State -> ( State, Cmd Msg )
update msg state =
case msg of
ShowItWorked message ->
let
_ =
Debug.log "ClickableSvg" message
in
( state, Cmd.none )
( Debug.log "ClickableSvg" message |> always state, Cmd.none )
SetPreviewTooltip bool ->
( { state | tooltipPreview = bool }, Cmd.none )
SetShareTooltip bool ->
( { state | tooltipShareTo = bool }, Cmd.none )
SetControls settings ->
( { state | settings = settings }, Cmd.none )

View File

@ -15,10 +15,8 @@ import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import Example exposing (Example)
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css, id)
import KeyboardSupport exposing (Direction(..), Key(..))
import Html.Styled.Attributes exposing (css)
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.Text.V6 as Text
import Nri.Ui.UiIcon.V1 as UiIcon
@ -111,11 +109,7 @@ update msg state =
( State controls, Cmd.none )
ShowItWorked group message ->
let
_ =
Debug.log group message
in
( state, Cmd.none )
( Debug.log group message |> always state, Cmd.none )

View File

@ -11,10 +11,8 @@ import Css
import Example exposing (Example)
import Html.Styled as Html
import Html.Styled.Attributes as Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.Extra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
import SolidColor exposing (highContrast)

View File

@ -8,12 +8,7 @@ module Examples.Confetti exposing (example, State, Msg)
import Browser.Events
import Category exposing (Category(..))
import Css exposing (Color)
import Dict exposing (Dict)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Confetti.V2 as Confetti

View File

@ -14,14 +14,10 @@ import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import Html.Styled.Events exposing (onClick)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Container.V2 as Container
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.Text.V6 as Text
import Nri.Ui.UiIcon.V1 as UiIcon

View File

@ -11,10 +11,7 @@ import Css
import Example exposing (Example)
import Html.Styled as Html
import Html.Styled.Attributes exposing (css)
import Html.Styled.Events exposing (onClick)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.DisclosureIndicator.V2 as DisclosureIndicator
import Nri.Ui.Text.V6 as Text

View File

@ -7,11 +7,7 @@ module Examples.Divider exposing (Msg, State, example)
-}
import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Html.Styled as Html
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Divider.V2 as Divider

View File

@ -11,7 +11,6 @@ import Css exposing (Style)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading

View File

@ -10,7 +10,6 @@ import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Html.Styled as Html
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import ViewHelpers exposing (viewExamples)

View File

@ -2,7 +2,7 @@ module Examples.IconExamples exposing (preview, view, viewWithCustomStyles)
import Css
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css, style, title)
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg

View File

@ -9,15 +9,12 @@ module Examples.Loading exposing (example, State, Msg)
import Browser.Events
import Category exposing (Category(..))
import Css
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Events as Events
import Json.Decode
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Loading.V1 as Loading
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.Text.V6 as Text

View File

@ -10,9 +10,8 @@ import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import Html.Styled as Html exposing (Html)
import Html.Styled as Html
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Logo.V1 as Logo
import Nri.Ui.Svg.V1 as Svg

View File

@ -13,12 +13,11 @@ import Css
import Debug.Control as Control exposing (Control)
import Example exposing (Example)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import KeyboardSupport exposing (Key(..))
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Menu.V3 as Menu
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Nri.Ui.Svg.V1 exposing (Svg)
import Nri.Ui.Tooltip.V2 as Tooltip
import Nri.Ui.UiIcon.V1 as UiIcon
import Set exposing (Set)
@ -299,7 +298,6 @@ type Msg
| SetIconButtonWithMenuConfiguration (Control IconButtonWithMenuConfiguration)
| FocusAndToggle String { isOpen : Bool, focus : Maybe String }
| Focused (Result Dom.Error ())
| NoOp
{-| -}
@ -319,11 +317,7 @@ update msg state =
)
ConsoleLog message ->
let
_ =
Debug.log "Menu Example" message
in
( state, Cmd.none )
( Debug.log "Menu Example" message |> always state, Cmd.none )
SetViewConfiguration configuration ->
( { state | viewConfiguration = configuration }, Cmd.none )
@ -347,9 +341,6 @@ update msg state =
Focused _ ->
( state, Cmd.none )
NoOp ->
( state, Cmd.none )
-- INTERNAL
@ -357,7 +348,3 @@ update msg state =
type alias Id =
String
type alias Value =
String

View File

@ -1,15 +1,13 @@
module Examples.Message exposing (Msg, State, example)
import Accessibility.Styled as Html exposing (..)
import Accessibility.Styled exposing (..)
import Category exposing (Category(..))
import CommonControls
import Css exposing (..)
import Css
import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import Example exposing (Example)
import Html.Styled.Attributes as Attributes exposing (css, href)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Message.V3 as Message

View File

@ -6,7 +6,7 @@ module Examples.Modal exposing (Msg, State, example)
-}
import Accessibility.Styled as Html exposing (Html, div, h3, h4, p, span, text)
import Accessibility.Styled as Html exposing (Html, div, text)
import Accessibility.Styled.Key as Key
import Browser.Dom as Dom
import Category exposing (Category(..))
@ -15,14 +15,12 @@ import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled.Attributes as Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import KeyboardSupport
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.Extra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.FocusTrap.V1 as FocusTrap
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Modal.V11 as Modal
import Nri.Ui.Text.V6 as Text

View File

@ -9,13 +9,11 @@ module Examples.Page exposing (example, State, Msg)
import Category exposing (Category(..))
import CommonControls
import Css
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
import Debug.Control as Control exposing (Control)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import Http
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
@ -40,11 +38,7 @@ update : Msg -> State -> ( State, Cmd Msg )
update msg model =
case msg of
ShowItWorked message ->
let
_ =
Debug.log "Clicked: " message
in
( model, Cmd.none )
( Debug.log "Clicked: " message |> always model, Cmd.none )
SetHttpError controls ->
( { model | httpError = controls }, Cmd.none )

View File

@ -7,15 +7,10 @@ module Examples.Pennant exposing (example, State, Msg)
-}
import Category exposing (Category(..))
import Css exposing (..)
import Css
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Pennant.V2 as Pennant
import Nri.Ui.Svg.V1 as Svg
{-| -}

View File

@ -19,12 +19,11 @@ import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled as Html exposing (..)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Data.PremiumDisplay as PremiumDisplay exposing (PremiumDisplay)
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Data.PremiumDisplay as PremiumDisplay
import Nri.Ui.Modal.V11 as Modal
import Nri.Ui.RadioButton.V4 as RadioButton
import Nri.Ui.Text.V6 as Text

View File

@ -16,9 +16,8 @@ import Category exposing (Category(..))
import Css
import Debug.Control as Control exposing (Control)
import Example exposing (Example)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Events as Events
import KeyboardSupport exposing (Direction(..), Key(..))
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.SegmentedControl.V14 as SegmentedControl
import Nri.Ui.Svg.V1 as Svg exposing (Svg)

View File

@ -14,9 +14,7 @@ import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Select.V8 as Select exposing (Choice)
@ -214,11 +212,7 @@ update : Msg -> State -> ( State, Cmd Msg )
update msg state =
case msg of
ConsoleLog message ->
let
_ =
Debug.log "SelectExample" message
in
( state, Cmd.none )
( Debug.log "SelectExample" message |> always state, Cmd.none )
UpdateLabel label ->
( { state | label = label }

View File

@ -10,7 +10,7 @@ import Category exposing (Category(..))
import Css exposing (Style)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes as Attributes
import Nri.Ui.Shadows.V1 as Shadows
import Nri.Ui.Text.V6 as Text
import ViewHelpers

View File

@ -14,11 +14,8 @@ import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Debug.Control.View as ControlView
import Example exposing (Example)
import Html.Styled
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.SideNav.V2 as SideNav
@ -253,8 +250,4 @@ update msg state =
( state, Cmd.none )
ConsoleLog message ->
let
_ =
Debug.log "SideNav" message
in
( state, Cmd.none )
( Debug.log "SideNav" message |> always state, Cmd.none )

View File

@ -6,13 +6,12 @@ module Examples.SlideModal exposing (Msg, State, example)
-}
import Accessibility.Styled as Html exposing (Html, div, h3, p, text)
import Accessibility.Styled as Html exposing (Html, div)
import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Html.Styled exposing (fromUnstyled)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.SlideModal.V2 as SlideModal

View File

@ -9,7 +9,6 @@ module Examples.SortableTable exposing (Msg, State, example)
import Category exposing (Category(..))
import Example exposing (Example)
import Html.Styled as Html
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.SortableTable.V2 as SortableTable
@ -22,8 +21,7 @@ type Column
{-| -}
type Msg
= NoOp
| SetSortState (SortableTable.State Column)
= SetSortState (SortableTable.State Column)
{-| -}
@ -99,8 +97,5 @@ init =
update : Msg -> State -> ( State, Cmd Msg )
update msg state =
case msg of
NoOp ->
( state, Cmd.none )
SetSortState sortState ->
( { state | sortState = sortState }, Cmd.none )

View File

@ -6,11 +6,9 @@ module Examples.Sprite exposing (example, State, Msg)
-}
import Accessibility.Styled.Aria as Aria
import Category exposing (Category(..))
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Sprite.V1 as Sprite exposing (SpriteId)
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
import Svg.Styled exposing (svg)

View File

@ -9,14 +9,11 @@ module Examples.Svg exposing (Msg, State, example)
import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import Html.Styled as Html
import Html.Styled.Attributes as Attributes
import Html.Styled.Events as Events
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.Extra exposing (fromCssColor, toCssColor)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.UiIcon.V1 as UiIcon
import SolidColor exposing (SolidColor)

View File

@ -10,7 +10,6 @@ import Category exposing (Category(..))
import Css exposing (..)
import Example exposing (Example)
import Html.Styled as Html
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Button.V10 as Button
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading

View File

@ -15,10 +15,9 @@ import Category exposing (Category(..))
import Css
import Debug.Control as Control exposing (Control)
import Example exposing (Example)
import Html.Styled as Html exposing (Html, fromUnstyled)
import Html.Styled as Html exposing (fromUnstyled)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Key(..))
import List.Zipper exposing (Zipper)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.Tabs.V7 as Tabs exposing (Alignment(..), Tab)

View File

@ -7,14 +7,13 @@ module Examples.Text exposing (example, State, Msg)
-}
import Category exposing (Category(..))
import CommonControls exposing (exampleHtml, quickBrownFox, romeoAndJulietQuotation)
import CommonControls
import Css
import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Html.Styled.Attributes exposing (css)
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Text.V6 as Text

View File

@ -9,7 +9,6 @@ module Examples.Text.Writing exposing (example, State, Msg)
import Category exposing (Category(..))
import Example exposing (Example)
import Html.Styled exposing (text)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Text.Writing.V1 as TextWriting

View File

@ -10,8 +10,6 @@ import Category exposing (Category(..))
import Dict exposing (Dict)
import Example exposing (Example)
import Html.Styled as Html
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.AssetPath exposing (Asset(..))
import Nri.Ui.Checkbox.V5 as Checkbox
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.TextArea.V4 as TextArea

View File

@ -9,16 +9,12 @@ module Examples.TextInput exposing (Msg, State, example)
import Accessibility.Styled as Html exposing (..)
import Accessibility.Styled.Key as Key
import Category exposing (Category(..))
import Css exposing (..)
import Css
import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Dict exposing (Dict)
import Example exposing (Example)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Message.V3 as Message
import Nri.Ui.TextInput.V7 as TextInput
import ViewHelpers exposing (viewExamples)

View File

@ -14,10 +14,8 @@ import Debug.Control as Control exposing (Control)
import Debug.Control.Extra as ControlExtra
import Example exposing (Example)
import Html.Styled.Attributes as Attributes exposing (css, href)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.ClickableSvg.V2 as ClickableSvg
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Svg.V1 as Svg
import Nri.Ui.Text.V6 as Text

View File

@ -9,7 +9,6 @@ module Examples.UiIcon exposing (example, State, Msg)
import Category exposing (Category(..))
import Example exposing (Example)
import Examples.IconExamples as IconExamples
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.UiIcon.V1 as UiIcon

View File

@ -13,7 +13,7 @@ module KeyboardSupport exposing
-}
import Css exposing (..)
import Html.Styled as Html exposing (..)
import Html.Styled exposing (..)
import Html.Styled.Attributes exposing (css)

View File

@ -1,31 +1,24 @@
module Main exposing (init, main)
module Main exposing (main)
import Accessibility.Styled as Html exposing (Html)
import Browser exposing (Document, UrlRequest(..))
import Browser.Dom
import Browser.Navigation exposing (Key)
import Category exposing (Category)
import Category
import Css exposing (..)
import Css.Media exposing (withMedia)
import Dict exposing (Dict)
import Example exposing (Example)
import Examples
import Html.Attributes
import Html.Styled.Attributes as Attributes exposing (..)
import Html.Styled.Events as Events
import Nri.Ui.ClickableText.V3 as ClickableText
import Nri.Ui.Colors.V1 as Colors
import Html.Styled.Attributes exposing (..)
import Nri.Ui.CssVendorPrefix.V1 as VendorPrefixed
import Nri.Ui.Data.PremiumLevel as PremiumLevel
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.MediaQuery.V1 exposing (mobile, notMobile)
import Nri.Ui.Page.V3 as Page
import Nri.Ui.SideNav.V2 as SideNav
import Nri.Ui.Sprite.V1 as Sprite
import Nri.Ui.UiIcon.V1 as UiIcon
import Routes as Routes exposing (Route(..))
import Sort.Set as Set exposing (Set)
import Routes exposing (Route)
import Sort.Set as Set
import Task
import Url exposing (Url)

View File

@ -1,6 +1,5 @@
module Routes exposing (Route(..), fromLocation, toString)
import Browser.Navigation as Navigation
import Category
import Parser exposing ((|.), (|=), Parser)
import Url exposing (Url)

View File

@ -2,7 +2,7 @@ module ViewHelpers exposing (viewExamples)
import Css
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes exposing (css)
import Html.Styled.Attributes exposing (css)
viewExamples : List ( String, Html msg ) -> Html msg

View File

@ -0,0 +1,35 @@
{
"type": "application",
"source-directories": [
"src"
],
"elm-version": "0.19.1",
"dependencies": {
"direct": {
"elm/core": "1.0.5",
"elm/json": "1.1.3",
"elm/project-metadata-utils": "1.0.2",
"jfmengels/elm-review": "2.7.0",
"jfmengels/elm-review-unused": "1.1.20",
"stil4m/elm-syntax": "7.2.9"
},
"indirect": {
"elm/html": "1.0.0",
"elm/parser": "1.1.0",
"elm/random": "1.0.0",
"elm/time": "1.0.0",
"elm/virtual-dom": "1.0.2",
"elm-community/list-extra": "8.5.2",
"elm-explorations/test": "1.2.2",
"miniBill/elm-unicode": "1.0.2",
"rtfeldman/elm-hex": "1.0.0",
"stil4m/structured-writer": "1.0.3"
}
},
"test-dependencies": {
"direct": {
"elm-explorations/test": "1.2.2"
},
"indirect": {}
}
}

View File

@ -0,0 +1,38 @@
module ReviewConfig exposing (config)
{-| Do not rename the ReviewConfig module or the config function, because
`elm-review` will look for these.
To add packages that contain rules, add them to this review project using
`elm install author/packagename`
when inside the directory containing this file.
-}
import NoUnused.CustomTypeConstructors
import NoUnused.Exports
import NoUnused.Modules
import NoUnused.Variables
import Review.Rule exposing (Rule)
config : List Rule
config =
List.map
(Review.Rule.ignoreErrorsForDirectories [ "../src" ])
[ NoUnused.CustomTypeConstructors.rule []
-- sometimes we just want to build a value without extracting it
-- , NoUnused.CustomTypeConstructorArgs.rule
-- this rules is not useful in here
-- , NoUnused.Dependencies.rule
, NoUnused.Exports.rule
, NoUnused.Modules.rule
-- We like to keep parameters around for readability.
-- , NoUnused.Parameters.rule
-- , NoUnused.Patterns.rule
, NoUnused.Variables.rule
]

View File

@ -1,6 +1,6 @@
module Spec.Nri.Ui.Page exposing (all)
import Expect exposing (Expectation)
import Expect
import Html.Styled as Html
import Nri.Ui.Page.V3 as Page
import Test exposing (..)

View File

@ -2,7 +2,7 @@ module Spec.Nri.Ui.PremiumCheckbox exposing (spec)
import Html.Attributes as Attributes
import Html.Styled
import Nri.Ui.Checkbox.V5 as Checkbox exposing (IsSelected(..))
import Nri.Ui.Checkbox.V5 exposing (IsSelected(..))
import Nri.Ui.PremiumCheckbox.V6 as PremiumCheckbox
import Test exposing (..)
import Test.Html.Event as Event

View File

@ -1,6 +1,6 @@
module Spec.Nri.Ui.SortableTable exposing (spec)
import Expect exposing (Expectation)
import Expect
import Html.Styled
import Nri.Ui.SortableTable.V2 as SortableTable
import Test exposing (..)
@ -11,7 +11,6 @@ import Test.Html.Selector as Selector
type Column
= FirstName
| LastName
| Coins
type alias Person =

View File

@ -2,8 +2,6 @@ module Spec.Nri.Ui.Tooltip exposing (spec)
import Accessibility.Aria as Aria
import Accessibility.Widget as Widget
import Expect
import Html
import Html.Attributes as Attributes
import Html.Styled as HtmlStyled
import Nri.Ui.Tooltip.V2 as Tooltip