@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
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@fpkit/acss",
3
3
  "description": "A lightweight React UI library for building modern and accessible components that leverage CSS custom properties for reactive Styles.",
4
4
  "private": false,
5
- "version": "3.4.0",
5
+ "version": "3.6.0",
6
6
  "engines": {
7
7
  "node": ">=22.12.0",
8
8
  "npm": ">=8.0.0"
@@ -126,5 +126,5 @@
126
126
  "publishConfig": {
127
127
  "access": "public"
128
128
  },
129
- "gitHead": "81fecf21dac68ced158953775dad7d16f4deffc5"
129
+ "gitHead": "69b02889cd71238da51024e5a0c80edf6cca04d7"
130
130
  }
@@ -20,6 +20,7 @@ utility class composition following the Grid.Item pattern.
20
20
 
21
21
  - **No Base Class**: Pure utility class mapping for maximum flexibility
22
22
  - **Span Control**: 1-12 column widths via the `span` prop
23
+ - **Flex-Grow Columns**: Fill remaining space with `span="flex"`
23
24
  - **Offset Positioning**: Push columns right with `offset` prop
24
25
  - **Visual Reordering**: Change display order with `order` prop
25
26
  - **Auto-Width**: Content-based width with `auto` prop
@@ -40,20 +41,27 @@ Use Col when you need:
40
41
 
41
42
  ### span
42
43
 
43
- Column span (width) from 1-12 columns. Ignored if `auto` is true.
44
+ Column span (width) from 1-12 columns, or "flex" for flex-grow behavior. Ignored
45
+ if `auto` is true.
44
46
 
45
- - **Type**: `1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12`
47
+ - **Type**: `1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | "flex"`
46
48
  - **Default**: `undefined`
47
- - **CSS Class**: `.col-{span}`
48
- - **Calculation**: `span / 12 * 100%`
49
+ - **CSS Class**: `.col-{span}` or `.col-flex`
50
+ - **Calculation**: `span / 12 * 100%` (for numeric values)
49
51
 
50
- **Examples:**
52
+ **Numeric Examples:**
51
53
 
52
54
  - `span={12}` = 100% width (`.col-12`)
53
55
  - `span={6}` = 50% width (`.col-6`)
54
56
  - `span={4}` = 33.33% width (`.col-4`)
55
57
  - `span={3}` = 25% width (`.col-3`)
56
58
 
59
+ **Flex Example:**
60
+
61
+ - `span="flex"` = Grows to fill remaining space (`.col-flex`)
62
+ - Desktop: `flex: 1 1 0%` (grows to fill available space)
63
+ - Mobile: Stacks to 100% width like other columns
64
+
57
65
  ### offset
58
66
 
59
67
  Column offset (left margin) from 0-11 columns. Pushes column to the right.
@@ -85,7 +93,8 @@ Visual display order using flexbox `order` property. Does not change DOM order.
85
93
 
86
94
  ### auto
87
95
 
88
- Auto-width column based on content. Takes precedence over `span`.
96
+ Auto-width column based on content. Takes precedence over `span` (including
97
+ `span="flex"`).
89
98
 
90
99
  - **Type**: `boolean`
91
100
  - **Default**: `false`
@@ -94,6 +103,9 @@ Auto-width column based on content. Takes precedence over `span`.
94
103
  When `true`, column width adjusts to fit content instead of spanning a fixed
95
104
  number of columns.
96
105
 
106
+ **Note**: For columns that grow to fill remaining space (not content-based), use
107
+ `span="flex"` instead of `auto`.
108
+
97
109
  ### as
98
110
 
99
111
  Element type to render. Supports semantic HTML elements.
