@fpkit/acss 3.3.0 → 3.5.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 (99) hide show
  1. package/libs/index.cjs +22 -20
  2. package/libs/index.cjs.map +1 -1
  3. package/libs/index.d.cts +309 -1
  4. package/libs/index.d.ts +309 -1
  5. package/libs/index.js +9 -9
  6. package/libs/index.js.map +1 -1
  7. package/package.json +2 -2
  8. package/src/components/col/README.mdx +661 -0
  9. package/src/components/col/col.stories.tsx +527 -0
  10. package/src/components/col/col.test.tsx +366 -0
  11. package/src/components/col/col.tsx +107 -0
  12. package/src/components/col/col.types.ts +90 -0
  13. package/src/components/row/README.mdx +324 -0
  14. package/src/components/row/row.stories.tsx +595 -0
  15. package/src/components/row/row.test.tsx +358 -0
  16. package/src/components/row/row.tsx +121 -0
  17. package/src/components/row/row.types.ts +93 -0
  18. package/src/index.scss +1 -0
  19. package/src/index.ts +2 -0
  20. package/src/sass/README.mdx +597 -0
  21. package/src/sass/_columns.scss +394 -0
  22. package/src/sass/columns.stories.tsx +456 -0
  23. package/src/styles/index.css +392 -0
  24. package/src/styles/index.css.map +1 -1
  25. package/src/types/layout-primitives.ts +81 -0
  26. package/libs/components/alert/alert.css +0 -1
  27. package/libs/components/alert/alert.css.map +0 -1
  28. package/libs/components/alert/alert.min.css +0 -3
  29. package/libs/components/badge/badge.css +0 -1
  30. package/libs/components/badge/badge.css.map +0 -1
  31. package/libs/components/badge/badge.min.css +0 -3
  32. package/libs/components/box/box.css +0 -1
  33. package/libs/components/box/box.css.map +0 -1
  34. package/libs/components/box/box.min.css +0 -3
  35. package/libs/components/breadcrumbs/breadcrumb.css +0 -1
  36. package/libs/components/breadcrumbs/breadcrumb.css.map +0 -1
  37. package/libs/components/breadcrumbs/breadcrumb.min.css +0 -3
  38. package/libs/components/buttons/button.css +0 -1
  39. package/libs/components/buttons/button.css.map +0 -1
  40. package/libs/components/buttons/button.min.css +0 -3
  41. package/libs/components/cards/card-style.css +0 -1
  42. package/libs/components/cards/card-style.css.map +0 -1
  43. package/libs/components/cards/card-style.min.css +0 -3
  44. package/libs/components/cards/card.css +0 -1
  45. package/libs/components/cards/card.css.map +0 -1
  46. package/libs/components/cards/card.min.css +0 -3
  47. package/libs/components/cluster/cluster.css +0 -1
  48. package/libs/components/cluster/cluster.css.map +0 -1
  49. package/libs/components/cluster/cluster.min.css +0 -3
  50. package/libs/components/details/details.css +0 -1
  51. package/libs/components/details/details.css.map +0 -1
  52. package/libs/components/details/details.min.css +0 -3
  53. package/libs/components/dialog/dialog.css +0 -1
  54. package/libs/components/dialog/dialog.css.map +0 -1
  55. package/libs/components/dialog/dialog.min.css +0 -3
  56. package/libs/components/flexbox/flex.css +0 -1
  57. package/libs/components/flexbox/flex.css.map +0 -1
  58. package/libs/components/flexbox/flex.min.css +0 -3
  59. package/libs/components/form/form.css +0 -1
  60. package/libs/components/form/form.css.map +0 -1
  61. package/libs/components/form/form.min.css +0 -3
  62. package/libs/components/grid/grid.css +0 -1
  63. package/libs/components/grid/grid.css.map +0 -1
  64. package/libs/components/grid/grid.min.css +0 -3
  65. package/libs/components/icons/icon.css +0 -1
  66. package/libs/components/icons/icon.css.map +0 -1
  67. package/libs/components/icons/icon.min.css +0 -3
  68. package/libs/components/images/img.css +0 -1
  69. package/libs/components/images/img.css.map +0 -1
  70. package/libs/components/images/img.min.css +0 -3
  71. package/libs/components/layout/landmarks.css +0 -1
  72. package/libs/components/layout/landmarks.css.map +0 -1
  73. package/libs/components/layout/landmarks.min.css +0 -3
  74. package/libs/components/link/link.css +0 -1
  75. package/libs/components/link/link.css.map +0 -1
  76. package/libs/components/link/link.min.css +0 -3
  77. package/libs/components/list/list.css +0 -1
  78. package/libs/components/list/list.css.map +0 -1
  79. package/libs/components/list/list.min.css +0 -3
  80. package/libs/components/nav/nav.css +0 -1
  81. package/libs/components/nav/nav.css.map +0 -1
  82. package/libs/components/nav/nav.min.css +0 -3
  83. package/libs/components/progress/progress.css +0 -1
  84. package/libs/components/progress/progress.css.map +0 -1
  85. package/libs/components/progress/progress.min.css +0 -3
  86. package/libs/components/stack/stack.css +0 -1
  87. package/libs/components/stack/stack.css.map +0 -1
  88. package/libs/components/stack/stack.min.css +0 -3
  89. package/libs/components/styles/index.css +0 -1
  90. package/libs/components/styles/index.css.map +0 -1
  91. package/libs/components/styles/index.min.css +0 -3
  92. package/libs/components/tag/tag.css +0 -1
  93. package/libs/components/tag/tag.css.map +0 -1
  94. package/libs/components/tag/tag.min.css +0 -3
  95. package/libs/components/text-to-speech/text-to-speech.css +0 -1
  96. package/libs/components/text-to-speech/text-to-speech.css.map +0 -1
  97. package/libs/components/text-to-speech/text-to-speech.min.css +0 -3
  98. package/libs/index.css +0 -1
  99. package/libs/index.css.map +0 -1
