@fpkit/acss 3.5.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 (87) hide show
  1. package/libs/components/alert/alert.css +1 -0
  2. package/libs/components/alert/alert.css.map +1 -0
  3. package/libs/components/alert/alert.min.css +3 -0
  4. package/libs/components/badge/badge.css +1 -0
  5. package/libs/components/badge/badge.css.map +1 -0
  6. package/libs/components/badge/badge.min.css +3 -0
  7. package/libs/components/box/box.css +1 -0
  8. package/libs/components/box/box.css.map +1 -0
  9. package/libs/components/box/box.min.css +3 -0
  10. package/libs/components/breadcrumbs/breadcrumb.css +1 -0
  11. package/libs/components/breadcrumbs/breadcrumb.css.map +1 -0
  12. package/libs/components/breadcrumbs/breadcrumb.min.css +3 -0
  13. package/libs/components/buttons/button.css +1 -0
  14. package/libs/components/buttons/button.css.map +1 -0
  15. package/libs/components/buttons/button.min.css +3 -0
  16. package/libs/components/cards/card-style.css +1 -0
  17. package/libs/components/cards/card-style.css.map +1 -0
  18. package/libs/components/cards/card-style.min.css +3 -0
  19. package/libs/components/cards/card.css +1 -0
  20. package/libs/components/cards/card.css.map +1 -0
  21. package/libs/components/cards/card.min.css +3 -0
  22. package/libs/components/cluster/cluster.css +1 -0
  23. package/libs/components/cluster/cluster.css.map +1 -0
  24. package/libs/components/cluster/cluster.min.css +3 -0
  25. package/libs/components/details/details.css +1 -0
  26. package/libs/components/details/details.css.map +1 -0
  27. package/libs/components/details/details.min.css +3 -0
  28. package/libs/components/dialog/dialog.css +1 -0
  29. package/libs/components/dialog/dialog.css.map +1 -0
  30. package/libs/components/dialog/dialog.min.css +3 -0
  31. package/libs/components/flexbox/flex.css +1 -0
  32. package/libs/components/flexbox/flex.css.map +1 -0
  33. package/libs/components/flexbox/flex.min.css +3 -0
  34. package/libs/components/form/form.css +1 -0
  35. package/libs/components/form/form.css.map +1 -0
  36. package/libs/components/form/form.min.css +3 -0
  37. package/libs/components/grid/grid.css +1 -0
  38. package/libs/components/grid/grid.css.map +1 -0
  39. package/libs/components/grid/grid.min.css +3 -0
  40. package/libs/components/icons/icon.css +1 -0
  41. package/libs/components/icons/icon.css.map +1 -0
  42. package/libs/components/icons/icon.min.css +3 -0
  43. package/libs/components/images/img.css +1 -0
  44. package/libs/components/images/img.css.map +1 -0
  45. package/libs/components/images/img.min.css +3 -0
  46. package/libs/components/layout/landmarks.css +1 -0
  47. package/libs/components/layout/landmarks.css.map +1 -0
  48. package/libs/components/layout/landmarks.min.css +3 -0
  49. package/libs/components/link/link.css +1 -0
  50. package/libs/components/link/link.css.map +1 -0
  51. package/libs/components/link/link.min.css +3 -0
  52. package/libs/components/list/list.css +1 -0
  53. package/libs/components/list/list.css.map +1 -0
  54. package/libs/components/list/list.min.css +3 -0
  55. package/libs/components/nav/nav.css +1 -0
  56. package/libs/components/nav/nav.css.map +1 -0
  57. package/libs/components/nav/nav.min.css +3 -0
  58. package/libs/components/progress/progress.css +1 -0
  59. package/libs/components/progress/progress.css.map +1 -0
  60. package/libs/components/progress/progress.min.css +3 -0
  61. package/libs/components/stack/stack.css +1 -0
  62. package/libs/components/stack/stack.css.map +1 -0
  63. package/libs/components/stack/stack.min.css +3 -0
  64. package/libs/components/styles/index.css +1 -0
  65. package/libs/components/styles/index.css.map +1 -0
  66. package/libs/components/styles/index.min.css +3 -0
  67. package/libs/components/tag/tag.css +1 -0
  68. package/libs/components/tag/tag.css.map +1 -0
  69. package/libs/components/tag/tag.min.css +3 -0
  70. package/libs/components/text-to-speech/text-to-speech.css +1 -0
  71. package/libs/components/text-to-speech/text-to-speech.css.map +1 -0
  72. package/libs/components/text-to-speech/text-to-speech.min.css +3 -0
  73. package/libs/index.cjs +5 -5
  74. package/libs/index.cjs.map +1 -1
  75. package/libs/index.css +1 -0
  76. package/libs/index.css.map +1 -0
  77. package/libs/index.d.cts +24 -7
  78. package/libs/index.d.ts +24 -7
  79. package/libs/index.js +4 -4
  80. package/libs/index.js.map +1 -1
  81. package/package.json +2 -2
  82. package/src/components/col/col.stories.tsx +1613 -7
  83. package/src/components/row/row.tsx +9 -0
  84. package/src/components/row/row.types.ts +24 -7
  85. package/src/sass/_columns.scss +122 -3
  86. package/src/styles/index.css +459 -3
  87. package/src/styles/index.css.map +1 -1