@@ -208,11 +220,81 @@ function MyLayout() {
208
220
  <Row gap="md">
209
221
  {/* Mix fixed and auto */}
210
222
  <Col span={3}>Fixed 25%</Col>
211
- <Col auto>Auto (fills remaining)</Col>
223
+ <Col auto>Auto width (content-based)</Col>
212
224
  <Col span={2}>Fixed 16.66%</Col>
213
225
  </Row>
214
226
  ```
215
227
 
228
+ ### Flex Columns (Fill Remaining Space)
229
+
230
+ Use `span="flex"` to create columns that grow to fill available space after
231
+ fixed-width columns. This is different from `auto` which sizes to content.
232
+
233
+ ```jsx
234
+ {/* Flex vs Auto Comparison */}
235
+ <Row gap="md">
236
+ <Col span={3}>Fixed 25%</Col>
237
+ <Col span="flex">Flex (grows to fill 75%)</Col>
238
+ </Row>
239
+
240
+ <Row gap="md">
241
+ <Col span={3}>Fixed 25%</Col>
242
+ <Col auto>Auto (sizes to content only)</Col>
243
+ </Row>
244
+ ```
245
+
246
+ **Multiple flex columns share space equally:**
247
+
248
+ ```jsx
249
+ <Row gap="md">
250
+ <Col span={2}>Fixed sidebar</Col>
251
+ <Col span="flex">Section 1 (50% of remaining)</Col>
252
+ <Col span="flex">Section 2 (50% of remaining)</Col>
253
+ </Row>
254
+ ```
255
+
256
+ **Common Patterns:**
257
+
258
+ ```jsx
259
+ {/* Sidebar layout */}
260
+ <Row gap="lg">
261
+ <Col span={3}>Sidebar (25%)</Col>
262
+ <Col span="flex">Main content (grows to fill 75%)</Col>
263
+ </Row>
264
+
265
+ {/* Button group with spacer */}
266
+ <Row gap="sm" align="center">
267
+ <Col auto><Button>Save</Button></Col>
268
+ <Col span="flex">{/* Flexible spacer */}</Col>
269
+ <Col auto><Button>Cancel</Button></Col>
270
+ </Row>
271
+
272
+ {/* App layout */}
273
+ <Row gap="md">
274
+ <Col span={2}>Navigation</Col>
275
+ <Col span="flex">Main Content</Col>
276
+ <Col span={3}>Sidebar</Col>
277
+ </Row>
278
+
279
+ {/* Form layout with label and input */}
280
+ <Row gap="sm" align="center">
281
+ <Col auto><Label>Email:</Label></Col>
282
+ <Col span="flex"><Input type="email" /></Col>
283
+ <Col auto><Button>Subscribe</Button></Col>
284
+ </Row>
285
+ ```
286
+
287
+ **Key Differences:**
288
+
289
+ | Feature | `auto` | `span="flex"` |
290
+ | ----------------- | ---------------------- | --------------------------- |
291
+ | **CSS** | `flex: 0 0 auto` | `flex: 1 1 0%` |
292
+ | **Behavior** | Sizes to content width | Grows to fill space |
293
+ | **Use case** | Buttons, labels, icons | Main content areas |
294
+ | **Mobile** | Content-based | 100% width (stacked) |
295
+ | **Desktop** | Content-based | Fills remaining space |
296
+ | **Multiple cols** | Each sizes to content | Share remaining space equally |
297
+
216
298
  ### Responsive Columns
217
299
 
218
300
  ```jsx
@@ -487,10 +569,11 @@ Use responsive utility classes on Col for breakpoint-specific widths:
487
569
 
488
570
  Col renders with **no base class**. Only utility classes are applied:
489
571
 
490
- - Span: `.col-{1-12}`
572
+ - Span: `.col-{1-12}` (fixed width columns)
573
+ - Flex: `.col-flex` (flex-grow column)
491
574
  - Offset: `.col-offset-{0-11}`
492
575
  - Order: `.col-order-{first|last|0-12}`
493
- - Auto: `.col-auto`
576
+ - Auto: `.col-auto` (content-based width)
494
577
 
495
578
  ### Column Width Calculation
496
579
 
@@ -526,6 +609,52 @@ margin-inline-start = (offset / 12) * 100%
526
609
  `.col-auto` uses `flex: 0 0 auto` with `width: auto`, allowing the column to
527
610
  size based on its content.
528
611
 
612
+ ### Flex-Grow Behavior
613
+
614
+ `.col-flex` uses responsive flex properties to fill remaining space:
615
+
616
+ **Mobile (`< 768px`):**
617
+
618
+ ```css
619
+ .col-flex {
620
+ flex: 0 0 100%; /* Stack to full width */
621
+ min-width: 0;
622
+ box-sizing: border-box;
623
+ }
624
+ ```
625
+
626
+ **Desktop (`≥ 768px`):**
627
+
628
+ ```css
629
+ .col-flex {
630
+ flex: 1 1 0%; /* Grow to fill available space */
631
+ }
632
+ ```
633
+
634
+ **How it works:**
635
+
636
+ - `flex-grow: 1` - Column grows to fill available space
637
+ - `flex-shrink: 1` - Column can shrink if constrained
638
+ - `flex-basis: 0%` - Ensures equal distribution when multiple flex columns exist
639
+ - Multiple flex columns share remaining space equally
640
+
641
+ **Example calculations:**
642
+
643
+ ```jsx
644
+ // Container width: 1200px
645
+ <Row>
646
+ <Col span={3}>Fixed 300px (25%)</Col>
647
+ <Col span="flex">Grows to 900px (75%)</Col>
648
+ </Row>
649
+
650
+ // Multiple flex columns
651
+ <Row>
652
+ <Col span={2}>Fixed 200px (16.67%)</Col>
653
+ <Col span="flex">Flex 1: 500px (41.67%)</Col>
654
+ <Col span="flex">Flex 2: 500px (41.67%)</Col>
655
+ </Row>
656
+ ```
657
+
529
658
  ### Performance
530
659
 
531
660
  Col is a lightweight wrapper with no runtime overhead. All layout calculations