@kolkrabbi/kol-component 0.51.0 → 0.53.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.51.0",
3
+ "version": "0.53.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",
@@ -67,9 +67,13 @@ const HOVER = {
67
67
  * of its own; article frames because its media is a 16/9 thumbnail that rarely
68
68
  * fills its box. */
69
69
  const MEDIA = {
70
- print: { ring: true },
70
+ /* zoom is for IMAGE-LED cards — where the artwork is the content and the
71
+ * card is a frame around it. A catalog tile whose preview is a diagram, or
72
+ * a default file card whose thumb is a 48px chip, gets nothing from it. */
73
+ print: { ring: true, zoom: true },
74
+ work: { zoom: true },
71
75
  /* ListingCard's card media steps its border on hover — fg-08 → fg-16 */
72
- article: { frame: true, borderHover: true },
76
+ article: { frame: true, borderHover: true, zoom: true },
73
77
  }
74
78
 
75
79
  export default function ContentCard({
@@ -80,6 +84,7 @@ export default function ContentCard({
80
84
  fit,
81
85
  frame,
82
86
  ring,
87
+ zoom,
83
88
  control,
84
89
  actions,
85
90
  selected = false,
@@ -146,6 +151,7 @@ export default function ContentCard({
146
151
  frame: frame ?? MEDIA[variant]?.frame ?? false,
147
152
  ring: ring ?? MEDIA[variant]?.ring ?? false,
148
153
  borderHover: MEDIA[variant]?.borderHover ?? false,
154
+ zoom: zoom ?? MEDIA[variant]?.zoom ?? false,
149
155
  }
150
156
 
151
157
  /* `control` — the in-frame control slot (user ruling 2026-08-15). One node,
@@ -53,6 +53,8 @@ import AssetPlaceholder from '../utilities/AssetPlaceholder.jsx'
53
53
  * @param {string} bg tint only, no border — a raw token value
54
54
  * @param {string} borderHover border colour on hover (article's fg-16 step)
55
55
  * @param {boolean} ring hairline border OVER the media, inset
56
+ * @param {boolean} zoom the artwork creeps up inside its frame on the
57
+ * CARD's hover — image-led variants only
56
58
  * @param {ReactNode} children the real media
57
59
  */
58
60
  const FIT = {
@@ -70,6 +72,7 @@ export default function ContentMedia({
70
72
  bg,
71
73
  borderHover,
72
74
  ring = false,
75
+ zoom = false,
73
76
  children,
74
77
  className = '',
75
78
  }) {
@@ -79,7 +82,7 @@ export default function ContentMedia({
79
82
  const round = radius ? 'rounded-[var(--kol-radius-sm)]' : ''
80
83
  return (
81
84
  <div
82
- className={`relative w-full overflow-hidden ${round} ${FIT[fit] ?? FIT.cover} ${frame ? 'bg-fg-04 border border-fg-08' : ''} ${border ? 'border border-fg-08' : ''} ${borderHover ? 'transition-colors hover:border-fg-16' : ''} ${ratio == null ? 'h-full' : ''} ${className}`.trim()}
85
+ className={`relative w-full overflow-hidden ${round} ${FIT[fit] ?? FIT.cover} ${frame ? 'bg-fg-04 border border-fg-08' : ''} ${border ? 'border border-fg-08' : ''} ${zoom ? 'kol-media-zoom' : ''} ${borderHover ? 'transition-colors hover:border-fg-16' : ''} ${ratio == null ? 'h-full' : ''} ${className}`.trim()}
83
86
  style={{ ...(ratio != null ? { aspectRatio: ratio } : null), background: bg }}
84
87
  >
85
88
  {children}
@@ -118,7 +118,7 @@ export default function ContentRow({
118
118
  )
119
119
 
120
120
  const common = {
121
- className: `kol-row flex ${box.column ? 'flex-col' : ''} ${box.align} ${box.divider ? 'border-b border-fg-08' : ''} ${box.frame ? 'rounded-[var(--kol-radius-sm)] border' : ''} ${interactive ? 'cursor-pointer select-none' : ''} ${interactive && box.hover ? 'kol-content-hover' : ''} ${interactive && box.frameHover ? 'kol-content-hover-frame' : ''} ${className}`.trim(),
121
+ className: `kol-row group flex ${box.column ? 'flex-col' : ''} ${box.align} ${box.divider ? 'kol-row--divided' : ''} ${box.frame ? 'rounded-[var(--kol-radius-sm)] border' : ''} ${interactive ? 'cursor-pointer select-none' : ''} ${interactive && box.hover ? 'kol-content-hover' : ''} ${interactive && box.frameHover ? 'kol-content-hover-frame' : ''} ${className}`.trim(),
122
122
  style: vars,
123
123
  }
124
124
 
@@ -26,10 +26,13 @@ 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
38
  * @param {number} gap px between items — defaults PER FORM (grid 24,
@@ -41,7 +44,7 @@ import usePrefersReducedMotion from '../hooks/usePrefersReducedMotion.js'
41
44
  */
42
45
  export default function ContentCollection({
43
46
  form = 'grid',
44
- min = '20rem',
47
+ min = '320px',
45
48
  listMin,
46
49
  gap,
47
50
  stagger = true,