2020-04-01 02:00:29 +03:00
|
|
|
module Examples.Text exposing (example, State, Msg)
|
2018-02-13 00:32:38 +03:00
|
|
|
|
2018-03-08 01:36:52 +03:00
|
|
|
{-|
|
|
|
|
|
2020-04-01 02:00:29 +03:00
|
|
|
@docs example, State, Msg
|
2018-03-08 01:36:52 +03:00
|
|
|
|
2018-02-13 00:32:38 +03:00
|
|
|
-}
|
|
|
|
|
2020-06-19 23:41:28 +03:00
|
|
|
import AtomicDesignType exposing (AtomicDesignType(..))
|
2020-03-24 03:33:42 +03:00
|
|
|
import Category exposing (Category(..))
|
2020-07-13 18:11:33 +03:00
|
|
|
import Css
|
2020-03-31 23:33:05 +03:00
|
|
|
import Example exposing (Example)
|
2018-03-08 01:36:52 +03:00
|
|
|
import Html.Styled as Html
|
2020-02-18 02:03:11 +03:00
|
|
|
import Html.Styled.Attributes as Attributes
|
2020-06-20 00:45:32 +03:00
|
|
|
import KeyboardSupport exposing (Direction(..), Key(..))
|
2019-07-23 17:53:43 +03:00
|
|
|
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 =
|
2019-10-01 04:15:26 +03:00
|
|
|
{ name = "Nri.Ui.Text.V4"
|
2020-06-19 23:41:28 +03:00
|
|
|
, categories = [ Text ]
|
2020-06-20 00:16:10 +03:00
|
|
|
, atomicDesignType = Atom
|
2020-06-20 00:45:32 +03:00
|
|
|
, 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-02-18 21:45:59 +03:00
|
|
|
]
|
2020-02-18 21:50:51 +03:00
|
|
|
|
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")
|
2020-07-13 18:11:33 +03:00
|
|
|
, 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
|
|
|
}
|