@kolkrabbi/kol-component 0.134.0 → 0.136.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 +1 -1
- package/src/molecules/ContentRow.jsx +33 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.136.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",
|
|
@@ -15,8 +15,16 @@ import ContentText from './ContentText.jsx'
|
|
|
15
15
|
* @param {ReactNode} media thumb content (omit → placeholder)
|
|
16
16
|
* @param {number|'fill'} thumb thumb edge px — overrides the ruled default; 0 hides; `'fill'` = a square
|
|
17
17
|
* the height of the row's content, whatever the rung (WorkListingRowsAndFilters)
|
|
18
|
-
* @param {string} ratio thumb aspect-ratio — overrides the ruled default
|
|
18
|
+
* @param {string} ratio thumb aspect-ratio — overrides the ruled default.
|
|
19
|
+
* Under `thumb="fill"` the rung is the thumb's HEIGHT,
|
|
20
|
+
* so a non-square ratio widens the thumb rather than
|
|
21
|
+
* growing the row past its rung (ruled 2026-08-30)
|
|
19
22
|
* @param {number} paddingY vertical padding px — overrides the ruled default
|
|
23
|
+
* @param {number} minHeight the row's rung in px — overrides the variant's
|
|
24
|
+
* @param {'width'|'height'} ratioAxis under `thumb="fill"`, WHICH AXIS PAYS for a
|
|
25
|
+
* non-square `ratio`. `width` (default) holds the height
|
|
26
|
+
* at the rung and narrows the thumb; `height` holds the
|
|
27
|
+
* width and lets the thumb grow taller than the rung
|
|
20
28
|
* @param {{label: ReactNode, value: ReactNode}[]} specs label/value pairs on the
|
|
21
29
|
* row's trailing edge, independent of variant.
|
|
22
30
|
* Horizontal variants only — `typeface` is a column
|
|
@@ -78,6 +86,8 @@ export default function ContentRow({
|
|
|
78
86
|
actions,
|
|
79
87
|
footer,
|
|
80
88
|
specs,
|
|
89
|
+
minHeight,
|
|
90
|
+
ratioAxis = 'width',
|
|
81
91
|
selected = false,
|
|
82
92
|
onClick,
|
|
83
93
|
href,
|
|
@@ -101,13 +111,31 @@ export default function ContentRow({
|
|
|
101
111
|
'--kol-row-pad-md': box.padMd,
|
|
102
112
|
'--kol-row-gap': box.gap,
|
|
103
113
|
'--kol-row-gap-md': box.gapMd,
|
|
104
|
-
|
|
114
|
+
/* THE RUNG IS A PROP (RowRungAndFillThumb, kol-website 2026-08-30). It was
|
|
115
|
+
* the variant's literal published as an inline custom property, and an
|
|
116
|
+
* inline property cannot be reached from a stylesheet — so a page wanting a
|
|
117
|
+
* taller row carried `--kol-row-min-h: 224px !important`. */
|
|
118
|
+
'--kol-row-min-h': minHeight != null ? `${minHeight}px` : box.minH != null ? `${box.minH}px` : undefined,
|
|
105
119
|
'--kol-row-min-h-md': box.minHMd != null ? `${box.minHMd}px` : undefined,
|
|
106
120
|
/* `fill` = the rung minus the vertical padding — a definite number, not a
|
|
107
121
|
* stretch (a min-height row has no definite cross size, so a stretched
|
|
108
|
-
* aspect-ratio square resolved to the image's intrinsic width)
|
|
109
|
-
|
|
122
|
+
* aspect-ratio square resolved to the image's intrinsic width).
|
|
123
|
+
*
|
|
124
|
+
* THE EFFECTIVE RUNG, not the variant's. This read `box.minH` — the literal
|
|
125
|
+
* — so raising the rung grew the ROW and left the thumb at its old height,
|
|
126
|
+
* floating. It is now `--kol-row-min-h`, whatever set it, resolved in CSS.
|
|
127
|
+
* That was the second `!important` kol-website was carrying. */
|
|
128
|
+
'--kol-row-pad-y': padY,
|
|
129
|
+
'--kol-row-thumb': thumbPx === 'fill'
|
|
130
|
+
? 'calc(var(--kol-row-min-h, 96px) - 2 * var(--kol-row-pad-y, 0px))'
|
|
131
|
+
: `${thumbPx}px`,
|
|
110
132
|
'--kol-row-thumb-md': box.thumbMd != null ? `${box.thumbMd}px` : undefined,
|
|
133
|
+
/* the documented `ratio` prop, finally connected (RowThumbRatioDead,
|
|
134
|
+
* kol-website 2026-08-30). It was destructured and then dropped — the row
|
|
135
|
+
* passed ContentMedia `ratio={null}` and kol-theme hard-coded `1 / 1`, so a
|
|
136
|
+
* consumer setting it got no error and no change. Undefined publishes
|
|
137
|
+
* nothing and the CSS fallback keeps every current row square. */
|
|
138
|
+
'--kol-row-thumb-ratio': ratio ?? box.ratio,
|
|
111
139
|
'--kol-content-hover-bg': box.hover,
|
|
112
140
|
'--kol-content-hover-border': box.frameHover,
|
|
113
141
|
/* rest values are PROPERTIES, not inline declarations — an inline
|
|
@@ -141,7 +169,7 @@ export default function ContentRow({
|
|
|
141
169
|
* media object-covers into it; row height = max(thumb, text). This
|
|
142
170
|
* retires the 2026-08-15 fill-the-height ruling and the `thumbSquare`
|
|
143
171
|
* exception it needed. Rows never zoom their thumb — cards keep theirs. */
|
|
144
|
-
<div className={`kol-row-thumb shrink-0 self-start ${thumbPx === 'fill' ? 'is-fill' : ''}`.trim()}>
|
|
172
|
+
<div className={`kol-row-thumb shrink-0 self-start ${thumbPx === 'fill' ? 'is-fill' : ''} ${thumbPx === 'fill' && ratioAxis === 'height' ? 'pays-height' : ''}`.replace(/\s+/g, ' ').trim()}>
|
|
145
173
|
<ContentMedia
|
|
146
174
|
ratio={null}
|
|
147
175
|
border={box.thumbBorder ?? false}
|