@kolkrabbi/kol-component 0.53.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.
|
|
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",
|
|
@@ -35,11 +35,12 @@ import usePrefersReducedMotion from '../hooks/usePrefersReducedMotion.js'
|
|
|
35
35
|
* @param {string} min grid track minimum, card form (default 320px)
|
|
36
36
|
* @param {string} listMin OPT-IN: makes the list multi-column too, for a dense
|
|
37
37
|
* file-browser cut. Unset = one full-width column
|
|
38
|
-
* @param {number} gap px between items
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
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
|
|
43
44
|
* @param {boolean} stagger enter animation on/off (reduced motion wins)
|
|
44
45
|
*/
|
|
45
46
|
export default function ContentCollection({
|
|
@@ -54,9 +55,11 @@ export default function ContentCollection({
|
|
|
54
55
|
const reduced = usePrefersReducedMotion()
|
|
55
56
|
const animate = stagger && !reduced
|
|
56
57
|
const items = Array.isArray(children) ? children.flat() : [children]
|
|
57
|
-
/* ruled 2026-08-15 — the shipped 24/8
|
|
58
|
-
*
|
|
59
|
-
const
|
|
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'})`
|
|
60
63
|
|
|
61
64
|
return (
|
|
62
65
|
<ul
|
|
@@ -67,7 +70,7 @@ export default function ContentCollection({
|
|
|
67
70
|
gridTemplateColumns: form === 'list'
|
|
68
71
|
? (listMin ? `repeat(auto-fill, minmax(${listMin}, 1fr))` : '1fr')
|
|
69
72
|
: `repeat(auto-fill, minmax(${min}, 1fr))`,
|
|
70
|
-
gap:
|
|
73
|
+
gap: g,
|
|
71
74
|
}}
|
|
72
75
|
>
|
|
73
76
|
{items.map((child, i) =>
|