Remove dependency on Nri.Accessibility from the inputs

This commit is contained in:
Tessa Kelly 2018-03-16 16:41:34 -07:00
parent 4ca27fc05c
commit e05c353980
2 changed files with 13 additions and 12 deletions

View File

@ -8,7 +8,6 @@ module Nri.Ui.InputStyles exposing (Assets, CssClasses(..), styles)
import Css exposing (..)
import Css.Foreign exposing (Snippet, adjacentSiblings, children, class, descendants, each, everything, media, selector, withClass)
import Nri.Accessibility
import Nri.Colors exposing (..)
import Nri.Fonts
import Nri.Stylers
@ -22,7 +21,6 @@ import Nri.Ui.Styles.V1 as Styles
-}
type CssClasses
= Container
| InvisibleLabel
| Label
| Input
| IsInError
@ -106,9 +104,6 @@ styles =
, class Container
[ position relative
]
, class InvisibleLabel
[ Nri.Accessibility.invisibleText
]
, class Label
[ backgroundColor Nri.Colors.white
, left (px 10)

View File

@ -17,6 +17,7 @@ module Nri.Ui.TextArea.V1
-}
import Accessibility.Style
import Html exposing (..)
import Html.Attributes exposing (..)
import Html.Events exposing (onInput)
@ -116,14 +117,19 @@ view_ textAreaStyle model =
else
Html.textarea sharedAttributes
[ Html.text model.value ]
, Html.label
[ for (generateId model.label)
, styles.classList
[ ( InvisibleLabel, not model.showLabel )
, ( Label, True )
, if not model.showLabel then
Html.label
[ for (generateId model.label)
, styles.class [ Label ]
, Accessibility.Style.invisible
]
]
[ Html.text model.label ]
[ Html.text model.label ]
else
Html.label
[ for (generateId model.label)
, styles.class [ Label ]
]
[ Html.text model.label ]
]