@fpkit/acss 3.4.0 → 3.6.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 (44) hide show
  1. package/libs/index.cjs +5 -5
  2. package/libs/index.cjs.map +1 -1
  3. package/libs/index.css +1 -1
  4. package/libs/index.css.map +1 -1
  5. package/libs/index.d.cts +64 -13
  6. package/libs/index.d.ts +64 -13
  7. package/libs/index.js +4 -4
  8. package/libs/index.js.map +1 -1
  9. package/package.json +2 -2
  10. package/src/components/col/README.mdx +138 -9
  11. package/src/components/col/col.stories.tsx +1711 -2
  12. package/src/components/col/col.test.tsx +45 -0
  13. package/src/components/col/col.tsx +3 -1
  14. package/src/components/col/col.types.ts +18 -4
  15. package/src/components/row/row.tsx +9 -0
  16. package/src/components/row/row.types.ts +24 -7
  17. package/src/sass/_columns.scss +396 -81
  18. package/src/styles/index.css +515 -7
  19. package/src/styles/index.css.map +1 -1
  20. package/src/types/layout-primitives.ts +22 -2
  21. package/libs/components/alert/alert.min.min.css +0 -2
  22. package/libs/components/badge/badge.min.min.css +0 -2
  23. package/libs/components/box/box.min.min.css +0 -2
  24. package/libs/components/breadcrumbs/breadcrumb.min.min.css +0 -2
  25. package/libs/components/buttons/button.min.min.css +0 -2
  26. package/libs/components/cards/card-style.min.min.css +0 -2
  27. package/libs/components/cards/card.min.min.css +0 -2
  28. package/libs/components/cluster/cluster.min.min.css +0 -2
  29. package/libs/components/details/details.min.min.css +0 -2
  30. package/libs/components/dialog/dialog.min.min.css +0 -2
  31. package/libs/components/flexbox/flex.min.min.css +0 -2
  32. package/libs/components/form/form.min.min.css +0 -2
  33. package/libs/components/grid/grid.min.min.css +0 -2
  34. package/libs/components/icons/icon.min.min.css +0 -2
  35. package/libs/components/images/img.min.min.css +0 -2
  36. package/libs/components/layout/landmarks.min.min.css +0 -2
  37. package/libs/components/link/link.min.min.css +0 -2
  38. package/libs/components/list/list.min.min.css +0 -2
  39. package/libs/components/nav/nav.min.min.css +0 -2
  40. package/libs/components/progress/progress.min.min.css +0 -2
  41. package/libs/components/stack/stack.min.min.css +0 -2
  42. package/libs/components/styles/index.min.min.css +0 -2
  43. package/libs/components/tag/tag.min.min.css +0 -2
  44. package/libs/components/text-to-speech/text-to-speech.min.min.css +0 -2
@@ -30,6 +30,32 @@
30
30
  --col-12: 100%;
31
31
  }
32
32
 
33
+ /**
34
+ * Responsive Breakpoints (mobile-first)
35
+ * These CSS custom properties document the breakpoint values and can be
36
+ * accessed via JavaScript. SCSS uses literal values for media queries.
37
+ */
38
+ :root {
39
+ --col-breakpoint-xs: 0rem; /* 0px - base mobile */
40
+ --col-breakpoint-sm: 30rem; /* 480px - large phones */
41
+ --col-breakpoint-md: 48rem; /* 768px - tablets */
42
+ --col-breakpoint-lg: 64rem; /* 1024px - desktops */
43
+
44
+ /* Legacy support - keep for backward compatibility */
45
+ --col-breakpoint: var(--col-breakpoint-md);
46
+ }
47
+
48
+ /**
49
+ * Breakpoint map for SCSS loop generation
50
+ * Uses literal rem values (not CSS custom properties) because
51
+ * @media queries require compile-time values, not runtime CSS variables.
52
+ */
53
+ $col-breakpoints: (
54
+ 'sm': 30rem,
55
+ 'md': 48rem,
56
+ 'lg': 64rem,
57
+ );
58
+
33
59
  /* ============================================================================
34
60
  Row Container Utility (Optional)
35
61
  ========================================================================== */
