@fiscozen/checkbox 0.2.0 → 1.0.0
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/checkbox.js +2376 -0
- package/dist/checkbox.umd.cjs +13 -0
- package/dist/index.d.ts +1 -0
- package/dist/src/FzCheckbox.vue.d.ts +102 -0
- package/dist/src/FzCheckboxGroup.vue.d.ts +72 -0
- package/dist/src/__tests__/FzCheckbox.spec.d.ts +1 -0
- package/dist/src/__tests__/FzCheckboxGroup.spec.d.ts +1 -0
- package/dist/src/common.d.ts +23 -0
- package/dist/src/components/ErrorAlert.vue.d.ts +34 -0
- package/dist/src/components/FzCheckboxGroupOption.vue.d.ts +86 -0
- package/dist/src/index.d.ts +4 -0
- package/dist/src/types.d.ts +192 -0
- package/dist/src/utils.d.ts +24 -0
- package/dist/style.css +1 -0
- package/package.json +9 -13
- package/src/__tests__/FzCheckbox.spec.ts +748 -0
- package/src/__tests__/FzCheckboxGroup.spec.ts +764 -0
- package/src/__tests__/__snapshots__/FzCheckbox.spec.ts.snap +427 -0
- package/src/__tests__/__snapshots__/FzCheckboxGroup.spec.ts.snap +805 -0
- package/src/components/ErrorAlert.vue +1 -1
- package/tsconfig.tsbuildinfo +1 -0
- package/vitest.config.ts +9 -1
- package/coverage/base.css +0 -224
- package/coverage/block-navigation.js +0 -87
- package/coverage/clover.xml +0 -1031
- package/coverage/coverage-final.json +0 -7
- package/coverage/favicon.png +0 -0
- package/coverage/index.html +0 -131
- package/coverage/prettify.css +0 -1
- package/coverage/prettify.js +0 -2
- package/coverage/sort-arrow-sprite.png +0 -0
- package/coverage/sorter.js +0 -196
- package/coverage/src/FzCheckbox.vue.html +0 -1489
- package/coverage/src/FzCheckboxGroup.vue.html +0 -682
- package/coverage/src/common.ts.html +0 -157
- package/coverage/src/components/ErrorAlert.vue.html +0 -268
- package/coverage/src/components/FzCheckboxGroupOption.vue.html +0 -652
- package/coverage/src/components/index.html +0 -131
- package/coverage/src/index.html +0 -161
- package/coverage/src/utils.ts.html +0 -265
- package/src/__test__/FzCheckbox.test.ts +0 -206
- package/src/__test__/FzCheckboxGroup.test.ts +0 -263
|
@@ -0,0 +1,805 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - default state 1`] = `
|
|
4
|
+
"<!-- Root container for the entire checkbox group -->
|
|
5
|
+
<div class="flex flex-col gap-10 text-base">
|
|
6
|
+
<!--
|
|
7
|
+
Group label with optional required indicator and help text
|
|
8
|
+
Connected to checkbox group via aria-labelledby
|
|
9
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
10
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
11
|
+
<!--v-if-->
|
|
12
|
+
</label>
|
|
13
|
+
<!--
|
|
14
|
+
Checkbox group container with ARIA group role
|
|
15
|
+
- role="group": Identifies this as a group of related form controls
|
|
16
|
+
- aria-labelledby: Links to the label element
|
|
17
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
18
|
+
- aria-required: Indicates if selection is mandatory
|
|
19
|
+
- aria-invalid: Indicates validation state
|
|
20
|
+
-->
|
|
21
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-required="false" aria-invalid="false">
|
|
22
|
+
<!--
|
|
23
|
+
Render each checkbox option
|
|
24
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
25
|
+
Key uses value if available, falls back to label for uniqueness
|
|
26
|
+
-->
|
|
27
|
+
<!--
|
|
28
|
+
Parent checkbox
|
|
29
|
+
- Displays indeterminate state when children are partially selected
|
|
30
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
31
|
+
- Change event cascades selection to all children
|
|
32
|
+
-->
|
|
33
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
34
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
35
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
36
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
37
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
38
|
+
<!--
|
|
39
|
+
Native checkbox input (visually hidden but functionally present)
|
|
40
|
+
- Maintains native keyboard navigation and form behavior
|
|
41
|
+
- Screen readers can interact with it normally
|
|
42
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
43
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
44
|
+
<!--
|
|
45
|
+
Label element: provides click target and visual representation
|
|
46
|
+
Connected to hidden input via "for" attribute
|
|
47
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
48
|
+
peer-focus:[&_div]:after:border-1
|
|
49
|
+
peer-focus:[&_div]:after:border-solid
|
|
50
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
51
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
52
|
+
peer-focus:[&_div]:after:content-['']
|
|
53
|
+
peer-focus:[&_div]:after:top-0
|
|
54
|
+
peer-focus:[&_div]:after:left-0
|
|
55
|
+
peer-focus:[&_div]:after:right-0
|
|
56
|
+
peer-focus:[&_div]:after:bottom-0
|
|
57
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
58
|
+
<!--
|
|
59
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
60
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
61
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
62
|
+
-->
|
|
63
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
64
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
65
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
66
|
+
</label>
|
|
67
|
+
<!--
|
|
68
|
+
Optional tooltip for additional context
|
|
69
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
70
|
+
-->
|
|
71
|
+
<!--v-if-->
|
|
72
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
73
|
+
<!--v-if-->
|
|
74
|
+
<!--
|
|
75
|
+
Children slot for nested checkboxes
|
|
76
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
77
|
+
-->
|
|
78
|
+
</div>
|
|
79
|
+
<!--
|
|
80
|
+
Parent checkbox
|
|
81
|
+
- Displays indeterminate state when children are partially selected
|
|
82
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
83
|
+
- Change event cascades selection to all children
|
|
84
|
+
-->
|
|
85
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
86
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
87
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
88
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
89
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
90
|
+
<!--
|
|
91
|
+
Native checkbox input (visually hidden but functionally present)
|
|
92
|
+
- Maintains native keyboard navigation and form behavior
|
|
93
|
+
- Screen readers can interact with it normally
|
|
94
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
95
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000006-8d7ea" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000006-8d7ea-label" value="option2">
|
|
96
|
+
<!--
|
|
97
|
+
Label element: provides click target and visual representation
|
|
98
|
+
Connected to hidden input via "for" attribute
|
|
99
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000006-8d7ea-label" for="fz-checkbox-100000000006-8d7ea" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
100
|
+
peer-focus:[&_div]:after:border-1
|
|
101
|
+
peer-focus:[&_div]:after:border-solid
|
|
102
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
103
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
104
|
+
peer-focus:[&_div]:after:content-['']
|
|
105
|
+
peer-focus:[&_div]:after:top-0
|
|
106
|
+
peer-focus:[&_div]:after:left-0
|
|
107
|
+
peer-focus:[&_div]:after:right-0
|
|
108
|
+
peer-focus:[&_div]:after:bottom-0
|
|
109
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
110
|
+
<!--
|
|
111
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
112
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
113
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
114
|
+
-->
|
|
115
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
116
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
117
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 2
|
|
118
|
+
</label>
|
|
119
|
+
<!--
|
|
120
|
+
Optional tooltip for additional context
|
|
121
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
122
|
+
-->
|
|
123
|
+
<!--v-if-->
|
|
124
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
125
|
+
<!--v-if-->
|
|
126
|
+
<!--
|
|
127
|
+
Children slot for nested checkboxes
|
|
128
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
129
|
+
-->
|
|
130
|
+
</div>
|
|
131
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
132
|
+
<!--v-if-->
|
|
133
|
+
</div>"
|
|
134
|
+
`;
|
|
135
|
+
|
|
136
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - disabled 1`] = `
|
|
137
|
+
"<!-- Root container for the entire checkbox group -->
|
|
138
|
+
<div class="flex flex-col gap-10 text-base">
|
|
139
|
+
<!--
|
|
140
|
+
Group label with optional required indicator and help text
|
|
141
|
+
Connected to checkbox group via aria-labelledby
|
|
142
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-grey-400">
|
|
143
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
144
|
+
<!--v-if-->
|
|
145
|
+
</label>
|
|
146
|
+
<!--
|
|
147
|
+
Checkbox group container with ARIA group role
|
|
148
|
+
- role="group": Identifies this as a group of related form controls
|
|
149
|
+
- aria-labelledby: Links to the label element
|
|
150
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
151
|
+
- aria-required: Indicates if selection is mandatory
|
|
152
|
+
- aria-invalid: Indicates validation state
|
|
153
|
+
-->
|
|
154
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-required="false" aria-invalid="false">
|
|
155
|
+
<!--
|
|
156
|
+
Render each checkbox option
|
|
157
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
158
|
+
Key uses value if available, falls back to label for uniqueness
|
|
159
|
+
-->
|
|
160
|
+
<!--
|
|
161
|
+
Parent checkbox
|
|
162
|
+
- Displays indeterminate state when children are partially selected
|
|
163
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
164
|
+
- Change event cascades selection to all children
|
|
165
|
+
-->
|
|
166
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
167
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
168
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
169
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
170
|
+
<div data-v-79ecb611="" class="flex items-start group" data-disabled="true">
|
|
171
|
+
<!--
|
|
172
|
+
Native checkbox input (visually hidden but functionally present)
|
|
173
|
+
- Maintains native keyboard navigation and form behavior
|
|
174
|
+
- Screen readers can interact with it normally
|
|
175
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
176
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" disabled="" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
177
|
+
<!--
|
|
178
|
+
Label element: provides click target and visual representation
|
|
179
|
+
Connected to hidden input via "for" attribute
|
|
180
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
181
|
+
peer-focus:[&_div]:after:border-1
|
|
182
|
+
peer-focus:[&_div]:after:border-solid
|
|
183
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
184
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
185
|
+
peer-focus:[&_div]:after:content-['']
|
|
186
|
+
peer-focus:[&_div]:after:top-0
|
|
187
|
+
peer-focus:[&_div]:after:left-0
|
|
188
|
+
peer-focus:[&_div]:after:right-0
|
|
189
|
+
peer-focus:[&_div]:after:bottom-0
|
|
190
|
+
peer-focus:[&_div]:after:absolute text-base text-grey-300 [&_div]:text-grey-300">
|
|
191
|
+
<!--
|
|
192
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
193
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
194
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
195
|
+
-->
|
|
196
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-300" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
197
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
198
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
199
|
+
</label>
|
|
200
|
+
<!--
|
|
201
|
+
Optional tooltip for additional context
|
|
202
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
203
|
+
-->
|
|
204
|
+
<!--v-if-->
|
|
205
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
206
|
+
<!--v-if-->
|
|
207
|
+
<!--
|
|
208
|
+
Children slot for nested checkboxes
|
|
209
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
210
|
+
-->
|
|
211
|
+
</div>
|
|
212
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
213
|
+
<!--v-if-->
|
|
214
|
+
</div>"
|
|
215
|
+
`;
|
|
216
|
+
|
|
217
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - hierarchical structure 1`] = `
|
|
218
|
+
"<!-- Root container for the entire checkbox group -->
|
|
219
|
+
<div class="flex flex-col gap-10 text-base">
|
|
220
|
+
<!--
|
|
221
|
+
Group label with optional required indicator and help text
|
|
222
|
+
Connected to checkbox group via aria-labelledby
|
|
223
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
224
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
225
|
+
<!--v-if-->
|
|
226
|
+
</label>
|
|
227
|
+
<!--
|
|
228
|
+
Checkbox group container with ARIA group role
|
|
229
|
+
- role="group": Identifies this as a group of related form controls
|
|
230
|
+
- aria-labelledby: Links to the label element
|
|
231
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
232
|
+
- aria-required: Indicates if selection is mandatory
|
|
233
|
+
- aria-invalid: Indicates validation state
|
|
234
|
+
-->
|
|
235
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-required="false" aria-invalid="false">
|
|
236
|
+
<!--
|
|
237
|
+
Render each checkbox option
|
|
238
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
239
|
+
Key uses value if available, falls back to label for uniqueness
|
|
240
|
+
-->
|
|
241
|
+
<!--
|
|
242
|
+
Parent checkbox
|
|
243
|
+
- Displays indeterminate state when children are partially selected
|
|
244
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
245
|
+
- Change event cascades selection to all children
|
|
246
|
+
-->
|
|
247
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
248
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
249
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
250
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
251
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
252
|
+
<!--
|
|
253
|
+
Native checkbox input (visually hidden but functionally present)
|
|
254
|
+
- Maintains native keyboard navigation and form behavior
|
|
255
|
+
- Screen readers can interact with it normally
|
|
256
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
257
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" aria-owns="fz-checkbox-100000000002-22ql0-child-0 fz-checkbox-100000000002-22ql0-child-1" value="parent">
|
|
258
|
+
<!--
|
|
259
|
+
Label element: provides click target and visual representation
|
|
260
|
+
Connected to hidden input via "for" attribute
|
|
261
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
262
|
+
peer-focus:[&_div]:after:border-1
|
|
263
|
+
peer-focus:[&_div]:after:border-solid
|
|
264
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
265
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
266
|
+
peer-focus:[&_div]:after:content-['']
|
|
267
|
+
peer-focus:[&_div]:after:top-0
|
|
268
|
+
peer-focus:[&_div]:after:left-0
|
|
269
|
+
peer-focus:[&_div]:after:right-0
|
|
270
|
+
peer-focus:[&_div]:after:bottom-0
|
|
271
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
272
|
+
<!--
|
|
273
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
274
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
275
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
276
|
+
-->
|
|
277
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
278
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
279
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Parent Option
|
|
280
|
+
</label>
|
|
281
|
+
<!--
|
|
282
|
+
Optional tooltip for additional context
|
|
283
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
284
|
+
-->
|
|
285
|
+
<!--v-if-->
|
|
286
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
287
|
+
<!--v-if-->
|
|
288
|
+
<!--
|
|
289
|
+
Children slot for nested checkboxes
|
|
290
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
291
|
+
-->
|
|
292
|
+
<!-- Indented container for visual hierarchy -->
|
|
293
|
+
<div class="flex flex-col justify-center gap-8 pl-24">
|
|
294
|
+
<!--
|
|
295
|
+
Child checkboxes
|
|
296
|
+
- Assigned deterministic IDs matching those in parent's aria-owns
|
|
297
|
+
- Change events update parent's indeterminate state
|
|
298
|
+
- Share same v-model array with parent and siblings
|
|
299
|
+
-->
|
|
300
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
301
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
302
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
303
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
304
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
305
|
+
<!--
|
|
306
|
+
Native checkbox input (visually hidden but functionally present)
|
|
307
|
+
- Maintains native keyboard navigation and form behavior
|
|
308
|
+
- Screen readers can interact with it normally
|
|
309
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
310
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000002-22ql0-child-0" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000002-22ql0-child-0-label" value="child1">
|
|
311
|
+
<!--
|
|
312
|
+
Label element: provides click target and visual representation
|
|
313
|
+
Connected to hidden input via "for" attribute
|
|
314
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000002-22ql0-child-0-label" for="fz-checkbox-100000000002-22ql0-child-0" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
315
|
+
peer-focus:[&_div]:after:border-1
|
|
316
|
+
peer-focus:[&_div]:after:border-solid
|
|
317
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
318
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
319
|
+
peer-focus:[&_div]:after:content-['']
|
|
320
|
+
peer-focus:[&_div]:after:top-0
|
|
321
|
+
peer-focus:[&_div]:after:left-0
|
|
322
|
+
peer-focus:[&_div]:after:right-0
|
|
323
|
+
peer-focus:[&_div]:after:bottom-0
|
|
324
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
325
|
+
<!--
|
|
326
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
327
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
328
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
329
|
+
-->
|
|
330
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
331
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
332
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Child 1
|
|
333
|
+
</label>
|
|
334
|
+
<!--
|
|
335
|
+
Optional tooltip for additional context
|
|
336
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
337
|
+
-->
|
|
338
|
+
<!--v-if-->
|
|
339
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
340
|
+
<!--v-if-->
|
|
341
|
+
<!--
|
|
342
|
+
Children slot for nested checkboxes
|
|
343
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
344
|
+
-->
|
|
345
|
+
</div><!-- Root container: vertical layout with consistent spacing -->
|
|
346
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
347
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
348
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
349
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
350
|
+
<!--
|
|
351
|
+
Native checkbox input (visually hidden but functionally present)
|
|
352
|
+
- Maintains native keyboard navigation and form behavior
|
|
353
|
+
- Screen readers can interact with it normally
|
|
354
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
355
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000002-22ql0-child-1" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000002-22ql0-child-1-label" value="child2">
|
|
356
|
+
<!--
|
|
357
|
+
Label element: provides click target and visual representation
|
|
358
|
+
Connected to hidden input via "for" attribute
|
|
359
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000002-22ql0-child-1-label" for="fz-checkbox-100000000002-22ql0-child-1" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
360
|
+
peer-focus:[&_div]:after:border-1
|
|
361
|
+
peer-focus:[&_div]:after:border-solid
|
|
362
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
363
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
364
|
+
peer-focus:[&_div]:after:content-['']
|
|
365
|
+
peer-focus:[&_div]:after:top-0
|
|
366
|
+
peer-focus:[&_div]:after:left-0
|
|
367
|
+
peer-focus:[&_div]:after:right-0
|
|
368
|
+
peer-focus:[&_div]:after:bottom-0
|
|
369
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
370
|
+
<!--
|
|
371
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
372
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
373
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
374
|
+
-->
|
|
375
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
376
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
377
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Child 2
|
|
378
|
+
</label>
|
|
379
|
+
<!--
|
|
380
|
+
Optional tooltip for additional context
|
|
381
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
382
|
+
-->
|
|
383
|
+
<!--v-if-->
|
|
384
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
385
|
+
<!--v-if-->
|
|
386
|
+
<!--
|
|
387
|
+
Children slot for nested checkboxes
|
|
388
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
389
|
+
-->
|
|
390
|
+
</div>
|
|
391
|
+
</div>
|
|
392
|
+
</div>
|
|
393
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
394
|
+
<!--v-if-->
|
|
395
|
+
</div>"
|
|
396
|
+
`;
|
|
397
|
+
|
|
398
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - horizontal layout 1`] = `
|
|
399
|
+
"<!-- Root container for the entire checkbox group -->
|
|
400
|
+
<div class="flex flex-col gap-10 text-base">
|
|
401
|
+
<!--
|
|
402
|
+
Group label with optional required indicator and help text
|
|
403
|
+
Connected to checkbox group via aria-labelledby
|
|
404
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
405
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
406
|
+
<!--v-if-->
|
|
407
|
+
</label>
|
|
408
|
+
<!--
|
|
409
|
+
Checkbox group container with ARIA group role
|
|
410
|
+
- role="group": Identifies this as a group of related form controls
|
|
411
|
+
- aria-labelledby: Links to the label element
|
|
412
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
413
|
+
- aria-required: Indicates if selection is mandatory
|
|
414
|
+
- aria-invalid: Indicates validation state
|
|
415
|
+
-->
|
|
416
|
+
<div class="flex items-start text-base gap-16 flex-row" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-required="false" aria-invalid="false">
|
|
417
|
+
<!--
|
|
418
|
+
Render each checkbox option
|
|
419
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
420
|
+
Key uses value if available, falls back to label for uniqueness
|
|
421
|
+
-->
|
|
422
|
+
<!--
|
|
423
|
+
Parent checkbox
|
|
424
|
+
- Displays indeterminate state when children are partially selected
|
|
425
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
426
|
+
- Change event cascades selection to all children
|
|
427
|
+
-->
|
|
428
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
429
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
430
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
431
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
432
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
433
|
+
<!--
|
|
434
|
+
Native checkbox input (visually hidden but functionally present)
|
|
435
|
+
- Maintains native keyboard navigation and form behavior
|
|
436
|
+
- Screen readers can interact with it normally
|
|
437
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
438
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
439
|
+
<!--
|
|
440
|
+
Label element: provides click target and visual representation
|
|
441
|
+
Connected to hidden input via "for" attribute
|
|
442
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
443
|
+
peer-focus:[&_div]:after:border-1
|
|
444
|
+
peer-focus:[&_div]:after:border-solid
|
|
445
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
446
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
447
|
+
peer-focus:[&_div]:after:content-['']
|
|
448
|
+
peer-focus:[&_div]:after:top-0
|
|
449
|
+
peer-focus:[&_div]:after:left-0
|
|
450
|
+
peer-focus:[&_div]:after:right-0
|
|
451
|
+
peer-focus:[&_div]:after:bottom-0
|
|
452
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
453
|
+
<!--
|
|
454
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
455
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
456
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
457
|
+
-->
|
|
458
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
459
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
460
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
461
|
+
</label>
|
|
462
|
+
<!--
|
|
463
|
+
Optional tooltip for additional context
|
|
464
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
465
|
+
-->
|
|
466
|
+
<!--v-if-->
|
|
467
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
468
|
+
<!--v-if-->
|
|
469
|
+
<!--
|
|
470
|
+
Children slot for nested checkboxes
|
|
471
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
472
|
+
-->
|
|
473
|
+
</div>
|
|
474
|
+
<!--
|
|
475
|
+
Parent checkbox
|
|
476
|
+
- Displays indeterminate state when children are partially selected
|
|
477
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
478
|
+
- Change event cascades selection to all children
|
|
479
|
+
-->
|
|
480
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
481
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
482
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
483
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
484
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
485
|
+
<!--
|
|
486
|
+
Native checkbox input (visually hidden but functionally present)
|
|
487
|
+
- Maintains native keyboard navigation and form behavior
|
|
488
|
+
- Screen readers can interact with it normally
|
|
489
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
490
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000006-8d7ea" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000006-8d7ea-label" value="option2">
|
|
491
|
+
<!--
|
|
492
|
+
Label element: provides click target and visual representation
|
|
493
|
+
Connected to hidden input via "for" attribute
|
|
494
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000006-8d7ea-label" for="fz-checkbox-100000000006-8d7ea" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
495
|
+
peer-focus:[&_div]:after:border-1
|
|
496
|
+
peer-focus:[&_div]:after:border-solid
|
|
497
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
498
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
499
|
+
peer-focus:[&_div]:after:content-['']
|
|
500
|
+
peer-focus:[&_div]:after:top-0
|
|
501
|
+
peer-focus:[&_div]:after:left-0
|
|
502
|
+
peer-focus:[&_div]:after:right-0
|
|
503
|
+
peer-focus:[&_div]:after:bottom-0
|
|
504
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
505
|
+
<!--
|
|
506
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
507
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
508
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
509
|
+
-->
|
|
510
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
511
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
512
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 2
|
|
513
|
+
</label>
|
|
514
|
+
<!--
|
|
515
|
+
Optional tooltip for additional context
|
|
516
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
517
|
+
-->
|
|
518
|
+
<!--v-if-->
|
|
519
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
520
|
+
<!--v-if-->
|
|
521
|
+
<!--
|
|
522
|
+
Children slot for nested checkboxes
|
|
523
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
524
|
+
-->
|
|
525
|
+
</div>
|
|
526
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
527
|
+
<!--v-if-->
|
|
528
|
+
</div>"
|
|
529
|
+
`;
|
|
530
|
+
|
|
531
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - required 1`] = `
|
|
532
|
+
"<!-- Root container for the entire checkbox group -->
|
|
533
|
+
<div class="flex flex-col gap-10 text-base">
|
|
534
|
+
<!--
|
|
535
|
+
Group label with optional required indicator and help text
|
|
536
|
+
Connected to checkbox group via aria-labelledby
|
|
537
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
538
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<span> *</span></span><!-- Optional help text slot for additional context -->
|
|
539
|
+
<!--v-if-->
|
|
540
|
+
</label>
|
|
541
|
+
<!--
|
|
542
|
+
Checkbox group container with ARIA group role
|
|
543
|
+
- role="group": Identifies this as a group of related form controls
|
|
544
|
+
- aria-labelledby: Links to the label element
|
|
545
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
546
|
+
- aria-required: Indicates if selection is mandatory
|
|
547
|
+
- aria-invalid: Indicates validation state
|
|
548
|
+
-->
|
|
549
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-required="true" aria-invalid="false">
|
|
550
|
+
<!--
|
|
551
|
+
Render each checkbox option
|
|
552
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
553
|
+
Key uses value if available, falls back to label for uniqueness
|
|
554
|
+
-->
|
|
555
|
+
<!--
|
|
556
|
+
Parent checkbox
|
|
557
|
+
- Displays indeterminate state when children are partially selected
|
|
558
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
559
|
+
- Change event cascades selection to all children
|
|
560
|
+
-->
|
|
561
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
562
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
563
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
564
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
565
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
566
|
+
<!--
|
|
567
|
+
Native checkbox input (visually hidden but functionally present)
|
|
568
|
+
- Maintains native keyboard navigation and form behavior
|
|
569
|
+
- Screen readers can interact with it normally
|
|
570
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
571
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
572
|
+
<!--
|
|
573
|
+
Label element: provides click target and visual representation
|
|
574
|
+
Connected to hidden input via "for" attribute
|
|
575
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
576
|
+
peer-focus:[&_div]:after:border-1
|
|
577
|
+
peer-focus:[&_div]:after:border-solid
|
|
578
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
579
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
580
|
+
peer-focus:[&_div]:after:content-['']
|
|
581
|
+
peer-focus:[&_div]:after:top-0
|
|
582
|
+
peer-focus:[&_div]:after:left-0
|
|
583
|
+
peer-focus:[&_div]:after:right-0
|
|
584
|
+
peer-focus:[&_div]:after:bottom-0
|
|
585
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
586
|
+
<!--
|
|
587
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
588
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
589
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
590
|
+
-->
|
|
591
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
592
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
593
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
594
|
+
</label>
|
|
595
|
+
<!--
|
|
596
|
+
Optional tooltip for additional context
|
|
597
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
598
|
+
-->
|
|
599
|
+
<!--v-if-->
|
|
600
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
601
|
+
<!--v-if-->
|
|
602
|
+
<!--
|
|
603
|
+
Children slot for nested checkboxes
|
|
604
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
605
|
+
-->
|
|
606
|
+
</div>
|
|
607
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
608
|
+
<!--v-if-->
|
|
609
|
+
</div>"
|
|
610
|
+
`;
|
|
611
|
+
|
|
612
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - with error 1`] = `
|
|
613
|
+
"<!-- Root container for the entire checkbox group -->
|
|
614
|
+
<div class="flex flex-col gap-10 text-base">
|
|
615
|
+
<!--
|
|
616
|
+
Group label with optional required indicator and help text
|
|
617
|
+
Connected to checkbox group via aria-labelledby
|
|
618
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
619
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
620
|
+
<!--v-if-->
|
|
621
|
+
</label>
|
|
622
|
+
<!--
|
|
623
|
+
Checkbox group container with ARIA group role
|
|
624
|
+
- role="group": Identifies this as a group of related form controls
|
|
625
|
+
- aria-labelledby: Links to the label element
|
|
626
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
627
|
+
- aria-required: Indicates if selection is mandatory
|
|
628
|
+
- aria-invalid: Indicates validation state
|
|
629
|
+
-->
|
|
630
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-describedby="fz-checkbox-group-100000000001-2a84k-error" aria-required="false" aria-invalid="true">
|
|
631
|
+
<!--
|
|
632
|
+
Render each checkbox option
|
|
633
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
634
|
+
Key uses value if available, falls back to label for uniqueness
|
|
635
|
+
-->
|
|
636
|
+
<!--
|
|
637
|
+
Parent checkbox
|
|
638
|
+
- Displays indeterminate state when children are partially selected
|
|
639
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
640
|
+
- Change event cascades selection to all children
|
|
641
|
+
-->
|
|
642
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
643
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
644
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
645
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
646
|
+
<div data-v-79ecb611="" class="flex items-start group" data-error="true">
|
|
647
|
+
<!--
|
|
648
|
+
Native checkbox input (visually hidden but functionally present)
|
|
649
|
+
- Maintains native keyboard navigation and form behavior
|
|
650
|
+
- Screen readers can interact with it normally
|
|
651
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
652
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="true" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
653
|
+
<!--
|
|
654
|
+
Label element: provides click target and visual representation
|
|
655
|
+
Connected to hidden input via "for" attribute
|
|
656
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
657
|
+
peer-focus:[&_div]:after:border-1
|
|
658
|
+
peer-focus:[&_div]:after:border-solid
|
|
659
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
660
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
661
|
+
peer-focus:[&_div]:after:content-['']
|
|
662
|
+
peer-focus:[&_div]:after:top-0
|
|
663
|
+
peer-focus:[&_div]:after:left-0
|
|
664
|
+
peer-focus:[&_div]:after:right-0
|
|
665
|
+
peer-focus:[&_div]:after:bottom-0
|
|
666
|
+
peer-focus:[&_div]:after:absolute text-base text-semantic-error-200 [&_div]:text-semantic-error-200 peer-checked:[&_div]:text-semantic-error-200 peer-indeterminate:[&_div]:text-semantic-error-200">
|
|
667
|
+
<!--
|
|
668
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
669
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
670
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
671
|
+
-->
|
|
672
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-semantic-error-200" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
673
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
674
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
675
|
+
</label>
|
|
676
|
+
<!--
|
|
677
|
+
Optional tooltip for additional context
|
|
678
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
679
|
+
-->
|
|
680
|
+
<!--v-if-->
|
|
681
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
682
|
+
<!--v-if-->
|
|
683
|
+
<!--
|
|
684
|
+
Children slot for nested checkboxes
|
|
685
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
686
|
+
-->
|
|
687
|
+
</div>
|
|
688
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
689
|
+
<!--
|
|
690
|
+
Error message display with ARIA live region
|
|
691
|
+
Announces validation errors immediately to screen readers
|
|
692
|
+
- role="alert": High-priority message
|
|
693
|
+
- aria-live="assertive": Interrupts current announcements
|
|
694
|
+
- aria-atomic="true": Reads complete message
|
|
695
|
+
|
|
696
|
+
@TODO: When FzAlert supports automatic ARIA handling based on \`type\`
|
|
697
|
+
(e.g., via an \`announce\` prop or similar semantic API), we can remove
|
|
698
|
+
these manual attributes.
|
|
699
|
+
|
|
700
|
+
Proposed future API:
|
|
701
|
+
FzAlert with type="error" and announce prop
|
|
702
|
+
would automatically get role="alert" and aria-live="assertive"
|
|
703
|
+
-->
|
|
704
|
+
<div data-v-9bf2fc2e="" class="flex select-none gap-12 rounded justify-between bg-semantic-error-50 border-semantic-error" id="fz-checkbox-group-100000000001-2a84k-error" role="alert" aria-live="assertive" aria-atomic="true">
|
|
705
|
+
<div data-v-da7f5873="" data-v-9bf2fc2e="" class="fz-container fz-container--horizontal gap-section-content-sm align-items-start layout-default flex-1 p-12">
|
|
706
|
+
<div data-v-9bf2fc2e="" class="flex items-center justify-center w-[20px] h-[20px] text-semantic-error"><svg class="svg-inline--fa fa-circle-xmark h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="circle-xmark" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
|
|
707
|
+
<path class="" fill="currentColor" d="M256 48a208 208 0 1 1 0 416 208 208 0 1 1 0-416zm0 464A256 256 0 1 0 256 0a256 256 0 1 0 0 512zM175 175c-9.4 9.4-9.4 24.6 0 33.9l47 47-47 47c-9.4 9.4-9.4 24.6 0 33.9s24.6 9.4 33.9 0l47-47 47 47c9.4 9.4 24.6 9.4 33.9 0s9.4-24.6 0-33.9l-47-47 47-47c9.4-9.4 9.4-24.6 0-33.9s-24.6-9.4-33.9 0l-47 47-47-47c-9.4-9.4-24.6-9.4-33.9 0z"></path>
|
|
708
|
+
</svg></div>
|
|
709
|
+
<div data-v-9bf2fc2e="" class="flex flex-col flex-1">
|
|
710
|
+
<!--v-if-->
|
|
711
|
+
<p data-v-9bf2fc2e="" class="font-normal !leading-[20px] mb-16">Test error message</p>
|
|
712
|
+
<div data-v-da7f5873="" data-v-9bf2fc2e="" class="fz-container fz-container--horizontal gap-section-content-sm align-items-center layout-default"><button data-v-9bf2fc2e="" type="button" aria-disabled="false" class="relative rounded flex flex-shrink items-center justify-center font-normal !text-[16px] !leading-[20px] border-1 border-transparent gap-8 h-44 px-12 min-w-96 bg-core-white text-grey-500 !border-grey-200 hover:bg-grey-100 hover:!border-grey-200 focus:bg-core-white focus:!border-blue-600 disabled:bg-grey-50 disabled:text-grey-200 disabled:!border-grey-200">
|
|
713
|
+
<!--v-if-->
|
|
714
|
+
<div class="truncate font-normal !text-[16px] !leading-[20px]"></div>
|
|
715
|
+
<!--v-if-->
|
|
716
|
+
</button>
|
|
717
|
+
<!--v-if-->
|
|
718
|
+
</div>
|
|
719
|
+
</div>
|
|
720
|
+
</div>
|
|
721
|
+
<!--v-if-->
|
|
722
|
+
</div>
|
|
723
|
+
</div>"
|
|
724
|
+
`;
|
|
725
|
+
|
|
726
|
+
exports[`FzCheckboxGroup > Snapshots > should match snapshot - with help text 1`] = `
|
|
727
|
+
"<!-- Root container for the entire checkbox group -->
|
|
728
|
+
<div class="flex flex-col gap-10 text-base">
|
|
729
|
+
<!--
|
|
730
|
+
Group label with optional required indicator and help text
|
|
731
|
+
Connected to checkbox group via aria-labelledby
|
|
732
|
+
--><label id="fz-checkbox-group-100000000001-2a84k-label" class="flex flex-col text-base gap-6 text-core-black">
|
|
733
|
+
<!-- Main label text with required asterisk if applicable --><span>Test Checkbox Group<!--v-if--></span><!-- Optional help text slot for additional context -->
|
|
734
|
+
<p id="fz-checkbox-group-100000000001-2a84k-help" class="text-sm text-grey-500">This is help text</p>
|
|
735
|
+
</label>
|
|
736
|
+
<!--
|
|
737
|
+
Checkbox group container with ARIA group role
|
|
738
|
+
- role="group": Identifies this as a group of related form controls
|
|
739
|
+
- aria-labelledby: Links to the label element
|
|
740
|
+
- aria-describedby: Links to help text and/or error message for screen readers
|
|
741
|
+
- aria-required: Indicates if selection is mandatory
|
|
742
|
+
- aria-invalid: Indicates validation state
|
|
743
|
+
-->
|
|
744
|
+
<div class="flex items-start text-base gap-8 flex-col" id="fz-checkbox-group-100000000001-2a84k" role="group" aria-labelledby="fz-checkbox-group-100000000001-2a84k-label" aria-describedby="fz-checkbox-group-100000000001-2a84k-help" aria-required="false" aria-invalid="false">
|
|
745
|
+
<!--
|
|
746
|
+
Render each checkbox option
|
|
747
|
+
Supports both simple checkboxes and parent-child hierarchies
|
|
748
|
+
Key uses value if available, falls back to label for uniqueness
|
|
749
|
+
-->
|
|
750
|
+
<!--
|
|
751
|
+
Parent checkbox
|
|
752
|
+
- Displays indeterminate state when children are partially selected
|
|
753
|
+
- aria-owns links to child checkboxes for screen reader navigation
|
|
754
|
+
- Change event cascades selection to all children
|
|
755
|
+
-->
|
|
756
|
+
<!-- Root container: vertical layout with consistent spacing -->
|
|
757
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
758
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
759
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
760
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
761
|
+
<!--
|
|
762
|
+
Native checkbox input (visually hidden but functionally present)
|
|
763
|
+
- Maintains native keyboard navigation and form behavior
|
|
764
|
+
- Screen readers can interact with it normally
|
|
765
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
766
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000003-2kdwy" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000003-2kdwy-label" value="option1">
|
|
767
|
+
<!--
|
|
768
|
+
Label element: provides click target and visual representation
|
|
769
|
+
Connected to hidden input via "for" attribute
|
|
770
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000003-2kdwy-label" for="fz-checkbox-100000000003-2kdwy" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
771
|
+
peer-focus:[&_div]:after:border-1
|
|
772
|
+
peer-focus:[&_div]:after:border-solid
|
|
773
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
774
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
775
|
+
peer-focus:[&_div]:after:content-['']
|
|
776
|
+
peer-focus:[&_div]:after:top-0
|
|
777
|
+
peer-focus:[&_div]:after:left-0
|
|
778
|
+
peer-focus:[&_div]:after:right-0
|
|
779
|
+
peer-focus:[&_div]:after:bottom-0
|
|
780
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
781
|
+
<!--
|
|
782
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
783
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
784
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
785
|
+
-->
|
|
786
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-grey-400" aria-hidden="true"><svg class="svg-inline--fa fa-square h-[16px]" aria-hidden="true" focusable="false" data-prefix="far" data-icon="square" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
787
|
+
<path class="" fill="currentColor" d="M384 80c8.8 0 16 7.2 16 16l0 320c0 8.8-7.2 16-16 16L64 432c-8.8 0-16-7.2-16-16L48 96c0-8.8 7.2-16 16-16l320 0zM64 32C28.7 32 0 60.7 0 96L0 416c0 35.3 28.7 64 64 64l320 0c35.3 0 64-28.7 64-64l0-320c0-35.3-28.7-64-64-64L64 32z"></path>
|
|
788
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Option 1
|
|
789
|
+
</label>
|
|
790
|
+
<!--
|
|
791
|
+
Optional tooltip for additional context
|
|
792
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
793
|
+
-->
|
|
794
|
+
<!--v-if-->
|
|
795
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
796
|
+
<!--v-if-->
|
|
797
|
+
<!--
|
|
798
|
+
Children slot for nested checkboxes
|
|
799
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
800
|
+
-->
|
|
801
|
+
</div>
|
|
802
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
803
|
+
<!--v-if-->
|
|
804
|
+
</div>"
|
|
805
|
+
`;
|