@fpkit/acss 3.8.0 → 3.9.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.
Files changed (38) hide show
  1. package/libs/components/form/checkbox.css +1 -0
  2. package/libs/components/form/checkbox.css.map +1 -0
  3. package/libs/components/form/checkbox.min.css +3 -0
  4. package/libs/components/form/form.css +1 -1
  5. package/libs/components/form/form.css.map +1 -1
  6. package/libs/components/form/form.min.css +2 -2
  7. package/libs/index.cjs +25 -25
  8. package/libs/index.cjs.map +1 -1
  9. package/libs/index.css +1 -1
  10. package/libs/index.css.map +1 -1
  11. package/libs/index.d.cts +142 -292
  12. package/libs/index.d.ts +142 -292
  13. package/libs/index.js +6 -5
  14. package/libs/index.js.map +1 -1
  15. package/package.json +2 -2
  16. package/src/components/form/checkbox.scss +129 -0
  17. package/src/components/form/checkbox.tsx +302 -0
  18. package/src/components/form/form.scss +59 -20
  19. package/src/components/form/form.types.ts +6 -0
  20. package/src/components/form/input.stories.tsx +258 -1
  21. package/src/index.scss +1 -1
  22. package/src/index.ts +13 -8
  23. package/src/styles/form/checkbox.css +97 -0
  24. package/src/styles/form/checkbox.css.map +1 -0
  25. package/src/styles/form/form.css +138 -22
  26. package/src/styles/form/form.css.map +1 -1
  27. package/src/styles/index.css +138 -393
  28. package/src/styles/index.css.map +1 -1
  29. package/libs/components/checkbox/checkbox.css +0 -1
  30. package/libs/components/checkbox/checkbox.css.map +0 -1
  31. package/libs/components/checkbox/checkbox.min.css +0 -3
  32. package/src/components/checkbox/README.mdx +0 -263
  33. package/src/components/checkbox/STYLES.mdx +0 -434
  34. package/src/components/checkbox/checkbox.scss +0 -432
  35. package/src/components/checkbox/checkbox.stories.tsx +0 -607
  36. package/src/components/checkbox/checkbox.test.tsx +0 -535
  37. package/src/components/checkbox/checkbox.tsx +0 -575
  38. package/src/styles/checkbox/checkbox.css +0 -372
