From 9cba1a22d05849043427f4495b1fd43a63e66dc9 Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Mon, 30 Sep 2019 18:15:26 -0700 Subject: [PATCH] :bug: fixes the broken see-only-this-link and the view docs link --- styleguide-app/Examples/Heading.elm | 31 +++++++++++++++++++++++++++++ styleguide-app/Examples/Text.elm | 26 ++++-------------------- styleguide-app/NriModules.elm | 2 ++ 3 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 styleguide-app/Examples/Heading.elm diff --git a/styleguide-app/Examples/Heading.elm b/styleguide-app/Examples/Heading.elm new file mode 100644 index 00000000..1bca0b06 --- /dev/null +++ b/styleguide-app/Examples/Heading.elm @@ -0,0 +1,31 @@ +module Examples.Heading exposing (example) + +{-| + +@docs example + +-} + +import Css +import Html.Styled as Html +import ModuleExample as ModuleExample exposing (Category(..), ModuleExample) +import Nri.Ui.Colors.V1 as Colors +import Nri.Ui.Heading.V2 as Heading + + +{-| -} +example : ModuleExample msg +example = + { name = "Nri.Ui.Heading.V2" + , category = Text + , content = + [ Heading.h1 [] [ Html.text "This is the main page heading." ] + , Heading.h2 [] [ Html.text "This is a tagline" ] + , Heading.h3 [] [ Html.text "This is a subHeading" ] + , Heading.h4 [] [ Html.text "This is a smallHeading" ] + , Heading.h2 [ Heading.style Heading.Top ] + [ Html.text "Heading.h2 [ Heading.style Heading.Top ]" ] + , Heading.h2 [ Heading.css [ Css.color Colors.highlightPurpleDark ] ] + [ Html.text "Heading.h2 [ Heading.css [ Css.color Colors.highlightPurpleDark ] ]" ] + ] + } diff --git a/styleguide-app/Examples/Text.elm b/styleguide-app/Examples/Text.elm index c47f2471..26a467cd 100644 --- a/styleguide-app/Examples/Text.elm +++ b/styleguide-app/Examples/Text.elm @@ -6,10 +6,8 @@ module Examples.Text exposing (example) -} -import Css import Html.Styled as Html import ModuleExample as ModuleExample exposing (Category(..), ModuleExample) -import Nri.Ui.Colors.V1 as Colors import Nri.Ui.Heading.V2 as Heading import Nri.Ui.Text.V4 as Text @@ -17,7 +15,7 @@ import Nri.Ui.Text.V4 as Text {-| -} example : ModuleExample msg example = - { name = "Nri.Ui.Text.V4 (with headers from Nri.Ui.Heading.V2)" + { name = "Nri.Ui.Text.V4" , category = Text , content = let @@ -28,30 +26,14 @@ example = how long the assignment will take. """ in - [ Html.text "NOTE: When using these styles, please read the documentation in the Elm module about \"Understanding spacing\"" - , Heading.h1 [] [ Html.text "This is the main page heading." ] - , Heading.h2 [] [ Html.text "This is a tagline" ] - , Heading.h3 [] [ Html.text "This is a subHeading" ] - , Heading.h4 [] [ Html.text "This is a smallHeading" ] - , Html.hr [] [] - , Heading.h2 [] [ Html.text "Paragraph styles" ] + [ Text.caption [ Html.text "NOTE: When using these styles, please read the documentation in the Elm module about \"Understanding spacing\"" ] + , Heading.h2 [ Heading.style Heading.Top ] [ Html.text "Paragraph styles" ] , Text.mediumBody [ Html.text <| "This is a mediumBody. " ++ longerBody ] , Text.smallBody [ Html.text <| "This is a smallBody. " ++ longerBody ] , Text.smallBodyGray [ Html.text <| "This is a smallBodyGray. " ++ longerBody ] , Text.caption [ Html.text <| "This is a caption. " ++ longerBody ] - , Html.hr [] [] - , Heading.h2 [] [ Html.text "Paragraph styles for user-authored content" ] + , Heading.h2 [ Heading.style Heading.Top ] [ Html.text "Paragraph styles for user-authored content" ] , Text.ugMediumBody [ Html.text <| "This is an ugMediumBody. " ++ longerBody ] , Text.ugSmallBody [ Html.text <| "This is an ugSmallBody. " ++ longerBody ] - - --------------- - , Html.hr [] [] - , Heading.h2 [] [ Html.text "Headings with overrides" ] - , Heading.h2 - [ Heading.style Heading.Top ] - [ Html.text "I'm an H2 with the top style!" ] - , Heading.h2 - [ Heading.css [ Css.color Colors.highlightPurpleDark ] ] - [ Html.text "I have a custom color!" ] ] } diff --git a/styleguide-app/NriModules.elm b/styleguide-app/NriModules.elm index 4d63d03d..8f5583de 100644 --- a/styleguide-app/NriModules.elm +++ b/styleguide-app/NriModules.elm @@ -11,6 +11,7 @@ import Examples.Colors import Examples.DisclosureIndicator import Examples.Dropdown import Examples.Fonts +import Examples.Heading import Examples.Icon import Examples.Modal import Examples.Page @@ -276,6 +277,7 @@ nriThemedModules model = , Examples.Page.example NoOp , Examples.SegmentedControl.example SegmentedControlMsg model.segmentedControlState , Examples.Select.example SelectMsg model.selectState + , Examples.Heading.example , Examples.Text.example , Examples.Text.Writing.example , Examples.Fonts.example