@kolkrabbi/kol-component 0.133.0 → 0.135.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 +10 -1
- package/src/molecules/Slider.jsx +11 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-component",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.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,7 +15,10 @@ 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
|
|
20
23
|
* @param {{label: ReactNode, value: ReactNode}[]} specs label/value pairs on the
|
|
21
24
|
* row's trailing edge, independent of variant.
|
|
@@ -108,6 +111,12 @@ export default function ContentRow({
|
|
|
108
111
|
* aspect-ratio square resolved to the image's intrinsic width) */
|
|
109
112
|
'--kol-row-thumb': thumbPx === 'fill' ? `calc(${box.minH ?? 96}px - 2 * ${padY})` : `${thumbPx}px`,
|
|
110
113
|
'--kol-row-thumb-md': box.thumbMd != null ? `${box.thumbMd}px` : undefined,
|
|
114
|
+
/* the documented `ratio` prop, finally connected (RowThumbRatioDead,
|
|
115
|
+
* kol-website 2026-08-30). It was destructured and then dropped — the row
|
|
116
|
+
* passed ContentMedia `ratio={null}` and kol-theme hard-coded `1 / 1`, so a
|
|
117
|
+
* consumer setting it got no error and no change. Undefined publishes
|
|
118
|
+
* nothing and the CSS fallback keeps every current row square. */
|
|
119
|
+
'--kol-row-thumb-ratio': ratio ?? box.ratio,
|
|
111
120
|
'--kol-content-hover-bg': box.hover,
|
|
112
121
|
'--kol-content-hover-border': box.frameHover,
|
|
113
122
|
/* rest values are PROPERTIES, not inline declarations — an inline
|
package/src/molecules/Slider.jsx
CHANGED
|
@@ -11,9 +11,13 @@ import Input from '../atoms/Input.jsx'
|
|
|
11
11
|
* One bare inline row: label · track · readout. (Bordered `default` and chip
|
|
12
12
|
* `subtle` variants retired 2026-07-08 — minimal is the only single slider.)
|
|
13
13
|
*
|
|
14
|
-
* Track color is
|
|
15
|
-
*
|
|
16
|
-
*
|
|
14
|
+
* Track color is `--kol-slider-track`. Set it per-instance via
|
|
15
|
+
* `style={{ '--kol-slider-track': '…' }}` on this component, or from ANY
|
|
16
|
+
* ancestor — `.slider-black` reads it as a fallback rather than declaring it,
|
|
17
|
+
* so it inherits (SliderTrackVariableNotForwarded, kol-mirror 2026-08-30: both
|
|
18
|
+
* routes were documented and neither was wired, so consumers were reaching into
|
|
19
|
+
* `.slider-black` by specificity from their own stylesheets).
|
|
20
|
+
* `--kol-slider-playhead` works the same way on the dual rail.
|
|
17
21
|
*
|
|
18
22
|
* DUAL + PLAYHEAD (SliderDualThumbAndPlayhead, kol-mirror 2026-08-30):
|
|
19
23
|
* `variant="dual"` stacks two native ranges on one rail for an in/out pair,
|
|
@@ -35,6 +39,7 @@ import Input from '../atoms/Input.jsx'
|
|
|
35
39
|
* @param {string} props.className - Additional wrapper classes
|
|
36
40
|
* @param {number} props.displayWidth - Width of the value readout, in characters (default: 6)
|
|
37
41
|
* @param {string} props.fontSize - Font size for label/value (e.g., '11px')
|
|
42
|
+
* @param {Object} props.style - forwarded to the wrapper; the seam for `--kol-slider-track` / `--kol-slider-playhead`
|
|
38
43
|
* @param {number} props.defaultValue - alt-click the control resets to this (falls back to `min`). Same contract on RotaryDial
|
|
39
44
|
* @param {'input'|'value'|'none'} props.readout - `input` (default) an editable Input · `value` a plain right-aligned span, RotaryDial's own display-only readout · `none`
|
|
40
45
|
* @param {'minimal'|'dual'} props.variant - `dual` = two thumbs on one rail
|
|
@@ -67,6 +72,7 @@ const Slider = ({
|
|
|
67
72
|
label2,
|
|
68
73
|
playhead = null,
|
|
69
74
|
onPlayheadChange,
|
|
75
|
+
style,
|
|
70
76
|
}) => {
|
|
71
77
|
/* Label ↔ input pairing — the <label> is a sibling of the range input, so
|
|
72
78
|
* without an htmlFor/id pair the visible label confers no accessible name. */
|
|
@@ -169,7 +175,7 @@ const Slider = ({
|
|
|
169
175
|
const showLabels = label1 != null || label2 != null
|
|
170
176
|
const ratio = max > min ? (playhead - min) / (max - min) : 0
|
|
171
177
|
return (
|
|
172
|
-
<div className={`control-slider gap-3 shadow-none ${className}`}>
|
|
178
|
+
<div className={`control-slider gap-3 shadow-none ${className}`} style={style}>
|
|
173
179
|
{label && (
|
|
174
180
|
<label
|
|
175
181
|
className={`kol-helper-12 whitespace-nowrap shrink-0 w-fit ${disabled ? 'opacity-50' : ''}`}
|
|
@@ -231,7 +237,7 @@ const Slider = ({
|
|
|
231
237
|
}
|
|
232
238
|
|
|
233
239
|
return (
|
|
234
|
-
<div className={`control-slider gap-3 shadow-none ${className}`} onClick={onAltReset}>
|
|
240
|
+
<div className={`control-slider gap-3 shadow-none ${className}`} style={style} onClick={onAltReset}>
|
|
235
241
|
{label && (
|
|
236
242
|
<label
|
|
237
243
|
htmlFor={sliderId}
|