Begin passing through attributes

This commit is contained in:
Tessa Kelly 2020-08-04 18:17:24 -07:00
parent 3878f190ed
commit a326999f84
2 changed files with 7 additions and 7 deletions

View File

@ -29,10 +29,11 @@ import Nri.Ui.Util exposing (dashify)
{-| -}
type alias Option a =
{ value : a
, icon : Maybe Svg
type alias Option value =
{ value : value
, label : String
, attributes : List (Attribute Never)
, icon : Maybe Svg
}
@ -158,9 +159,6 @@ viewSegment :
-> Html msg
viewSegment config option =
let
idValue =
segmentIdFor option
element attrs children =
case config.toUrl of
Nothing ->
@ -183,7 +181,8 @@ viewSegment config option =
in
element
(List.concat
[ [ Attributes.id idValue
[ List.map (Attributes.map never) option.attributes
, [ Attributes.id (segmentIdFor option)
, config.ariaRole
, css sharedSegmentStyles
]

View File

@ -112,6 +112,7 @@ buildOptions prefix options selections =
Nothing
, label = prefix ++ Debug.toString option
, value = option
, attributes = []
}
in
List.map2 buildOption selections