From efaee1b7af1a3868d577e905e7c70970a4e9a17a Mon Sep 17 00:00:00 2001 From: Ju Liu Date: Tue, 15 Mar 2022 18:06:13 +0000 Subject: [PATCH] Apply elm-review in styleguide app --- styleguide-app/CommonControls.elm | 16 +++------------- styleguide-app/Example.elm | 5 ++--- styleguide-app/Examples/Accordion.elm | 3 +-- styleguide-app/Examples/AssignmentIcon.elm | 1 - styleguide-app/Examples/Balloon.elm | 5 +---- styleguide-app/Examples/Button.elm | 14 ++------------ styleguide-app/Examples/Checkbox.elm | 4 ++-- styleguide-app/Examples/ClickableSvg.elm | 17 ++--------------- styleguide-app/Examples/ClickableText.elm | 10 ++-------- styleguide-app/Examples/Colors.elm | 2 -- styleguide-app/Examples/Confetti.elm | 5 ----- styleguide-app/Examples/Container.elm | 4 ---- .../Examples/DisclosureIndicator.elm | 3 --- styleguide-app/Examples/Divider.elm | 4 ---- styleguide-app/Examples/Fonts.elm | 1 - styleguide-app/Examples/Heading.elm | 1 - styleguide-app/Examples/IconExamples.elm | 2 +- styleguide-app/Examples/Loading.elm | 3 --- styleguide-app/Examples/Logo.elm | 3 +-- styleguide-app/Examples/Menu.elm | 19 +++---------------- styleguide-app/Examples/Message.elm | 6 ++---- styleguide-app/Examples/Modal.elm | 6 ++---- styleguide-app/Examples/Page.elm | 8 +------- styleguide-app/Examples/Pennant.elm | 7 +------ styleguide-app/Examples/RadioButton.elm | 5 ++--- styleguide-app/Examples/SegmentedControl.elm | 5 ++--- styleguide-app/Examples/Select.elm | 8 +------- styleguide-app/Examples/Shadows.elm | 2 +- styleguide-app/Examples/SideNav.elm | 9 +-------- styleguide-app/Examples/SlideModal.elm | 3 +-- styleguide-app/Examples/SortableTable.elm | 7 +------ styleguide-app/Examples/Sprite.elm | 2 -- styleguide-app/Examples/Svg.elm | 3 --- styleguide-app/Examples/Table.elm | 1 - styleguide-app/Examples/Tabs.elm | 3 +-- styleguide-app/Examples/Text.elm | 5 ++--- styleguide-app/Examples/Text/Writing.elm | 1 - styleguide-app/Examples/TextArea.elm | 2 -- styleguide-app/Examples/TextInput.elm | 6 +----- styleguide-app/Examples/Tooltip.elm | 2 -- styleguide-app/Examples/UiIcon.elm | 1 - styleguide-app/KeyboardSupport.elm | 2 +- styleguide-app/Main.elm | 17 +++++------------ styleguide-app/Routes.elm | 1 - styleguide-app/ViewHelpers.elm | 2 +- 45 files changed, 46 insertions(+), 190 deletions(-) diff --git a/styleguide-app/CommonControls.elm b/styleguide-app/CommonControls.elm index 8184ebf5..4d2e67c8 100644 --- a/styleguide-app/CommonControls.elm +++ b/styleguide-app/CommonControls.elm @@ -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 diff --git a/styleguide-app/Example.elm b/styleguide-app/Example.elm index 126a1ed1..e42c1195 100644 --- a/styleguide-app/Example.elm +++ b/styleguide-app/Example.elm @@ -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) diff --git a/styleguide-app/Examples/Accordion.elm b/styleguide-app/Examples/Accordion.elm index 088ce90a..6c69bf97 100644 --- a/styleguide-app/Examples/Accordion.elm +++ b/styleguide-app/Examples/Accordion.elm @@ -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 diff --git a/styleguide-app/Examples/AssignmentIcon.elm b/styleguide-app/Examples/AssignmentIcon.elm index e5b5b57c..98f82ded 100644 --- a/styleguide-app/Examples/AssignmentIcon.elm +++ b/styleguide-app/Examples/AssignmentIcon.elm @@ -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 diff --git a/styleguide-app/Examples/Balloon.elm b/styleguide-app/Examples/Balloon.elm index 9ba1a24a..9d8a5842 100644 --- a/styleguide-app/Examples/Balloon.elm +++ b/styleguide-app/Examples/Balloon.elm @@ -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 {-| -} diff --git a/styleguide-app/Examples/Button.elm b/styleguide-app/Examples/Button.elm index 00b33a0f..7e840a77 100644 --- a/styleguide-app/Examples/Button.elm +++ b/styleguide-app/Examples/Button.elm @@ -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 diff --git a/styleguide-app/Examples/Checkbox.elm b/styleguide-app/Examples/Checkbox.elm index a6751307..543fc9f6 100644 --- a/styleguide-app/Examples/Checkbox.elm +++ b/styleguide-app/Examples/Checkbox.elm @@ -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) diff --git a/styleguide-app/Examples/ClickableSvg.elm b/styleguide-app/Examples/ClickableSvg.elm index 105fe4b8..28e1847b 100644 --- a/styleguide-app/Examples/ClickableSvg.elm +++ b/styleguide-app/Examples/ClickableSvg.elm @@ -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 ) diff --git a/styleguide-app/Examples/ClickableText.elm b/styleguide-app/Examples/ClickableText.elm index 33723d1c..443a7076 100644 --- a/styleguide-app/Examples/ClickableText.elm +++ b/styleguide-app/Examples/ClickableText.elm @@ -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 ) diff --git a/styleguide-app/Examples/Colors.elm b/styleguide-app/Examples/Colors.elm index 830f6101..c598df2f 100644 --- a/styleguide-app/Examples/Colors.elm +++ b/styleguide-app/Examples/Colors.elm @@ -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) diff --git a/styleguide-app/Examples/Confetti.elm b/styleguide-app/Examples/Confetti.elm index e3325631..ad4a1f0a 100644 --- a/styleguide-app/Examples/Confetti.elm +++ b/styleguide-app/Examples/Confetti.elm @@ -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 diff --git a/styleguide-app/Examples/Container.elm b/styleguide-app/Examples/Container.elm index 2c3134da..533a1679 100644 --- a/styleguide-app/Examples/Container.elm +++ b/styleguide-app/Examples/Container.elm @@ -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 diff --git a/styleguide-app/Examples/DisclosureIndicator.elm b/styleguide-app/Examples/DisclosureIndicator.elm index 46f576b8..9f8273a3 100644 --- a/styleguide-app/Examples/DisclosureIndicator.elm +++ b/styleguide-app/Examples/DisclosureIndicator.elm @@ -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 diff --git a/styleguide-app/Examples/Divider.elm b/styleguide-app/Examples/Divider.elm index d81abccc..0cdc2358 100644 --- a/styleguide-app/Examples/Divider.elm +++ b/styleguide-app/Examples/Divider.elm @@ -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 diff --git a/styleguide-app/Examples/Fonts.elm b/styleguide-app/Examples/Fonts.elm index 9f9da583..6e5adfc5 100644 --- a/styleguide-app/Examples/Fonts.elm +++ b/styleguide-app/Examples/Fonts.elm @@ -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 diff --git a/styleguide-app/Examples/Heading.elm b/styleguide-app/Examples/Heading.elm index 8aecec39..5f88add8 100644 --- a/styleguide-app/Examples/Heading.elm +++ b/styleguide-app/Examples/Heading.elm @@ -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) diff --git a/styleguide-app/Examples/IconExamples.elm b/styleguide-app/Examples/IconExamples.elm index 24240703..8a542242 100644 --- a/styleguide-app/Examples/IconExamples.elm +++ b/styleguide-app/Examples/IconExamples.elm @@ -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 diff --git a/styleguide-app/Examples/Loading.elm b/styleguide-app/Examples/Loading.elm index 46b9a0b3..f666d471 100644 --- a/styleguide-app/Examples/Loading.elm +++ b/styleguide-app/Examples/Loading.elm @@ -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 diff --git a/styleguide-app/Examples/Logo.elm b/styleguide-app/Examples/Logo.elm index f6682581..161b03ef 100644 --- a/styleguide-app/Examples/Logo.elm +++ b/styleguide-app/Examples/Logo.elm @@ -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 diff --git a/styleguide-app/Examples/Menu.elm b/styleguide-app/Examples/Menu.elm index 5d52da02..85cedfec 100644 --- a/styleguide-app/Examples/Menu.elm +++ b/styleguide-app/Examples/Menu.elm @@ -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 diff --git a/styleguide-app/Examples/Message.elm b/styleguide-app/Examples/Message.elm index f1559ac1..7d4799fd 100644 --- a/styleguide-app/Examples/Message.elm +++ b/styleguide-app/Examples/Message.elm @@ -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 diff --git a/styleguide-app/Examples/Modal.elm b/styleguide-app/Examples/Modal.elm index 1fa5f2be..9141c4b7 100644 --- a/styleguide-app/Examples/Modal.elm +++ b/styleguide-app/Examples/Modal.elm @@ -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 diff --git a/styleguide-app/Examples/Page.elm b/styleguide-app/Examples/Page.elm index cab7e94c..578b8865 100644 --- a/styleguide-app/Examples/Page.elm +++ b/styleguide-app/Examples/Page.elm @@ -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 ) diff --git a/styleguide-app/Examples/Pennant.elm b/styleguide-app/Examples/Pennant.elm index 8cadebb2..403e3889 100644 --- a/styleguide-app/Examples/Pennant.elm +++ b/styleguide-app/Examples/Pennant.elm @@ -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 {-| -} diff --git a/styleguide-app/Examples/RadioButton.elm b/styleguide-app/Examples/RadioButton.elm index dbd8c457..5461247e 100644 --- a/styleguide-app/Examples/RadioButton.elm +++ b/styleguide-app/Examples/RadioButton.elm @@ -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 diff --git a/styleguide-app/Examples/SegmentedControl.elm b/styleguide-app/Examples/SegmentedControl.elm index 5f92b7d1..f1a186bf 100644 --- a/styleguide-app/Examples/SegmentedControl.elm +++ b/styleguide-app/Examples/SegmentedControl.elm @@ -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) diff --git a/styleguide-app/Examples/Select.elm b/styleguide-app/Examples/Select.elm index f424155d..c09b525d 100644 --- a/styleguide-app/Examples/Select.elm +++ b/styleguide-app/Examples/Select.elm @@ -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 } diff --git a/styleguide-app/Examples/Shadows.elm b/styleguide-app/Examples/Shadows.elm index db690e75..9bcc71f8 100644 --- a/styleguide-app/Examples/Shadows.elm +++ b/styleguide-app/Examples/Shadows.elm @@ -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 diff --git a/styleguide-app/Examples/SideNav.elm b/styleguide-app/Examples/SideNav.elm index 8264cfc8..53d68113 100644 --- a/styleguide-app/Examples/SideNav.elm +++ b/styleguide-app/Examples/SideNav.elm @@ -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 ) diff --git a/styleguide-app/Examples/SlideModal.elm b/styleguide-app/Examples/SlideModal.elm index 6164c0f0..668c6c73 100644 --- a/styleguide-app/Examples/SlideModal.elm +++ b/styleguide-app/Examples/SlideModal.elm @@ -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 diff --git a/styleguide-app/Examples/SortableTable.elm b/styleguide-app/Examples/SortableTable.elm index d62638e9..0e2f49a0 100644 --- a/styleguide-app/Examples/SortableTable.elm +++ b/styleguide-app/Examples/SortableTable.elm @@ -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 ) diff --git a/styleguide-app/Examples/Sprite.elm b/styleguide-app/Examples/Sprite.elm index a8753c82..162500b5 100644 --- a/styleguide-app/Examples/Sprite.elm +++ b/styleguide-app/Examples/Sprite.elm @@ -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) diff --git a/styleguide-app/Examples/Svg.elm b/styleguide-app/Examples/Svg.elm index a11e07fa..fde2e09a 100644 --- a/styleguide-app/Examples/Svg.elm +++ b/styleguide-app/Examples/Svg.elm @@ -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) diff --git a/styleguide-app/Examples/Table.elm b/styleguide-app/Examples/Table.elm index c9e4e0bb..71fd0ce7 100644 --- a/styleguide-app/Examples/Table.elm +++ b/styleguide-app/Examples/Table.elm @@ -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 diff --git a/styleguide-app/Examples/Tabs.elm b/styleguide-app/Examples/Tabs.elm index 9e7a9b2a..25c5550f 100644 --- a/styleguide-app/Examples/Tabs.elm +++ b/styleguide-app/Examples/Tabs.elm @@ -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) diff --git a/styleguide-app/Examples/Text.elm b/styleguide-app/Examples/Text.elm index 4dda7c84..0adedf0f 100644 --- a/styleguide-app/Examples/Text.elm +++ b/styleguide-app/Examples/Text.elm @@ -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 diff --git a/styleguide-app/Examples/Text/Writing.elm b/styleguide-app/Examples/Text/Writing.elm index 22299a47..bf6cf4e7 100644 --- a/styleguide-app/Examples/Text/Writing.elm +++ b/styleguide-app/Examples/Text/Writing.elm @@ -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 diff --git a/styleguide-app/Examples/TextArea.elm b/styleguide-app/Examples/TextArea.elm index f39bf075..aa8ae39d 100644 --- a/styleguide-app/Examples/TextArea.elm +++ b/styleguide-app/Examples/TextArea.elm @@ -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 diff --git a/styleguide-app/Examples/TextInput.elm b/styleguide-app/Examples/TextInput.elm index e3dd8afe..bc2f933a 100644 --- a/styleguide-app/Examples/TextInput.elm +++ b/styleguide-app/Examples/TextInput.elm @@ -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) diff --git a/styleguide-app/Examples/Tooltip.elm b/styleguide-app/Examples/Tooltip.elm index c502e108..ff6739be 100644 --- a/styleguide-app/Examples/Tooltip.elm +++ b/styleguide-app/Examples/Tooltip.elm @@ -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 diff --git a/styleguide-app/Examples/UiIcon.elm b/styleguide-app/Examples/UiIcon.elm index f97f390a..52bec392 100644 --- a/styleguide-app/Examples/UiIcon.elm +++ b/styleguide-app/Examples/UiIcon.elm @@ -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 diff --git a/styleguide-app/KeyboardSupport.elm b/styleguide-app/KeyboardSupport.elm index f7395914..a6ac7b93 100644 --- a/styleguide-app/KeyboardSupport.elm +++ b/styleguide-app/KeyboardSupport.elm @@ -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) diff --git a/styleguide-app/Main.elm b/styleguide-app/Main.elm index f2789143..986d77be 100644 --- a/styleguide-app/Main.elm +++ b/styleguide-app/Main.elm @@ -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) diff --git a/styleguide-app/Routes.elm b/styleguide-app/Routes.elm index 6fc49ee4..0e18dbc2 100644 --- a/styleguide-app/Routes.elm +++ b/styleguide-app/Routes.elm @@ -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) diff --git a/styleguide-app/ViewHelpers.elm b/styleguide-app/ViewHelpers.elm index 0fc3d4a3..7ba49093 100644 --- a/styleguide-app/ViewHelpers.elm +++ b/styleguide-app/ViewHelpers.elm @@ -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