Adds some defaults

This commit is contained in:
Tessa Kelly 2020-09-08 14:14:40 -07:00
parent c033727e81
commit 688b3190ce
5 changed files with 10 additions and 12 deletions

View File

@ -138,7 +138,8 @@ viewRadioGroup config =
)
{-| -}
{-| Tooltip defaults: `[Tooltip.smallPadding, Tooltip.onBottom, Tooltip.fitToContent]`
-}
type alias Option value msg =
{ value : value
, idString : String

View File

@ -64,7 +64,8 @@ tabHtml content =
Attribute (\tab -> { tab | tabView = content })
{-| -}
{-| Tooltip defaults: `[Tooltip.smallPadding, Tooltip.onBottom, Tooltip.fitToContent]`
-}
withTooltip : List (Tooltip.Attribute msg) -> Attribute id msg
withTooltip attributes =
Attribute (\tab -> { tab | tabTooltip = attributes })

View File

@ -123,7 +123,12 @@ viewTab_ config index tab =
{ id = "tab-tooltip__" ++ tabToId tab.idString
, trigger = \eventHandlers -> buttonOrLink eventHandlers
}
tooltipAttributes
([ Tooltip.smallPadding
, Tooltip.onBottom
, Tooltip.fitToContent
]
++ tooltipAttributes
)
keyEvents : Config id msg -> Tab id msg -> Int -> Json.Decode.Decoder msg

View File

@ -112,10 +112,7 @@ buildOptions { icon, longContent, tooltips } openTooltip =
, tabTooltip =
if tooltips then
[ Tooltip.plaintext (Debug.toString value)
, Tooltip.smallPadding
, Tooltip.onBottom
, Tooltip.onHover (PageTooltip value)
, Tooltip.fitToContent
, Tooltip.open (openTooltip == Just value)
]

View File

@ -170,12 +170,9 @@ allTabs openTooltipId =
, Tabs.tabString "1"
, Tabs.withTooltip
[ Tooltip.plaintext "Link Example"
, Tooltip.onBottom
, Tooltip.onHover (ToggleTooltip First)
, Tooltip.alignStart (Css.px 75)
, Tooltip.primaryLabel
, Tooltip.fitToContent
, Tooltip.smallPadding
, Tooltip.open (openTooltipId == Just First)
]
, Tabs.panelHtml (Html.text "First Panel")
@ -188,11 +185,8 @@ allTabs openTooltipId =
[ Tabs.tabHtml bulbIcon
, Tabs.withTooltip
[ Tooltip.plaintext "The Electrifying Third Tab"
, Tooltip.onBottom
, Tooltip.onHover (ToggleTooltip Third)
, Tooltip.primaryLabel
, Tooltip.fitToContent
, Tooltip.smallPadding
, Tooltip.open (openTooltipId == Just Third)
]
, Tabs.panelHtml (Html.text "Third Panel")