@@ -1,372 +0,0 @@
1
- /* ============================================================================
2
- Checkbox Component Styles
3
- ============================================================================
4
-
5
- Accessible checkbox component with size and color variants.
6
- All measurements use rem units (1rem = 16px).
7
- All color variants meet WCAG 2.1 AA contrast requirements (4.5:1 minimum).
8
-
9
- CSS Variable Naming Convention:
10
- --checkbox-{element}-{variant}-{property}-{modifier}
11
-
12
- Approved abbreviations: bg, fs, fw, radius, gap
13
- Full words for: padding, margin, color, border, display, width, height
14
- ========================================================================= */
15
- :root {
16
- /* ==========================================================================
17
- Size Tokens
18
- ========================================================================== */
19
- --checkbox-size-sm: 1rem; /* 16px */
20
- --checkbox-size-md: 1.25rem; /* 20px */
21
- --checkbox-size-lg: 1.5rem; /* 24px */
22
- /* ==========================================================================
23
- Base Properties
24
- ========================================================================== */
25
- --checkbox-size: var(--checkbox-size-md);
26
- --checkbox-bg: #ffffff;
27
- --checkbox-border: 0.125rem solid #6b7280; /* 2px border */
28
- --checkbox-border-color: #6b7280; /* Gray 500 */
29
- --checkbox-radius: 0.25rem; /* 4px */
30
- --checkbox-cursor: pointer;
31
- --checkbox-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
32
- /* ==========================================================================
33
- Checkmark Indicator
34
- ========================================================================== */
35
- --checkbox-checkmark-color: #ffffff;
36
- --checkbox-checkmark-opacity: 0;
37
- --checkbox-checkmark-transform: scale(0.7);
38
- /* ==========================================================================
39
- Label Properties
40
- ========================================================================== */
41
- --checkbox-label-gap: 0.5rem; /* 8px */
42
- --checkbox-label-fs: 1rem; /* 16px */
43
- --checkbox-label-color: inherit;
44
- --checkbox-label-cursor: pointer;
45
- --checkbox-label-fw: 400;
46
- /* ==========================================================================
47
- Description Properties
48
- ========================================================================== */
49
- --checkbox-description-fs: 0.875rem; /* 14px */
50
- --checkbox-description-color: #6b7280; /* Gray 500 */
51
- --checkbox-description-margin-block-start: 0.25rem; /* 4px */
52
- --checkbox-description-padding-inline-start: calc(
53
- var(--checkbox-size) + var(--checkbox-label-gap)
54
- );
55
- /* ==========================================================================
56
- Error Message Properties
57
- ========================================================================== */
58
- --checkbox-error-fs: 0.875rem; /* 14px */
59
- --checkbox-error-color: #dc2626; /* Red 600 */
60
- --checkbox-error-margin-block-start: 0.25rem; /* 4px */
61
- --checkbox-error-padding-inline-start: calc(
62
- var(--checkbox-size) + var(--checkbox-label-gap)
63
- );
64
- /* ==========================================================================
65
- Required Indicator
66
- ========================================================================== */
67
- --checkbox-required-color: #dc2626; /* Red 600 */
68
- --checkbox-required-fw: 600;
69
- /* ==========================================================================
70
- Color Variants - WCAG AA Compliant
71
- ========================================================================== */
72
- /* Primary Variant (Blue) */
73
- --checkbox-primary-checked-bg: #2563eb; /* Blue 600 - 4.68:1 contrast */
74
- --checkbox-primary-checked-border: #2563eb;
75
- --checkbox-primary-hover-border: #3b82f6; /* Blue 500 */
76
- --checkbox-primary-focus-outline-color: #93c5fd; /* Blue 300 */
77
- /* Secondary Variant (Gray) */
78
- --checkbox-secondary-checked-bg: #4b5563; /* Gray 600 - 7.56:1 contrast */
79
- --checkbox-secondary-checked-border: #4b5563;
80
- --checkbox-secondary-hover-border: #6b7280; /* Gray 500 */
81
- --checkbox-secondary-focus-outline-color: #9ca3af; /* Gray 400 */
82
- /* Error Variant (Red) */
83
- --checkbox-error-checked-bg: #dc2626; /* Red 600 - 5.14:1 contrast */
84
- --checkbox-error-checked-border: #dc2626;
85
- --checkbox-error-hover-border: #ef4444; /* Red 500 */
86
- --checkbox-error-focus-outline-color: #fca5a5; /* Red 300 */
87
- /* Success Variant (Green) */
88
- --checkbox-success-checked-bg: #16a34a; /* Green 600 - 4.54:1 contrast */
89
- --checkbox-success-checked-border: #16a34a;
90
- --checkbox-success-hover-border: #22c55e; /* Green 500 */
91
- --checkbox-success-focus-outline-color: #86efac; /* Green 300 */
92
- /* ==========================================================================
93
- State Variables
94
- ========================================================================== */
95
- /* Hover State */
96
- --checkbox-hover-border-color: #9ca3af; /* Gray 400 */
97
- --checkbox-hover-bg: #f9fafb; /* Gray 50 */
98
- /* Focus State */
99
- --checkbox-focus-outline: 0.125rem solid; /* 2px */
100
- --checkbox-focus-outline-offset: 0.125rem; /* 2px */
101
- --checkbox-focus-outline-color: var(--checkbox-primary-focus-outline-color);
102
- /* Checked State */
103
- --checkbox-checked-bg: var(--checkbox-primary-checked-bg);
104
- --checkbox-checked-border: var(--checkbox-primary-checked-border);
105
- --checkbox-checked-checkmark-opacity: 1;
106
- --checkbox-checked-checkmark-transform: scale(1);
107
- /* Indeterminate State */
108
- --checkbox-indeterminate-bg: var(--checkbox-primary-checked-bg);
109
- --checkbox-indeterminate-border: var(--checkbox-primary-checked-border);
110
- --checkbox-indeterminate-dash-width: 0.625rem; /* 10px */
111
- --checkbox-indeterminate-dash-height: 0.125rem; /* 2px */
112
- --checkbox-indeterminate-dash-opacity: 1;
113
- /* Disabled State */
114
- --checkbox-disabled-bg: #f3f4f6; /* Gray 100 */
115
- --checkbox-disabled-border-color: #d1d5db; /* Gray 300 */
116
- --checkbox-disabled-opacity: 0.6;
117
- --checkbox-disabled-cursor: not-allowed;
118
- /* Invalid State */
119
- --checkbox-invalid-border-color: #dc2626; /* Red 600 */
120
- --checkbox-invalid-focus-outline-color: #fca5a5; /* Red 300 */
121
- }
122
-
123
- /* ============================================================================
124
- Wrapper Element
125
- ============================================================================ */
126
- [data-checkbox] {
127
- display: inline-flex;
128
- flex-direction: column;
129
- gap: var(--checkbox-label-gap);
130
- /* Size Variants */
131
- /* Color Variants */
132
- }
133
- [data-checkbox][data-checkbox~=sm] {
134
- --checkbox-size: var(--checkbox-size-sm);
135
- --checkbox-label-fs: 0.875rem; /* 14px */
136
- }
137
- [data-checkbox][data-checkbox~=md] {
138
- --checkbox-size: var(--checkbox-size-md);
139
- --checkbox-label-fs: 1rem; /* 16px */
140
- }
141
- [data-checkbox][data-checkbox~=lg] {
142
- --checkbox-size: var(--checkbox-size-lg);
143
- --checkbox-label-fs: 1.125rem; /* 18px */
144
- }
145
- [data-checkbox][data-checkbox~=primary] {
146
- --checkbox-checked-bg: var(--checkbox-primary-checked-bg);
147
- --checkbox-checked-border: var(--checkbox-primary-checked-border);
148
- --checkbox-hover-border-color: var(--checkbox-primary-hover-border);
149
- --checkbox-focus-outline-color: var(--checkbox-primary-focus-outline-color);
150
- --checkbox-indeterminate-bg: var(--checkbox-primary-checked-bg);
151
- --checkbox-indeterminate-border: var(--checkbox-primary-checked-border);
152
- }
153
- [data-checkbox][data-checkbox~=secondary] {
154
- --checkbox-checked-bg: var(--checkbox-secondary-checked-bg);
155
- --checkbox-checked-border: var(--checkbox-secondary-checked-border);
156
- --checkbox-hover-border-color: var(--checkbox-secondary-hover-border);
157
- --checkbox-focus-outline-color: var(
158
- --checkbox-secondary-focus-outline-color
159
- );
160
- --checkbox-indeterminate-bg: var(--checkbox-secondary-checked-bg);
161
- --checkbox-indeterminate-border: var(--checkbox-secondary-checked-border);
162
- }
163
- [data-checkbox][data-checkbox~=error] {
164
- --checkbox-checked-bg: var(--checkbox-error-checked-bg);
165
- --checkbox-checked-border: var(--checkbox-error-checked-border);
166
- --checkbox-hover-border-color: var(--checkbox-error-hover-border);
167
- --checkbox-focus-outline-color: var(--checkbox-error-focus-outline-color);
168
- --checkbox-indeterminate-bg: var(--checkbox-error-checked-bg);
169
- --checkbox-indeterminate-border: var(--checkbox-error-checked-border);
170
- }
171
- [data-checkbox][data-checkbox~=success] {
172
- --checkbox-checked-bg: var(--checkbox-success-checked-bg);
173
- --checkbox-checked-border: var(--checkbox-success-checked-border);
174
- --checkbox-hover-border-color: var(--checkbox-success-hover-border);
175
- --checkbox-focus-outline-color: var(
176
- --checkbox-success-focus-outline-color
177
- );
178
- --checkbox-indeterminate-bg: var(--checkbox-success-checked-bg);
179
- --checkbox-indeterminate-border: var(--checkbox-success-checked-border);
180
- }
181
-
182
- /* ============================================================================
183
- Container (Input + Label)
184
- ============================================================================ */
185
- .checkbox-container {
186
- display: inline-flex;
187
- align-items: flex-start;
188
- gap: var(--checkbox-label-gap);
189
- cursor: var(--checkbox-cursor);
190
- }
191
-
192
- /* ============================================================================
193
- Input Wrapper (Contains native input + custom indicator)
194
- ============================================================================ */
195
- .checkbox-input-wrapper {
196
- position: relative;
197
- display: inline-flex;
198
- align-items: center;
199
- justify-content: center;
200
- flex-shrink: 0; /* Prevent checkbox from shrinking */
201
- }
202
-
203
- /* ============================================================================
204
- Native Checkbox Input (Hidden but accessible)
205
- ============================================================================ */
206
- .checkbox-input {
207
- position: absolute;
208
- opacity: 0;
209
- width: var(--checkbox-size);
210
- height: var(--checkbox-size);
211
- margin: 0;
212
- cursor: var(--checkbox-cursor);
213
- z-index: 1;
214
- /* Focus State */
215
- /* Hover State */
216
- /* Checked State */
217
- /* Indeterminate State */
218
- /* Disabled State */
219
- /* Invalid State */
220
- }
221
- .checkbox-input:focus-visible + .checkbox-indicator {
222
- outline: var(--checkbox-focus-outline);
223
- outline-color: var(--checkbox-focus-outline-color);
224
- outline-offset: var(--checkbox-focus-outline-offset);
225
- }
226
- .checkbox-input:hover:not(:disabled):not([aria-disabled=true]) + .checkbox-indicator {
227
- background-color: var(--checkbox-hover-bg);
228
- border-color: var(--checkbox-hover-border-color);
229
- }
230
- .checkbox-input:checked + .checkbox-indicator {
231
- background-color: var(--checkbox-checked-bg);
232
- border-color: var(--checkbox-checked-border);
233
- }
234
- .checkbox-input:checked + .checkbox-indicator .checkbox-checkmark {
235
- opacity: var(--checkbox-checked-checkmark-opacity);
236
- transform: var(--checkbox-checked-checkmark-transform);
237
- }
238
- .checkbox-input:checked + .checkbox-indicator .checkbox-indeterminate-dash {
239
- opacity: 0;
240
- }
241
- .checkbox-input:indeterminate + .checkbox-indicator {
242
- background-color: var(--checkbox-indeterminate-bg);
243
- border-color: var(--checkbox-indeterminate-border);
244
- }
245
- .checkbox-input:indeterminate + .checkbox-indicator .checkbox-checkmark {
246
- opacity: 0;
247
- }
248
- .checkbox-input:indeterminate + .checkbox-indicator .checkbox-indeterminate-dash {
249
- opacity: var(--checkbox-indeterminate-dash-opacity);
250
- }
251
- .checkbox-input:disabled, .checkbox-input[aria-disabled=true] {
252
- cursor: var(--checkbox-disabled-cursor);
253
- }
254
- .checkbox-input:disabled + .checkbox-indicator, .checkbox-input[aria-disabled=true] + .checkbox-indicator {
255
- background-color: var(--checkbox-disabled-bg);
256
- border-color: var(--checkbox-disabled-border-color);
257
- opacity: var(--checkbox-disabled-opacity);
258
- cursor: var(--checkbox-disabled-cursor);
259
- }
260
- .checkbox-input[aria-invalid=true]:not(:checked):not(:indeterminate) + .checkbox-indicator {
261
- border-color: var(--checkbox-invalid-border-color);
262
- }
263
- .checkbox-input[aria-invalid=true]:focus-visible + .checkbox-indicator {
264
- outline-color: var(--checkbox-invalid-focus-outline-color);
265
- }
266
-
267
- /* ============================================================================
268
- Custom Checkbox Indicator
269
- ============================================================================ */
270
- .checkbox-indicator {
271
- position: relative;
272
- display: inline-flex;
273
- align-items: center;
274
- justify-content: center;
275
- width: var(--checkbox-size);
276
- height: var(--checkbox-size);
277
- min-width: var(--checkbox-size); /* Prevent shrinking */
278
- min-height: var(--checkbox-size);
279
- background-color: var(--checkbox-bg);
280
- border: var(--checkbox-border);
281
- border-radius: var(--checkbox-radius);
282
- transition: var(--checkbox-transition);
283
- pointer-events: none; /* Let clicks pass through to input */
284
- }
285
-
286
- /* ============================================================================
287
- Checkmark SVG (Checked State)
288
- ============================================================================ */
289
- .checkbox-checkmark {
290
- width: 75%; /* Scale relative to checkbox size */
291
- height: 75%;
292
- color: var(--checkbox-checkmark-color);
293
- opacity: var(--checkbox-checkmark-opacity);
294
- transform: var(--checkbox-checkmark-transform);
295
- transition: var(--checkbox-transition);
296
- pointer-events: none;
297
- }
298
-
299
- /* ============================================================================
300
- Indeterminate Dash (Indeterminate State)
301
- ============================================================================ */
302
- .checkbox-indeterminate-dash {
303
- position: absolute;
304
- width: var(--checkbox-indeterminate-dash-width);
305
- height: var(--checkbox-indeterminate-dash-height);
306
- background-color: var(--checkbox-checkmark-color);
307
- border-radius: calc(var(--checkbox-indeterminate-dash-height) / 2);
308
- opacity: 0;
309
- transition: var(--checkbox-transition);
310
- pointer-events: none;
311
- }
312
-
313
- /* ============================================================================
314
- Label
315
- ============================================================================ */
316
- .checkbox-label {
317
- display: inline-flex;
318
- align-items: flex-start;
319
- font-size: var(--checkbox-label-fs);
320
- font-weight: var(--checkbox-label-fw);
321
- color: var(--checkbox-label-color);
322
- cursor: var(--checkbox-label-cursor);
323
- user-select: none;
324
- line-height: 1.5;
325
- /* Match checkbox vertical alignment */
326
- padding-block-start: calc((var(--checkbox-size) - var(--checkbox-label-fs) * 1.5) / 2);
327
- }
328
-
329
- /* Required Indicator */
330
- .checkbox-required {
331
- color: var(--checkbox-required-color);
332
- font-weight: var(--checkbox-required-fw);
333
- }
334
-
335
- /* ============================================================================
336
- Description Text
337
- ============================================================================ */
338
- .checkbox-description {
339
- font-size: var(--checkbox-description-fs);
340
- color: var(--checkbox-description-color);
341
- margin-block-start: var(--checkbox-description-margin-block-start);
342
- padding-inline-start: var(--checkbox-description-padding-inline-start);
343
- line-height: 1.5;
344
- }
345
-
346
- /* ============================================================================
347
- Error Message
348
- ============================================================================ */
349
- .checkbox-error {
350
- font-size: var(--checkbox-error-fs);
351
- color: var(--checkbox-error-color);
352
- margin-block-start: var(--checkbox-error-margin-block-start);
353
- padding-inline-start: var(--checkbox-error-padding-inline-start);
354
- line-height: 1.5;
355
- }
356
-
357
- /* ============================================================================
358
- Disabled State on Wrapper
359
- ============================================================================ */
360
- [data-checkbox].is-disabled .checkbox-label {
361
- cursor: var(--checkbox-disabled-cursor);
362
- opacity: var(--checkbox-disabled-opacity);
363
- }
364
- [data-checkbox].is-disabled .checkbox-container {
365
- cursor: var(--checkbox-disabled-cursor);
366
- }
367
- [data-checkbox].is-disabled .checkbox-description,
368
- [data-checkbox].is-disabled .checkbox-error {
369
- opacity: var(--checkbox-disabled-opacity);
370
- }
371
-
372
- /*# sourceMappingURL=checkbox.css.map */