@@ -47,17 +73,29 @@
47
73
  .col-row {
48
74
  display: flex;
49
75
  flex-wrap: wrap;
50
- gap: var(--spacing-md); /* Default gap - can be overridden with gap utilities */
76
+ gap: var(
77
+ --spacing-md
78
+ ); /* Default gap - can be overridden with gap utilities */
51
79
  }
52
80
 
53
81
  /* ============================================================================
54
82
  Base Column Classes - Mobile First (100% width)
55
83
  ========================================================================== */
56
84
 
57
- .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
58
- .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
59
- flex: 0 0 100%; /* flex-grow flex-shrink flex-basis */
60
- min-width: 0; /* Prevent content overflow in flex containers */
85
+ .col-1,
86
+ .col-2,
87
+ .col-3,
88
+ .col-4,
89
+ .col-5,
90
+ .col-6,
91
+ .col-7,
92
+ .col-8,
93
+ .col-9,
94
+ .col-10,
95
+ .col-11,
96
+ .col-12 {
97
+ flex: 0 0 100%; /* flex-grow flex-shrink flex-basis */
98
+ min-width: 0; /* Prevent content overflow in flex containers */
61
99
  box-sizing: border-box;
62
100
  }
63
101
 
@@ -68,36 +106,108 @@
68
106
  flex-wrap: nowrap;
69
107
  }
70
108
 
71
- .col-1 { flex: 0 1 var(--col-1); }
72
- .col-2 { flex: 0 1 var(--col-2); }
73
- .col-3 { flex: 0 1 var(--col-3); }
74
- .col-4 { flex: 0 1 var(--col-4); }
75
- .col-5 { flex: 0 1 var(--col-5); }
76
- .col-6 { flex: 0 1 var(--col-6); }
77
- .col-7 { flex: 0 1 var(--col-7); }
78
- .col-8 { flex: 0 1 var(--col-8); }
79
- .col-9 { flex: 0 1 var(--col-9); }
80
- .col-10 { flex: 0 1 var(--col-10); }
81
- .col-11 { flex: 0 1 var(--col-11); }
82
- .col-12 { flex: 0 1 var(--col-12); }
109
+ .col-1 {
110
+ flex: 0 1 var(--col-1);
111
+ }
112
+
113
+ .col-2 {
114
+ flex: 0 1 var(--col-2);
115
+ }
116
+ .col-3 {
117
+ flex: 0 1 var(--col-3);
118
+ }
119
+ .col-4 {
120
+ flex: 0 1 var(--col-4);
121
+ }
122
+ .col-5 {
123
+ flex: 0 1 var(--col-5);
124
+ }
125
+ .col-6 {
126
+ flex: 0 1 var(--col-6);
127
+ }
128
+ .col-7 {
129
+ flex: 0 1 var(--col-7);
130
+ }
131
+ .col-8 {
132
+ flex: 0 1 var(--col-8);
133
+ }
134
+ .col-9 {
135
+ flex: 0 1 var(--col-9);
136
+ }
137
+ .col-10 {
138
+ flex: 0 1 var(--col-10);
139
+ }
140
+ .col-11 {
141
+ flex: 0 1 var(--col-11);
142
+ }
143
+ .col-12 {
144
+ flex: 0 1 var(--col-12);
145
+ }
83
146
  }
84
147
 
85
148
  /* ============================================================================
86
- Proportional Layout Mode (Opt-in)
149
+ Responsive Column Span Utilities (Generated)
87
150
  ========================================================================== */
88
151
 
