@kolkrabbi/kol-component 0.47.0 → 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.
|
|
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",
|
|
@@ -65,9 +65,14 @@ const RAMP = {
|
|
|
65
65
|
|
|
66
66
|
/* render order per variant/form. Strings are slots; arrays are ONE line:
|
|
67
67
|
* ['group', …] = 16px baseline group · ['between', …] = header.between ·
|
|
68
|
-
* ['line', …] = one flex line, first slot flex-1 truncating, rest fixed ·
|
|
69
68
|
* ['stack', …] = a vertical block on the tight 4px gap, nestable inside any of
|
|
70
69
|
* the above. In a `between`, the LEADING part flexes and the trailing one hugs.
|
|
70
|
+
*
|
|
71
|
+
* A third kind, ['line', …] — fixed-width trailing columns for a table-like
|
|
72
|
+
* row — was removed 2026-08-15. `default.row` was its only caller and moved to
|
|
73
|
+
* a group when the date went below the title; the fixed 96/80px columns had
|
|
74
|
+
* already been dropped for hugging content, so the branch was rendering
|
|
75
|
+
* nothing anyone asked for.
|
|
71
76
|
* Directions are the RULED structures (06-content-card-system.md §2 boxes),
|
|
72
77
|
* read off the shipped components and the live pages they render on. */
|
|
73
78
|
const ORDER = {
|
|
@@ -169,24 +174,6 @@ export default function ContentText({
|
|
|
169
174
|
</div>
|
|
170
175
|
)
|
|
171
176
|
}
|
|
172
|
-
if (kind === 'line') {
|
|
173
|
-
/* ruled (default row): title flex-1 truncate · date w-24 · size w-20,
|
|
174
|
-
* trailing fields in fixed columns so rows align in a list.
|
|
175
|
-
*
|
|
176
|
-
* Trailing fields HUG their content and sit on the group's 24px gap, so
|
|
177
|
-
* the row and the card space their meta identically. They used to be
|
|
178
|
-
* fixed 96/80px right-aligned columns: the date never filled 96px, so a
|
|
179
|
-
* row showed leftover column PLUS the gap, and anything that grew on
|
|
180
|
-
* hover (the size/download affordance) expanded leftwards in a row and
|
|
181
|
-
* rightwards in a card. */
|
|
182
|
-
return (
|
|
183
|
-
<div key={`line-${i}`} className="flex items-baseline min-w-0" style={{ gap: 'var(--kol-spacing-6)' }}>
|
|
184
|
-
{parts.map((p, j) => (j === 0
|
|
185
|
-
? <div key={j} className="flex-1 min-w-0 truncate">{p}</div>
|
|
186
|
-
: <div key={j} className="shrink-0">{p}</div>))}
|
|
187
|
-
</div>
|
|
188
|
-
)
|
|
189
|
-
}
|
|
190
177
|
return (
|
|
191
178
|
<div
|
|
192
179
|
key={`${kind}-${i}`}
|
|
@@ -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 (
|
|
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 = '
|
|
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
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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 : (
|