From 3eaea56a92a156af8997af78f334eda74e09371e Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Tue, 4 Aug 2020 18:25:41 -0700 Subject: [PATCH] Open up the type for the attributes for each option --- src/Nri/Ui/SegmentedControl/V10.elm | 16 ++++++++-------- styleguide-app/Examples/SegmentedControl.elm | 2 +- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/Nri/Ui/SegmentedControl/V10.elm b/src/Nri/Ui/SegmentedControl/V10.elm index c897aa89..3b285682 100644 --- a/src/Nri/Ui/SegmentedControl/V10.elm +++ b/src/Nri/Ui/SegmentedControl/V10.elm @@ -31,10 +31,10 @@ import Nri.Ui.Util exposing (dashify) {-| -} -type alias Option value = +type alias Option value msg = { value : value , label : String - , attributes : List (Attribute Never) + , attributes : List (Attribute msg) , icon : Maybe Svg } @@ -56,7 +56,7 @@ not a page control -} viewSelect : { onClick : a -> msg - , options : List (Option a) + , options : List (Option a msg) , selected : Maybe a , width : Width } @@ -95,7 +95,7 @@ viewSelect config = -} view : { onClick : a -> msg - , options : List (Option a) + , options : List (Option a msg) , selected : a , width : Width , content : Html msg @@ -139,12 +139,12 @@ view config = ] -segmentIdFor : Option a -> String +segmentIdFor : Option a msg -> String segmentIdFor option = "Nri-Ui-SegmentedControl-Segment-" ++ dashify option.label -panelIdFor : Option a -> String +panelIdFor : Option a msg -> String panelIdFor option = "Nri-Ui-SegmentedControl-Panel-" ++ dashify option.label @@ -157,7 +157,7 @@ viewSegment : , selectedAttribute : Attribute msg , ariaRole : Attribute msg } - -> Option a + -> Option a msg -> Html msg viewSegment config option = let @@ -209,7 +209,7 @@ viewSegment config option = else AttributesExtra.none ] - ++ List.map (Attributes.map never) option.attributes + ++ option.attributes ) [ case option.icon of Nothing -> diff --git a/styleguide-app/Examples/SegmentedControl.elm b/styleguide-app/Examples/SegmentedControl.elm index ad8ce5af..59cc24c7 100644 --- a/styleguide-app/Examples/SegmentedControl.elm +++ b/styleguide-app/Examples/SegmentedControl.elm @@ -100,7 +100,7 @@ plainIcons = ] -buildOptions : String -> Options -> List a -> List Svg -> List (SegmentedControl.Option a) +buildOptions : String -> Options -> List a -> List Svg -> List (SegmentedControl.Option a msg) buildOptions prefix options selections = let buildOption option icon =