@kolkrabbi/kol-component 0.359.0 → 0.361.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.359.0",
3
+ "version": "0.361.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,12 +29,12 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@floating-ui/react": "^0.27.19",
32
- "@kolkrabbi/kol-growth": "workspace:^",
33
- "@kolkrabbi/kol-markdown": "workspace:^",
34
- "@kolkrabbi/kol-search": "workspace:^",
35
32
  "embla-carousel-react": "^8.6.0",
36
33
  "pdfjs-dist": "^6.3.289",
37
- "react-syntax-highlighter": "^16.1.1"
34
+ "react-syntax-highlighter": "^16.1.1",
35
+ "@kolkrabbi/kol-markdown": "^0.2.0",
36
+ "@kolkrabbi/kol-search": "^0.3.0",
37
+ "@kolkrabbi/kol-growth": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "@kolkrabbi/kol-icons": ">=0.68.0",
@@ -45,7 +45,7 @@
45
45
  "react-dom": "^18.3.0 || ^19.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@kolkrabbi/kol-icons": "workspace:^"
48
+ "@kolkrabbi/kol-icons": "^0.68.0"
49
49
  },
50
50
  "files": [
51
51
  "src",
@@ -67,4 +67,4 @@
67
67
  "access": "public"
68
68
  },
69
69
  "sideEffects": false
70
- }
70
+ }
@@ -38,9 +38,15 @@ const LABEL = 'text-[10px] leading-[12px] text-oq-64 font-(family-name:--kol-fon
38
38
  const MONO = 'font-(family-name:--kol-font-family-mono) text-[10px] leading-[12px] text-fg-96'
39
39
 
40
40
  /* a disabled control: a fieldset disables every input and button inside it natively */
41
- const Dim = ({ disabled, className = '', children, ...rest }) => (
41
+ /* `row`: a fixed-height field whose content is one centred row. A fieldset does not centre its flex children vertically
42
+ * (the slider and readout rode the top 16px of the 28px box — modal-system review 2026-11-08), so the row is an inner
43
+ * div the box's inner height. `h-full` does not resolve inside a fieldset (its content box is auto-height), so the row
44
+ * states it: 26 inside the bordered 28 field, 28 where the box has no border. */
45
+ const Dim = ({ disabled, className = '', row, children, ...rest }) => (
42
46
  <fieldset disabled={disabled || undefined} aria-disabled={disabled || undefined} {...rest}
43
- className={`min-w-0 m-0 p-0 ${className.includes('border-oq-16') ? '' : 'border-0'} ${disabled ? 'opacity-40' : ''} ${className}`.trim()}>{children}</fieldset>
47
+ className={`min-w-0 m-0 p-0 ${className.includes('border-oq-16') ? '' : 'border-0'} ${disabled ? 'opacity-40' : ''} ${className}`.trim()}>
48
+ {row ? <div className={`flex items-center ${className.includes('border-oq-16') ? 'h-[26px]' : 'h-7'} min-w-0 ${row}`}>{children}</div> : children}
49
+ </fieldset>
44
50
  )
45
51
 
46
52
  export function SettingsGroup({ title, note, ruled = true, className = '', children }) {
@@ -70,7 +76,7 @@ export function SettingsCell({ label, span = 1, disabled, className = '', childr
70
76
 
71
77
  export function SettingsSlider({ value, onChange, min = 0, max = 1, step = 0.01, format = (v) => String(v), disabled, 'aria-label': ariaLabel }) {
72
78
  return (
73
- <Dim disabled={disabled} className={`${FIELD} flex items-center gap-3 pl-[9px] pr-2`}>
79
+ <Dim disabled={disabled} className={FIELD} row="gap-3 pl-[9px] pr-2">
74
80
  <Slider variant="float" readout="none" value={value} onChange={onChange} min={min} max={max} step={step} disabled={disabled}
75
81
  aria-label={ariaLabel} className="flex-1 min-w-0 [&_.kol-slider-float]:h-4" />
76
82
  <span className={`${MONO} w-[52px] shrink-0 tabular-nums`}>{format(value)}</span>
@@ -81,7 +87,7 @@ export function SettingsSlider({ value, onChange, min = 0, max = 1, step = 0.01,
81
87
  export function SettingsRange({ value = [0, 1], onChange, min = 0, max = 1, step = 0.01, format = (v) => String(v), disabled, 'aria-label': ariaLabel }) {
82
88
  const [a, b] = value
83
89
  return (
84
- <Dim disabled={disabled} className={`${FIELD} flex items-center gap-2 px-2`}>
90
+ <Dim disabled={disabled} className={FIELD} row="gap-2 px-2">
85
91
  <span className={`${MONO} shrink-0 tabular-nums`}>{format(a)}</span>
86
92
  <Slider variant="dual" value={a} value2={b} min={min} max={max} step={step} aria-label={ariaLabel}
87
93
  onChange={(v) => onChange?.([Math.min(v, b), b])} onChange2={(v) => onChange?.([a, Math.max(v, a)])}
@@ -111,7 +117,7 @@ export function SettingsSegmented({ value, onChange, options = [], disabled, ari
111
117
 
112
118
  export function SettingsToggle({ label, checked, onChange, disabled }) {
113
119
  return (
114
- <Dim disabled={disabled} className="flex items-center gap-2 h-7">
120
+ <Dim disabled={disabled} className="h-7" row="gap-2">
115
121
  <ToggleSwitch checked={!!checked} onChange={onChange} aria-label={label} disabled={disabled} />
116
122
  {label && <span className={INK}>{label}</span>}
117
123
  </Dim>
@@ -189,7 +189,8 @@ const Slider = ({
189
189
  if (variant === 'dual') {
190
190
  const v1 = value ?? min
191
191
  const v2 = value2 ?? max
192
- const showLabels = label1 != null || label2 != null
192
+ /* an empty label is no label: `label1="" label2=""` (SettingsRange, GeneratorRail) drew an empty 16px row that pushed the rail low */
193
+ const showLabels = !!(label1 || label2)
193
194
  const ratio = max > min ? (playhead - min) / (max - min) : 0
194
195
  return (
195
196
  <div className={`control-slider gap-3 shadow-none ${className}`} style={style}>