89
152
  /**
153
+ * Generate responsive span utilities for all breakpoints
154
+ * Produces: .col-{sm|md|lg}-{1-12}, .col-{sm|md|lg}-auto, .col-{sm|md|lg}-flex
155
+ *
156
+ * These utilities enable mobile-first responsive layouts where columns can
157
+ * have different widths at different breakpoints. For example:
158
+ * .col-12.col-md-6.col-lg-4 creates a layout that:
159
+ * - Stacks full-width (100%) on mobile (< 768px)
160
+ * - Shows 2 columns (50%) on tablets (>= 768px)
161
+ * - Shows 3 columns (33.33%) on desktops (>= 1024px)
162
+ */
163
+ @each $breakpoint, $min-width in $col-breakpoints {
164
+ @media (width >= #{$min-width}) {
165
+ // Generate .col-{breakpoint}-{1-12} classes
166
+ @for $i from 1 through 12 {
167
+ .col-#{$breakpoint}-#{$i} {
168
+ flex: 0 1 var(--col-#{$i});
169
+ }
170
+ }
171
+
172
+ // Auto-width variant - sizes to content
173
+ .col-#{$breakpoint}-auto {
174
+ flex: 0 0 auto;
175
+ width: auto;
176
+ }
177
+
178
+ // Flex-grow variant - grows to fill remaining space
179
+ .col-#{$breakpoint}-flex {
180
+ flex: 1 1 0%;
181
+ min-width: 0;
182
+ }
183
+ }
184
+ }
185
+
186
+ /* ============================================================================
187
+ DEPRECATED: Proportional Layout Mode
188
+ ========================================================================== */
189
+
190
+ /**
191
+ * @deprecated Use responsive utility classes instead (.col-sm-*, .col-md-*, .col-lg-*)
192
+ * This class will be removed in v5.0.0
193
+ *
90
194
  * .col-row-proportional prevents columns from stacking on tablets and larger.
91
195
  * Columns still stack on mobile phones (< 30rem / 480px) for readability,
92
196
  * but maintain proportional widths on tablets and desktops (>= 30rem / 480px).
93
197
  *
94
- * Usage with Row component:
198
+ * Migration:
199
+ * Before: <Row alwaysProportional><Col span={6} /></Row>
200
+ * After: <Row><div className="col-sm-6" /></Row>
201
+ *
202
+ * Backward compatibility maintained for now, but use responsive utilities for new code.
203
+ *
204
+ * Usage with Row component (deprecated):
95
205
  * <Row alwaysProportional>
96
206
  * <Col span={6}>Column 1</Col>
97
207
  * <Col span={6}>Column 2</Col>
98
208
  * </Row>
99
209
  *
100
- * Usage with vanilla HTML:
210
+ * Usage with vanilla HTML (deprecated):
101
211
  * <div className="col-row col-row-proportional">
102
212
  * <div className="col-6">Column 1</div>
103
213
  * <div className="col-6">Column 2</div>
@@ -105,40 +215,119 @@
105
215
  */