@@ -0,0 +1,366 @@
1
+ import React from "react";
2
+ import { render, screen } from "@testing-library/react";
3
+ import { describe, it, expect } from "vitest";
4
+ import { Col } from "./col";
5
+
6
+ describe("Col Component", () => {
7
+ describe("Rendering", () => {
8
+ it("renders with default props", () => {
9
+ render(<Col>Test content</Col>);
10
+ expect(screen.getByText("Test content")).toBeInTheDocument();
11
+ });
12
+
13
+ it("renders as div by default", () => {
14
+ const { container } = render(<Col>Content</Col>);
15
+ const col = container.firstChild as HTMLElement;
16
+ expect(col.tagName).toBe("DIV");
17
+ });
18
+
19
+ it("renders as specified element type", () => {
20
+ const { container } = render(<Col as="section">Content</Col>);
21
+ const col = container.firstChild as HTMLElement;
22
+ expect(col.tagName).toBe("SECTION");
23
+ });
24
+
25
+ it("renders as li element", () => {
26
+ const { container } = render(<Col as="li">Content</Col>);
27
+ const col = container.firstChild as HTMLElement;
28
+ expect(col.tagName).toBe("LI");
29
+ });
30
+
31
+ it("renders children correctly", () => {
32
+ render(
33
+ <Col>
34
+ <span>Child 1</span>
35
+ <span>Child 2</span>
36
+ </Col>
37
+ );
38
+ expect(screen.getByText("Child 1")).toBeInTheDocument();
39
+ expect(screen.getByText("Child 2")).toBeInTheDocument();
40
+ });
41
+ });
42
+
43
+ describe("No Base Class", () => {
44
+ it("has no classes when no props provided", () => {
45
+ const { container } = render(<Col>Content</Col>);
46
+ const col = container.firstChild as HTMLElement;
47
+ expect(col.className).toBe("");
48
+ });
49
+
50
+ it("does not have a base .col class", () => {
51
+ const { container } = render(<Col span={6}>Content</Col>);
52
+ const col = container.firstChild as HTMLElement;
53
+ expect(col.classList.contains("col")).toBe(false);
54
+ });
55
+ });
56
+
57
+ describe("Span Utilities", () => {
58
+ it("applies col-1 utility class", () => {
59
+ const { container } = render(<Col span={1}>Content</Col>);
60
+ const col = container.firstChild as HTMLElement;
61
+ expect(col).toHaveClass("col-1");
62
+ });
63
+
64
+ it("applies col-6 utility class", () => {
65
+ const { container } = render(<Col span={6}>Content</Col>);
66
+ const col = container.firstChild as HTMLElement;
67
+ expect(col).toHaveClass("col-6");
68
+ });
69
+
70
+ it("applies col-12 utility class", () => {
71
+ const { container } = render(<Col span={12}>Content</Col>);
72
+ const col = container.firstChild as HTMLElement;
73
+ expect(col).toHaveClass("col-12");
74
+ });
75
+
76
+ it("does not apply span class when span is undefined", () => {
77
+ const { container } = render(<Col>Content</Col>);
78
+ const col = container.firstChild as HTMLElement;
79
+ expect(col.className).not.toMatch(/col-\d+/);
80
+ });
81
+
82
+ // Test all span values
83
+ [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].forEach((spanValue) => {
84
+ it(`applies col-${spanValue} for span={${spanValue}}`, () => {
85
+ const { container } = render(<Col span={spanValue as 1}>Content</Col>);
86
+ const col = container.firstChild as HTMLElement;
87
+ expect(col).toHaveClass(`col-${spanValue}`);
88
+ });
89
+ });
90
+ });
91
+
92
+ describe("Auto Width", () => {
93
+ it("applies col-auto utility class", () => {
94
+ const { container } = render(<Col auto>Content</Col>);
95
+ const col = container.firstChild as HTMLElement;
96
+ expect(col).toHaveClass("col-auto");
97
+ });
98
+
99
+ it("auto overrides span when both provided", () => {
100
+ const { container } = render(<Col auto span={6}>Content</Col>);
101
+ const col = container.firstChild as HTMLElement;
102
+ expect(col).toHaveClass("col-auto");
103
+ expect(col).not.toHaveClass("col-6");
104
+ });
105
+
106
+ it("does not apply auto class when auto is false", () => {
107
+ const { container } = render(<Col auto={false} span={6}>Content</Col>);
108
+ const col = container.firstChild as HTMLElement;
109
+ expect(col).not.toHaveClass("col-auto");
110
+ expect(col).toHaveClass("col-6");
111
+ });
112
+ });
113
+
114
+ describe("Flex Column", () => {
115
+ it("applies col-flex utility class when span is 'flex'", () => {
116
+ const { container } = render(<Col span="flex">Content</Col>);
117
+ const col = container.firstChild as HTMLElement;
118
+ expect(col).toHaveClass("col-flex");
119
+ });
120
+
121
+ it("does not apply numeric col class when span is 'flex'", () => {
122
+ const { container } = render(<Col span="flex">Content</Col>);
123
+ const col = container.firstChild as HTMLElement;
124
+ expect(col.className).not.toMatch(/col-\d+/);
125
+ });
126
+
127
+ it("auto overrides flex when both provided", () => {
128
+ const { container } = render(<Col auto span="flex">Content</Col>);
129
+ const col = container.firstChild as HTMLElement;
130
+ expect(col).toHaveClass("col-auto");
131
+ expect(col).not.toHaveClass("col-flex");
132
+ });
133
+
134
+ it("flex column works with offset", () => {
135
+ const { container } = render(<Col span="flex" offset={2}>Content</Col>);
136
+ const col = container.firstChild as HTMLElement;
137
+ expect(col).toHaveClass("col-flex");
138
+ expect(col).toHaveClass("col-offset-2");
139
+ });
140
+
141
+ it("flex column works with order", () => {
142
+ const { container } = render(<Col span="flex" order="first">Content</Col>);
143
+ const col = container.firstChild as HTMLElement;
144
+ expect(col).toHaveClass("col-flex");
145
+ expect(col).toHaveClass("col-order-first");
146
+ });
147
+
148
+ it("flex column works with combined props", () => {
149
+ const { container } = render(
150
+ <Col span="flex" offset={1} order={2}>Content</Col>
151
+ );
152
+ const col = container.firstChild as HTMLElement;
153
+ expect(col).toHaveClass("col-flex");
154
+ expect(col).toHaveClass("col-offset-1");
155
+ expect(col).toHaveClass("col-order-2");
156
+ });
157
+ });
158
+
159
+ describe("Offset Utilities", () => {
160
+ it("applies col-offset-0 utility class", () => {
161
+ const { container } = render(<Col offset={0}>Content</Col>);
162
+ const col = container.firstChild as HTMLElement;
163
+ expect(col).toHaveClass("col-offset-0");
164
+ });
165
+
166
+ it("applies col-offset-3 utility class", () => {
167
+ const { container } = render(<Col offset={3}>Content</Col>);
168
+ const col = container.firstChild as HTMLElement;
169
+ expect(col).toHaveClass("col-offset-3");
170
+ });
171
+
172
+ it("applies col-offset-11 utility class", () => {
173
+ const { container } = render(<Col offset={11}>Content</Col>);
174
+ const col = container.firstChild as HTMLElement;
175
+ expect(col).toHaveClass("col-offset-11");
176
+ });
177
+
178
+ it("does not apply offset class when offset is undefined", () => {
179
+ const { container } = render(<Col span={6}>Content</Col>);
180
+ const col = container.firstChild as HTMLElement;
181
+ expect(col.className).not.toMatch(/col-offset-/);
182
+ });
183
+
184
+ // Test all offset values
185
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11].forEach((offsetValue) => {
186
+ it(`applies col-offset-${offsetValue} for offset={${offsetValue}}`, () => {
187
+ const { container } = render(
188
+ <Col offset={offsetValue as 0}>Content</Col>
189
+ );
190
+ const col = container.firstChild as HTMLElement;
191
+ expect(col).toHaveClass(`col-offset-${offsetValue}`);
192
+ });
193
+ });
194
+ });
195
+
196
+ describe("Order Utilities", () => {
197
+ it("applies col-order-first utility class", () => {
198
+ const { container } = render(<Col order="first">Content</Col>);
199
+ const col = container.firstChild as HTMLElement;
200
+ expect(col).toHaveClass("col-order-first");
201
+ });
202
+
203
+ it("applies col-order-last utility class", () => {
204
+ const { container } = render(<Col order="last">Content</Col>);
205
+ const col = container.firstChild as HTMLElement;
206
+ expect(col).toHaveClass("col-order-last");
207
+ });
208
+
209
+ it("applies col-order-0 utility class", () => {
210
+ const { container } = render(<Col order={0}>Content</Col>);
211
+ const col = container.firstChild as HTMLElement;
212
+ expect(col).toHaveClass("col-order-0");
213
+ });
214
+
215
+ it("applies col-order-5 utility class", () => {
216
+ const { container } = render(<Col order={5}>Content</Col>);
217
+ const col = container.firstChild as HTMLElement;
218
+ expect(col).toHaveClass("col-order-5");
219
+ });
220
+
221
+ it("applies col-order-12 utility class", () => {
222
+ const { container } = render(<Col order={12}>Content</Col>);
223
+ const col = container.firstChild as HTMLElement;
224
+ expect(col).toHaveClass("col-order-12");
225
+ });
226
+
227
+ it("does not apply order class when order is undefined", () => {
228
+ const { container } = render(<Col span={6}>Content</Col>);
229
+ const col = container.firstChild as HTMLElement;
230
+ expect(col.className).not.toMatch(/col-order-/);
231
+ });
232
+
233
+ // Test numeric order values
234
+ [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].forEach((orderValue) => {
235
+ it(`applies col-order-${orderValue} for order={${orderValue}}`, () => {
236
+ const { container } = render(
237
+ <Col order={orderValue as 0}>Content</Col>
238
+ );
239
+ const col = container.firstChild as HTMLElement;
240
+ expect(col).toHaveClass(`col-order-${orderValue}`);
241
+ });
242
+ });
243
+ });
244
+
245
+ describe("Combined Props", () => {
246
+ it("applies span and offset together", () => {
247
+ const { container } = render(<Col span={6} offset={3}>Content</Col>);
248
+ const col = container.firstChild as HTMLElement;
249
+ expect(col).toHaveClass("col-6");
250
+ expect(col).toHaveClass("col-offset-3");
251
+ });
252
+
253
+ it("applies span and order together", () => {
254
+ const { container } = render(<Col span={4} order={2}>Content</Col>);
255
+ const col = container.firstChild as HTMLElement;
256
+ expect(col).toHaveClass("col-4");
257
+ expect(col).toHaveClass("col-order-2");
258
+ });
259
+
260
+ it("applies span, offset, and order together", () => {
261
+ const { container } = render(
262
+ <Col span={4} offset={2} order="first">
263
+ Content
264
+ </Col>
265
+ );
266
+ const col = container.firstChild as HTMLElement;
267
+ expect(col).toHaveClass("col-4");
268
+ expect(col).toHaveClass("col-offset-2");
269
+ expect(col).toHaveClass("col-order-first");
270
+ });
271
+
272
+ it("applies auto, offset, and order together", () => {
273
+ const { container } = render(
274
+ <Col auto offset={1} order="last">
275
+ Content
276
+ </Col>
277
+ );
278
+ const col = container.firstChild as HTMLElement;
279
+ expect(col).toHaveClass("col-auto");
280
+ expect(col).toHaveClass("col-offset-1");
281
+ expect(col).toHaveClass("col-order-last");
282
+ });
283
+ });
284
+
285
+ describe("Custom Classes", () => {
286
+ it("merges className prop with utility classes", () => {
287
+ const { container } = render(
288
+ <Col className="custom-class" span={6}>
289
+ Content
290
+ </Col>
291
+ );
292
+ const col = container.firstChild as HTMLElement;
293
+ expect(col).toHaveClass("col-6");
294
+ expect(col).toHaveClass("custom-class");
295
+ });
296
+
297
+ it("merges classes prop with utility classes", () => {
298
+ const { container } = render(
299
+ <Col classes="another-class" span={4}>
300
+ Content
301
+ </Col>
302
+ );
303
+ const col = container.firstChild as HTMLElement;
304
+ expect(col).toHaveClass("col-4");
305
+ expect(col).toHaveClass("another-class");
306
+ });
307
+
308
+ it("merges both className and classes props", () => {
309
+ const { container } = render(
310
+ <Col className="class-one" classes="class-two" span={6}>
311
+ Content
312
+ </Col>
313
+ );
314
+ const col = container.firstChild as HTMLElement;
315
+ expect(col).toHaveClass("col-6");
316
+ expect(col).toHaveClass("class-one");
317
+ expect(col).toHaveClass("class-two");
318
+ });
319
+
320
+ it("allows custom classes without utility props", () => {
321
+ const { container } = render(
322
+ <Col className="custom-only">Content</Col>
323
+ );
324
+ const col = container.firstChild as HTMLElement;
325
+ expect(col).toHaveClass("custom-only");
326
+ });
327
+ });
328
+
329
+ describe("Ref Forwarding", () => {
330
+ it("forwards ref to the underlying element", () => {
331
+ const ref = { current: null };
332
+ render(<Col ref={ref}>Content</Col>);
333
+ expect(ref.current).toBeInstanceOf(HTMLDivElement);
334
+ });
335
+
336
+ it("forwards ref with custom element type", () => {
337
+ const ref = { current: null };
338
+ render(
339
+ <Col ref={ref} as="section">
340
+ Content
341
+ </Col>
342
+ );
343
+ expect(ref.current).toBeInstanceOf(HTMLElement);
344
+ expect((ref.current as unknown as HTMLElement).tagName).toBe("SECTION");
345
+ });
346
+ });
347
+
348
+ describe("Additional Props", () => {
349
+ it("passes through additional HTML attributes", () => {
350
+ const { container } = render(
351
+ <Col data-testid="test-col" aria-label="Test Column" span={6}>
352
+ Content
353
+ </Col>
354
+ );
355
+ const col = container.firstChild as HTMLElement;
356
+ expect(col).toHaveAttribute("data-testid", "test-col");
357
+ expect(col).toHaveAttribute("aria-label", "Test Column");
358
+ });
359
+
360
+ it("handles id prop", () => {
361
+ const { container } = render(<Col id="my-col" span={6}>Content</Col>);
362
+ const col = container.firstChild as HTMLElement;
363
+ expect(col).toHaveAttribute("id", "my-col");
364
+ });
365
+ });
366
+ });
@@ -0,0 +1,107 @@
1
+ import React from "react";
2
+ import UI from "../ui";
3
+ import type { ColProps } from "./col.types";
4
+
5
+ // Re-export types for convenience
6
+ export type { ColProps } from "./col.types";
7
+
8
+ /**
9
+ * Col - A column component for 12-column layouts.
10
+ *
11
+ * Col provides a type-safe React wrapper around column utility classes,
12
+ * allowing developers to create responsive columns with span, offset, order,
13
+ * and auto-width options. Unlike Row, Col has no base class - it's pure
14
+ * utility class composition.
15
+ *
16
+ * ## Key Features
17
+ * - **No base class**: Pure utility class mapping (follows Grid.Item pattern)
18
+ * - **Span control**: 1-12 column widths via span prop
19
+ * - **Offset positioning**: Push columns right with offset prop
20
+ * - **Visual reordering**: Change order with order prop
21
+ * - **Auto-width**: Content-based width with auto prop
22
+ * - **Polymorphic**: Render as any semantic HTML element
23
+ * - **Type-Safe**: Full TypeScript support with literal types
24
+ *
25
+ * ## Use Cases
26
+ * - Responsive column layouts
27
+ * - Grid-based designs
28
+ * - Content positioning
29
+ * - Visual reordering
30
+ *
31
+ * @example
32
+ * // Basic 50% column
33
+ * <Col span={6}>Half width column</Col>
34
+ *
35
+ * @example
36
+ * // Centered column with offset
37
+ * <Col span={6} offset={3}>Centered column</Col>
38
+ *
39
+ * @example
40
+ * // Auto-width column
41
+ * <Col auto>Content-based width</Col>
42
+ *
43
+ * @example
44
+ * // Reordered column
45
+ * <Col span={6} order="first">Appears first visually</Col>
46
+ *
47
+ * @example
48
+ * // Semantic HTML
49
+ * <Row as="ul">
50
+ * <Col as="li" span={4}>List item</Col>
51
+ * </Row>
52
+ *
53
+ * @see {@link ColProps} for complete props documentation
54
+ */
55
+ export const Col = React.forwardRef<HTMLElement, ColProps>(
56
+ (
57
+ {
58
+ span,
59
+ offset,
60
+ order,
61
+ auto = false,
62
+ as = "div",
63
+ className,
64
+ classes,
65
+ children,
66
+ ...props
67
+ },
68
+ ref
69
+ ) => {
70
+ // Build utility classes array - NO base class
71
+ const utilityClasses: string[] = [];
72
+
73
+ // Auto takes precedence over span (including "flex")
74
+ if (auto) {
75
+ utilityClasses.push("col-auto");
76
+ } else if (span === "flex") {
77
+ utilityClasses.push("col-flex");
78
+ } else if (span) {
79
+ utilityClasses.push(`col-${span}`);
80
+ }
81
+
82
+ // Offset utilities
83
+ if (offset !== undefined) {
84
+ utilityClasses.push(`col-offset-${offset}`);
85
+ }
86
+
87
+ // Order utilities
88
+ if (order !== undefined) {
89
+ utilityClasses.push(`col-order-${order}`);
90
+ }
91
+
92
+ // Merge all classes: utilities + className + classes
93
+ const allClasses = [...utilityClasses, className, classes]
94
+ .filter(Boolean)
95
+ .join(" ");
96
+
97
+ return (
98
+ <UI as={as} ref={ref} classes={allClasses} {...props}>
99
+ {children}
100
+ </UI>
101
+ );
102
+ }
103
+ );
104
+
105
+ Col.displayName = "Col";
106
+
107
+ export default Col;
@@ -0,0 +1,90 @@
1
+ import type { ComponentProps } from "../../types/component-props";
2
+ import type {
3
+ ColElement,
4
+ ColumnSpan,
5
+ ColumnOffset,
6
+ ColumnOrder,
7
+ } from "../../types/layout-primitives";
8
+
9
+ /**
10
+ * Props for the Col component
11
+ *
12
+ * Col provides a column element for use within Row containers. Maps React
13
+ * props to column utility classes (.col-*, .col-offset-*, .col-order-*,
14
+ * .col-auto) without a base class. Pure utility class composition.
15
+ *
16
+ * @example
17
+ * // Basic column with 50% width
18
+ * <Col span={6}>Column content</Col>
19
+ *
20
+ * @example
21
+ * // Column with offset and order
22
+ * <Col span={4} offset={2} order={1}>
23
+ * Offset and reordered
24
+ * </Col>
25
+ */
26
+ export interface ColProps
27
+ extends Partial<ComponentProps>,
28
+ Omit<React.HTMLAttributes<HTMLElement>, "className"> {
29
+ /**
30
+ * Column span (1-12 or "flex")
31
+ *
32
+ * - Numeric values (1-12): Maps to .col-{span} utility class (fixed width)
33
+ * - "flex": Maps to .col-flex utility class (grows to fill space)
34
+ *
35
+ * Ignored if auto is true (auto takes precedence)
36
+ *
37
+ * @default undefined
38
+ *
39
+ * @example
40
+ * // Fixed width column
41
+ * <Col span={6}>50% width on desktop</Col>
42
+ *
43
+ * @example
44
+ * // Flex column fills remaining space
45
+ * <Col span="flex">Grows to fill available space</Col>
46
+ */
47
+ span?: ColumnSpan;
48
+
49
+ /**
50
+ * Column offset (0-11)
51
+ * Pushes column to the right using margin-inline-start
52
+ * Maps to .col-offset-{offset} utility class
53
+ * @default undefined
54
+ */
55
+ offset?: ColumnOffset;
56
+
57
+ /**
58
+ * Column order
59
+ * Controls visual order using flexbox order property
60
+ * Maps to .col-order-{order} utility class
61
+ * @default undefined
62
+ */
63
+ order?: ColumnOrder;
64
+
65
+ /**
66
+ * Auto-width column
67
+ * When true, uses .col-auto (content-based width)
68
+ * Takes precedence over span prop (including "flex")
69
+ * @default false
70
+ *
71
+ * @see span - For flex-grow behavior, use span="flex" instead of auto
72
+ */
73
+ auto?: boolean;
74
+
75
+ /**
76
+ * Element type to render
77
+ * @default "div"
78
+ */
79
+ as?: ColElement;
80
+
81
+ /**
82
+ * Additional CSS classes
83
+ */
84
+ className?: string;
85
+
86
+ /**
87
+ * Child elements
88
+ */
89
+ children?: React.ReactNode;
90
+ }