@thecb/components 12.1.0-beta.3 → 12.1.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs.js +5 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +5 -2
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/checkbox/Checkbox.js +2 -1
- package/src/components/atoms/checkbox/Checkbox.stories.js +16 -0
- package/src/components/molecules/payment-form-ach/PaymentFormACH.js +1 -0
- package/src/components/molecules/payment-form-card/PaymentFormCard.js +1 -0
package/package.json
CHANGED
|
@@ -109,6 +109,7 @@ const Checkbox = forwardRef(
|
|
|
109
109
|
dataQa = null,
|
|
110
110
|
checkboxExtraStyles,
|
|
111
111
|
hasIconOverride = false,
|
|
112
|
+
customAriaLabel,
|
|
112
113
|
icon: Icon,
|
|
113
114
|
...rest
|
|
114
115
|
},
|
|
@@ -151,7 +152,7 @@ const Checkbox = forwardRef(
|
|
|
151
152
|
tabIndex="0"
|
|
152
153
|
required={isRequired}
|
|
153
154
|
aria-invalid={error}
|
|
154
|
-
aria-label={ariaLabel}
|
|
155
|
+
aria-label={customAriaLabel || ariaLabel}
|
|
155
156
|
aria-labelledby={labelledById}
|
|
156
157
|
aria-describedby={error ? `${name}-error-message` : undefined}
|
|
157
158
|
onKeyDown={e => handleClick(e, onChange)}
|
|
@@ -21,6 +21,7 @@ const meta = {
|
|
|
21
21
|
extraStyles: undefined,
|
|
22
22
|
textExtraStyles: undefined,
|
|
23
23
|
labelledById: undefined,
|
|
24
|
+
customAriaLabel: undefined,
|
|
24
25
|
dataQa: null
|
|
25
26
|
},
|
|
26
27
|
argTypes: {
|
|
@@ -52,6 +53,13 @@ const meta = {
|
|
|
52
53
|
type: { summary: "string" }
|
|
53
54
|
}
|
|
54
55
|
},
|
|
56
|
+
customAriaLabel: {
|
|
57
|
+
table: {
|
|
58
|
+
description:
|
|
59
|
+
"Overrides the default aria-label. Useful when the checkbox needs a descriptive accessible name other than the `name` prop provides.",
|
|
60
|
+
type: { summary: "string" }
|
|
61
|
+
}
|
|
62
|
+
},
|
|
55
63
|
extraStyles: {
|
|
56
64
|
table: {
|
|
57
65
|
type: { summary: "string" }
|
|
@@ -153,3 +161,11 @@ export const Hidden = {
|
|
|
153
161
|
},
|
|
154
162
|
render: args => <CheckboxWithHooks {...args} />
|
|
155
163
|
};
|
|
164
|
+
|
|
165
|
+
export const WithCustomAriaLabel = {
|
|
166
|
+
args: {
|
|
167
|
+
customAriaLabel: "Custom aria label",
|
|
168
|
+
title: "A different label"
|
|
169
|
+
},
|
|
170
|
+
render: args => <CheckboxWithHooks {...args} />
|
|
171
|
+
};
|