allow HTML in labels

This commit is contained in:
Brian Hicks 2020-08-20 15:13:35 -05:00
parent 85bcfbe424
commit e979190537
2 changed files with 5 additions and 10 deletions

View File

@ -4,14 +4,9 @@ module Nri.Ui.SegmentedControl.V12 exposing
, Width(..)
)
{-| Changes from V10:
{-| Changes from V11:
- change selection using left/right arrow keys
- only currently-selected or first control is tabbable
- tabpanel is tabbable
- Uses TabsInternal under the hood
- `viewSelect` renamed to `viewRadioGroup`, `SelectOption` renamed to `Radio`
- `viewRadioGroup` uses native HTML radio input internally
- allow HTML in labels
@docs Option, view
@docs Radio, viewRadioGroup
@ -127,7 +122,7 @@ viewRadioGroup config =
{-| -}
type alias Option value msg =
{ value : value
, label : String
, label : Html msg
, attributes : List (Attribute msg)
, icon : Maybe Svg
, content : Html msg
@ -162,7 +157,7 @@ view config =
{ id = option.value
, idString = config.toString option.value
, tabAttributes = option.attributes
, tabView = [ viewIcon option.icon, text option.label ]
, tabView = [ viewIcon option.icon, option.label ]
, panelView = option.content
, spaHref = Maybe.map (\toUrl -> toUrl option.value) config.toUrl
}

View File

@ -106,7 +106,7 @@ buildOptions { icon, longContent } =
else
Nothing
, label = Debug.toString value
, label = Html.text (Debug.toString value)
, value = value
, attributes = []
, content =