noredink-ui/styleguide-app/Examples/Text.elm

88 lines
3.3 KiB
Elm
Raw Normal View History

2020-04-01 02:00:29 +03:00
module Examples.Text exposing (example, State, Msg)
2018-02-13 00:32:38 +03:00
{-|
2020-04-01 02:00:29 +03:00
@docs example, State, Msg
2018-02-13 00:32:38 +03:00
-}
2020-06-19 23:41:28 +03:00
import AtomicDesignType exposing (AtomicDesignType(..))
import Category exposing (Category(..))
import Css
2020-03-31 23:33:05 +03:00
import Example exposing (Example)
import Html.Styled as Html
2020-02-18 02:03:11 +03:00
import Html.Styled.Attributes as Attributes
import KeyboardSupport exposing (Direction(..), Key(..))
import Nri.Ui.Heading.V2 as Heading
2020-07-13 17:50:19 +03:00
import Nri.Ui.Text.V5 as Text
2018-02-13 00:32:38 +03:00
{-| -}
2020-04-01 02:00:29 +03:00
type alias State =
()
{-| -}
type alias Msg =
()
{-| -}
example : Example State Msg
2018-02-13 00:32:38 +03:00
example =
2020-09-09 21:43:10 +03:00
{ name = "Text"
2020-09-21 20:36:59 +03:00
, version = 5
2020-06-19 23:41:28 +03:00
, categories = [ Text ]
2020-06-20 00:16:10 +03:00
, atomicDesignType = Atom
, keyboardSupport = []
2020-03-31 23:33:05 +03:00
, state = ()
, update = \_ state -> ( state, Cmd.none )
, subscriptions = \_ -> Sub.none
, view =
\_ ->
let
exampleHtml kind =
[ Html.text "This is a "
, Html.strong [] [ Html.text kind ]
, Html.text ". "
, Html.a
[ Attributes.href "http://www.noredink.com"
, Attributes.target "_blank"
]
[ Html.text "The quick brown fox jumps over the lazy dog." ]
, Html.text " Be on the lookout for a new and improved assignment creation form! Soon, you'll be able to easily see a summary of the content you're assigning, as well as an estimate for how long the assignment will take."
]
2020-03-31 23:33:05 +03:00
exampleUGHtml kind =
[ Html.text "This is a "
, Html.strong [] [ Html.text kind ]
, Html.text ". The quick brown fox jumps over the lazy dog."
, Html.text " When I stepped out, into the bright sunlight from the darkness of the movie house, I had only two things on my mind: Paul Newman, and a ride home."
]
in
2020-07-13 17:50:19 +03:00
[ Text.caption [] [ Html.text "NOTE: When using these styles, please read the documentation in the Elm module about \"Understanding spacing\"" ]
2020-03-31 23:33:05 +03:00
, Heading.h2 [ Heading.style Heading.Top ] [ Html.text "Paragraph styles" ]
2020-07-13 17:50:19 +03:00
, Text.mediumBody [] (exampleHtml "mediumBody")
, Text.smallBody [] (exampleHtml "smallBody")
, Text.smallBodyGray [] (exampleHtml "smallBodyGray")
, Text.caption [] (exampleHtml "caption")
2020-03-31 23:33:05 +03:00
, Heading.h2 [ Heading.style Heading.Top ] [ Html.text "Paragraph styles for user-authored content" ]
2020-07-13 17:50:19 +03:00
, Text.ugMediumBody [] (exampleUGHtml "ugMediumBody")
, Text.ugSmallBody [] (exampleUGHtml "ugSmallBody")
, Heading.h2 [ Heading.style Heading.Top ] [ Html.text "One-Off Styles" ]
, Text.mediumBody
[ Text.css [ Css.padding (Css.px 20) ] ]
[ Html.text "I've got more padding than my siblings!" ]
, Html.div
[ Attributes.css
[ Css.width (Css.px 80)
, Css.border3 (Css.px 1) Css.solid (Css.hex "000")
]
]
[ Text.mediumBody
[ Text.noBreak ]
[ Html.text "I won't ever break, no matter how narrow my container is." ]
]
2020-03-31 23:33:05 +03:00
]
2018-02-13 00:32:38 +03:00
}