@kolkrabbi/kol-component 0.52.0 → 0.54.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.52.0",
3
+ "version": "0.54.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",
@@ -26,22 +26,26 @@ import usePrefersReducedMotion from '../hooks/usePrefersReducedMotion.js'
26
26
  * never a fixed track count — 05-layout-systems.md, the card-wall law: *"the
27
27
  * shell rails eat width that viewport breakpoints can't see, so a forced count
28
28
  * compresses every card"* (user call 2026-08-09). Hence `auto-fill` +
29
- * `minmax()`, with the law's 20rem minimum as the default.
29
+ * `minmax()`, with the law's minimum as the default — written in PX, not rem
30
+ * (user ruling 2026-08-15). A track width is a LAYOUT measure, not type: rem
31
+ * ties it to the root font-size, so a user bumping their browser text size
32
+ * silently re-counts the columns of every wall in the estate.
30
33
  *
31
34
  * @param {string} form 'grid' | 'list'
32
- * @param {string} min grid track minimum, card form (default 20rem — the law)
35
+ * @param {string} min grid track minimum, card form (default 320px)
33
36
  * @param {string} listMin OPT-IN: makes the list multi-column too, for a dense
34
37
  * file-browser cut. Unset = one full-width column
35
- * @param {number} gap px between items defaults PER FORM (grid 24,
36
- * list 8), the values every shipped consumer
37
- * re-typed as a ternary at its own call site. A
38
- * single default meant the ternary survived the
39
- * migration, which is half the duplication
38
+ * @param {number} gap px between items. UNSET reads the token for the
39
+ * form `--kol-gap-wall-grid` (24) or
40
+ * `--kol-gap-wall-list` (8) the same treatment
41
+ * `--kol-pad-card-*` gets, and for the same reason:
42
+ * these two numbers were re-typed as a ternary at
43
+ * nine call sites. Pass a number only to differ
40
44
  * @param {boolean} stagger enter animation on/off (reduced motion wins)
41
45
  */
42
46
  export default function ContentCollection({
43
47
  form = 'grid',
44
- min = '20rem',
48
+ min = '320px',
45
49
  listMin,
46
50
  gap,
47
51
  stagger = true,
@@ -51,9 +55,11 @@ export default function ContentCollection({
51
55
  const reduced = usePrefersReducedMotion()
52
56
  const animate = stagger && !reduced
53
57
  const items = Array.isArray(children) ? children.flat() : [children]
54
- /* ruled 2026-08-15 — the shipped 24/8 become the defaults, so `gap` is only
55
- * passed when a consumer genuinely differs from the house. */
56
- const px = gap ?? (form === 'list' ? 8 : 24)
58
+ /* ruled 2026-08-15 — the shipped 24/8 are TOKENS now, so `gap` is only passed
59
+ * when a consumer genuinely differs from the house. A number still wins. */
60
+ const g = gap != null
61
+ ? `${gap}px`
62
+ : `var(--kol-gap-wall-${form === 'list' ? 'list' : 'grid'})`
57
63
 
58
64
  return (
59
65
  <ul
@@ -64,7 +70,7 @@ export default function ContentCollection({
64
70
  gridTemplateColumns: form === 'list'
65
71
  ? (listMin ? `repeat(auto-fill, minmax(${listMin}, 1fr))` : '1fr')
66
72
  : `repeat(auto-fill, minmax(${min}, 1fr))`,
67
- gap: `${px}px`,
73
+ gap: g,
68
74
  }}
69
75
  >
70
76
  {items.map((child, i) =>