106
216
  @media (width >= 30rem) {
107
217
  .col-row-proportional {
108
- .col-1, .col-2, .col-3, .col-4, .col-5, .col-6,
109
- .col-7, .col-8, .col-9, .col-10, .col-11, .col-12 {
110
- flex: 0 1 auto; /* Allow proportional sizing with shrink */
218
+ .col-1,
219
+ .col-2,
220
+ .col-3,
221
+ .col-4,
222
+ .col-5,
223
+ .col-6,
224
+ .col-7,
225
+ .col-8,
226
+ .col-9,
227
+ .col-10,
228
+ .col-11,
229
+ .col-12 {
230
+ flex: 0 1 auto; /* Allow proportional sizing with shrink */
111
231
  }
112
232
 
113
- .col-1 { flex-basis: var(--col-1); }
114
- .col-2 { flex-basis: var(--col-2); }
115
- .col-3 { flex-basis: var(--col-3); }
116
- .col-4 { flex-basis: var(--col-4); }
117
- .col-5 { flex-basis: var(--col-5); }
118
- .col-6 { flex-basis: var(--col-6); }
119
- .col-7 { flex-basis: var(--col-7); }
120
- .col-8 { flex-basis: var(--col-8); }
121
- .col-9 { flex-basis: var(--col-9); }
122
- .col-10 { flex-basis: var(--col-10); }
123
- .col-11 { flex-basis: var(--col-11); }
124
- .col-12 { flex-basis: var(--col-12); }
233
+ .col-1 {
234
+ flex-basis: var(--col-1);
235
+ }
236
+ .col-2 {
237
+ flex-basis: var(--col-2);
238
+ }
239
+ .col-3 {
240
+ flex-basis: var(--col-3);
241
+ }
242
+ .col-4 {
243
+ flex-basis: var(--col-4);
244
+ }
245
+ .col-5 {
246
+ flex-basis: var(--col-5);
247
+ }
248
+ .col-6 {
249
+ flex-basis: var(--col-6);
250
+ }
251
+ .col-7 {
252
+ flex-basis: var(--col-7);
253
+ }
254
+ .col-8 {
255
+ flex-basis: var(--col-8);
256
+ }
257
+ .col-9 {
258
+ flex-basis: var(--col-9);
259
+ }
260
+ .col-10 {
261
+ flex-basis: var(--col-10);
262
+ }
263
+ .col-11 {
264
+ flex-basis: var(--col-11);
265
+ }
266
+ .col-12 {
267
+ flex-basis: var(--col-12);
268
+ }
125
269
  }
126
270
  }
127
271
 
128
272
  /* Optional: Column Offset Utilities */
129
273
  @media (width >= 48rem) {
130
- .col-offset-0 { margin-inline-start: 0; }
131
- .col-offset-1 { margin-inline-start: var(--col-1); }
132
- .col-offset-2 { margin-inline-start: var(--col-2); }
133
- .col-offset-3 { margin-inline-start: var(--col-3); }
134
- .col-offset-4 { margin-inline-start: var(--col-4); }
135
- .col-offset-5 { margin-inline-start: var(--col-5); }
136
- .col-offset-6 { margin-inline-start: var(--col-6); }
137
- .col-offset-7 { margin-inline-start: var(--col-7); }
138
- .col-offset-8 { margin-inline-start: var(--col-8); }
139
- .col-offset-9 { margin-inline-start: var(--col-9); }
140
- .col-offset-10 { margin-inline-start: var(--col-10); }
141
- .col-offset-11 { margin-inline-start: var(--col-11); }
274
+ .col-offset-0 {
275
+ margin-inline-start: 0;
276
+ }
277
+ .col-offset-1 {
278
+ margin-inline-start: var(--col-1);
279
+ }
280
+ .col-offset-2 {
281
+ margin-inline-start: var(--col-2);
282
+ }
283
+ .col-offset-3 {
284
+ margin-inline-start: var(--col-3);
285
+ }
286
+ .col-offset-4 {
287
+ margin-inline-start: var(--col-4);
288
+ }
289
+ .col-offset-5 {
290
+ margin-inline-start: var(--col-5);
291
+ }
292
+ .col-offset-6 {
293
+ margin-inline-start: var(--col-6);
294
+ }
295
+ .col-offset-7 {
296
+ margin-inline-start: var(--col-7);
297
+ }
298
+ .col-offset-8 {
299
+ margin-inline-start: var(--col-8);
300
+ }
301
+ .col-offset-9 {
302
+ margin-inline-start: var(--col-9);
303
+ }
304
+ .col-offset-10 {
305
+ margin-inline-start: var(--col-10);
306
+ }
307
+ .col-offset-11 {
308
+ margin-inline-start: var(--col-11);
309
+ }
310
+ }
311
+
312
+ /* ============================================================================
313
+ Responsive Column Offset Utilities (Generated)
314
+ ========================================================================== */
315
+
316
+ /**
317
+ * Generate responsive offset utilities for all breakpoints
318
+ * Produces: .col-{sm|md|lg}-offset-{0-11}
319
+ *
320
+ * Responsive offsets enable pushing columns to the right at specific breakpoints.
321
+ * For example: .col-md-offset-3 adds left margin equal to 3 columns on tablets+
322
+ */
323
+ @each $breakpoint, $min-width in $col-breakpoints {
324
+ @media (width >= #{$min-width}) {
325
+ @for $i from 0 through 11 {
326
+ .col-#{$breakpoint}-offset-#{$i} {
327
+ margin-inline-start: if($i == 0, 0, var(--col-#{$i}));
328
+ }
329
+ }
330
+ }
142
331
  }
143
332
 
144
333
  /* Optional: Auto-Width Columns */
@@ -147,23 +336,111 @@
147
336
  flex: 0 0 auto;
148
337
  }
149
338
 
339
+ /* Optional: Flex-Grow Columns */
340
+ /**
341
+ * .col-flex provides a column that grows to fill remaining space.
342
+ * Different from .col-auto (content-based) - this uses flex-grow.
343
+ *
344
+ * Key Differences:
345
+ * - .col-auto: Sizes to content width (flex: 0 0 auto)
346
+ * - .col-flex: Grows to fill space (flex: 1 1 0%)
347
+ *
348
+ * Responsive Behavior:
349
+ * - Mobile (< 48rem): 100% width (stacked)
350
+ * - Desktop (>= 48rem): Grows to fill remaining space
351
+ *
352
+ * Usage:
353
+ * <Row>
354
+ * <Col span={3}>Fixed 25%</Col>
355
+ * <Col span="flex">Fills remaining 75%</Col>
356
+ * </Row>
357
+ */
358
+ .col-flex {
359
+ /* Mobile: Stack like all columns */
360
+ flex: 0 0 100%;
361
+ min-width: 0; /* Prevent content overflow */
362
+ box-sizing: border-box;
363
+ }
364
+
365
+ /* Desktop: Grow to fill available space */
366
+ @media (width >= 48rem) {
367
+ .col-flex {
368
+ flex: 1 1 0%; /* flex-grow: 1, flex-shrink: 1, flex-basis: 0% */
369
+ }
370
+ }
371
+
150
372
  /* Optional: Column Order Utilities */
151
373
  @media (width >= 48rem) {
152
- .col-order-first { order: -1; }
153
- .col-order-last { order: 13; }
154
- .col-order-0 { order: 0; }
155
- .col-order-1 { order: 1; }
156
- .col-order-2 { order: 2; }
157
- .col-order-3 { order: 3; }
158
- .col-order-4 { order: 4; }
159
- .col-order-5 { order: 5; }
160
- .col-order-6 { order: 6; }
161
- .col-order-7 { order: 7; }
162
- .col-order-8 { order: 8; }
163
- .col-order-9 { order: 9; }
164
- .col-order-10 { order: 10; }
165
- .col-order-11 { order: 11; }
166
- .col-order-12 { order: 12; }
374
+ .col-order-first {
375
+ order: -1;
376
+ }
377
+ .col-order-last {
378
+ order: 13;
379
+ }
380
+ .col-order-0 {
381
+ order: 0;
382
+ }
383
+ .col-order-1 {
384
+ order: 1;
385
+ }
386
+ .col-order-2 {
387
+ order: 2;
388
+ }
389
+ .col-order-3 {
390
+ order: 3;
391
+ }
392
+ .col-order-4 {
393
+ order: 4;
394
+ }
395
+ .col-order-5 {
396
+ order: 5;
397
+ }
398
+ .col-order-6 {
399
+ order: 6;
400
+ }
401
+ .col-order-7 {
402
+ order: 7;
403
+ }
404
+ .col-order-8 {
405
+ order: 8;
406
+ }
407
+ .col-order-9 {
408
+ order: 9;
409
+ }
410
+ .col-order-10 {
411
+ order: 10;
412
+ }
413
+ .col-order-11 {
414
+ order: 11;
415
+ }
416
+ .col-order-12 {
417
+ order: 12;
418
+ }
419
+ }
420
+
421
+ /* ============================================================================
422
+ Responsive Column Order Utilities (Generated)
423
+ ========================================================================== */
424
+
425
+ /**
426
+ * Generate responsive order utilities for all breakpoints
427
+ * Produces: .col-{sm|md|lg}-order-{first|last|0-12}
428
+ *
429
+ * Responsive ordering enables reordering columns at specific breakpoints.
430
+ * Visual order changes don't affect DOM order (important for accessibility).
431
+ * For example: .col-md-order-2 sets order:2 on tablets+
432
+ */
433
+ @each $breakpoint, $min-width in $col-breakpoints {
434
+ @media (width >= #{$min-width}) {
435
+ .col-#{$breakpoint}-order-first { order: -1; }
436
+ .col-#{$breakpoint}-order-last { order: 13; }
437
+
438
+ @for $i from 0 through 12 {
439
+ .col-#{$breakpoint}-order-#{$i} {
440
+ order: $i;
441
+ }
442
+ }
443
+ }
167
444
  }
