mirror of
https://github.com/NoRedInk/noredink-ui.git
synced 2024-11-24 00:42:29 +03:00
Rename BorderlessButton to ClickableText
This commit is contained in:
parent
3454f2586e
commit
e0b1ca20ae
2
elm.json
2
elm.json
@ -8,7 +8,7 @@
|
||||
"Nri.Ui.Alert.V2",
|
||||
"Nri.Ui.AssetPath",
|
||||
"Nri.Ui.BannerAlert.V2",
|
||||
"Nri.Ui.BorderlessButton.V1",
|
||||
"Nri.Ui.ClickableText.V1",
|
||||
"Nri.Ui.Button.V3",
|
||||
"Nri.Ui.Button.V4",
|
||||
"Nri.Ui.Button.V5",
|
||||
|
@ -1,4 +1,4 @@
|
||||
module Nri.Ui.BorderlessButton.V1 exposing
|
||||
module Nri.Ui.ClickableText.V1 exposing
|
||||
( button, link
|
||||
, Size(..)
|
||||
)
|
||||
@ -8,8 +8,8 @@ module Nri.Ui.BorderlessButton.V1 exposing
|
||||
|
||||
# About:
|
||||
|
||||
BorderlessButton looks different from Nri.Ui.Button in that it displays without margin or padding.
|
||||
BorderlessButton has the suave, traditional look of a "link"!
|
||||
ClickableText looks different from Nri.Ui.Button in that it displays without margin or padding.
|
||||
ClickableText has the suave, traditional look of a "link"!
|
||||
|
||||
For accessibility purposes, buttons that perform an action on the current page should be HTML `<button>`
|
||||
elements and are created here with `*Button` functions. Buttons that take the user to a new page should be
|
@ -1,4 +1,4 @@
|
||||
module Examples.BorderlessButton exposing (Msg, State, example, init, update)
|
||||
module Examples.ClickableText exposing (Msg, State, example, init, update)
|
||||
|
||||
{- \
|
||||
@docs Msg, State, example, init, update,
|
||||
@ -11,7 +11,7 @@ import Html.Styled exposing (..)
|
||||
import Html.Styled.Attributes exposing (css, id)
|
||||
import ModuleExample as ModuleExample exposing (Category(..), ModuleExample, ModuleMessages)
|
||||
import Nri.Ui.AssetPath exposing (Asset)
|
||||
import Nri.Ui.BorderlessButton.V1 as BorderlessButton exposing (Size(..))
|
||||
import Nri.Ui.ClickableText.V1 as ClickableText exposing (Size(..))
|
||||
import Nri.Ui.Icon.V4 as Icon
|
||||
import Nri.Ui.Text.V2 as Text
|
||||
|
||||
@ -41,9 +41,9 @@ example :
|
||||
example assets unnamedMessages state =
|
||||
let
|
||||
messages =
|
||||
unnamedMessages "BorderlessButtonExample"
|
||||
unnamedMessages "ClickableTextExample"
|
||||
in
|
||||
{ filename = "Nri.Ui.BorderlessButton.V1"
|
||||
{ filename = "Nri.Ui.ClickableText.V1"
|
||||
, category = Buttons
|
||||
, content =
|
||||
[ viewExamples assets messages state ]
|
||||
@ -54,7 +54,7 @@ example assets unnamedMessages state =
|
||||
init : { r | performance : String, lock : String } -> State
|
||||
init assets =
|
||||
Control.record Model
|
||||
|> Control.field "label" (Control.string "Borderless Button")
|
||||
|> Control.field "label" (Control.string "Clickable Text")
|
||||
|> Control.field "icon"
|
||||
(Control.maybe False <|
|
||||
Control.choice
|
||||
@ -64,8 +64,8 @@ init assets =
|
||||
)
|
||||
|> Control.field "button type"
|
||||
(Control.choice
|
||||
( "Nri.Ui.BorderlessButton.V1.button", Control.value Button )
|
||||
[ ( "Nri.Ui.BorderlessButton.V1.link", Control.value Link )
|
||||
( "Nri.Ui.ClickableText.V1.button", Control.value Button )
|
||||
[ ( "Nri.Ui.ClickableText.V1.link", Control.value Link )
|
||||
]
|
||||
)
|
||||
|> State
|
||||
@ -125,7 +125,7 @@ buttons assets messages model =
|
||||
exampleCell size =
|
||||
(case model.buttonType of
|
||||
Link ->
|
||||
BorderlessButton.link
|
||||
ClickableText.link
|
||||
{ size = size
|
||||
, label = model.label
|
||||
, icon = model.icon
|
||||
@ -134,7 +134,7 @@ buttons assets messages model =
|
||||
[]
|
||||
|
||||
Button ->
|
||||
BorderlessButton.button
|
||||
ClickableText.button
|
||||
{ size = size
|
||||
, onClick = messages.showItWorked (Debug.toString size)
|
||||
, label = model.label
|
@ -2,7 +2,7 @@ module NriModules exposing (ModuleStates, Msg, init, nriThemedModules, subscript
|
||||
|
||||
import Assets exposing (assets)
|
||||
import Examples.Alert
|
||||
import Examples.BorderlessButton
|
||||
import Examples.ClickableText
|
||||
import Examples.Button
|
||||
import Examples.Checkbox
|
||||
import Examples.Colors
|
||||
@ -28,7 +28,7 @@ import Url exposing (Url)
|
||||
|
||||
type alias ModuleStates =
|
||||
{ buttonExampleState : Examples.Button.State
|
||||
, borderlessButtonExampleState : Examples.BorderlessButton.State
|
||||
, clickableTextExampleState : Examples.ClickableText.State
|
||||
, checkboxExampleState : Examples.Checkbox.State
|
||||
, dropdownState : Examples.Dropdown.State Examples.Dropdown.Value
|
||||
, segmentedControlState : Examples.SegmentedControl.State
|
||||
@ -45,7 +45,7 @@ type alias ModuleStates =
|
||||
init : ModuleStates
|
||||
init =
|
||||
{ buttonExampleState = Examples.Button.init assets
|
||||
, borderlessButtonExampleState = Examples.BorderlessButton.init assets
|
||||
, clickableTextExampleState = Examples.ClickableText.init assets
|
||||
, checkboxExampleState = Examples.Checkbox.init
|
||||
, dropdownState = Examples.Dropdown.init
|
||||
, segmentedControlState = Examples.SegmentedControl.init
|
||||
@ -61,7 +61,7 @@ init =
|
||||
|
||||
type Msg
|
||||
= ButtonExampleMsg Examples.Button.Msg
|
||||
| BorderlessButtonExampleMsg Examples.BorderlessButton.Msg
|
||||
| ClickableTextExampleMsg Examples.ClickableText.Msg
|
||||
| CheckboxExampleMsg Examples.Checkbox.Msg
|
||||
| DropdownMsg Examples.Dropdown.Msg
|
||||
| SegmentedControlMsg Examples.SegmentedControl.Msg
|
||||
@ -88,13 +88,13 @@ update outsideMsg moduleStates =
|
||||
, Cmd.map ButtonExampleMsg cmd
|
||||
)
|
||||
|
||||
BorderlessButtonExampleMsg msg ->
|
||||
ClickableTextExampleMsg msg ->
|
||||
let
|
||||
( borderlessButtonExampleState, cmd ) =
|
||||
Examples.BorderlessButton.update msg moduleStates.borderlessButtonExampleState
|
||||
( clickableTextExampleState, cmd ) =
|
||||
Examples.ClickableText.update msg moduleStates.clickableTextExampleState
|
||||
in
|
||||
( { moduleStates | borderlessButtonExampleState = borderlessButtonExampleState }
|
||||
, Cmd.map BorderlessButtonExampleMsg cmd
|
||||
( { moduleStates | clickableTextExampleState = clickableTextExampleState }
|
||||
, Cmd.map ClickableTextExampleMsg cmd
|
||||
)
|
||||
|
||||
CheckboxExampleMsg msg ->
|
||||
@ -214,7 +214,7 @@ nriThemedModules : ModuleStates -> List (ModuleExample Msg)
|
||||
nriThemedModules model =
|
||||
[ Examples.Alert.example
|
||||
, Examples.Button.example assets (exampleMessages ButtonExampleMsg) model.buttonExampleState
|
||||
, Examples.BorderlessButton.example assets (exampleMessages BorderlessButtonExampleMsg) model.borderlessButtonExampleState
|
||||
, Examples.ClickableText.example assets (exampleMessages ClickableTextExampleMsg) model.clickableTextExampleState
|
||||
, Examples.Checkbox.example CheckboxExampleMsg model.checkboxExampleState
|
||||
, Examples.Dropdown.example DropdownMsg model.dropdownState
|
||||
, Examples.Icon.example
|
||||
|
Loading…
Reference in New Issue
Block a user