@kolkrabbi/kol-component 0.84.0 → 0.85.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.84.0",
3
+ "version": "0.85.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",
@@ -31,7 +31,11 @@ import { minHeightClass } from './sectionHeights.js'
31
31
  * @param {{num: ReactNode, label: string}[]} meta stats strip (mutually exclusive with `actions`)
32
32
  * @param {ReactNode} actions button row
33
33
  * @param {ReactNode} media image / video / interactive node for the visual column
34
- * @param {string} [ratio='4/5'] aspect ratio of the media frame
34
+ * @param {string} [ratio='4/5'] aspect ratio of the media frame. THE FRAME IS BOUNDED BY THE
35
+ * RUNG (SectionSplitMediaBounded, 2026-08-27): its height is the section's `height` rung minus
36
+ * the vertical padding, its width follows the ratio (capped at the column). Before, the frame
37
+ * was as wide as its column and set the section's height itself, so `40` · `60` · `80`
38
+ * rendered identically — a ladder that only floors is decorative for a card with media.
35
39
  * @param {boolean} [mediaHover=false] zoom the media on frame hover (the CardFeatureItem numbers)
36
40
  * @param {boolean} [mediaClip=true] the frame clips its media (overflow hidden + radius). `false`
37
41
  * for a node that transforms in 3D (a tilt card) — the frame keeps its ratio and radius,
@@ -86,7 +90,7 @@ export default function SectionSplit({
86
90
  <section
87
91
  ref={themeRef}
88
92
  data-theme={themeStamp}
89
- className={`kol-section-split flex flex-col justify-center px-5 py-16 md:px-8 md:py-24 lg:px-14 lg:py-32 ${minHeightClass(height)} ${bleed} ${className}`.replace(/\s+/g, ' ').trim()}
93
+ className={`kol-section-split flex flex-col justify-center px-5 py-16 md:px-8 md:py-24 lg:px-14 lg:py-32 [--kol-section-py:4rem] md:[--kol-section-py:6rem] lg:[--kol-section-py:8rem] ${minHeightClass(height)} ${bleed} ${className}`.replace(/\s+/g, ' ').trim()}
90
94
  style={sectionStyle}
91
95
  >
92
96
  {/* ONE cap for the whole section family (user ruling 2026-08-26): the shell's
@@ -120,9 +124,12 @@ export default function SectionSplit({
120
124
  )}
121
125
  </SectionText>
122
126
  {media && (
127
+ /* height = the rung minus the padding; width follows the ratio and
128
+ * caps at the column — the media takes its size from the section,
129
+ * never gives it */
123
130
  <div
124
- className={`kol-section-split-visual relative rounded-[var(--kol-radius-sm)] ${mediaClip ? 'overflow-hidden' : ''} ${mediaHover ? 'is-hoverable' : ''} ${mediaFirst ? 'order-1' : ''} ${centred ? 'w-full max-w-[640px]' : ''}`.replace(/\s+/g, ' ').trim()}
125
- style={{ aspectRatio: ratio }}
131
+ className={`kol-section-split-visual relative w-auto max-w-full justify-self-center rounded-[var(--kol-radius-sm)] ${mediaClip ? 'overflow-hidden' : ''} ${mediaHover ? 'is-hoverable' : ''} ${mediaFirst ? 'order-1' : ''} ${centred ? 'max-w-[640px]' : ''}`.replace(/\s+/g, ' ').trim()}
132
+ style={{ aspectRatio: ratio, height: 'calc(var(--kol-section-h, 60vh) - 2 * var(--kol-section-py, 4rem))' }}
126
133
  >
127
134
  {media}
128
135
  {caption && <div className="kol-section-split-visual-veil" aria-hidden="true" />}
@@ -4,12 +4,15 @@
4
4
  * Same three names as SectionHero's presets; literal strings — a class built
5
5
  * at runtime is not a class (the SPLIT_HEIGHTS lesson). Anything else passes
6
6
  * through as a class string. */
7
+ /* Each rung also publishes itself as `--kol-section-h`, so a child that must
8
+ * be BOUNDED by the rung — the split's media frame (SectionSplitMediaBounded,
9
+ * 2026-08-27) — can read it. Literal strings, every one. */
7
10
  export const MIN_HEIGHTS = {
8
- full: 'min-h-dvh',
9
- 80: 'min-h-[70svh] md:min-h-[80vh]',
10
- 60: 'min-h-[50svh] md:min-h-[60vh]',
11
+ full: 'min-h-dvh [--kol-section-h:100dvh]',
12
+ 80: 'min-h-[70svh] md:min-h-[80vh] [--kol-section-h:70svh] md:[--kol-section-h:80vh]',
13
+ 60: 'min-h-[50svh] md:min-h-[60vh] [--kol-section-h:50svh] md:[--kol-section-h:60vh]',
11
14
  /* 40 (SectionHeightForty, 2026-08-27): the rung below 60 for a page-foot
12
15
  * CTA or a cards band that wants less air; default stays 60 everywhere */
13
- 40: 'min-h-[35svh] md:min-h-[40vh]',
16
+ 40: 'min-h-[35svh] md:min-h-[40vh] [--kol-section-h:35svh] md:[--kol-section-h:40vh]',
14
17
  }
15
18
  export const minHeightClass = (height) => MIN_HEIGHTS[height] || height