mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-24 17:02:51 +03:00
Adds small, medium, large attribute helpers
This commit is contained in:
parent
724260bd3a
commit
73033fac55
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user