From da1e069f8cc4fda38a4205d6a16c5567c11dbc05 Mon Sep 17 00:00:00 2001 From: Tom Nunn Date: Thu, 21 Jul 2022 21:57:27 +0200 Subject: [PATCH] Tidy up examples --- examples/src/EffectExample.elm | 3 +-- examples/src/Example.elm | 25 ++++++++----------------- package.json | 2 +- 3 files changed, 10 insertions(+), 20 deletions(-) diff --git a/examples/src/EffectExample.elm b/examples/src/EffectExample.elm index 582cb3c..8ffd1d9 100644 --- a/examples/src/EffectExample.elm +++ b/examples/src/EffectExample.elm @@ -5,7 +5,6 @@ import Countries exposing (Country) import Element import Element.Input as Input import Html exposing (Html) -import Html.Attributes import Resources.ClearButton import Select exposing (Select) import Select.Effect @@ -46,7 +45,7 @@ view model = ] [ Select.view [] { onChange = CountrySelectMsg - , label = Input.labelAbove [ Element.htmlAttribute <| Html.Attributes.for (Select.toInputElementId model.countrySelect) ] (Element.text "Choose a country") + , label = Input.labelAbove [] (Element.text "Choose a country") , placeholder = Just (Input.placeholder [] (Element.text "Type to search")) , itemToString = \c -> c.flag ++ " " ++ c.name } diff --git a/examples/src/Example.elm b/examples/src/Example.elm index fb23838..e5afd47 100644 --- a/examples/src/Example.elm +++ b/examples/src/Example.elm @@ -5,9 +5,8 @@ import Countries exposing (Country) import Element import Element.Input as Input import Html exposing (Html) -import Html.Attributes +import Resources.ClearButton import Select exposing (Select) -import Element.Region main : Program () Model Msg main = @@ -44,21 +43,13 @@ view model = , Element.padding 30 ] [ Select.view [] - { onChange = CountrySelectMsg - , label = Input.labelAbove [ Element.htmlAttribute <| Html.Attributes.for (Select.toInputElementId model.countrySelect) ] (Element.text "Choose a country") - , placeholder = Just (Input.placeholder [] (Element.text "Type to search")) - , itemToString = \c -> c.flag ++ " " ++ c.name - } - |> Select.withClearButton - (Just - (Select.clearButton [ - Element.alignRight - , Element.centerY - , Element.moveLeft 12 ] - (Element.el [ Element.Region.description "clear selection" ] (Element.text "❌")) - ) - ) - |> Select.toElement model.countrySelect + { onChange = CountrySelectMsg + , label = Input.labelAbove [] (Element.text "Choose a country") + , placeholder = Just (Input.placeholder [] (Element.text "Type to search")) + , itemToString = \c -> c.flag ++ " " ++ c.name + } + |> Select.withClearButton (Just Resources.ClearButton.clearButton) + |> Select.toElement model.countrySelect , Maybe.map (\{ name } -> Element.text ("You chose " ++ name)) (Select.toValue model.countrySelect) |> Maybe.withDefault Element.none ] diff --git a/package.json b/package.json index 221f550..6330df0 100644 --- a/package.json +++ b/package.json @@ -10,7 +10,7 @@ "examples": "cd examples/src && elm reactor" }, "pre-commit": [ - "review" + "ci" ], "repository": { "type": "git",