168
445
 
169
446
  /* ============================================================================
@@ -171,28 +448,66 @@
171
448
  ========================================================================== */
172
449
 
173
450
  /* Row Gap Utilities - Override default gap */
174
- .col-row-gap-0 { gap: 0; }
175
- .col-row-gap-xs { gap: var(--spacing-xs); }
176
- .col-row-gap-sm { gap: var(--spacing-sm); }
177
- .col-row-gap-md { gap: var(--spacing-md); }
178
- .col-row-gap-lg { gap: var(--spacing-lg); }
179
- .col-row-gap-xl { gap: var(--spacing-xl); }
451
+ .col-row-gap-0 {
452
+ gap: 0;
453
+ }
454
+ .col-row-gap-xs {
455
+ gap: var(--spacing-xs);
456
+ }
457
+ .col-row-gap-sm {
458
+ gap: var(--spacing-sm);
459
+ }
460
+ .col-row-gap-md {
461
+ gap: var(--spacing-md);
462
+ }
463
+ .col-row-gap-lg {
464
+ gap: var(--spacing-lg);
465
+ }
466
+ .col-row-gap-xl {
467
+ gap: var(--spacing-xl);
468
+ }
180
469
 
181
470
  /* Row Justify Content Utilities */
182
- .col-row-justify-start { justify-content: flex-start; }
183
- .col-row-justify-center { justify-content: center; }
184
- .col-row-justify-end { justify-content: flex-end; }
185
- .col-row-justify-between { justify-content: space-between; }
186
- .col-row-justify-around { justify-content: space-around; }
187
- .col-row-justify-evenly { justify-content: space-evenly; }
471
+ .col-row-justify-start {
472
+ justify-content: flex-start;
473
+ }
474
+ .col-row-justify-center {
475
+ justify-content: center;
476
+ }
477
+ .col-row-justify-end {
478
+ justify-content: flex-end;
479
+ }
480
+ .col-row-justify-between {
481
+ justify-content: space-between;
482
+ }
483
+ .col-row-justify-around {
484
+ justify-content: space-around;
485
+ }
486
+ .col-row-justify-evenly {
487
+ justify-content: space-evenly;
488
+ }
188
489
 
189
490
  /* Row Align Items Utilities */
190
- .col-row-align-start { align-items: flex-start; }
191
- .col-row-align-center { align-items: center; }
192
- .col-row-align-end { align-items: flex-end; }
193
- .col-row-align-baseline { align-items: baseline; }
194
- .col-row-align-stretch { align-items: stretch; }
491
+ .col-row-align-start {
492
+ align-items: flex-start;
493
+ }
494
+ .col-row-align-center {
495
+ align-items: center;
496
+ }
497
+ .col-row-align-end {
498
+ align-items: flex-end;
499
+ }
500
+ .col-row-align-baseline {
501
+ align-items: baseline;
502
+ }
503
+ .col-row-align-stretch {
504
+ align-items: stretch;
505
+ }
195
506
 
196
507
  /* Row Wrap Utilities */
197
- .col-row-nowrap { flex-wrap: nowrap; }
198
- .col-row-wrap-reverse { flex-wrap: wrap-reverse; }
508
+ .col-row-nowrap {
509
+ flex-wrap: nowrap;
510
+ }
511
+ .col-row-wrap-reverse {
512
+ flex-wrap: wrap-reverse;
513
+ }