Adds separate version field

This commit is contained in:
Tessa Kelly 2020-09-09 11:43:10 -07:00
parent 1e484236a7
commit e431f736ce
38 changed files with 86 additions and 41 deletions

View File

@ -12,6 +12,7 @@ import Nri.Ui.Html.Attributes.V2 as AttributeExtras exposing (targetBlank)
type alias Example state msg = type alias Example state msg =
{ name : String { name : String
, version : Int
, state : state , state : state
, update : msg -> state -> ( state, Cmd msg ) , update : msg -> state -> ( state, Cmd msg )
, subscriptions : state -> Sub msg , subscriptions : state -> Sub msg
@ -29,6 +30,7 @@ wrapMsg :
-> Example state msg2 -> Example state msg2
wrapMsg wrapMsg_ unwrapMsg example = wrapMsg wrapMsg_ unwrapMsg example =
{ name = example.name { name = example.name
, version = example.version
, state = example.state , state = example.state
, update = , update =
\msg2 state -> \msg2 state ->
@ -54,6 +56,7 @@ wrapState :
-> Example state2 msg -> Example state2 msg
wrapState wrapState_ unwrapState example = wrapState wrapState_ unwrapState example =
{ name = example.name { name = example.name
, version = example.version
, state = wrapState_ example.state , state = wrapState_ example.state
, update = , update =
\msg state2 -> \msg state2 ->
@ -80,6 +83,10 @@ wrapState wrapState_ unwrapState example =
view : Bool -> Example state msg -> Html msg view : Bool -> Example state msg -> Html msg
view showFocusLink example = view showFocusLink example =
let
fullName =
"Nri.Ui." ++ example.name ++ ".V" ++ String.fromInt example.version
in
Html.div Html.div
[ -- this class makes the axe accessibility checking output easier to parse [ -- this class makes the axe accessibility checking output easier to parse
String.replace "." "-" example.name String.replace "." "-" example.name
@ -104,11 +111,12 @@ view showFocusLink example =
, marginBottom zero , marginBottom zero
] ]
[] []
[ Html.a [ Attributes.href ("#/doodad/" ++ example.name) ] [ Html.text example.name ] ] [ Html.a [ Attributes.href ("#/doodad/" ++ example.name) ] [ Html.text fullName ]
, String.replace "." "-" example.name ]
, String.replace "." "-" fullName
|> (++) "https://package.elm-lang.org/packages/NoRedInk/noredink-ui/latest/" |> (++) "https://package.elm-lang.org/packages/NoRedInk/noredink-ui/latest/"
|> viewLink "Docs" |> viewLink "Docs"
, String.replace "." "/" example.name , String.replace "." "/" fullName
++ ".elm" ++ ".elm"
|> (++) "https://github.com/NoRedInk/noredink-ui/blob/master/src/" |> (++) "https://github.com/NoRedInk/noredink-ui/blob/master/src/"
|> viewLink "Source" |> viewLink "Source"

View File

@ -28,7 +28,8 @@ import Nri.Ui.Text.V4 as Text
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Accordion.V1" { name = "Accordion"
, version = 1
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -28,7 +28,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.AssignmentIcon.V2" { name = "AssignmentIcon"
, version = 2
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -23,7 +23,8 @@ import Nri.Ui.UiIcon.V1 as UiIcon
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Button.V10" { name = "Button"
, version = 10
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -30,7 +30,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Callout.V1" { name = "Callout"
, version = 1
, categories = [ Messaging ] , categories = [ Messaging ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -35,7 +35,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Checkbox.V5" { name = "Checkbox"
, version = 5
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -28,7 +28,8 @@ import Nri.Ui.UiIcon.V1 as UiIcon
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.ClickableSvg.V1" { name = "ClickableSvg"
, version = 1
, categories = [ Buttons, Icons ] , categories = [ Buttons, Icons ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -28,7 +28,8 @@ type State
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.ClickableText.V3" { name = "ClickableText"
, version = 3
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -35,7 +35,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Colors.V1" { name = "Colors"
, version = 1
, categories = [ Colors ] , categories = [ Colors ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -22,7 +22,8 @@ import Nri.Ui.Confetti.V2 as Confetti
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Confetti.V2" { name = "Confetti"
, version = 2
, categories = [ Animations ] , categories = [ Animations ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -30,7 +30,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.DisclosureIndicator.V2" { name = "DisclosureIndicator"
, version = 2
, categories = [ Widgets ] , categories = [ Widgets ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -29,7 +29,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Divider.V2" { name = "Divider"
, version = 2
, categories = [ Layout ] , categories = [ Layout ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -29,7 +29,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Fonts.V1" { name = "Fonts"
, version = 1
, categories = [ Text ] , categories = [ Text ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -29,7 +29,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Heading.V2" { name = "Heading"
, version = 2
, categories = [ Text, Layout ] , categories = [ Text, Layout ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -34,7 +34,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Icon.V5" { name = "Icon"
, version = 5
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -88,7 +88,8 @@ subscriptions { showLoadingFadeIn, showLoading, showSpinners } =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Loading.V1" { name = "Loading"
, version = 1
, categories = [ Pages ] , categories = [ Pages ]
, atomicDesignType = Page , atomicDesignType = Page
, keyboardSupport = [] , keyboardSupport = []

View File

@ -29,7 +29,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Logo.V1" { name = "Logo"
, version = 1
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -28,7 +28,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.MasteryIcon.V1" { name = "MasteryIcon"
, version = 1
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -25,7 +25,8 @@ import Set exposing (Set)
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Menu.V1" { name = "Menu"
, version = 1
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -155,7 +155,8 @@ update msg state =
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Message.V2" { name = "Message"
, version = 2
, categories = [ Messaging ] , categories = [ Messaging ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -108,7 +108,8 @@ controlCss =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Modal.V11" { name = "Modal"
, version = 11
, categories = [ Modals ] , categories = [ Modals ]
, atomicDesignType = Organism , atomicDesignType = Organism
, keyboardSupport = , keyboardSupport =

View File

@ -30,7 +30,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Page.V3" { name = "Page"
, version = 3
, categories = [ Pages ] , categories = [ Pages ]
, atomicDesignType = Page , atomicDesignType = Page
, keyboardSupport = [] , keyboardSupport = []

View File

@ -31,7 +31,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Pennant.V2" { name = "Pennant"
, version = 2
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -30,7 +30,8 @@ import Nri.Ui.Text.V5 as Text
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.RadioButton.V1" { name = "RadioButton"
, version = 1
, state = init , state = init
, update = update , update = update
, subscriptions = subscriptions , subscriptions = subscriptions

View File

@ -31,7 +31,8 @@ import Task
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.SegmentedControl.V12" { name = "SegmentedControl"
, version = 12
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -20,7 +20,8 @@ import Nri.Ui.Select.V7 as Select
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Select.V7" { name = "Select"
, version = 7
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -36,7 +36,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Slide.V1" { name = "Slide"
, version = 1
, categories = [ Animations ] , categories = [ Animations ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -34,7 +34,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.SlideModal.V2" { name = "SlideModal"
, version = 2
, categories = [ Modals ] , categories = [ Modals ]
, atomicDesignType = Organism , atomicDesignType = Organism
, keyboardSupport = [] , keyboardSupport = []

View File

@ -35,7 +35,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.SortableTable.V2" { name = "SortableTable"
, version = 2
, categories = [ Tables, Layout ] , categories = [ Tables, Layout ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -27,7 +27,8 @@ import Nri.Ui.UiIcon.V1 as UiIcon
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Svg.V1" { name = "Svg"
, version = 1
, categories = [ Icons ] , categories = [ Icons ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -31,7 +31,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Table.V5" { name = "Table"
, version = 5
, state = () , state = ()
, update = \_ state -> ( state, Cmd.none ) , update = \_ state -> ( state, Cmd.none )
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -102,7 +102,8 @@ update msg model =
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Tabs.V6" { name = "Tabs"
, version = 6
, categories = [ Layout ] , categories = [ Layout ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = , keyboardSupport =
@ -143,7 +144,7 @@ allTabs : List (Tab Id Msg)
allTabs = allTabs =
[ { id = First [ { id = First
, idString = "tab-0" , idString = "tab-0"
, spaHref = Just "/#/doodad/Nri.Ui.Tabs.V6" , spaHref = Just "/#/doodad/Nri.Ui.Tabs.6"
, tabView = Tabs.viewTabDefault "Link example" , tabView = Tabs.viewTabDefault "Link example"
, panelView = Html.text "First Panel" , panelView = Html.text "First Panel"
} }

View File

@ -30,7 +30,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Text.V4" { name = "Text"
, version = 4
, categories = [ Text ] , categories = [ Text ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -26,7 +26,8 @@ type alias Msg =
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Text.Writing.V1" { name = "Text.Writing"
, version = 1
, categories = [ Text ] , categories = [ Text ]
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []

View File

@ -38,7 +38,8 @@ type alias State =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.TextArea.V4" { name = "TextArea"
, version = 4
, state = init , state = init
, update = update , update = update
, subscriptions = \_ -> Sub.none , subscriptions = \_ -> Sub.none

View File

@ -52,7 +52,8 @@ type alias ExampleConfig =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.TextInput.V6" { name = "TextInput"
, version = 6
, categories = [ Inputs ] , categories = [ Inputs ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -55,7 +55,8 @@ update msg model =
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.Tooltip.V1" { name = "Tooltip"
, version = 1
, categories = [ Widgets ] , categories = [ Widgets ]
, atomicDesignType = Molecule , atomicDesignType = Molecule
, keyboardSupport = [] , keyboardSupport = []

View File

@ -27,7 +27,8 @@ type alias Msg =
{-| -} {-| -}
example : Example State Msg example : Example State Msg
example = example =
{ name = "Nri.Ui.UiIcon.V1" { name = "UiIcon"
, version = 1
, categories = List.singleton Icons , categories = List.singleton Icons
, atomicDesignType = Atom , atomicDesignType = Atom
, keyboardSupport = [] , keyboardSupport = []