Adds Button examples

This commit is contained in:
Tessa Kelly 2021-11-05 12:04:46 -07:00
parent cf319c6423
commit db95e2c3b9
4 changed files with 27 additions and 5 deletions

View File

@ -114,7 +114,14 @@ preview_ navigate example =
[ ClickableText.href (exampleHref example)
, ClickableText.css [ Css.marginBottom (Css.px 10) ]
]
:: List.map (Html.map never) example.preview
:: [ Html.div
[ Attributes.css
[ Css.displayFlex
, Css.flexDirection Css.column
]
]
(List.map (Html.map never) example.preview)
]
)
]

View File

@ -33,7 +33,7 @@ example =
[ Balloon.balloon
[ Balloon.onTop
, Balloon.navy
, Balloon.paddingPx 4
, Balloon.paddingPx 15
]
(text "This is a balloon.")
]

View File

@ -28,7 +28,21 @@ example =
, state = init
, update = update
, subscriptions = \_ -> Sub.none
, preview = []
, preview =
[ Button.link "Primary" [ Button.small, Button.fillContainerWidth ]
, Button.link "Secondary"
[ Button.small
, Button.fillContainerWidth
, Button.secondary
, Button.css [ Css.marginTop (Css.px 8) ]
]
, Button.link "Premium"
[ Button.small
, Button.fillContainerWidth
, Button.premium
, Button.css [ Css.marginTop (Css.px 8) ]
]
]
, view = \state -> [ viewButtonExamples state ]
, categories = [ Buttons ]
, keyboardSupport = []

View File

@ -14,12 +14,13 @@ preview icons =
[ Html.div
[ css
[ Css.displayFlex
, Css.justifyContent Css.spaceBetween
, Css.flexWrap Css.wrap
, Css.property "gap" "10px"
, Css.color Colors.gray45
]
]
(List.map
(Svg.withWidth (Css.px 18) >> Svg.withHeight (Css.px 18) >> Svg.toHtml)
(Svg.withWidth (Css.px 30) >> Svg.withHeight (Css.px 30) >> Svg.toHtml)
icons
)
]