@kolkrabbi/kol-component 0.47.1 → 0.48.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-component",
3
- "version": "0.47.1",
3
+ "version": "0.48.0",
4
4
  "description": "KOL design-system components — atoms through organisms, emitting canonical kol-* classes. Pairs with @kolkrabbi/kol-theme for styling.",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -13,14 +13,28 @@ import usePrefersReducedMotion from '../hooks/usePrefersReducedMotion.js'
13
13
  * ponytail: form switch re-mounts with a stagger, no FLIP — add FLIP
14
14
  * (measure → invert → play) when a consumer needs card↔row to tween.
15
15
  *
16
+ * BOTH FORMS ARE GRIDS (user call 2026-08-15: *"layout always wraps the items
17
+ * in a grid, at least 99% of the time"*). `list` is not a single column — it is
18
+ * the same wall with WIDER tracks, so a compact row gets the room its fields
19
+ * need. The shipped consumers already did this (`repeat(4, 1fr)` for list,
20
+ * `repeat(6, 1fr)` for grid); what they got wrong was FORCING the count.
21
+ *
22
+ * The count derives from the wall's OWN width, never the viewport, and never a
23
+ * fixed track count — 05-layout-systems.md, the card-wall law: *"the shell
24
+ * rails eat width that viewport breakpoints can't see, so a forced count
25
+ * compresses every card"* (user call 2026-08-09). Hence `auto-fill` +
26
+ * `minmax()`, with the law's 20rem minimum as the default.
27
+ *
16
28
  * @param {string} form 'grid' | 'list'
17
- * @param {string} min grid track minimum (CSS length), grid form only
29
+ * @param {string} min grid track minimum, card form (default 20rem the law)
30
+ * @param {string} listMin grid track minimum, list form (default 30rem)
18
31
  * @param {number} gap px between items
19
32
  * @param {boolean} stagger enter animation on/off (reduced motion wins)
20
33
  */
21
34
  export default function ContentCollection({
22
35
  form = 'grid',
23
- min = '12rem',
36
+ min = '20rem',
37
+ listMin = '30rem',
24
38
  gap = 16,
25
39
  stagger = true,
26
40
  children,
@@ -34,11 +48,11 @@ export default function ContentCollection({
34
48
  <ul
35
49
  key={form}
36
50
  className={`m-0 list-none p-0 ${className}`.trim()}
37
- style={
38
- form === 'grid'
39
- ? { display: 'grid', gridTemplateColumns: `repeat(auto-fill, minmax(${min}, 1fr))`, gap: `${gap}px` }
40
- : { display: 'flex', flexDirection: 'column', gap: `${gap}px` }
41
- }
51
+ style={{
52
+ display: 'grid',
53
+ gridTemplateColumns: `repeat(auto-fill, minmax(${form === 'list' ? listMin : min}, 1fr))`,
54
+ gap: `${gap}px`,
55
+ }}
42
56
  >
43
57
  {items.map((child, i) =>
44
58
  child == null ? null : (