Move Callout examples into Message examples

This commit is contained in:
Aaron VonderHaar 2020-04-27 14:44:27 -07:00
parent c419ee292d
commit 086d8f3321
3 changed files with 37 additions and 94 deletions

View File

@ -4,7 +4,6 @@ import Example exposing (Example)
import Examples.Accordion as Accordion import Examples.Accordion as Accordion
import Examples.AssignmentIcon as AssignmentIcon import Examples.AssignmentIcon as AssignmentIcon
import Examples.Button as Button import Examples.Button as Button
import Examples.Callout as Callout
import Examples.Checkbox as Checkbox import Examples.Checkbox as Checkbox
import Examples.ClickableSvg as ClickableSvg import Examples.ClickableSvg as ClickableSvg
import Examples.ClickableText as ClickableText import Examples.ClickableText as ClickableText
@ -94,25 +93,6 @@ all =
ButtonState childState -> ButtonState childState ->
Just childState Just childState
_ ->
Nothing
)
, Callout.example
|> Example.wrapMsg CalloutMsg
(\msg ->
case msg of
CalloutMsg childMsg ->
Just childMsg
_ ->
Nothing
)
|> Example.wrapState CalloutState
(\msg ->
case msg of
CalloutState childState ->
Just childState
_ -> _ ->
Nothing Nothing
) )
@ -712,7 +692,6 @@ type State
= AccordionState Accordion.State = AccordionState Accordion.State
| AssignmentIconState AssignmentIcon.State | AssignmentIconState AssignmentIcon.State
| ButtonState Button.State | ButtonState Button.State
| CalloutState Callout.State
| CheckboxState Checkbox.State | CheckboxState Checkbox.State
| ClickableSvgState ClickableSvg.State | ClickableSvgState ClickableSvg.State
| ClickableTextState ClickableText.State | ClickableTextState ClickableText.State
@ -750,7 +729,6 @@ type Msg
= AccordionMsg Accordion.Msg = AccordionMsg Accordion.Msg
| AssignmentIconMsg AssignmentIcon.Msg | AssignmentIconMsg AssignmentIcon.Msg
| ButtonMsg Button.Msg | ButtonMsg Button.Msg
| CalloutMsg Callout.Msg
| CheckboxMsg Checkbox.Msg | CheckboxMsg Checkbox.Msg
| ClickableSvgMsg ClickableSvg.Msg | ClickableSvgMsg ClickableSvg.Msg
| ClickableTextMsg ClickableText.Msg | ClickableTextMsg ClickableText.Msg

View File

@ -1,70 +0,0 @@
module Examples.Callout exposing (example, State, Msg)
{-|
@docs example, State, Msg
-}
import Category exposing (Category(..))
import Css
import Example exposing (Example)
import Html.Styled as Html
import Html.Styled.Attributes exposing (href, title)
import Nri.Ui.Callout.V1 as Callout exposing (callout)
type alias State =
()
{-| -}
type alias Msg =
()
{-| -}
example : Example State Msg
example =
{ name = "Nri.Ui.Callout.V1"
, categories = [ Messaging ]
, state = ()
, update = \_ state -> ( state, Cmd.none )
, subscriptions = \_ -> Sub.none
, view =
\_ ->
[ -- PLAIN
Html.h3 [] [ Html.text "Originally Designed Use Case" ]
, callout
[ Callout.label (Html.text "BETA")
, Callout.custom (title "beta warning")
]
[ Html.text "This tab is still a work in progress; some of your student's information may be missing."
, Html.br [] []
, Html.text "To share your thoughts and help us improve the experience, "
, Html.a [ href "#" ] [ Html.text "click here" ]
, Html.text "."
]
-- WITH SIDE TEXT
, Html.h3 [] [ Html.text "Without side text" ]
, callout
[ Callout.custom (title "no side text") ]
[ Html.text "I feel weird without my side text!" ]
-- WITH CSS CUSTOMIZATIONS
, Html.h3 [] [ Html.text "With CSS customizations" ]
, callout
[ Callout.containerCss [ Css.margin (Css.px 20) ]
, Callout.label (Html.text "HMMM")
, Callout.custom (title "margin")
]
[ Html.text "My container styles are customized to add margin around the callout" ]
, callout
[ Callout.contentCss [ Css.textTransform Css.uppercase ]
, Callout.label (Html.text "WOW!")
, Callout.custom (title "yelling")
]
[ Html.text "My content styles are customized to yell about everything" ]
]
}

View File

@ -4,11 +4,11 @@ import Category exposing (Category(..))
import Css import Css
import Example exposing (Example) import Example exposing (Example)
import Html.Styled as Html exposing (Html, a, div, h3, pre, text) import Html.Styled as Html exposing (Html, a, div, h3, pre, text)
import Html.Styled.Attributes as Attributes import Html.Styled.Attributes as Attributes exposing (href, title)
import Nri.Ui.Alert.V4 as Alert import Nri.Ui.Alert.V4 as Alert
import Nri.Ui.BannerAlert.V6 as BannerAlert import Nri.Ui.BannerAlert.V6 as BannerAlert
import Nri.Ui.Callout.V1 as Callout exposing (callout)
import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1 as Fonts
import Nri.Ui.Heading.V2 as Heading import Nri.Ui.Heading.V2 as Heading
import Nri.Ui.Pennant.V2 as Pennant import Nri.Ui.Pennant.V2 as Pennant
import Nri.Ui.Svg.V1 as Svg import Nri.Ui.Svg.V1 as Svg
@ -131,6 +131,41 @@ example =
Nothing Nothing
""" """
] ]
, Html.hr [] []
, Heading.h3 [] [ text "Message.callout (deprecated; talk with your designer, but generally prefer Message.large, or consider adding Message.medium)" ]
, -- PLAIN
Html.h3 [] [ Html.text "Originally Designed Use Case" ]
, callout
[ Callout.label (Html.text "BETA")
, Callout.custom (title "beta warning")
]
[ Html.text "This tab is still a work in progress; some of your student's information may be missing."
, Html.br [] []
, Html.text "To share your thoughts and help us improve the experience, "
, Html.a [ href "#" ] [ Html.text "click here" ]
, Html.text "."
]
-- WITH SIDE TEXT
, Html.h3 [] [ Html.text "Without side text" ]
, callout
[ Callout.custom (title "no side text") ]
[ Html.text "I feel weird without my side text!" ]
-- WITH CSS CUSTOMIZATIONS
, Html.h3 [] [ Html.text "With CSS customizations" ]
, callout
[ Callout.containerCss [ Css.margin (Css.px 20) ]
, Callout.label (Html.text "HMMM")
, Callout.custom (title "margin")
]
[ Html.text "My container styles are customized to add margin around the callout" ]
, callout
[ Callout.contentCss [ Css.textTransform Css.uppercase ]
, Callout.label (Html.text "WOW!")
, Callout.custom (title "yelling")
]
[ Html.text "My content styles are customized to yell about everything" ]
] ]
} }