@kolkrabbi/kol-component 0.341.1 → 0.343.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.341.1",
3
+ "version": "0.343.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -29,9 +29,9 @@
29
29
  "embla-carousel-react": "^8.6.0",
30
30
  "pdfjs-dist": "^6.3.289",
31
31
  "react-syntax-highlighter": "^16.1.1",
32
- "@kolkrabbi/kol-growth": "^0.5.0",
32
+ "@kolkrabbi/kol-search": "^0.3.0",
33
33
  "@kolkrabbi/kol-markdown": "^0.2.0",
34
- "@kolkrabbi/kol-search": "^0.3.0"
34
+ "@kolkrabbi/kol-growth": "^0.5.0"
35
35
  },
36
36
  "peerDependencies": {
37
37
  "@kolkrabbi/kol-icons": ">=0.61.1",
@@ -42,7 +42,7 @@
42
42
  "react-dom": "^18.3.0 || ^19.0.0"
43
43
  },
44
44
  "devDependencies": {
45
- "@kolkrabbi/kol-icons": "^0.64.0"
45
+ "@kolkrabbi/kol-icons": "^0.66.0"
46
46
  },
47
47
  "files": [
48
48
  "src",
package/src/index.js CHANGED
@@ -176,6 +176,11 @@ export { MenuItem, MenuRow, MenuDivider, MenuFlyout, MenuDropdownItem, MenuDropd
176
176
  export { Menu, MenuTrigger, MenuPanel, MenuLabel, MenuFilter, MenuDatePicker, MenuMore } from './molecules/Menu.jsx'
177
177
  export { MenuPopover } from './molecules/MenuPopover.jsx'
178
178
  export { ModalProvider, useModal, Dialog } from './molecules/Modal.jsx'
179
+ /* the generator settings window's controls (plan-2026-11-05-float-editor W7.2) — `Dialog variant="settings"`'s rows */
180
+ export {
181
+ SettingsGroup, SettingsGrid, SettingsCell, SettingsSlider, SettingsRange, SettingsSelect, SettingsSegmented, SettingsToggle,
182
+ SettingsText, SettingsPoint, SettingsRamp, SettingsRampHead, SettingsLights, SettingsFieldMap, SettingsDisclosure,
183
+ } from './molecules/SettingsControls.jsx'
179
184
  export { default as Combobox } from './molecules/Combobox.jsx'
180
185
  export { default as PaletteHarmonyWheel } from './molecules/PaletteHarmonyWheel.jsx'
181
186
  export { default as PropertyInput } from './molecules/PropertyInput.jsx'
@@ -347,16 +347,85 @@ export function useModal() {
347
347
  * @param {Element} [container] the portal target instead of `<body>` (float-operational W2, 2026-11-04): the layer turns
348
348
  * `absolute` and fills it — a specimen box (`position: relative`, a height) shows the window open in place. Unset, unchanged.
349
349
  */
350
- export function Dialog({ open, onClose, title, width = 560, variant = 'lift', icon, onMinimise, blocking = true, container, children }) {
350
+ /*
351
+ * `variant="settings"` (plan-2026-11-05-float-editor W7.1 — his "Stripe Array settings modal", Figma 7K5v68l4tblHPFuiLdokRu
352
+ * 12:2282, 880 × 656): the generator's settings window. A 60 header (the `title` in Inter 14 semibold, `kind` beside it in
353
+ * the hint ink, `headerEnd` — the preset select — and the ×), a 156 section list on the primary surface (`sections`
354
+ * `[{ key, label, state }]` — the name and a one-line state, the lit one on oq-12 with a 2px marker; `section` /
355
+ * `onSection`), the body (`children`, 24 in, scrolling), an `aside` column 248 wide (the preview), and a 60 `footer`. The
356
+ * secondary surface, a 16 round, oq-16 rules between the parts — his frame draws them. `height` (default 656) and
357
+ * `width` (default 880) are its size; both shrink to the viewport.
358
+ * @param {string} [kind] settings: the line beside the title ("Generate")
359
+ * @param {ReactNode} [headerEnd] settings: the header's right side, before the × (the preset select)
360
+ * @param {Array} [sections] settings: `[{ key, label, state }]`
361
+ * @param {string} [section] · @param {Function} [onSection]
362
+ * @param {ReactNode} [aside] · @param {ReactNode} [footer] · @param {number} [height=656]
363
+ */
364
+ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', icon, onMinimise, blocking = true, container, kind, headerEnd, sections, section, onSection, aside, footer, height = 656, children }) {
351
365
  const look = modalVariant(variant, 'lift')
352
366
  const float = variant === 'float'
353
367
  useEffect(() => {
354
368
  if (!open) return undefined
355
- const onKey = (e) => { if (e.key === 'Escape' && !document.querySelector('.kol-popover-float')) onClose() }
369
+ const onKey = (e) => { if (e.key === 'Escape' && !document.querySelector('.kol-popover-float, [data-state="open"].kol-dd-trigger')) onClose() }
356
370
  window.addEventListener('keydown', onKey)
357
371
  return () => window.removeEventListener('keydown', onKey)
358
372
  }, [open, onClose])
359
373
  if (!open || typeof document === 'undefined') return null
374
+ if (variant === 'settings') {
375
+ const within = container ? '100%' : '100vw'
376
+ const withinH = container ? '100%' : '100dvh'
377
+ return createPortal(
378
+ <div onMouseDown={blocking ? onClose : undefined} className={blocking ? 'kol-overlay-scrim' : 'pointer-events-none'}
379
+ style={{ position: container ? 'absolute' : 'fixed', inset: 0, zIndex: 150, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
380
+ <div role="dialog" aria-modal={blocking ? 'true' : undefined} aria-label={title} data-dialog onMouseDown={(e) => e.stopPropagation()}
381
+ className="kol-modal kol-settings-window pointer-events-auto flex flex-col overflow-hidden rounded-2xl border border-oq-16 bg-surface-secondary text-fg-96 font-(family-name:--kol-font-family-float) shadow-[var(--kol-shadow-float)]"
382
+ style={{ width: `min(${width}px, calc(${within} - 32px))`, height: `min(${height}px, calc(${withinH} - 32px))` }}>
383
+ <header className="flex items-center gap-4 h-[60px] shrink-0 pl-6 pr-[22px] border-b border-oq-16">
384
+ <h2 className="text-[14px] font-semibold leading-none">{title}</h2>
385
+ {kind && <span className="text-[11px] text-oq-64 leading-none mt-px">{kind}</span>}
386
+ <span className="flex-1" />
387
+ {headerEnd}
388
+ <button type="button" aria-label="Close" onClick={onClose}
389
+ className="ml-3 size-7 -mr-[7px] inline-flex items-center justify-center rounded-md text-[20px] leading-none text-oq-64 hover:text-(--kol-fg-96) hover:bg-(--kol-oq-08) focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]">×</button>
390
+ </header>
391
+ <div className="flex flex-1 min-h-0">
392
+ {sections?.length > 0 && (
393
+ <nav aria-label="Settings" className="w-[156px] shrink-0 overflow-y-auto bg-surface-primary border-r border-oq-16 px-2 pt-[21px] pb-4">
394
+ <p className="pl-[10px] pb-[14px] text-[9px] font-medium leading-[11px] uppercase text-oq-64">Settings</p>
395
+ <div role="tablist" aria-orientation="vertical" className="flex flex-col gap-1.5"
396
+ onKeyDown={(e) => {
397
+ const dir = { ArrowDown: 1, ArrowUp: -1 }[e.key]
398
+ if (!dir) return
399
+ e.preventDefault()
400
+ const at = sections.findIndex((s) => s.key === section)
401
+ const next = sections[(at + dir + sections.length) % sections.length]
402
+ onSection?.(next.key)
403
+ e.currentTarget.querySelector(`[data-section="${next.key}"]`)?.focus()
404
+ }}>
405
+ {sections.map((s) => {
406
+ const lit = s.key === section
407
+ return (
408
+ <button key={s.key} type="button" role="tab" aria-selected={lit} data-section={s.key} tabIndex={lit ? 0 : -1}
409
+ onClick={() => onSection?.(s.key)}
410
+ className={`relative h-[45px] shrink-0 flex flex-col items-start justify-center gap-[5px] px-3 rounded-md text-left focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] ${lit ? 'bg-oq-12' : 'hover:bg-(--kol-oq-08)'}`}>
411
+ {lit && <span aria-hidden="true" className="absolute left-0 top-[13px] h-[18px] w-0.5 rounded-[1px] bg-fg-96" />}
412
+ <span className={`text-[11px] leading-[13px] text-fg-96 ${lit ? 'font-medium' : ''}`}>{s.label}</span>
413
+ {s.state != null && <span className="text-[10px] leading-[12px] text-oq-64">{s.state}</span>}
414
+ </button>
415
+ )
416
+ })}
417
+ </div>
418
+ </nav>
419
+ )}
420
+ <div className="flex-1 min-w-0 overflow-y-auto pl-6 pr-5 pt-6 pb-6">{children}</div>
421
+ {aside && <aside className="w-[248px] shrink-0 mr-6 pt-6 pb-6 overflow-y-auto">{aside}</aside>}
422
+ </div>
423
+ {footer && <footer className="flex items-center gap-3 h-[60px] shrink-0 px-6 border-t border-oq-16">{footer}</footer>}
424
+ </div>
425
+ </div>,
426
+ container ?? document.body,
427
+ )
428
+ }
360
429
  return createPortal(
361
430
  <div
362
431
  onMouseDown={blocking ? onClose : undefined}
@@ -0,0 +1,227 @@
1
+ import Input from '../atoms/Input.jsx'
2
+ import Button from '../atoms/Button.jsx'
3
+ import SegmentedToggle from '../atoms/SegmentedToggle.jsx'
4
+ import ToggleSwitch from '../atoms/ToggleSwitch.jsx'
5
+ import Dropdown from './Dropdown.jsx'
6
+ import Slider from './Slider.jsx'
7
+
8
+ /* taxonomy-ok: molecule — the settings window's controls, each a shipped atom in the window's dense look */
9
+
10
+ /**
11
+ * The SETTINGS controls — the generator settings window's rows (plan-2026-11-05-float-editor W7.2; his frame 12:2282,
12
+ * `Dialog variant="settings"`). His look, one rung: a 28 field on the primary surface behind an oq-16 rule, a 5 round,
13
+ * Inter 11 (readouts JetBrains Mono 10); a label above in Inter 10 at oq-64. Every part is a shipped control dressed for
14
+ * the window — Slider, the dual Slider, Dropdown, SegmentedToggle, ToggleSwitch, Input — not a second set.
15
+ *
16
+ * SettingsGroup a titled block (Inter 12 semibold) with a note at its right; `children` its rows; groups are
17
+ * ruled apart (`ruled`, default true)
18
+ * SettingsCell a labelled cell (`label` over the control) — a group lays them two-up (`SettingsGrid`)
19
+ * SettingsSlider the boxed slider: the float track and a mono readout (`format`)
20
+ * SettingsRange two handles on one track (From / To) — the dual Slider, boxed, both readouts
21
+ * SettingsSelect the boxed Dropdown (`options` `[{ value, label }]`)
22
+ * SettingsSegmented the boxed SegmentedToggle (Rows / Columns), the lit cell on oq-16
23
+ * SettingsToggle ToggleSwitch with its words
24
+ * SettingsText the boxed Input (text or number)
25
+ * SettingsPoint an X / Y pair of number fields
26
+ * SettingsRamp an A→B row: label · value A · curve · value B (`SettingsRampHead` the VALUE A · CURVE · VALUE B row)
27
+ * SettingsLights a list of points — X · Y · radius · intensity · delete — and Add light
28
+ * SettingsFieldMap the field's gradient strip: FIELD MAP over a 26 strip (`background`) and two captions
29
+ * SettingsDisclosure a group that starts closed (› More geometry … its note)
30
+ *
31
+ * `disabled` on any of them dims it to 40% and takes it out of the tab order (a control whose engine param does not
32
+ * exist yet). Keyboard is each shipped part's own: ← / → on a slider and on the segmented, Enter / Space on a select.
33
+ */
34
+
35
+ const FIELD = 'h-7 w-full min-w-0 rounded-[5px] border border-oq-16 bg-surface-primary'
36
+ const INK = 'text-[11px] leading-[13px] text-fg-96 font-(family-name:--kol-font-family-float)'
37
+ const LABEL = 'text-[10px] leading-[12px] text-oq-64 font-(family-name:--kol-font-family-float)'
38
+ const MONO = 'font-(family-name:--kol-font-family-mono) text-[10px] leading-[12px] text-fg-96'
39
+
40
+ /* a disabled control: a fieldset disables every input and button inside it natively */
41
+ const Dim = ({ disabled, className = '', children, ...rest }) => (
42
+ <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>
44
+ )
45
+
46
+ export function SettingsGroup({ title, note, ruled = true, className = '', children }) {
47
+ return (
48
+ <section className={`flex flex-col ${ruled ? 'pb-[22px] mb-[18px] border-b border-oq-16 last:border-b-0 last:mb-0' : ''} ${className}`.trim()}>
49
+ {(title || note) && (
50
+ <header className="flex items-baseline justify-between gap-4 pr-3 pb-[15px]">
51
+ {title && <h3 className="text-[12px] leading-[15px] font-semibold text-fg-96 font-(family-name:--kol-font-family-float)">{title}</h3>}
52
+ {note && <span className={LABEL}>{note}</span>}
53
+ </header>
54
+ )}
55
+ {children}
56
+ </section>
57
+ )
58
+ }
59
+
60
+ export const SettingsGrid = ({ className = '', children }) => <div className={`grid grid-cols-2 gap-x-3 gap-y-[7px] ${className}`.trim()}>{children}</div>
61
+
62
+ export function SettingsCell({ label, span = 1, disabled, className = '', children, ...rest }) {
63
+ return (
64
+ <Dim disabled={disabled} className={`flex flex-col gap-1.5 ${span === 2 ? 'col-span-2' : ''} ${className}`.trim()} {...rest}>
65
+ {label && <span className={LABEL}>{label}</span>}
66
+ {children}
67
+ </Dim>
68
+ )
69
+ }
70
+
71
+ export function SettingsSlider({ value, onChange, min = 0, max = 1, step = 0.01, format = (v) => String(v), disabled, 'aria-label': ariaLabel }) {
72
+ return (
73
+ <Dim disabled={disabled} className={`${FIELD} flex items-center gap-3 pl-[9px] pr-2`}>
74
+ <Slider variant="float" readout="none" value={value} onChange={onChange} min={min} max={max} step={step} disabled={disabled}
75
+ aria-label={ariaLabel} className="flex-1 min-w-0 [&_.kol-slider-float]:h-4" />
76
+ <span className={`${MONO} w-[52px] shrink-0 tabular-nums`}>{format(value)}</span>
77
+ </Dim>
78
+ )
79
+ }
80
+
81
+ export function SettingsRange({ value = [0, 1], onChange, min = 0, max = 1, step = 0.01, format = (v) => String(v), disabled, 'aria-label': ariaLabel }) {
82
+ const [a, b] = value
83
+ return (
84
+ <Dim disabled={disabled} className={`${FIELD} flex items-center gap-2 px-2`}>
85
+ <span className={`${MONO} shrink-0 tabular-nums`}>{format(a)}</span>
86
+ <Slider variant="dual" value={a} value2={b} min={min} max={max} step={step} aria-label={ariaLabel}
87
+ onChange={(v) => onChange?.([Math.min(v, b), b])} onChange2={(v) => onChange?.([a, Math.max(v, a)])}
88
+ label1="" label2="" className="flex-1 min-w-0" />
89
+ <span className={`${MONO} shrink-0 tabular-nums`}>{format(b)}</span>
90
+ </Dim>
91
+ )
92
+ }
93
+
94
+ export function SettingsSelect({ value, onChange, options = [], disabled, ariaLabel, className = '' }) {
95
+ return (
96
+ <Dim disabled={disabled} className="w-full">
97
+ <Dropdown value={value} onChange={onChange} options={options} ariaLabel={ariaLabel} size="sm"
98
+ className={`w-full [&_.kol-dd-trigger]:w-full [&_.kol-dd-trigger]:!h-7 [&_.kol-dd-trigger]:!rounded-[5px] [&_.kol-dd-trigger]:!border [&_.kol-dd-trigger]:!border-(--kol-oq-16) [&_.kol-dd-trigger]:!bg-(--kol-surface-primary) [&_.kol-dd-trigger]:!px-2 [&_.kol-dd-trigger]:!text-[11px] [&_.kol-dd-trigger]:!font-normal [&_.kol-dd-trigger]:!text-(--kol-fg-96) [&_.kol-dd-trigger]:font-(family-name:--kol-font-family-float) [&_.kol-dd-trigger]:justify-between [&_.kol-dd-caret]:text-(--kol-oq-64) ${className}`.trim()} />
99
+ </Dim>
100
+ )
101
+ }
102
+
103
+ export function SettingsSegmented({ value, onChange, options = [], disabled, ariaLabel }) {
104
+ return (
105
+ <Dim disabled={disabled} className={`${FIELD} p-0.5`}>
106
+ <SegmentedToggle value={value} onChange={onChange} options={options} ariaLabel={ariaLabel} size="sm"
107
+ className="!flex w-full h-full !border-0 !bg-transparent !p-0 gap-0 [&_.kol-seg-cell]:flex-1 [&_.kol-seg-cell]:h-full [&_.kol-seg-cell]:!rounded-[3px] [&_.kol-seg-cell]:!border-0 [&_.kol-seg-cell]:!bg-transparent [&_.kol-seg-cell]:!text-[10px] [&_.kol-seg-cell]:!text-(--kol-oq-64) [&_.kol-seg-cell]:font-(family-name:--kol-font-family-float) [&_.kol-seg-cell.is-active]:!bg-(--kol-oq-16) [&_.kol-seg-cell.is-active]:!text-(--kol-fg-96) [&_.kol-seg-cell.is-active]:font-medium" />
108
+ </Dim>
109
+ )
110
+ }
111
+
112
+ export function SettingsToggle({ label, checked, onChange, disabled }) {
113
+ return (
114
+ <Dim disabled={disabled} className="flex items-center gap-2 h-7">
115
+ <ToggleSwitch checked={!!checked} onChange={onChange} aria-label={label} disabled={disabled} />
116
+ {label && <span className={INK}>{label}</span>}
117
+ </Dim>
118
+ )
119
+ }
120
+
121
+ export function SettingsText({ value, onChange, onCommit, type = 'text', placeholder, disabled, 'aria-label': ariaLabel, className = '' }) {
122
+ return (
123
+ <Dim disabled={disabled} className="w-full">
124
+ <Input variant="outline" size="sm" type={type} value={value ?? ''} placeholder={placeholder} aria-label={ariaLabel}
125
+ onChange={onChange ? (e) => onChange(type === 'number' ? Number(e.target.value) : e.target.value) : undefined}
126
+ onCommit={onCommit} disabled={disabled}
127
+ className={`${FIELD} !px-2 !py-0 [&_input]:text-[11px] [&_input]:text-(--kol-fg-96) [&_input]:font-(family-name:--kol-font-family-float) ${className}`.trim()} />
128
+ </Dim>
129
+ )
130
+ }
131
+
132
+ export function SettingsPoint({ value = [0.5, 0.5], onChange, min, max, step = 0.01, disabled, 'aria-label': ariaLabel }) {
133
+ const [x, y] = value
134
+ const clamp = (n) => Math.min(max ?? Infinity, Math.max(min ?? -Infinity, n))
135
+ const field = (axis, v, set) => (
136
+ <label className={`${FIELD} flex items-center gap-1.5 px-2`}>
137
+ <span className={LABEL} aria-hidden="true">{axis}</span>
138
+ <input type="number" value={v} min={min} max={max} step={step} disabled={disabled} aria-label={`${ariaLabel ?? 'Point'} ${axis}`}
139
+ onChange={(e) => { const n = Number(e.target.value); if (Number.isFinite(n)) set(clamp(n)) }}
140
+ className={`${INK} w-full min-w-0 bg-transparent border-0 p-0 focus:outline-none tabular-nums`} />
141
+ </label>
142
+ )
143
+ return (
144
+ <Dim disabled={disabled} className="grid grid-cols-2 gap-2">
145
+ {field('X', x, (n) => onChange?.([n, y]))}
146
+ {field('Y', y, (n) => onChange?.([x, n]))}
147
+ </Dim>
148
+ )
149
+ }
150
+
151
+ export const SettingsRampHead = () => (
152
+ <div className="grid grid-cols-[88px_minmax(0,87fr)_minmax(0,122fr)_minmax(0,87fr)] gap-x-2 pb-0.5" aria-hidden="true">
153
+ <span />
154
+ {['Value A', 'Curve', 'Value B'].map((t) => <span key={t} className={`${LABEL} uppercase text-center`}>{t}</span>)}
155
+ </div>
156
+ )
157
+
158
+ export function SettingsRamp({ label, value = { a: 0, b: 1, curve: 'linear' }, onChange, curves = [], disabled, partial, ...rest }) {
159
+ const set = (k) => (v) => onChange?.({ ...value, [k]: v })
160
+ const num = (k) => (
161
+ <input type="number" value={value[k]} aria-label={`${label} value ${k.toUpperCase()}`} disabled={disabled || partial?.[k]}
162
+ onChange={(e) => { const n = Number(e.target.value); if (Number.isFinite(n)) set(k)(n) }}
163
+ className={`${FIELD} ${INK} px-2 focus:outline-none focus-visible:shadow-[var(--kol-float-focus)] tabular-nums ${partial?.[k] ? 'opacity-40' : ''}`} />
164
+ )
165
+ return (
166
+ <Dim disabled={disabled} className="grid grid-cols-[88px_minmax(0,87fr)_minmax(0,122fr)_minmax(0,87fr)] gap-x-2 items-center" {...rest}>
167
+ <span className={`${INK} !text-(--kol-oq-64)`}>{label}</span>
168
+ {num('a')}
169
+ <div className={partial?.curve ? 'opacity-40' : ''}>
170
+ <SettingsSelect value={value.curve} onChange={set('curve')} options={curves} ariaLabel={`${label} curve`} disabled={disabled || partial?.curve} />
171
+ </div>
172
+ {num('b')}
173
+ </Dim>
174
+ )
175
+ }
176
+
177
+ export function SettingsLights({ value = [], onChange, disabled }) {
178
+ const set = (i, k, n) => onChange?.(value.map((l, j) => (j === i ? { ...l, [k]: n } : l)))
179
+ const cell = (i, k, v, label, step = 0.01) => (
180
+ <input type="number" value={v} step={step} aria-label={`Light ${i + 1} ${label}`}
181
+ onChange={(e) => { const n = Number(e.target.value); if (Number.isFinite(n)) set(i, k, n) }}
182
+ className={`${FIELD} ${INK} px-2 focus:outline-none focus-visible:shadow-[var(--kol-float-focus)] tabular-nums`} />
183
+ )
184
+ return (
185
+ <Dim disabled={disabled} className="flex flex-col gap-1">
186
+ <div className="grid grid-cols-[1fr_1fr_1fr_1fr_28px] gap-x-2 pb-0.5" aria-hidden="true">
187
+ {['X', 'Y', 'Radius', 'Intensity'].map((t) => <span key={t} className={`${LABEL} uppercase`}>{t}</span>)}
188
+ <span />
189
+ </div>
190
+ {value.map((l, i) => (
191
+ <div key={i} className="grid grid-cols-[1fr_1fr_1fr_1fr_28px] gap-x-2 items-center">
192
+ {cell(i, 'x', l.x, 'X')}{cell(i, 'y', l.y, 'Y')}{cell(i, 'radius', l.radius, 'radius')}{cell(i, 'intensity', l.intensity, 'intensity')}
193
+ <Button tone="ghost" quiet size="xs" iconOnly="trash" aria-label={`Delete light ${i + 1}`} onClick={() => onChange?.(value.filter((_, j) => j !== i))} />
194
+ </div>
195
+ ))}
196
+ <button type="button" onClick={() => onChange?.([...value, { x: 0.5, y: 0.5, radius: 0.3, intensity: 1 }])}
197
+ className={`${INK} self-start h-7 px-2 rounded-[5px] hover:bg-(--kol-oq-08) focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]`}>+ Add light</button>
198
+ </Dim>
199
+ )
200
+ }
201
+
202
+ export function SettingsFieldMap({ background, left, right, label = 'Field map' }) {
203
+ return (
204
+ <div className="flex flex-col">
205
+ <span className={`${LABEL} uppercase pb-[9px]`}>{label}</span>
206
+ <div className="h-[26px] rounded-[4px] bg-surface-primary" style={{ background }} role="img" aria-label={`${label}: ${left ?? ''}`} />
207
+ <div className="flex justify-between gap-2 pt-2.5 pr-6">
208
+ <span className={INK}>{left}</span>
209
+ <span className={`${LABEL} !text-(--kol-fg-64)`}>{right}</span>
210
+ </div>
211
+ </div>
212
+ )
213
+ }
214
+
215
+ export function SettingsDisclosure({ label, note, open, onToggle, children }) {
216
+ return (
217
+ <section className="flex flex-col">
218
+ <button type="button" aria-expanded={!!open} onClick={() => onToggle?.(!open)}
219
+ className="flex items-center gap-[11px] h-[19px] pr-3 text-left rounded focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)]">
220
+ <span aria-hidden="true" className={`text-[16px] leading-[19px] text-oq-64 transition-transform ${open ? 'rotate-90' : ''}`}>›</span>
221
+ <span className={`${INK} font-medium`}>{label}</span>
222
+ {note && <span className={`${LABEL} ml-auto`}>{note}</span>}
223
+ </button>
224
+ {open && <div className="pt-4 flex flex-col gap-[7px]">{children}</div>}
225
+ </section>
226
+ )
227
+ }
@@ -51,6 +51,11 @@ import { Tooltip } from '../utilities/Popover.jsx'
51
51
  * @param {string} accentColor outline + handle + label color (default var(--kol-accent-primary))
52
52
  * @param {Function} labelFormatter (box) => string — dimension readout (default `${round(w)} × ${round(h)}`)
53
53
  * @param {string} rotateTitle tooltip on the rotate handle (default 'Rotate')
54
+ * @param {'float'} variant THE FLOAT LOOK (plan-2026-11-05-float-editor W2.6; his frame 19:6066 — "New text" ·
55
+ * "600 × 160"): a solid 1px oq-64 outline, 6 square handles filled at full ink, the
56
+ * rotate handle a 6 circle, `name` above the box's top-left (`kol-float-label`, oq-64) and
57
+ * the size cap under it (`kol-float-ruler` on oq-08, the float list round). Unset, as before
58
+ * @param {string} name the object's name, drawn above the box by the float look
54
59
  */
55
60
  const HANDLE_DIRS = [
56
61
  { dir: 'NW', cursor: 'nwse-resize', x: 0, y: 0 },
@@ -76,6 +81,8 @@ export default function SelectionOverlay({
76
81
  accentColor = 'var(--kol-accent-primary)',
77
82
  labelFormatter = (b) => `${Math.round(b.w)} × ${Math.round(b.h)}`,
78
83
  rotateTitle = 'Rotate',
84
+ variant,
85
+ name,
79
86
  }) {
80
87
  /* Chrome renders in virtual px inside the zoomed transform — divide by zoom
81
88
  * so handles / outline / label stay screen-constant at any zoom. 1 outside a
@@ -83,6 +90,7 @@ export default function SelectionOverlay({
83
90
  const zoom = useContext(CanvasZoomContext)
84
91
 
85
92
  if (!box || box.x == null) return null /* no positional box → no chrome */
93
+ if (variant === 'float') return <FloatSelection box={box} zoom={zoom} showHandles={showHandles} showRotate={showRotate} showLabel={showLabel} name={name} labelFormatter={labelFormatter} rotateTitle={rotateTitle} />
86
94
 
87
95
  const { x, y, w, h } = box
88
96
  const size = handleSize / zoom
@@ -196,3 +204,41 @@ export default function SelectionOverlay({
196
204
  </>
197
205
  )
198
206
  }
207
+
208
+ /* the float look — the same handles and data-handle routing, drawn as his frame draws the selection; every screen-constant
209
+ * size divides by the zoom (6 handles, the 1px outline) and the two labels counter-scale, as the default look does */
210
+ function FloatSelection({ box, zoom, showHandles = true, showRotate, showLabel = true, name, labelFormatter, rotateTitle }) {
211
+ const { x, y, w, h } = box
212
+ const size = 6 / zoom
213
+ const rotate = showRotate ?? showHandles
214
+ const rot = typeof box.rotation === 'number' ? box.rotation : 0
215
+ const ink = 'var(--kol-surface-on-primary)'
216
+ const counter = { transform: `scale(${1 / zoom})`, pointerEvents: 'none', whiteSpace: 'nowrap', zIndex: 100 }
217
+ return (
218
+ <>
219
+ <div style={{ position: 'absolute', left: x, top: y, width: w, height: h, transform: rot ? `rotate(${rot}deg)` : undefined, pointerEvents: 'none', zIndex: 100 }}>
220
+ <div style={{ position: 'absolute', inset: 0, boxShadow: `0 0 0 ${1 / zoom}px var(--kol-oq-64)` }} />
221
+ {rotate && (
222
+ <Tooltip label={rotateTitle} asChild>
223
+ <div data-handle="ROT" style={{ position: 'absolute', left: `calc(50% - ${size / 2}px)`, top: -(ROTATE_OFFSET / zoom), width: size, height: size, borderRadius: '50%', background: ink, cursor: 'grab', pointerEvents: 'auto' }} />
224
+ </Tooltip>
225
+ )}
226
+ {showHandles && HANDLE_DIRS.map(({ dir, cursor, x: hx, y: hy }) => (
227
+ <div key={dir} data-handle={dir} style={{ position: 'absolute', left: `calc(${hx * 100}% - ${size / 2}px)`, top: `calc(${hy * 100}% - ${size / 2}px)`, width: size, height: size, background: ink, cursor, pointerEvents: 'auto' }} />
228
+ ))}
229
+ </div>
230
+ {/* each label hangs off a zero-size anchor so the counter-scale keeps its edge on the anchor */}
231
+ {showLabel && name && (
232
+ <div style={{ position: 'absolute', left: x, top: y - 8 / zoom, width: 0, height: 0, zIndex: 100 }}>
233
+ <span className="kol-float-label text-oq-64" style={{ ...counter, position: 'absolute', left: 0, bottom: 0, transformOrigin: 'left bottom' }}>{name}</span>
234
+ </div>
235
+ )}
236
+ {showLabel && (
237
+ <div style={{ position: 'absolute', left: x + w / 2, top: y + h + 8 / zoom, width: 0, height: 0, zIndex: 100 }}>
238
+ <span className="kol-float-ruler text-emphasis bg-oq-08 rounded-[var(--kol-float-list-r)] px-2 py-1"
239
+ style={{ ...counter, position: 'absolute', left: 0, top: 0, transform: `translateX(-50%) scale(${1 / zoom})`, transformOrigin: 'top center' }}>{labelFormatter(box)}</span>
240
+ </div>
241
+ )}
242
+ </>
243
+ )
244
+ }