@kolkrabbi/kol-component 0.71.0 → 0.72.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.72.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",
|
|
@@ -12,6 +12,13 @@ import ContentText from './ContentText.jsx'
|
|
|
12
12
|
* canvas the card is the ratio frame; media fills it absolutely and the
|
|
13
13
|
* text plate floats on top — typeface (details over specimen)
|
|
14
14
|
*
|
|
15
|
+
* EXPANDED (2026-08-26, the GridCard retirement): a fill-card variant with
|
|
16
|
+
* `expanded` grows to a 2×2 cell — `grid-column / grid-row: span 2`, no
|
|
17
|
+
* ratio — and flips to a ROW: media on the right at 50%, `expandedContent`
|
|
18
|
+
* (the info field + button the consumer authors) on the left in a lg-padded,
|
|
19
|
+
* space-between column. Verbatim the 2×2 GridCard shipped; without it the
|
|
20
|
+
* three GridCard repos could not swap. Neighbour-hiding stays consumer-side.
|
|
21
|
+
*
|
|
15
22
|
* Padding spells the TOKENS (--kol-pad-card-{sm,md,lg} = 12/16/24), never a
|
|
16
23
|
* literal. Passing `pad` overrides the plate padding with one token step
|
|
17
24
|
* (named `pad`, not `size` — `size` is the ruled TEXT slot). Image-only cards
|
|
@@ -91,6 +98,8 @@ export default function ContentCard({
|
|
|
91
98
|
zoom,
|
|
92
99
|
control,
|
|
93
100
|
actions,
|
|
101
|
+
expanded = false,
|
|
102
|
+
expandedContent,
|
|
94
103
|
selected = false,
|
|
95
104
|
onClick,
|
|
96
105
|
href,
|
|
@@ -178,11 +187,18 @@ export default function ContentCard({
|
|
|
178
187
|
</>
|
|
179
188
|
) : box.layout === 'fill-card' ? (
|
|
180
189
|
<>
|
|
181
|
-
<div className="flex-1 min-w-0 relative overflow-hidden">
|
|
190
|
+
<div className="flex-1 min-w-0 min-h-0 relative overflow-hidden" style={expanded ? { flex: '0 0 50%' } : undefined}>
|
|
182
191
|
<ContentMedia ratio={null} {...mediaProps}>{media}</ContentMedia>
|
|
183
192
|
{controlNode}
|
|
184
193
|
</div>
|
|
185
|
-
{
|
|
194
|
+
{expanded ? (
|
|
195
|
+
<div
|
|
196
|
+
className="flex flex-1 flex-col justify-between overflow-auto"
|
|
197
|
+
style={{ padding: 'var(--kol-pad-card-lg)' }}
|
|
198
|
+
>
|
|
199
|
+
{expandedContent}
|
|
200
|
+
</div>
|
|
201
|
+
) : textNode}
|
|
186
202
|
</>
|
|
187
203
|
) : box.layout === 'drawer' ? (
|
|
188
204
|
<>
|
|
@@ -223,7 +239,7 @@ export default function ContentCard({
|
|
|
223
239
|
const hoverBg = HOVER[variant]
|
|
224
240
|
|
|
225
241
|
const common = {
|
|
226
|
-
className: `kol-card group flex flex-col ${box.layout === 'drawer' ? 'relative overflow-hidden rounded-[var(--kol-radius-sm)]' : ''} ${framed ? 'overflow-hidden rounded-[var(--kol-radius-sm)]' : ''} ${box.border ? 'border' : ''} ${box.layout === 'canvas' ? 'relative' : ''} ${interactive ? 'cursor-pointer select-none' : ''} ${hoverBg && interactive ? 'kol-content-hover' : ''} ${className}`.trim(),
|
|
242
|
+
className: `kol-card group flex ${expanded ? 'flex-row-reverse' : 'flex-col'} ${box.layout === 'drawer' ? 'relative overflow-hidden rounded-[var(--kol-radius-sm)]' : ''} ${framed ? 'overflow-hidden rounded-[var(--kol-radius-sm)]' : ''} ${box.border ? 'border' : ''} ${box.layout === 'canvas' ? 'relative' : ''} ${interactive ? 'cursor-pointer select-none' : ''} ${hoverBg && interactive ? 'kol-content-hover' : ''} ${className}`.trim(),
|
|
227
243
|
style: {
|
|
228
244
|
/* same reason as ContentRow: rest colours are PROPERTIES, because an
|
|
229
245
|
* inline background/borderColor outranks the hover class and the step
|
|
@@ -231,8 +247,13 @@ export default function ContentCard({
|
|
|
231
247
|
'--kol-card-bg': box.bg ?? undefined,
|
|
232
248
|
'--kol-card-border': box.border ? (selected ? 'var(--kol-fg-64)' : box.border) : undefined,
|
|
233
249
|
'--kol-content-hover-bg': hoverBg ?? undefined,
|
|
234
|
-
aspectRatio: box.height ? undefined : (box.layout !== 'stack' ? r : undefined),
|
|
250
|
+
aspectRatio: box.height || expanded ? undefined : (box.layout !== 'stack' ? r : undefined),
|
|
235
251
|
height: box.height,
|
|
252
|
+
gridColumn: expanded ? 'span 2' : undefined,
|
|
253
|
+
gridRow: expanded ? 'span 2' : undefined,
|
|
254
|
+
/* the grow/shrink between the two states rides the house curve; only a
|
|
255
|
+
* card that CAN expand carries the transition */
|
|
256
|
+
transition: expandedContent != null ? 'all 300ms var(--kol-ease-house)' : undefined,
|
|
236
257
|
},
|
|
237
258
|
}
|
|
238
259
|
|