Adds small, medium, large attribute helpers

This commit is contained in:
Tessa Kelly 2019-07-03 07:02:59 -07:00
parent 724260bd3a
commit 73033fac55

View File

@ -1,6 +1,7 @@
module Nri.Ui.Button.V9 exposing
( buildButton, buildLink
, render
, small, medium, large
, ButtonSize(..), ButtonWidth(..), ButtonStyle(..), ButtonState(..)
, button
, delete
@ -39,6 +40,7 @@ may be exceptions, for example if button content is supplied by an end-user.
@docs buildButton, buildLink
@docs render
@docs small, medium, large
## Commonly-used attributes
@ -144,6 +146,34 @@ render buttonOrLink =
link config
{-| -}
small : ButtonOrLink msg -> ButtonOrLink msg
small =
setSize Small
{-| -}
medium : ButtonOrLink msg -> ButtonOrLink msg
medium =
setSize Medium
{-| -}
large : ButtonOrLink msg -> ButtonOrLink msg
large =
setSize Large
setSize : ButtonSize -> ButtonOrLink msg -> ButtonOrLink msg
setSize size buttonOrLink =
case buttonOrLink of
Button config state ->
Button { config | size = size } state
Link config ->
Link { config | size = size }
{-| Sizes for buttons and links that have button classes
-}
type ButtonSize