2021-10-13 20:44:03 +03:00
|
|
|
module Examples.Container exposing (Msg, State, example)
|
|
|
|
|
|
|
|
{-|
|
|
|
|
|
|
|
|
@docs Msg, State, example
|
|
|
|
|
|
|
|
-}
|
|
|
|
|
|
|
|
import Category exposing (Category(..))
|
|
|
|
import Css
|
|
|
|
import Example exposing (Example)
|
|
|
|
import Html.Styled as Html
|
|
|
|
import Html.Styled.Attributes exposing (css)
|
|
|
|
import Html.Styled.Events exposing (onClick)
|
|
|
|
import KeyboardSupport exposing (Direction(..), Key(..))
|
|
|
|
import Nri.Ui.Button.V10 as Button
|
|
|
|
import Nri.Ui.Colors.V1 as Colors
|
2021-10-21 22:17:48 +03:00
|
|
|
import Nri.Ui.Container.V2 as Container
|
2021-10-13 20:44:03 +03:00
|
|
|
import Nri.Ui.Heading.V2 as Heading
|
|
|
|
import Nri.Ui.Text.V5 as Text
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
example : Example State Msg
|
|
|
|
example =
|
|
|
|
{ name = "Container"
|
2021-10-22 00:47:50 +03:00
|
|
|
, version = 2
|
2021-10-13 20:44:03 +03:00
|
|
|
, categories = [ Layout ]
|
|
|
|
, keyboardSupport = []
|
|
|
|
, state = init
|
|
|
|
, update = update
|
|
|
|
, subscriptions = \_ -> Sub.none
|
|
|
|
, view =
|
|
|
|
\state ->
|
|
|
|
[ Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
2021-10-21 22:17:48 +03:00
|
|
|
[ Html.text "Default Container" ]
|
|
|
|
, Html.text "Your go-to container."
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.default
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-13 20:44:03 +03:00
|
|
|
, Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
2021-10-21 22:17:48 +03:00
|
|
|
[ Html.text "Gray Container" ]
|
|
|
|
, Html.text "A container that doesn't draw too much attention to itself."
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.gray
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-13 20:44:03 +03:00
|
|
|
, Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
2021-10-21 22:17:48 +03:00
|
|
|
[ Html.text "Pillow Container" ]
|
|
|
|
, Html.text "When you want something big and soft."
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.pillow
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-21 22:17:48 +03:00
|
|
|
, Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
|
|
|
[ Html.text "Buttony Container" ]
|
|
|
|
, Html.text "Used for clickable button card things."
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.buttony
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-13 20:44:03 +03:00
|
|
|
, Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
|
|
|
[ Html.text "Disabled Container" ]
|
|
|
|
, Html.text "Used to indicate content is locked/inaccessible"
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.disabled
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-13 20:44:03 +03:00
|
|
|
, Heading.h3 [ Heading.css [ Css.marginTop (Css.px 8) ] ]
|
|
|
|
[ Html.text "Invalid Container" ]
|
|
|
|
, Html.text "Used to indicate content is invalid"
|
2021-10-22 01:21:24 +03:00
|
|
|
, Container.view
|
|
|
|
[ Container.invalid
|
|
|
|
, Container.plaintext "Content, content..."
|
2021-10-22 01:06:41 +03:00
|
|
|
]
|
2021-10-13 20:44:03 +03:00
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
init : State
|
|
|
|
init =
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
type alias State =
|
|
|
|
{}
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
type alias Msg =
|
|
|
|
()
|
|
|
|
|
|
|
|
|
|
|
|
{-| -}
|
|
|
|
update : Msg -> State -> ( State, Cmd Msg )
|
|
|
|
update msg state =
|
|
|
|
( state, Cmd.none )
|