Adds example app

This commit is contained in:
Tessa Kelly 2020-07-30 11:12:30 -07:00
parent d7dbb1af92
commit 192cd5c49c
2 changed files with 89 additions and 0 deletions

View File

@ -23,6 +23,7 @@ import Examples.Message as Message
import Examples.Modal as Modal
import Examples.Page as Page
import Examples.Pennant as Pennant
import Examples.RadioButton as RadioButton
import Examples.SegmentedControl as SegmentedControl
import Examples.Select as Select
import Examples.Slide as Slide
@ -456,6 +457,25 @@ all =
PennantState childState ->
Just childState
_ ->
Nothing
)
, RadioButton.example
|> Example.wrapMsg RadioButtonMsg
(\msg ->
case msg of
RadioButtonMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState RadioButtonState
(\msg ->
case msg of
RadioButtonState childState ->
Just childState
_ ->
Nothing
)
@ -751,6 +771,7 @@ type State
| ModalState Modal.State
| PageState Page.State
| PennantState Pennant.State
| RadioButtonState RadioButton.State
| SegmentedControlState SegmentedControl.State
| SelectState Select.State
| SlideState Slide.State
@ -790,6 +811,7 @@ type Msg
| ModalMsg Modal.Msg
| PageMsg Page.Msg
| PennantMsg Pennant.Msg
| RadioButtonMsg RadioButton.Msg
| SegmentedControlMsg SegmentedControl.Msg
| SelectMsg Select.Msg
| SlideMsg Slide.Msg

View File

@ -0,0 +1,67 @@
module Examples.RadioButton exposing
( example
, State, Msg
)
{-|
@docs example
@docs State, Msg
-}
import AtomicDesignType exposing (AtomicDesignType(..))
import Category exposing (Category(..))
import Css exposing (..)
import Dict exposing (Dict)
import Example exposing (Example)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes exposing (css)
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.RadioButton.V1 as RadioButton
import Nri.Ui.Text.V4 as Text
{-| -}
example : Example State Msg
example =
{ name = "Nri.Ui.RadioButton.V1"
, state = init
, update = update
, subscriptions = \_ -> Sub.none
, view = view
, categories = [ Layout ]
, atomicDesignType = Atom
, keyboardSupport = []
}
{-| -}
view : State -> List (Html Msg)
view model =
[ Heading.h3 [] [ Html.text "RadioButton" ]
]
type alias Msg =
()
{-| -}
init : State
init =
()
{-| -}
type alias State =
()
{-| -}
update : Msg -> State -> ( State, Cmd Msg )
update msg model =
( model, Cmd.none )