mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-12-25 14:42:37 +03:00
Rename from 'shortcuts' to 'support' -- not about providing shortcuts, about providing access
This commit is contained in:
parent
311ba32ec3
commit
3ca51afde0
@ -5,7 +5,7 @@ import Category exposing (Category)
|
||||
import Css exposing (..)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes as Attributes
|
||||
import KeyboardShortcuts exposing (KeyboardShortcut)
|
||||
import KeyboardSupport exposing (KeyboardSupport)
|
||||
import Nri.Ui.Colors.V1 exposing (..)
|
||||
import Nri.Ui.Html.Attributes.V2 as AttributeExtras exposing (targetBlank)
|
||||
|
||||
@ -18,7 +18,7 @@ type alias Example state msg =
|
||||
, view : state -> List (Html msg)
|
||||
, categories : List Category
|
||||
, atomicDesignType : AtomicDesignType
|
||||
, keyboardShortcuts : List KeyboardShortcut
|
||||
, keyboardSupport : List KeyboardSupport
|
||||
}
|
||||
|
||||
|
||||
@ -43,7 +43,7 @@ wrapMsg wrapMsg_ unwrapMsg example =
|
||||
, view = \state -> List.map (Html.map wrapMsg_) (example.view state)
|
||||
, categories = example.categories
|
||||
, atomicDesignType = example.atomicDesignType
|
||||
, keyboardShortcuts = example.keyboardShortcuts
|
||||
, keyboardSupport = example.keyboardSupport
|
||||
}
|
||||
|
||||
|
||||
@ -74,7 +74,7 @@ wrapState wrapState_ unwrapState example =
|
||||
>> Maybe.withDefault []
|
||||
, categories = example.categories
|
||||
, atomicDesignType = example.atomicDesignType
|
||||
, keyboardShortcuts = example.keyboardShortcuts
|
||||
, keyboardSupport = example.keyboardSupport
|
||||
}
|
||||
|
||||
|
||||
@ -113,7 +113,7 @@ view showFocusLink example =
|
||||
|> (++) "https://github.com/NoRedInk/noredink-ui/blob/master/src/"
|
||||
|> viewLink "Source"
|
||||
]
|
||||
, KeyboardShortcuts.view example.keyboardShortcuts
|
||||
, KeyboardSupport.view example.keyboardSupport
|
||||
, Html.div [ Attributes.css [ padding2 (px 20) zero ] ] (example.view example.state)
|
||||
]
|
||||
|
||||
|
@ -17,7 +17,7 @@ import Dict exposing (Dict)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Accordion.V1 as Accordion
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Fonts.V1 as Fonts
|
||||
@ -35,7 +35,7 @@ example =
|
||||
, view = view
|
||||
, categories = [ Layout ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -10,7 +10,7 @@ import AtomicDesignType exposing (AtomicDesignType(..))
|
||||
import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Examples.IconExamples as IconExamples
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.AssignmentIcon.V2 as AssignmentIcon
|
||||
import Nri.Ui.Icon.V5 as Icon
|
||||
|
||||
@ -31,7 +31,7 @@ example =
|
||||
{ name = "Nri.Ui.AssignmentIcon.V2"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -13,7 +13,7 @@ import Debug.Control as Control exposing (Control)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled exposing (..)
|
||||
import Html.Styled.Attributes exposing (css, id)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
|
||||
@ -30,7 +30,7 @@ example =
|
||||
, view = \state -> [ viewButtonExamples state ]
|
||||
, categories = [ Buttons ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes exposing (href, title)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Callout.V1 as Callout exposing (callout)
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
|
||||
@ -33,7 +33,7 @@ example =
|
||||
{ name = "Nri.Ui.Callout.V1"
|
||||
, categories = [ Messaging ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -12,7 +12,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (..)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Checkbox.V5 as Checkbox
|
||||
import Nri.Ui.Data.PremiumLevel as PremiumLevel exposing (PremiumLevel(..))
|
||||
import Nri.Ui.PremiumCheckbox.V6 as PremiumCheckbox
|
||||
@ -51,7 +51,7 @@ example =
|
||||
]
|
||||
, categories = [ Inputs ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ import Examples.IconExamples as IconExamples
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes as Attributes
|
||||
import Html.Styled.Events as Events
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.ClickableSvg.V1 as ClickableSvg
|
||||
import Nri.Ui.Colors.Extra exposing (fromCssColor, toCssColor)
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
@ -31,7 +31,7 @@ example =
|
||||
{ name = "Nri.Ui.ClickableSvg.V1"
|
||||
, categories = [ Buttons, Icons ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -13,7 +13,7 @@ import Debug.Control as Control exposing (Control)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled exposing (..)
|
||||
import Html.Styled.Attributes exposing (css, id)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.ClickableText.V3 as ClickableText
|
||||
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
|
||||
import Nri.Ui.Text.V4 as Text
|
||||
@ -35,7 +35,7 @@ example =
|
||||
, view = \state -> [ viewExamples state ]
|
||||
, categories = [ Buttons ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -13,7 +13,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes as Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.Extra
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -38,7 +38,7 @@ example =
|
||||
{ name = "Nri.Ui.Colors.V1"
|
||||
, categories = [ Colors ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -14,7 +14,7 @@ import Dict exposing (Dict)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes as Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Confetti.V2 as Confetti
|
||||
|
||||
@ -25,7 +25,7 @@ example =
|
||||
{ name = "Nri.Ui.Confetti.V2"
|
||||
, categories = [ Animations ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = Confetti.init 700
|
||||
, update = update
|
||||
, subscriptions =
|
||||
|
@ -13,7 +13,7 @@ import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import Html.Styled.Events exposing (onClick)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.DisclosureIndicator.V2 as DisclosureIndicator
|
||||
@ -33,7 +33,7 @@ example =
|
||||
{ name = "Nri.Ui.DisclosureIndicator.V2"
|
||||
, categories = [ Widgets ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -12,7 +12,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Divider.V2 as Divider
|
||||
|
||||
|
||||
@ -32,7 +32,7 @@ example =
|
||||
{ name = "Nri.Ui.Divider.V2"
|
||||
, categories = [ Layout ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = {}
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Fonts.V1 as Fonts
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
|
||||
@ -32,7 +32,7 @@ example =
|
||||
{ name = "Nri.Ui.Fonts.V1"
|
||||
, categories = [ Text ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
|
||||
@ -32,7 +32,7 @@ example =
|
||||
{ name = "Nri.Ui.Heading.V2"
|
||||
, categories = [ Text, Layout ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -13,7 +13,7 @@ import Css.Global
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.AssetPath as AssetPath exposing (Asset(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -37,7 +37,7 @@ example =
|
||||
{ name = "Nri.Ui.Icon.V5"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -15,7 +15,7 @@ import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Events as Events
|
||||
import Json.Decode
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -91,7 +91,7 @@ example =
|
||||
{ name = "Nri.Ui.Loading.V1"
|
||||
, categories = [ Pages ]
|
||||
, atomicDesignType = Page
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Css
|
||||
import Example exposing (Example)
|
||||
import Examples.IconExamples as IconExamples
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Logo.V1 as Logo
|
||||
|
||||
@ -32,7 +32,7 @@ example =
|
||||
{ name = "Nri.Ui.Logo.V1"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -10,7 +10,7 @@ import AtomicDesignType exposing (AtomicDesignType(..))
|
||||
import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Examples.IconExamples as IconExamples
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.MasteryIcon.V1 as MasteryIcon
|
||||
|
||||
@ -31,7 +31,7 @@ example =
|
||||
{ name = "Nri.Ui.MasteryIcon.V1"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -13,7 +13,7 @@ import Css
|
||||
import Debug.Control as Control exposing (Control)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.ClickableText.V3 as ClickableText
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Menu.V1 as Menu
|
||||
@ -31,7 +31,7 @@ example =
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, categories = [ Widgets ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, view = view
|
||||
}
|
||||
|
||||
|
@ -8,7 +8,7 @@ import Debug.Control as Control exposing (Control)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled exposing (styled)
|
||||
import Html.Styled.Attributes as Attributes exposing (href)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Message.V1 as Message
|
||||
@ -126,7 +126,7 @@ example =
|
||||
{ name = "Nri.Ui.Message.V1"
|
||||
, categories = [ Messaging ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -14,7 +14,7 @@ import Css.Global
|
||||
import Example exposing (Example)
|
||||
import Html as Root
|
||||
import Html.Styled.Attributes as Attributes
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Checkbox.V5 as Checkbox
|
||||
import Nri.Ui.ClickableText.V3 as ClickableText
|
||||
@ -56,7 +56,7 @@ example =
|
||||
{ name = "Nri.Ui.Modal.V8"
|
||||
, categories = [ Modals ]
|
||||
, atomicDesignType = Organism
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = subscriptions
|
||||
|
@ -12,7 +12,7 @@ import Css
|
||||
import Css.Global exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Page.V3 as Page
|
||||
|
||||
@ -33,7 +33,7 @@ example =
|
||||
{ name = "Nri.Ui.Page.V3"
|
||||
, categories = [ Pages ]
|
||||
, atomicDesignType = Page
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update =
|
||||
\msg model ->
|
||||
|
@ -12,7 +12,7 @@ import Css exposing (..)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Fonts.V1 as Fonts
|
||||
import Nri.Ui.Pennant.V2 as Pennant
|
||||
import Nri.Ui.Svg.V1 as Svg
|
||||
@ -34,7 +34,7 @@ example =
|
||||
{ name = "Nri.Ui.Pennant.V2"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -18,7 +18,7 @@ import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html)
|
||||
import Html.Styled.Attributes as Attr
|
||||
import Html.Styled.Events as Events
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.SegmentedControl.V9 as SegmentedControl
|
||||
import Nri.Ui.Svg.V1 as Svg exposing (Svg)
|
||||
@ -66,7 +66,7 @@ example =
|
||||
]
|
||||
, categories = [ Inputs, Widgets, Layout ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
}
|
||||
|
||||
|
||||
|
@ -12,7 +12,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled
|
||||
import Html.Styled.Attributes
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Select.V7 as Select
|
||||
|
||||
@ -26,7 +26,7 @@ example =
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, categories = [ Inputs ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, view =
|
||||
\state ->
|
||||
[ Html.Styled.label
|
||||
|
@ -13,7 +13,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import Html.Styled.Keyed as Keyed
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import List.Zipper as Zipper exposing (Zipper)
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
@ -39,7 +39,7 @@ example =
|
||||
{ name = "Nri.Ui.Slide.V1"
|
||||
, categories = [ Animations ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -13,7 +13,7 @@ import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled exposing (fromUnstyled)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V10 as Button
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.SlideModal.V2 as SlideModal
|
||||
@ -37,7 +37,7 @@ example =
|
||||
{ name = "Nri.Ui.SlideModal.V2"
|
||||
, categories = [ Modals ]
|
||||
, atomicDesignType = Organism
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -10,7 +10,7 @@ import AtomicDesignType exposing (AtomicDesignType(..))
|
||||
import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.SortableTable.V1 as SortableTable
|
||||
|
||||
@ -38,7 +38,7 @@ example =
|
||||
{ name = "Nri.Ui.SortableTable.V1"
|
||||
, categories = [ Tables, Layout ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -15,7 +15,7 @@ import Examples.IconExamples as IconExamples
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes as Attributes
|
||||
import Html.Styled.Events as Events
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Colors.Extra exposing (fromCssColor, toCssColor)
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -30,7 +30,7 @@ example =
|
||||
{ name = "Nri.Ui.Svg.V1"
|
||||
, categories = [ Icons ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Css exposing (..)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Button.V5 as Button
|
||||
import Nri.Ui.Colors.V1 as Colors
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -37,7 +37,7 @@ example =
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, categories = [ Tables, Layout ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, view =
|
||||
\() ->
|
||||
let
|
||||
|
@ -18,7 +18,7 @@ import Debug.Control as Control exposing (Control)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html exposing (Html, fromUnstyled)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Key(..))
|
||||
import KeyboardSupport exposing (Key(..))
|
||||
import List.Zipper exposing (Zipper)
|
||||
import Nri.Ui.Svg.V1 as Svg
|
||||
import Nri.Ui.Tabs.V5 as Tabs exposing (Alignment(..), Tab)
|
||||
@ -105,7 +105,7 @@ example =
|
||||
{ name = "Nri.Ui.Tabs.V5"
|
||||
, categories = [ Layout ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import Html.Styled.Attributes as Attributes
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Text.V4 as Text
|
||||
|
||||
@ -32,7 +32,7 @@ example =
|
||||
{ name = "Nri.Ui.Text.V4"
|
||||
, categories = [ Text ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -10,7 +10,7 @@ import AtomicDesignType exposing (AtomicDesignType(..))
|
||||
import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Html.Styled exposing (text)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Text.Writing.V1 as TextWriting
|
||||
|
||||
|
||||
@ -29,7 +29,7 @@ example =
|
||||
{ name = "Nri.Ui.Text.Writing.V1"
|
||||
, categories = [ Text ]
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -11,7 +11,7 @@ import Category exposing (Category(..))
|
||||
import Dict exposing (Dict)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled as Html
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.AssetPath exposing (Asset(..))
|
||||
import Nri.Ui.Checkbox.V5 as Checkbox
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
@ -44,7 +44,7 @@ example =
|
||||
, subscriptions = \_ -> Sub.none
|
||||
, categories = [ Inputs ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, view =
|
||||
\state ->
|
||||
[ Heading.h1 [] [ Html.text "Textarea controls" ]
|
||||
|
@ -14,7 +14,7 @@ import Debug.Control as Control exposing (Control)
|
||||
import Dict exposing (Dict)
|
||||
import Example exposing (Example)
|
||||
import Html.Styled.Attributes exposing (css)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.TextInput.V6 as TextInput
|
||||
|
||||
@ -55,7 +55,7 @@ example =
|
||||
{ name = "Nri.Ui.TextInput.V6"
|
||||
, categories = [ Inputs ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -12,7 +12,7 @@ import Category exposing (Category(..))
|
||||
import Css
|
||||
import Example exposing (Example)
|
||||
import Html.Styled.Attributes exposing (css, href)
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.Heading.V2 as Heading
|
||||
import Nri.Ui.Text.V4 as Text
|
||||
import Nri.Ui.Tooltip.V1 as Tooltip
|
||||
@ -58,7 +58,7 @@ example =
|
||||
{ name = "Nri.Ui.Tooltip.V1"
|
||||
, categories = [ Widgets ]
|
||||
, atomicDesignType = Molecule
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = init
|
||||
, update = update
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -10,7 +10,7 @@ import AtomicDesignType exposing (AtomicDesignType(..))
|
||||
import Category exposing (Category(..))
|
||||
import Example exposing (Example)
|
||||
import Examples.IconExamples as IconExamples
|
||||
import KeyboardShortcuts exposing (Direction(..), Key(..))
|
||||
import KeyboardSupport exposing (Direction(..), Key(..))
|
||||
import Nri.Ui.UiIcon.V1 as UiIcon
|
||||
|
||||
|
||||
@ -30,7 +30,7 @@ example =
|
||||
{ name = "Nri.Ui.UiIcon.V1"
|
||||
, categories = List.singleton Icons
|
||||
, atomicDesignType = Atom
|
||||
, keyboardShortcuts = []
|
||||
, keyboardSupport = []
|
||||
, state = ()
|
||||
, update = \_ state -> ( state, Cmd.none )
|
||||
, subscriptions = \_ -> Sub.none
|
||||
|
@ -1,13 +1,13 @@
|
||||
module KeyboardShortcuts exposing
|
||||
module KeyboardSupport exposing
|
||||
( view
|
||||
, KeyboardShortcut
|
||||
, KeyboardSupport
|
||||
, Key(..), Direction(..)
|
||||
)
|
||||
|
||||
{-|
|
||||
|
||||
@docs view
|
||||
@docs KeyboardShortcut
|
||||
@docs KeyboardSupport
|
||||
@docs Key, Direction
|
||||
|
||||
-}
|
||||
@ -16,27 +16,27 @@ import Html.Styled as Html exposing (..)
|
||||
|
||||
|
||||
{-| -}
|
||||
type alias KeyboardShortcut =
|
||||
type alias KeyboardSupport =
|
||||
{ keys : List Key
|
||||
, result : String
|
||||
}
|
||||
|
||||
|
||||
{-| -}
|
||||
view : List KeyboardShortcut -> Html msg
|
||||
view keyboardShortcuts =
|
||||
case keyboardShortcuts of
|
||||
view : List KeyboardSupport -> Html msg
|
||||
view keyboardSupport =
|
||||
case keyboardSupport of
|
||||
[] ->
|
||||
text ""
|
||||
|
||||
_ ->
|
||||
details []
|
||||
[ summary [] [ text "Keyboard Support" ]
|
||||
, ul [] (List.map viewKeyboardActions keyboardShortcuts)
|
||||
, ul [] (List.map viewKeyboardActions keyboardSupport)
|
||||
]
|
||||
|
||||
|
||||
viewKeyboardActions : KeyboardShortcut -> Html msg
|
||||
viewKeyboardActions : KeyboardSupport -> Html msg
|
||||
viewKeyboardActions { keys, result } =
|
||||
li []
|
||||
[ strong [] [ text (String.join "+" (List.map keyToString keys)) ]
|
Loading…
Reference in New Issue
Block a user