@@ -75,6 +75,15 @@ export const Row = React.forwardRef<HTMLElement, RowProps>(
75
75
  },
76
76
  ref
77
77
  ) => {
78
+ // Deprecation warning in development
79
+ if (process.env.NODE_ENV === "development" && alwaysProportional) {
80
+ // eslint-disable-next-line no-console
81
+ console.warn(
82
+ "[fpkit] Row: alwaysProportional is deprecated and will be removed in v5.0.0. " +
83
+ 'Use responsive column utilities instead: className="col-sm-6 col-md-4"'
84
+ );
85
+ }
86
+
78
87
  // Build utility classes array - ALWAYS include base class
79
88
  const utilityClasses: string[] = ["col-row"];
80
89
 
@@ -56,22 +56,39 @@ export interface RowProps
56
56
  wrap?: FlexWrap;
57
57
 
58
58
  /**
59
- * When true, columns maintain their proportional layout on tablets and larger
60
- * instead of stacking to 100% width on all mobile devices (< 768px).
59
+ * @deprecated This prop will be removed in v5.0.0
61
60
  *
62
- * Wrapping behavior with this prop:
63
- * - Mobile phones (< 480px): Columns still stack at 100% width
64
- * - Tablets & larger (≥ 480px): Columns maintain proportional layout
61
+ * Use responsive column utility classes instead for better control across breakpoints.
65
62
  *
66
- * Use this when you want columns to stay side-by-side on tablets and desktops
67
- * but still provide mobile-friendly stacking on phones.
63
+ * Migration path:
64
+ * - Before: `<Row alwaysProportional><Col span={6}>Column</Col></Row>`
65
+ * - After: `<Row><div className="col-sm-6">Column</div></Row>`
66
+ *
67
+ * Responsive utilities provide more flexibility:
68
+ * - Mobile phones (< 480px): `.col-12` (stack full width)
69
+ * - Tablets (≥ 480px): `.col-sm-6` (half width)
70
+ * - Desktops (≥ 1024px): `.col-lg-4` (third width)
68
71
  *
69
72
  * @default false
70
73
  * @example
74
+ * // Deprecated approach
71
75
  * <Row alwaysProportional>
72
76
  * <Col span={6}>Column 1</Col>
73
77
  * <Col span={6}>Column 2</Col>
74
78
  * </Row>
79
+ *
80
+ * @example
81
+ * // Recommended approach with responsive utilities
82
+ * <Row>
83
+ * <div className="col-12 col-sm-6 col-lg-4">Column 1</div>
84
+ * <div className="col-12 col-sm-6 col-lg-4">Column 2</div>
85
+ * </Row>
86
+ *
87
+ * @example
88
+ * // Mix with Col component if needed
89
+ * <Row>
90
+ * <Col span={12} className="col-sm-6 col-lg-4">Column</Col>
91
+ * </Row>
75
92
  */
76
93
  alwaysProportional?: boolean;
77
94
 
@@ -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
  ========================================================================== */
@@ -120,21 +146,68 @@
120
146
  }
121
147
 
122
148
  /* ============================================================================
123
- Proportional Layout Mode (Opt-in)
149
+ Responsive Column Span Utilities (Generated)
150
+ ========================================================================== */
151
+
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
124
188
  ========================================================================== */
125
189
 
126
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
+ *
127
194
  * .col-row-proportional prevents columns from stacking on tablets and larger.
128
195
  * Columns still stack on mobile phones (< 30rem / 480px) for readability,
129
196
  * but maintain proportional widths on tablets and desktops (>= 30rem / 480px).
130
197
  *
131
- * 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):
132
205
  * <Row alwaysProportional>
133
206
  * <Col span={6}>Column 1</Col>
134
207
  * <Col span={6}>Column 2</Col>
135
208
  * </Row>
136
209
  *
137
- * Usage with vanilla HTML:
210
+ * Usage with vanilla HTML (deprecated):
138
211
  * <div className="col-row col-row-proportional">
139
212
  * <div className="col-6">Column 1</div>
140
213
  * <div className="col-6">Column 2</div>
@@ -236,6 +309,27 @@
236
309
  }
237
310
  }
238
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
+ }
331
+ }
332
+
239
333
  /* Optional: Auto-Width Columns */
240
334
  .col-auto {
241
335
  width: auto;
@@ -324,6 +418,31 @@
324
418
  }
325
419
  }
326
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
+ }
444
+ }
445
+
327
446
  /* ============================================================================
328
447
  Row Variant Utilities (for Row React Component)
329
448
  ========================================================================== */