diff --git a/styleguide-app/Examples.elm b/styleguide-app/Examples.elm index 72ac4110..7ca01b85 100644 --- a/styleguide-app/Examples.elm +++ b/styleguide-app/Examples.elm @@ -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 diff --git a/styleguide-app/Examples/RadioButton.elm b/styleguide-app/Examples/RadioButton.elm new file mode 100644 index 00000000..d05f255f --- /dev/null +++ b/styleguide-app/Examples/RadioButton.elm @@ -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 )