From 1844d0cc04216f6dd33e1668fece552f944cdc9d Mon Sep 17 00:00:00 2001 From: Casey Webb Date: Fri, 11 Mar 2022 00:33:03 -0600 Subject: [PATCH 1/4] Allow setting custom ID property on PremiumCheckbox Note, this fixes a regression introduced V6 -> V7 --- src/Nri/Ui/PremiumCheckbox/V8.elm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/Nri/Ui/PremiumCheckbox/V8.elm b/src/Nri/Ui/PremiumCheckbox/V8.elm index 102039c1..d8096682 100644 --- a/src/Nri/Ui/PremiumCheckbox/V8.elm +++ b/src/Nri/Ui/PremiumCheckbox/V8.elm @@ -1,5 +1,6 @@ module Nri.Ui.PremiumCheckbox.V8 exposing ( view + , id , selected, partiallySelected , premium, showPennant , Attribute @@ -39,6 +40,15 @@ import String exposing (toLower) import String.Extra exposing (dasherize) +{-| Set a custom ID for this checkbox and label. If you don't set this, +we'll automatically generate one from the label you pass in, but this can +cause problems if you have more than one checkbox with the same label on +the page. Use this to be more specific and avoid issues with duplicate IDs! +-} +id : String -> Attribute msg +id id_ = + Attribute (\config -> { config | id = Just id_ }) + {-| This disables the input -} disabled : Attribute msg From 36fd725752c01426bea28f2f6d6d878779958b82 Mon Sep 17 00:00:00 2001 From: Celso Bonutti Date: Fri, 11 Mar 2022 10:06:47 -0300 Subject: [PATCH 2/4] formats 'PremiumCheckbox.V8' --- src/Nri/Ui/PremiumCheckbox/V8.elm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Nri/Ui/PremiumCheckbox/V8.elm b/src/Nri/Ui/PremiumCheckbox/V8.elm index d8096682..b3d0092d 100644 --- a/src/Nri/Ui/PremiumCheckbox/V8.elm +++ b/src/Nri/Ui/PremiumCheckbox/V8.elm @@ -1,10 +1,10 @@ module Nri.Ui.PremiumCheckbox.V8 exposing ( view - , id , selected, partiallySelected , premium, showPennant , Attribute , disabled, enabled + , id ) {-| Changes from V7: @@ -49,6 +49,7 @@ id : String -> Attribute msg id id_ = Attribute (\config -> { config | id = Just id_ }) + {-| This disables the input -} disabled : Attribute msg From f24b2283ac41730b43844e734c50a608fa836c10 Mon Sep 17 00:00:00 2001 From: Celso Bonutti Date: Fri, 11 Mar 2022 10:11:59 -0300 Subject: [PATCH 3/4] adds 'id' to PremiumCheckbox.v8 docs --- src/Nri/Ui/PremiumCheckbox/V8.elm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Nri/Ui/PremiumCheckbox/V8.elm b/src/Nri/Ui/PremiumCheckbox/V8.elm index b3d0092d..33e8e5a5 100644 --- a/src/Nri/Ui/PremiumCheckbox/V8.elm +++ b/src/Nri/Ui/PremiumCheckbox/V8.elm @@ -25,6 +25,8 @@ module Nri.Ui.PremiumCheckbox.V8 exposing @docs Attribute @docs disabled, enabled +@docs id + -} From 3480986bf57e309298ff88fc651f2be61b1819c1 Mon Sep 17 00:00:00 2001 From: Celso Bonutti Date: Fri, 11 Mar 2022 10:56:04 -0300 Subject: [PATCH 4/4] formats 'PremiumCheckbox.V8' --- src/Nri/Ui/PremiumCheckbox/V8.elm | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Nri/Ui/PremiumCheckbox/V8.elm b/src/Nri/Ui/PremiumCheckbox/V8.elm index 33e8e5a5..108785f8 100644 --- a/src/Nri/Ui/PremiumCheckbox/V8.elm +++ b/src/Nri/Ui/PremiumCheckbox/V8.elm @@ -27,7 +27,6 @@ module Nri.Ui.PremiumCheckbox.V8 exposing @docs disabled, enabled @docs id - -} import Accessibility.Styled as Html exposing (Html)