Adds helpers to clickable test

This commit is contained in:
Tessa Kelly 2020-11-06 10:47:04 -08:00
parent b262c1879b
commit 9b4e46145d
3 changed files with 23 additions and 4 deletions

View File

@ -70,7 +70,6 @@ import Css exposing (Style)
import Css.Global
import Html.Styled as Styled
import Html.Styled.Attributes as Attributes
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Html.Styled.Events as Events
import Markdown.Block
import Markdown.Inline
@ -78,6 +77,7 @@ import Nri.Ui
import Nri.Ui.Colors.Extra as ColorsExtra
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.Svg.V1 as NriSvg exposing (Svg)
import Svg
import Svg.Attributes

View File

@ -51,8 +51,8 @@ import ClickableAttributes exposing (ClickableAttributes)
import Css exposing (Color, Style)
import Html.Styled as Html exposing (Html)
import Html.Styled.Attributes as Attributes
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.Svg.V1 as Svg exposing (Svg)

View File

@ -6,7 +6,7 @@ module Nri.Ui.ClickableText.V3 exposing
, onClick
, href, linkSpa, linkExternal, linkWithMethod, linkWithTracking, linkExternalWithTracking
, icon
, custom, css
, custom, css, nriDescription, testId, id
)
{-|
@ -62,7 +62,7 @@ HTML `<a>` elements and are created here with `*Link` functions.
@docs href, linkSpa, linkExternal, linkWithMethod, linkWithTracking, linkExternalWithTracking
@docs icon
@docs custom, css
@docs custom, css, nriDescription, testId, id
-}
@ -73,6 +73,7 @@ import Html.Styled.Attributes as Attributes
import Nri.Ui
import Nri.Ui.Colors.V1 as Colors
import Nri.Ui.Fonts.V1
import Nri.Ui.Html.Attributes.V2 as ExtraAttributes
import Nri.Ui.Svg.V1 as NriSvg exposing (Svg)
@ -128,6 +129,24 @@ custom attributes =
)
{-| -}
nriDescription : String -> Attribute msg
nriDescription description =
custom [ ExtraAttributes.nriDescription description ]
{-| -}
testId : String -> Attribute msg
testId id_ =
custom [ ExtraAttributes.testId id_ ]
{-| -}
id : String -> Attribute msg
id id_ =
custom [ Attributes.id id_ ]
{-| -}
css : List Style -> Attribute msg
css styles =