@fiscozen/checkbox 1.0.0-next.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,427 @@
|
|
|
1
|
+
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
+
|
|
3
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - checked state 1`] = `
|
|
4
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
5
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
6
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
7
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
8
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
9
|
+
<!--
|
|
10
|
+
Native checkbox input (visually hidden but functionally present)
|
|
11
|
+
- Maintains native keyboard navigation and form behavior
|
|
12
|
+
- Screen readers can interact with it normally
|
|
13
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
14
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="true" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
15
|
+
<!--
|
|
16
|
+
Label element: provides click target and visual representation
|
|
17
|
+
Connected to hidden input via "for" attribute
|
|
18
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
19
|
+
peer-focus:[&_div]:after:border-1
|
|
20
|
+
peer-focus:[&_div]:after:border-solid
|
|
21
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
22
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
23
|
+
peer-focus:[&_div]:after:content-['']
|
|
24
|
+
peer-focus:[&_div]:after:top-0
|
|
25
|
+
peer-focus:[&_div]:after:left-0
|
|
26
|
+
peer-focus:[&_div]:after:right-0
|
|
27
|
+
peer-focus:[&_div]:after:bottom-0
|
|
28
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
29
|
+
<!--
|
|
30
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
31
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
32
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
33
|
+
-->
|
|
34
|
+
<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-check h-[16px]" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="square-check" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
35
|
+
<path class="" fill="currentColor" d="M64 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 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"></path>
|
|
36
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
37
|
+
</label>
|
|
38
|
+
<!--
|
|
39
|
+
Optional tooltip for additional context
|
|
40
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
41
|
+
-->
|
|
42
|
+
<!--v-if-->
|
|
43
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
44
|
+
<!--v-if-->
|
|
45
|
+
<!--
|
|
46
|
+
Children slot for nested checkboxes
|
|
47
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
48
|
+
-->
|
|
49
|
+
</div>"
|
|
50
|
+
`;
|
|
51
|
+
|
|
52
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - default state 1`] = `
|
|
53
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
54
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
55
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
56
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
57
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
58
|
+
<!--
|
|
59
|
+
Native checkbox input (visually hidden but functionally present)
|
|
60
|
+
- Maintains native keyboard navigation and form behavior
|
|
61
|
+
- Screen readers can interact with it normally
|
|
62
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
63
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
64
|
+
<!--
|
|
65
|
+
Label element: provides click target and visual representation
|
|
66
|
+
Connected to hidden input via "for" attribute
|
|
67
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
68
|
+
peer-focus:[&_div]:after:border-1
|
|
69
|
+
peer-focus:[&_div]:after:border-solid
|
|
70
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
71
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
72
|
+
peer-focus:[&_div]:after:content-['']
|
|
73
|
+
peer-focus:[&_div]:after:top-0
|
|
74
|
+
peer-focus:[&_div]:after:left-0
|
|
75
|
+
peer-focus:[&_div]:after:right-0
|
|
76
|
+
peer-focus:[&_div]:after:bottom-0
|
|
77
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
78
|
+
<!--
|
|
79
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
80
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
81
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
82
|
+
-->
|
|
83
|
+
<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">
|
|
84
|
+
<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>
|
|
85
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
86
|
+
</label>
|
|
87
|
+
<!--
|
|
88
|
+
Optional tooltip for additional context
|
|
89
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
90
|
+
-->
|
|
91
|
+
<!--v-if-->
|
|
92
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
93
|
+
<!--v-if-->
|
|
94
|
+
<!--
|
|
95
|
+
Children slot for nested checkboxes
|
|
96
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
97
|
+
-->
|
|
98
|
+
</div>"
|
|
99
|
+
`;
|
|
100
|
+
|
|
101
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - disabled state 1`] = `
|
|
102
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
103
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
104
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
105
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
106
|
+
<div data-v-79ecb611="" class="flex items-start group" data-disabled="true">
|
|
107
|
+
<!--
|
|
108
|
+
Native checkbox input (visually hidden but functionally present)
|
|
109
|
+
- Maintains native keyboard navigation and form behavior
|
|
110
|
+
- Screen readers can interact with it normally
|
|
111
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
112
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" disabled="" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
113
|
+
<!--
|
|
114
|
+
Label element: provides click target and visual representation
|
|
115
|
+
Connected to hidden input via "for" attribute
|
|
116
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
117
|
+
peer-focus:[&_div]:after:border-1
|
|
118
|
+
peer-focus:[&_div]:after:border-solid
|
|
119
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
120
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
121
|
+
peer-focus:[&_div]:after:content-['']
|
|
122
|
+
peer-focus:[&_div]:after:top-0
|
|
123
|
+
peer-focus:[&_div]:after:left-0
|
|
124
|
+
peer-focus:[&_div]:after:right-0
|
|
125
|
+
peer-focus:[&_div]:after:bottom-0
|
|
126
|
+
peer-focus:[&_div]:after:absolute text-base text-grey-300 [&_div]:text-grey-300">
|
|
127
|
+
<!--
|
|
128
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
129
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
130
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
131
|
+
-->
|
|
132
|
+
<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">
|
|
133
|
+
<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>
|
|
134
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
135
|
+
</label>
|
|
136
|
+
<!--
|
|
137
|
+
Optional tooltip for additional context
|
|
138
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
139
|
+
-->
|
|
140
|
+
<!--v-if-->
|
|
141
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
142
|
+
<!--v-if-->
|
|
143
|
+
<!--
|
|
144
|
+
Children slot for nested checkboxes
|
|
145
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
146
|
+
-->
|
|
147
|
+
</div>"
|
|
148
|
+
`;
|
|
149
|
+
|
|
150
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - error state 1`] = `
|
|
151
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
152
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
153
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
154
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
155
|
+
<div data-v-79ecb611="" class="flex items-start group" data-error="true">
|
|
156
|
+
<!--
|
|
157
|
+
Native checkbox input (visually hidden but functionally present)
|
|
158
|
+
- Maintains native keyboard navigation and form behavior
|
|
159
|
+
- Screen readers can interact with it normally
|
|
160
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
161
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-required="false" aria-invalid="true" aria-describedby="fz-checkbox-100000000001-2a84k-error" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
162
|
+
<!--
|
|
163
|
+
Label element: provides click target and visual representation
|
|
164
|
+
Connected to hidden input via "for" attribute
|
|
165
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
166
|
+
peer-focus:[&_div]:after:border-1
|
|
167
|
+
peer-focus:[&_div]:after:border-solid
|
|
168
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
169
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
170
|
+
peer-focus:[&_div]:after:content-['']
|
|
171
|
+
peer-focus:[&_div]:after:top-0
|
|
172
|
+
peer-focus:[&_div]:after:left-0
|
|
173
|
+
peer-focus:[&_div]:after:right-0
|
|
174
|
+
peer-focus:[&_div]:after:bottom-0
|
|
175
|
+
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">
|
|
176
|
+
<!--
|
|
177
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
178
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
179
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
180
|
+
-->
|
|
181
|
+
<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">
|
|
182
|
+
<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>
|
|
183
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
184
|
+
</label>
|
|
185
|
+
<!--
|
|
186
|
+
Optional tooltip for additional context
|
|
187
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
188
|
+
-->
|
|
189
|
+
<!--v-if-->
|
|
190
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
191
|
+
<!--
|
|
192
|
+
Error message display with ARIA live region
|
|
193
|
+
Announces validation errors immediately to screen readers
|
|
194
|
+
- role="alert": High-priority message
|
|
195
|
+
- aria-live="assertive": Interrupts current announcements
|
|
196
|
+
- aria-atomic="true": Reads complete message
|
|
197
|
+
|
|
198
|
+
@TODO: When FzAlert supports automatic ARIA handling based on \`type\`
|
|
199
|
+
(e.g., via an \`announce\` prop or similar semantic API), we can remove
|
|
200
|
+
these manual attributes.
|
|
201
|
+
|
|
202
|
+
Proposed future API:
|
|
203
|
+
FzAlert with type="error" and announce prop
|
|
204
|
+
would automatically get role="alert" and aria-live="assertive"
|
|
205
|
+
-->
|
|
206
|
+
<div data-v-9bf2fc2e="" data-v-79ecb611="" class="flex select-none gap-12 rounded justify-between bg-semantic-error-50 border-semantic-error" id="fz-checkbox-100000000001-2a84k-error" role="alert" aria-live="assertive" aria-atomic="true">
|
|
207
|
+
<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">
|
|
208
|
+
<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">
|
|
209
|
+
<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>
|
|
210
|
+
</svg></div>
|
|
211
|
+
<div data-v-9bf2fc2e="" class="flex flex-col flex-1">
|
|
212
|
+
<!--v-if-->
|
|
213
|
+
<p data-v-9bf2fc2e="" class="font-normal !leading-[20px] mb-16">Error message</p>
|
|
214
|
+
<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">
|
|
215
|
+
<!--v-if-->
|
|
216
|
+
<div class="truncate font-normal !text-[16px] !leading-[20px]"></div>
|
|
217
|
+
<!--v-if-->
|
|
218
|
+
</button>
|
|
219
|
+
<!--v-if-->
|
|
220
|
+
</div>
|
|
221
|
+
</div>
|
|
222
|
+
</div>
|
|
223
|
+
<!--v-if-->
|
|
224
|
+
</div>
|
|
225
|
+
<!--
|
|
226
|
+
Children slot for nested checkboxes
|
|
227
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
228
|
+
-->
|
|
229
|
+
</div>"
|
|
230
|
+
`;
|
|
231
|
+
|
|
232
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - indeterminate state 1`] = `
|
|
233
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
234
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
235
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
236
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
237
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
238
|
+
<!--
|
|
239
|
+
Native checkbox input (visually hidden but functionally present)
|
|
240
|
+
- Maintains native keyboard navigation and form behavior
|
|
241
|
+
- Screen readers can interact with it normally
|
|
242
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
243
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="mixed" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
244
|
+
<!--
|
|
245
|
+
Label element: provides click target and visual representation
|
|
246
|
+
Connected to hidden input via "for" attribute
|
|
247
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
248
|
+
peer-focus:[&_div]:after:border-1
|
|
249
|
+
peer-focus:[&_div]:after:border-solid
|
|
250
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
251
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
252
|
+
peer-focus:[&_div]:after:content-['']
|
|
253
|
+
peer-focus:[&_div]:after:top-0
|
|
254
|
+
peer-focus:[&_div]:after:left-0
|
|
255
|
+
peer-focus:[&_div]:after:right-0
|
|
256
|
+
peer-focus:[&_div]:after:bottom-0
|
|
257
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
258
|
+
<!--
|
|
259
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
260
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
261
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
262
|
+
-->
|
|
263
|
+
<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-minus h-[16px]" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="square-minus" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
264
|
+
<path class="" fill="currentColor" d="M64 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 32zm88 200l144 0c13.3 0 24 10.7 24 24s-10.7 24-24 24l-144 0c-13.3 0-24-10.7-24-24s10.7-24 24-24z"></path>
|
|
265
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
266
|
+
</label>
|
|
267
|
+
<!--
|
|
268
|
+
Optional tooltip for additional context
|
|
269
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
270
|
+
-->
|
|
271
|
+
<!--v-if-->
|
|
272
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
273
|
+
<!--v-if-->
|
|
274
|
+
<!--
|
|
275
|
+
Children slot for nested checkboxes
|
|
276
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
277
|
+
-->
|
|
278
|
+
</div>"
|
|
279
|
+
`;
|
|
280
|
+
|
|
281
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - required 1`] = `
|
|
282
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
283
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
284
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
285
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
286
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
287
|
+
<!--
|
|
288
|
+
Native checkbox input (visually hidden but functionally present)
|
|
289
|
+
- Maintains native keyboard navigation and form behavior
|
|
290
|
+
- Screen readers can interact with it normally
|
|
291
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
292
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" required="" aria-checked="false" aria-required="true" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
293
|
+
<!--
|
|
294
|
+
Label element: provides click target and visual representation
|
|
295
|
+
Connected to hidden input via "for" attribute
|
|
296
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
297
|
+
peer-focus:[&_div]:after:border-1
|
|
298
|
+
peer-focus:[&_div]:after:border-solid
|
|
299
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
300
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
301
|
+
peer-focus:[&_div]:after:content-['']
|
|
302
|
+
peer-focus:[&_div]:after:top-0
|
|
303
|
+
peer-focus:[&_div]:after:left-0
|
|
304
|
+
peer-focus:[&_div]:after:right-0
|
|
305
|
+
peer-focus:[&_div]:after:bottom-0
|
|
306
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
307
|
+
<!--
|
|
308
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
309
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
310
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
311
|
+
-->
|
|
312
|
+
<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">
|
|
313
|
+
<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>
|
|
314
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
315
|
+
</label>
|
|
316
|
+
<!--
|
|
317
|
+
Optional tooltip for additional context
|
|
318
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
319
|
+
-->
|
|
320
|
+
<!--v-if-->
|
|
321
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
322
|
+
<!--v-if-->
|
|
323
|
+
<!--
|
|
324
|
+
Children slot for nested checkboxes
|
|
325
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
326
|
+
-->
|
|
327
|
+
</div>"
|
|
328
|
+
`;
|
|
329
|
+
|
|
330
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - standalone mode 1`] = `
|
|
331
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
332
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
333
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
334
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
335
|
+
<div data-v-79ecb611="" class="flex items-start group">
|
|
336
|
+
<!--
|
|
337
|
+
Native checkbox input (visually hidden but functionally present)
|
|
338
|
+
- Maintains native keyboard navigation and form behavior
|
|
339
|
+
- Screen readers can interact with it normally
|
|
340
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
341
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="false" aria-label="Test Checkbox" aria-required="false" aria-invalid="false" value="test">
|
|
342
|
+
<!--
|
|
343
|
+
Label element: provides click target and visual representation
|
|
344
|
+
Connected to hidden input via "for" attribute
|
|
345
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
346
|
+
peer-focus:[&_div]:after:border-1
|
|
347
|
+
peer-focus:[&_div]:after:border-solid
|
|
348
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
349
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
350
|
+
peer-focus:[&_div]:after:content-['']
|
|
351
|
+
peer-focus:[&_div]:after:top-0
|
|
352
|
+
peer-focus:[&_div]:after:left-0
|
|
353
|
+
peer-focus:[&_div]:after:right-0
|
|
354
|
+
peer-focus:[&_div]:after:bottom-0
|
|
355
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black peer-checked:[&_div]:text-grey-500 peer-indeterminate:[&_div]:text-grey-500">
|
|
356
|
+
<!--
|
|
357
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
358
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
359
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
360
|
+
-->
|
|
361
|
+
<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">
|
|
362
|
+
<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>
|
|
363
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->
|
|
364
|
+
<!--v-if-->
|
|
365
|
+
</label>
|
|
366
|
+
<!--
|
|
367
|
+
Optional tooltip for additional context
|
|
368
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
369
|
+
-->
|
|
370
|
+
<!--v-if-->
|
|
371
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
372
|
+
<!--v-if-->
|
|
373
|
+
<!--
|
|
374
|
+
Children slot for nested checkboxes
|
|
375
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
376
|
+
-->
|
|
377
|
+
</div>"
|
|
378
|
+
`;
|
|
379
|
+
|
|
380
|
+
exports[`FzCheckbox > Snapshots > should match snapshot - with emphasis 1`] = `
|
|
381
|
+
"<!-- Root container: vertical layout with consistent spacing -->
|
|
382
|
+
<div data-v-79ecb611="" class="flex justify-center flex-col w-fit gap-4">
|
|
383
|
+
<!-- Checkbox row: input + label + optional tooltip, aligned to top for long labels -->
|
|
384
|
+
<!-- Hover effects are handled in CSS using data attributes -->
|
|
385
|
+
<div data-v-79ecb611="" class="flex items-start group" data-emphasis="true">
|
|
386
|
+
<!--
|
|
387
|
+
Native checkbox input (visually hidden but functionally present)
|
|
388
|
+
- Maintains native keyboard navigation and form behavior
|
|
389
|
+
- Screen readers can interact with it normally
|
|
390
|
+
- Styled via adjacent label and icon using Tailwind's "peer" selector
|
|
391
|
+
--><input data-v-79ecb611="" type="checkbox" id="fz-checkbox-100000000001-2a84k" class="w-0 h-0 peer fz-hidden-input" aria-checked="true" aria-required="false" aria-invalid="false" aria-labelledby="fz-checkbox-100000000001-2a84k-label" value="test">
|
|
392
|
+
<!--
|
|
393
|
+
Label element: provides click target and visual representation
|
|
394
|
+
Connected to hidden input via "for" attribute
|
|
395
|
+
--><label data-v-79ecb611="" id="fz-checkbox-100000000001-2a84k-label" for="fz-checkbox-100000000001-2a84k" class="flex gap-6 items-start hover:cursor-pointer text-core-black
|
|
396
|
+
peer-focus:[&_div]:after:border-1
|
|
397
|
+
peer-focus:[&_div]:after:border-solid
|
|
398
|
+
peer-focus:[&_div]:after:rounded-[2px]
|
|
399
|
+
peer-focus:[&_div]:after:border-blue-200
|
|
400
|
+
peer-focus:[&_div]:after:content-['']
|
|
401
|
+
peer-focus:[&_div]:after:top-0
|
|
402
|
+
peer-focus:[&_div]:after:left-0
|
|
403
|
+
peer-focus:[&_div]:after:right-0
|
|
404
|
+
peer-focus:[&_div]:after:bottom-0
|
|
405
|
+
peer-focus:[&_div]:after:absolute text-base text-core-black [&_div]:text-blue-500 peer-checked:[&_div]:text-blue-500 peer-indeterminate:[&_div]:text-blue-500">
|
|
406
|
+
<!--
|
|
407
|
+
Visual checkbox icon (replaces hidden native checkbox)
|
|
408
|
+
aria-hidden because it's purely decorative - the native input conveys state
|
|
409
|
+
@TODO: When FzIcon natively supports ariaHidden prop, remove aria-hidden as HTML attribute and use :aria-hidden as prop
|
|
410
|
+
-->
|
|
411
|
+
<div data-v-79ecb611="" class="flex items-center justify-center w-[20px] h-[20px] relative text-blue-500" aria-hidden="true"><svg class="svg-inline--fa fa-square-check h-[16px]" aria-hidden="true" focusable="false" data-prefix="fas" data-icon="square-check" role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
|
|
412
|
+
<path class="" fill="currentColor" d="M64 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 32zM337 209L209 337c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L303 175c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"></path>
|
|
413
|
+
</svg></div><!-- Label text (hidden in standalone mode for checkbox-only display) -->Test Checkbox
|
|
414
|
+
</label>
|
|
415
|
+
<!--
|
|
416
|
+
Optional tooltip for additional context
|
|
417
|
+
@TODO: When FzTooltip supports keyboard accessibility and ARIA attributes (role="tooltip", aria-describedby), update implementation
|
|
418
|
+
-->
|
|
419
|
+
<!--v-if-->
|
|
420
|
+
</div><!-- Error message display with accessible ARIA live region -->
|
|
421
|
+
<!--v-if-->
|
|
422
|
+
<!--
|
|
423
|
+
Children slot for nested checkboxes
|
|
424
|
+
Used by FzCheckboxGroupOption to render child checkboxes
|
|
425
|
+
-->
|
|
426
|
+
</div>"
|
|
427
|
+
`;
|