From cc9aabd99a75007527878be1b8e8ca0af2aa295e Mon Sep 17 00:00:00 2001 From: Tessa Kelly Date: Thu, 11 Nov 2021 13:38:55 -0800 Subject: [PATCH] InputErrorInternal -> InputErrorAndGuidanceInternal --- ...nternal.elm => InputErrorAndGuidanceInternal.elm} | 2 +- src/InputLabelInternal.elm | 4 ++-- src/Nri/Ui/Select/V8.elm | 12 ++++++------ src/Nri/Ui/TextInput/V7.elm | 12 ++++++------ 4 files changed, 15 insertions(+), 15 deletions(-) rename src/{InputErrorInternal.elm => InputErrorAndGuidanceInternal.elm} (96%) diff --git a/src/InputErrorInternal.elm b/src/InputErrorAndGuidanceInternal.elm similarity index 96% rename from src/InputErrorInternal.elm rename to src/InputErrorAndGuidanceInternal.elm index ae961b82..d45ab16e 100644 --- a/src/InputErrorInternal.elm +++ b/src/InputErrorAndGuidanceInternal.elm @@ -1,4 +1,4 @@ -module InputErrorInternal exposing +module InputErrorAndGuidanceInternal exposing ( ErrorState, init , setErrorIf, setErrorMessage , getIsInError, getErrorMessage diff --git a/src/InputLabelInternal.elm b/src/InputLabelInternal.elm index 7e498c6d..5c45f89a 100644 --- a/src/InputLabelInternal.elm +++ b/src/InputLabelInternal.elm @@ -10,7 +10,7 @@ import Accessibility.Styled as Html exposing (Html) import Accessibility.Styled.Style as Accessibility import Css import Html.Styled.Attributes as Attributes -import InputErrorInternal exposing (ErrorState) +import InputErrorAndGuidanceInternal exposing (ErrorState) import Nri.Ui.Colors.V1 as Colors import Nri.Ui.InputStyles.V3 as InputStyles exposing (Theme) @@ -32,7 +32,7 @@ view { for, label, theme } config = Html.label ([ Attributes.for for , Attributes.css - [ InputStyles.label theme (InputErrorInternal.getIsInError config.error) + [ InputStyles.label theme (InputErrorAndGuidanceInternal.getIsInError config.error) , if config.noMarginTop then Css.top (Css.px -InputStyles.defaultMarginTop) diff --git a/src/Nri/Ui/Select/V8.elm b/src/Nri/Ui/Select/V8.elm index ddeb57d2..9d2f3d07 100644 --- a/src/Nri/Ui/Select/V8.elm +++ b/src/Nri/Ui/Select/V8.elm @@ -46,7 +46,7 @@ import Css import Dict import Html.Styled.Attributes as Attributes exposing (css) import Html.Styled.Events as Events -import InputErrorInternal exposing (ErrorState) +import InputErrorAndGuidanceInternal exposing (ErrorState) import InputLabelInternal import Json.Decode exposing (Decoder) import Nri.Ui @@ -81,7 +81,7 @@ If you have an error message to display, use `errorMessage` instead. -} errorIf : Bool -> Attribute value errorIf = - Attribute << InputErrorInternal.setErrorIf + Attribute << InputErrorAndGuidanceInternal.setErrorIf {-| If `Just`, the field will be highlighted as having a validation error, @@ -89,7 +89,7 @@ and the given error message will be shown. -} errorMessage : Maybe String -> Attribute value errorMessage = - Attribute << InputErrorInternal.setErrorMessage + Attribute << InputErrorAndGuidanceInternal.setErrorMessage {-| Hides the visible label. (There will still be an invisible label for screen readers.) @@ -207,7 +207,7 @@ defaultConfig = , choices = [] , valueToString = Nothing , defaultDisplayText = Nothing - , error = InputErrorInternal.init + , error = InputErrorAndGuidanceInternal.init , hideLabel = False , noMarginTop = False , containerCss = [] @@ -223,7 +223,7 @@ view label attributes = applyConfig attributes isInError_ = - InputErrorInternal.getIsInError config.error + InputErrorAndGuidanceInternal.getIsInError config.error id_ = Maybe.withDefault (generateId label) config.id @@ -264,7 +264,7 @@ view label attributes = , Message.alertRole ] ) - (InputErrorInternal.getErrorMessage config.error) + (InputErrorAndGuidanceInternal.getErrorMessage config.error) ] diff --git a/src/Nri/Ui/TextInput/V7.elm b/src/Nri/Ui/TextInput/V7.elm index e58b646b..48aade46 100644 --- a/src/Nri/Ui/TextInput/V7.elm +++ b/src/Nri/Ui/TextInput/V7.elm @@ -56,7 +56,7 @@ import Css.Global import Html.Styled as Html exposing (..) import Html.Styled.Attributes as Attributes exposing (..) import Html.Styled.Events as Events -import InputErrorInternal exposing (ErrorState) +import InputErrorAndGuidanceInternal exposing (ErrorState) import InputLabelInternal import Keyboard.Event exposing (KeyboardEvent) import Nri.Ui.ClickableSvg.V2 as ClickableSvg @@ -285,7 +285,7 @@ loading = -} errorIf : Bool -> Attribute value msg errorIf = - Attribute emptyEventsAndValues << InputErrorInternal.setErrorIf + Attribute emptyEventsAndValues << InputErrorAndGuidanceInternal.setErrorIf {-| If `Just`, the field will be highlighted as having a validation error, @@ -293,7 +293,7 @@ and the given error message will be shown. -} errorMessage : Maybe String -> Attribute value msg errorMessage = - Attribute emptyEventsAndValues << InputErrorInternal.setErrorMessage + Attribute emptyEventsAndValues << InputErrorAndGuidanceInternal.setErrorMessage {-| A guidance message shows below the input, unless an error message is showing instead. @@ -485,7 +485,7 @@ emptyConfig = { inputStyle = InputStyles.Standard , inputCss = [] , guidance = Nothing - , error = InputErrorInternal.init + , error = InputErrorAndGuidanceInternal.init , disabled = False , loading = False , hideLabel = False @@ -561,10 +561,10 @@ view label attributes = |> Maybe.withDefault label isInError = - InputErrorInternal.getIsInError config.error + InputErrorAndGuidanceInternal.getIsInError config.error errorMessage_ = - InputErrorInternal.getErrorMessage config.error + InputErrorAndGuidanceInternal.getErrorMessage config.error ( opacity, disabled_ ) = case ( config.disabled, config.loading ) of