Begins adding styleguide example

This commit is contained in:
Tessa Kelly 2020-05-07 12:46:21 -07:00
parent ab151ebf3e
commit fa8fd2003e
2 changed files with 75 additions and 0 deletions

View File

@ -17,6 +17,7 @@ import Examples.Icon as Icon
import Examples.Loading as Loading
import Examples.Logo as Logo
import Examples.MasteryIcon as MasteryIcon
import Examples.Menu as Menu
import Examples.Message as Message
import Examples.Modal as Modal
import Examples.Page as Page
@ -340,6 +341,25 @@ all =
MasteryIconState childState ->
Just childState
_ ->
Nothing
)
, Menu.example
|> Example.wrapMsg MenuMsg
(\msg ->
case msg of
MenuMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState MenuState
(\msg ->
case msg of
MenuState childState ->
Just childState
_ ->
Nothing
)
@ -705,6 +725,7 @@ type State
| LoadingState Loading.State
| LogoState Logo.State
| MasteryIconState MasteryIcon.State
| MenuState Menu.State
| MessageState Message.State
| ModalState Modal.State
| PageState Page.State
@ -742,6 +763,7 @@ type Msg
| LoadingMsg Loading.Msg
| LogoMsg Logo.Msg
| MasteryIconMsg MasteryIcon.Msg
| MenuMsg Menu.Msg
| MessageMsg Message.Msg
| ModalMsg Modal.Msg
| PageMsg Page.Msg

View File

@ -0,0 +1,53 @@
module Examples.Menu exposing (Msg, State, example)
{-|
@docs Msg, State, example
-}
import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Html.Styled
import Html.Styled.Attributes
import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Menu.V1 as Meny
{-| -}
example : Example State Msg
example =
{ name = "Nri.Ui.Menu.V1"
, state = init
, update = update
, subscriptions = \_ -> Sub.none
, categories = [ Widgets ]
, view =
\state ->
[]
}
{-| -}
init : State
init =
()
{-| -}
type alias State =
()
{-| -}
type Msg
= NoOp
{-| -}
update : Msg -> State -> ( State, Cmd Msg )
update msg state =
case msg of
NoOp ->
( state, Cmd.none )