@kolkrabbi/kol-component 0.355.0 → 0.356.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.355.0",
3
+ "version": "0.356.0",
4
4
  "description": "The core component library",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/index.js CHANGED
@@ -179,6 +179,7 @@ export { MenuItem, MenuRow, MenuDivider, MenuFlyout, MenuDropdownItem, MenuDropd
179
179
  export { Menu, MenuTrigger, MenuPanel, MenuLabel, MenuFilter, MenuDatePicker, MenuMore } from './molecules/Menu.jsx'
180
180
  export { MenuList } from './molecules/MenuList.jsx'
181
181
  export { ModalProvider, useModal, Dialog } from './molecules/Modal.jsx'
182
+ export { default as ModalShell } from './molecules/ModalShell.jsx'
182
183
  /* the generator settings window's controls (plan-2026-11-05-float-editor W7.2) — `Dialog variant="settings"`'s rows */
183
184
  export {
184
185
  SettingsGroup, SettingsGrid, SettingsCell, SettingsSlider, SettingsRange, SettingsSelect, SettingsSegmented, SettingsToggle,
@@ -4,6 +4,7 @@ import Button from '../atoms/Button.jsx'
4
4
  import Input from '../atoms/Input.jsx'
5
5
  import ToggleCheckbox from '../atoms/ToggleCheckbox.jsx'
6
6
  import QuickLookHeader from './QuickLookHeader.jsx'
7
+ import ModalShell from './ModalShell.jsx'
7
8
 
8
9
  /**
9
10
  * Modal — promise-based prompt + confirm + alert dialogs.
@@ -85,16 +86,11 @@ import QuickLookHeader from './QuickLookHeader.jsx'
85
86
 
86
87
  const ModalCtx = (globalThis[Symbol.for('@kolkrabbi/kol-component/ModalCtx')] ??= createContext(null))
87
88
 
88
- /* THE MODAL VARIANTS (user 2026-10-31: *"do we not use variants for different styles?"*). `lift` — the overlay panel
89
- * every KOL overlay wears (oq-04, no border, the scrim is the edge); `bordered` — the page surface behind an fg-08
90
- * hairline. Each modal keeps its own default (prompts bordered, Dialog lift) until he picks one. */
91
- const MODAL_VARIANTS = {
92
- lift: { className: 'kol-overlay-panel', style: {} },
93
- /* float (W6, 2026-11-04): the float window — solid ground + the float shadow, the window radius, no edge */
94
- float: { className: 'kol-float-solid !rounded-[var(--kol-float-window-r)] text-fg-emphasis', style: {} },
95
- bordered: { className: 'border border-fg-08', style: { background: 'var(--kol-surface-primary)', color: 'var(--kol-surface-on-primary)' } },
96
- }
97
- const modalVariant = (v, fallback) => MODAL_VARIANTS[v] ?? MODAL_VARIANTS[fallback]
89
+ /* THE MODAL VARIANTS (user 2026-10-31: *"do we not use variants for different styles?"*) live on ModalShell (W2.1,
90
+ * 2026-11-08) — the one panel: `lift`, `bordered`, `float`. Each modal keeps its own default (prompts bordered, Dialog
91
+ * lift) until he picks one; an unknown name falls back to that default. */
92
+ const KNOWN = new Set(['lift', 'bordered', 'float'])
93
+ const modalVariant = (v, fallback) => (KNOWN.has(v) ? v : fallback)
98
94
 
99
95
  export function ModalProvider({ children, variant = 'bordered', container }) {
100
96
  const [state, setState] = useState(null)
@@ -135,7 +131,7 @@ export function ModalProvider({ children, variant = 'bordered', container }) {
135
131
 
136
132
  function ModalView({ state, closeWith, variant, contained }) {
137
133
  const look = modalVariant(variant, 'bordered')
138
- const float = variant === 'float'
134
+ const float = look === 'float'
139
135
  const [val, setVal] = useState(state.defaultValue ?? '')
140
136
  const [values, setValues] = useState(() => Object.fromEntries((state.options ?? []).map((o) => [o.id, !!o.defaultValue])))
141
137
  const [fieldVals, setFieldVals] = useState(() => Object.fromEntries((state.fields ?? []).map((f) => [f.id, f.defaultValue ?? ''])))
@@ -214,21 +210,35 @@ function ModalView({ state, closeWith, variant, contained }) {
214
210
  display: 'flex', alignItems: 'center', justifyContent: 'center',
215
211
  }}
216
212
  >
217
- <div
213
+ <ModalShell
218
214
  ref={dialogRef}
215
+ variant={look}
219
216
  role={typing ? 'dialog' : 'alertdialog'}
220
217
  aria-modal="true"
221
218
  aria-labelledby="kol-modal-title"
222
219
  onMouseDown={(e) => e.stopPropagation()}
223
- className={float ? `kol-modal flex flex-col gap-[18px] p-6 ${look.className}` : `kol-modal flex flex-col gap-4 p-5 rounded ${look.className}`}
220
+ className={float ? 'gap-[18px] p-6' : 'gap-4 p-5'}
224
221
  style={{
225
- ...look.style,
226
222
  minWidth: 320,
227
223
  maxWidth: contained ? '90%' : '90vw',
228
224
  ...(float ? { width: 562 } : {}),
229
225
  }}
226
+ header={float && state.header && <QuickLookHeader variant="float" icon={state.icon} title={state.header} onClose={cancel} />}
227
+ footer={float ? (
228
+ /* the float's actions sit apart: recovery quiet at the left, the next step at the right */
229
+ <div className="flex items-center justify-between gap-3">
230
+ {state.kind !== 'alert' ? <Button variant="float" tone="ghost" size="md" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button> : <span />}
231
+ <Button variant="float" tone={state.tone === 'danger' ? 'danger' : 'inverted'} size="md" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
232
+ </div>
233
+ ) : (
234
+ <div className="flex gap-2 justify-end">
235
+ {state.kind !== 'alert' && <Button size="sm" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button>}
236
+ {/* inverted, not primary: since tone-is-the-ground-axis (2026-09-03) primary is the
237
+ * dark ground, so OK drew the same as Cancel and nothing showed what Enter does */}
238
+ <Button tone="inverted" size="sm" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
239
+ </div>
240
+ )}
230
241
  >
231
- {float && state.header && <QuickLookHeader variant="float" icon={state.icon} title={state.header} onClose={cancel} />}
232
242
  {/* kol-mono-12, not helper: dialog copy WRAPS, and helper's
233
243
  * line-height 1 is single-line chrome only (type protocol). */}
234
244
  {/* pre-line: an alert can carry a failure list, one per line */}
@@ -276,21 +286,7 @@ function ModalView({ state, closeWith, variant, contained }) {
276
286
  ))}
277
287
  </div>
278
288
  )}
279
- {float ? (
280
- /* the float's actions sit apart: recovery quiet at the left, the next step at the right */
281
- <div className="flex items-center justify-between gap-3">
282
- {state.kind !== 'alert' ? <Button variant="float" tone="ghost" size="md" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button> : <span />}
283
- <Button variant="float" tone={state.tone === 'danger' ? 'danger' : 'inverted'} size="md" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
284
- </div>
285
- ) : (
286
- <div className="flex gap-2 justify-end">
287
- {state.kind !== 'alert' && <Button size="sm" onClick={cancel}>{state.cancelLabel ?? 'Cancel'}</Button>}
288
- {/* inverted, not primary: since tone-is-the-ground-axis (2026-09-03) primary is the
289
- * dark ground, so OK drew the same as Cancel and nothing showed what Enter does */}
290
- <Button tone="inverted" size="sm" onClick={submit} data-modal-ok>{state.okLabel ?? 'OK'}</Button>
291
- </div>
292
- )}
293
- </div>
289
+ </ModalShell>
294
290
  </div>
295
291
  )
296
292
  }
@@ -329,7 +325,7 @@ export function useModal() {
329
325
  /**
330
326
  * Dialog — Modal's shell holding any content (MetricDashboardUpstream, kol-website 2026-10-31 — metric's filter and
331
327
  * segment dialogs). The same `.kol-overlay-scrim` + `.kol-modal` surface as the prompts above, with `children` in place
332
- * of a prompt. **z 150, not Modal's 1000**, so KOL's portalled floats (z 210+) open ABOVE it — a Dropdown or Combobox
328
+ * of a prompt — both draw their panel through `ModalShell` (W2.1, 2026-11-08). **z 150, not Modal's 1000**, so KOL's portalled floats (z 210+) open ABOVE it — a Dropdown or Combobox
333
329
  * inside a dialog has to show its list (a native `<dialog>` cannot: `showModal()` puts it in the top layer, over every
334
330
  * portal). Esc and a press on the scrim close it; Esc is left to an open float inside first.
335
331
  *
@@ -362,8 +358,8 @@ export function useModal() {
362
358
  * @param {ReactNode} [aside] · @param {ReactNode} [footer] · @param {number} [height=656]
363
359
  */
364
360
  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 }) {
365
- const look = modalVariant(variant, 'lift')
366
- const float = variant === 'float'
361
+ const look = variant === 'settings' ? 'settings' : modalVariant(variant, 'lift')
362
+ const float = look === 'float'
367
363
  useEffect(() => {
368
364
  if (!open) return undefined
369
365
  const onKey = (e) => { if (e.key === 'Escape' && !document.querySelector('.kol-popover-float, [data-state="open"].kol-dd-trigger')) onClose() }
@@ -377,17 +373,20 @@ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', ic
377
373
  return createPortal(
378
374
  <div onMouseDown={blocking ? onClose : undefined} className={blocking ? 'kol-overlay-scrim' : 'pointer-events-none'}
379
375
  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>
376
+ <ModalShell variant="settings" role="dialog" aria-modal={blocking ? 'true' : undefined} aria-label={title} data-dialog onMouseDown={(e) => e.stopPropagation()}
377
+ className="kol-settings-window pointer-events-auto overflow-hidden"
378
+ style={{ width: `min(${width}px, calc(${within} - 32px))`, height: `min(${height}px, calc(${withinH} - 32px))` }}
379
+ header={(
380
+ <header className="flex items-center gap-4 h-[60px] shrink-0 pl-6 pr-[22px] border-b border-oq-16">
381
+ <h2 className="text-[14px] font-semibold leading-none">{title}</h2>
382
+ {kind && <span className="text-[11px] text-oq-64 leading-none mt-px">{kind}</span>}
383
+ <span className="flex-1" />
384
+ {headerEnd}
385
+ <button type="button" aria-label="Close" onClick={onClose}
386
+ 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>
387
+ </header>
388
+ )}
389
+ footer={footer && <footer className="flex items-center gap-3 h-[60px] shrink-0 px-6 border-t border-oq-16">{footer}</footer>}>
391
390
  <div className="flex flex-1 min-h-0">
392
391
  {sections?.length > 0 && (
393
392
  <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">
@@ -420,8 +419,7 @@ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', ic
420
419
  <div className="flex-1 min-w-0 overflow-y-auto pl-6 pr-5 pt-6 pb-6">{children}</div>
421
420
  {aside && <aside className="w-[248px] shrink-0 mr-6 pt-6 pb-6 overflow-y-auto">{aside}</aside>}
422
421
  </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>
422
+ </ModalShell>
425
423
  </div>,
426
424
  container ?? document.body,
427
425
  )
@@ -432,7 +430,8 @@ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', ic
432
430
  className={blocking ? 'kol-overlay-scrim' : 'pointer-events-none'}
433
431
  style={{ position: container ? 'absolute' : 'fixed', inset: 0, zIndex: 150, display: 'flex', alignItems: 'center', justifyContent: 'center' }}
434
432
  >
435
- <div
433
+ <ModalShell
434
+ variant={look}
436
435
  role="dialog"
437
436
  aria-modal={blocking ? 'true' : undefined}
438
437
  aria-label={title}
@@ -441,12 +440,12 @@ export function Dialog({ open, onClose, title, width = 560, variant = 'lift', ic
441
440
  /* THE OVERLAY PANEL (MetricRebuild, 2026-10-31 — user: the filter dialog read as "a borderless box floating
442
441
  * mid-page"): it painted the page's own surface behind an fg-08 hairline, so on a dark page it was the page.
443
442
  * `.kol-overlay-panel` is the lift every KOL overlay wears (oq-04, no border — the scrim is the edge). */
444
- className={float ? `kol-modal pointer-events-auto flex flex-col gap-[18px] p-6 ${container ? 'max-h-[85%]' : 'max-h-[85vh]'} overflow-auto ${look.className}` : `kol-modal flex flex-col rounded ${container ? 'max-h-[85%]' : 'max-h-[85vh]'} ${look.className}${blocking ? '' : ' pointer-events-auto'}`}
445
- style={{ ...look.style, width: `min(${width}px, calc(${container ? '100%' : '100vw'} - 32px))` }}
443
+ className={float ? `pointer-events-auto gap-[18px] p-6 ${container ? 'max-h-[85%]' : 'max-h-[85vh]'} overflow-auto` : `${container ? 'max-h-[85%]' : 'max-h-[85vh]'}${blocking ? '' : ' pointer-events-auto'}`}
444
+ style={{ width: `min(${width}px, calc(${container ? '100%' : '100vw'} - 32px))` }}
445
+ header={float && title && <QuickLookHeader variant="float" icon={icon} title={title} onMinimise={onMinimise} onClose={onClose} />}
446
446
  >
447
- {float && title && <QuickLookHeader variant="float" icon={icon} title={title} onMinimise={onMinimise} onClose={onClose} />}
448
447
  {children}
449
- </div>
448
+ </ModalShell>
450
449
  </div>,
451
450
  container ?? document.body,
452
451
  )
@@ -0,0 +1,48 @@
1
+ import { forwardRef } from 'react'
2
+
3
+ /* taxonomy-ok: molecule — the modal family's panel: the surface every modal, dialog and sheet window draws its parts on */
4
+
5
+ /**
6
+ * ModalShell — The one modal panel (plan-2026-11-08-outstanding W2.1, his Figma issue 52: *"modals not built on one
7
+ * modal"*). The surface, the radius, a header slot, the body and a footer slot — nothing else. The scrim, the portal,
8
+ * the keys and the size stay the caller's (Modal, Dialog, FullscreenOverlay), so every overlay can wear it whatever
9
+ * layer it sits in. Padding and the gap between the parts are the caller's too (`className`): a prompt and a media
10
+ * window do not share them.
11
+ *
12
+ * <ModalShell header={<QuickLookHeader … />} footer={<div>…actions</div>} className="gap-4 p-5" style={{ width: 560 }}>
13
+ * …body
14
+ * </ModalShell>
15
+ *
16
+ * ONE RADIUS: `--kol-radius-sm` (4px) — the radius Modal's prompts and Dialog wore. The float style's windows keep the
17
+ * float window radius (`float`, 28) and the generator settings window its 16 (`settings`); both are the float style's
18
+ * own, drawn in its Figma.
19
+ *
20
+ * @param {'lift'|'bordered'|'float'|'settings'} [variant='lift']
21
+ * `lift` — the overlay panel every KOL overlay wears (`.kol-overlay-panel`: oq-04, no border, the scrim is the edge);
22
+ * `bordered` — the page surface behind an fg-08 hairline (Modal's prompts); `float` — the float window
23
+ * (`kol-float-solid`); `settings` — the generator settings window (the secondary surface, oq-16 edge, the float shadow).
24
+ * @param {ReactNode} [header] drawn first
25
+ * @param {ReactNode} [footer] drawn last
26
+ * @param {string} [className] the caller's layout: padding, gap, size
27
+ * @param {Object} [style]
28
+ * Any other prop (role, aria-*, onMouseDown, data-*) lands on the panel; the ref is the panel.
29
+ */
30
+ const VARIANTS = {
31
+ lift: { className: 'kol-overlay-panel rounded-[var(--kol-radius-sm)]', style: {} },
32
+ bordered: { className: 'border border-fg-08 rounded-[var(--kol-radius-sm)]', style: { background: 'var(--kol-surface-primary)', color: 'var(--kol-surface-on-primary)' } },
33
+ float: { className: 'kol-float-solid !rounded-[var(--kol-float-window-r)] text-fg-emphasis', style: {} },
34
+ settings: { className: 'rounded-2xl border border-oq-16 bg-surface-secondary text-fg-96 font-(family-name:--kol-font-family-float) shadow-[var(--kol-shadow-float)]', style: {} },
35
+ }
36
+
37
+ const ModalShell = forwardRef(function ModalShell({ variant = 'lift', header, footer, className = '', style, children, ...rest }, ref) {
38
+ const look = VARIANTS[variant] ?? VARIANTS.lift
39
+ return (
40
+ <div ref={ref} {...rest} className={`kol-modal flex flex-col ${look.className} ${className}`.trim()} style={{ ...look.style, ...style }}>
41
+ {header}
42
+ {children}
43
+ {footer}
44
+ </div>
45
+ )
46
+ })
47
+
48
+ export default ModalShell
@@ -1,8 +1,9 @@
1
1
  import { useRef, useState } from 'react'
2
2
  import { IconLoader } from '@kolkrabbi/kol-icons'
3
3
  import QuickLookHeader from './QuickLookHeader.jsx'
4
+ import ModalShell from './ModalShell.jsx'
4
5
 
5
- /* taxonomy-ok: molecule — nests QuickLookHeader (molecule) + kol-icons's Icon. */
6
+ /* taxonomy-ok: molecule — QuickLookHeader (molecule) on ModalShell (molecule) + kol-icons's IconLoader. */
6
7
 
7
8
  /**
8
9
  * QuickLookFrame — The preview window. the Finder Quick Look window (user 2026-09-23: *"put them in a container LIKE
@@ -68,26 +69,31 @@ export default function QuickLookFrame({ variant, icon, onMinimise, status, titl
68
69
  const grip = { role: 'separator', 'aria-label': 'Resize', onPointerDown, onPointerMove, onPointerUp, onPointerCancel: onPointerUp }
69
70
  if (variant === 'float') {
70
71
  return (
71
- <div ref={ref} style={size ? { width: size.w, height: size.h } : undefined}
72
- className={`kol-float-solid flex w-full max-w-[562px] flex-col gap-[18px] rounded-[var(--kol-float-window-r)] p-5 text-fg-emphasis ${className}`.trim()}>
73
- {header && <QuickLookHeader variant="float" icon={icon} title={title} actions={actions} onMinimise={onMinimise} onClose={onClose} />}
72
+ <ModalShell ref={ref} variant="float" style={size ? { width: size.w, height: size.h } : undefined}
73
+ className={`w-full max-w-[562px] gap-[18px] p-5 ${className}`.trim()}
74
+ header={header && <QuickLookHeader variant="float" icon={icon} title={title} actions={actions} onMinimise={onMinimise} onClose={onClose} />}
75
+ footer={(
76
+ <>
77
+ {footer}
78
+ <div className="flex items-center gap-3">
79
+ <span className="kol-float-label min-w-0 flex-1 truncate text-fg-64">{status}</span>
80
+ <span {...grip} className="inline-flex size-4 cursor-nwse-resize touch-none items-center justify-center text-oq-64 hover:text-oq-96"><IconLoader name="expand" size={13} /></span>
81
+ </div>
82
+ </>
83
+ )}>
74
84
  <div className="flex min-h-0 flex-1 flex-col gap-[18px]">{children}</div>
75
- {footer}
76
- <div className="flex items-center gap-3">
77
- <span className="kol-float-label min-w-0 flex-1 truncate text-fg-64">{status}</span>
78
- <span {...grip} className="inline-flex size-4 cursor-nwse-resize touch-none items-center justify-center text-oq-64 hover:text-oq-96"><IconLoader name="expand" size={13} /></span>
79
- </div>
80
- </div>
85
+ </ModalShell>
81
86
  )
82
87
  }
83
- const style = size ? { width: size.w, height: size.h, '--kol-ql-frame-h': `${size.h}px`, '--kol-ql-max-w': `${size.w - 2}px` } : undefined
88
+ /* THE PANEL IS ModalShell's (W2.2, 2026-11-08): the lift surface and the one modal radius; the oq-12 hairline the
89
+ * window wore went with its own panel style — the scrim is the edge, as on every other KOL overlay */
90
+ const style = size ? { width: size.w, height: size.h, '--kol-ql-frame-h': `${size.h}px`, '--kol-ql-max-w': `${size.w}px` } : undefined
84
91
  return (
85
- <div ref={ref} style={style}
86
- className={`kol-quicklook${footer ? ' kol-quicklook--footer' : ''}${size ? ' kol-quicklook--sized' : ''} ${className}`.trim()}>
87
- {header && <QuickLookHeader title={title} meta={meta} actions={actions} nav={nav} onClose={onClose} />}
92
+ <ModalShell ref={ref} style={style}
93
+ className={`kol-quicklook${footer ? ' kol-quicklook--footer' : ''}${size ? ' kol-quicklook--sized' : ''} ${className}`.trim()}
94
+ header={header && <QuickLookHeader title={title} meta={meta} actions={actions} nav={nav} onClose={onClose} />}
95
+ footer={<>{footer && <div className="kol-quicklook-footer">{footer}</div>}<span className="kol-quicklook-grip" {...grip} /></>}>
88
96
  <div className="kol-quicklook-body">{children}</div>
89
- {footer && <div className="kol-quicklook-footer">{footer}</div>}
90
- <span className="kol-quicklook-grip" {...grip} />
91
- </div>
97
+ </ModalShell>
92
98
  )
93
99
  }
@@ -8,6 +8,7 @@ import Input from '../atoms/Input.jsx'
8
8
  import ViewToggle from '../atoms/ViewToggle.jsx'
9
9
  import SearchInput from '../molecules/SearchInput.jsx'
10
10
  import FullscreenOverlay from '../molecules/FullscreenOverlay.jsx'
11
+ import ModalShell from '../molecules/ModalShell.jsx'
11
12
  import { Tooltip } from '../utilities/Popover.jsx'
12
13
  import MediaTile from '../molecules/MediaTile.jsx'
13
14
  import ContentRow from '../molecules/ContentRow.jsx'
@@ -992,9 +993,9 @@ function PickerShell({ onClose, onPick }) {
992
993
  {/* `scrim` — a modal OVER the page it was opened from, not an opaque surface in its place
993
994
  * (user, 2026-10-07, on labs: "its not overlay, its complete full screen") */}
994
995
  <FullscreenOverlay open scrim onClose={viewerIndex === null ? onClose : () => {}}>
995
- <div className="kol-media-picker">
996
+ <ModalShell className="kol-media-picker max-md:rounded-none">
996
997
  <LibraryChrome onOpen={setViewerIndex} onPick={pick} />
997
- </div>
998
+ </ModalShell>
998
999
  </FullscreenOverlay>
999
1000
 
1000
1001
  {viewerIndex !== null && viewable[viewerIndex] && (
@@ -1115,7 +1116,14 @@ function PickerBrowse({ client, accept, onClose, onSelect, title = 'MEDIA', ...b
1115
1116
  * The X moved three times (overlay corner → title row, 2026-10-10 → beside the gear → corner again)
1116
1117
  * and was wrong each time; without it the card's block-start lane goes too (`pt-5`). */
1117
1118
  <FullscreenOverlay open scrim onClose={onClose} closeButton={false}>
1118
- <div className="kol-media-picker gap-4 pt-5">
1119
+ <ModalShell className="kol-media-picker max-md:rounded-none gap-4 pt-5"
1120
+ footer={!phone && (
1121
+ <div className="mt-auto flex items-center justify-end gap-4">
1122
+ <span className="kol-mono-12 text-fg-48 truncate mr-auto">{file ? file.key : 'Select a file'}</span>
1123
+ <Button tone="grey" size="md" onClick={onClose}>Cancel</Button>
1124
+ <Button size="md" disabled={!ok} onClick={() => use()}>Use</Button>
1125
+ </div>
1126
+ )}>
1119
1127
  {/* THE PICKER READS AS THE MEDIA APP (user 2026-10-23, beside kol-r2b2 on a phone): the title in the display voice —
1120
1128
  * a modal card, not a page of the app, so the shell's masthead does not reach it — and the listing opening at
1121
1129
  * the title root, the buckets as rows (the database glyph), each with its count. The browse surface's own
@@ -1137,14 +1145,7 @@ function PickerBrowse({ client, accept, onClose, onSelect, title = 'MEDIA', ...b
1137
1145
  canInsert={fits}
1138
1146
  />
1139
1147
  </MastheadContext.Provider>
1140
- {!phone && (
1141
- <div className="mt-auto flex items-center justify-end gap-4">
1142
- <span className="kol-mono-12 text-fg-48 truncate mr-auto">{file ? file.key : 'Select a file'}</span>
1143
- <Button tone="grey" size="md" onClick={onClose}>Cancel</Button>
1144
- <Button size="md" disabled={!ok} onClick={() => use()}>Use</Button>
1145
- </div>
1146
- )}
1147
- </div>
1148
+ </ModalShell>
1148
1149
  </FullscreenOverlay>
1149
1150
  )
1150
1151
  }
@@ -7,6 +7,7 @@ import LabeledControl from '../molecules/LabeledControl.jsx'
7
7
  import ToggleSwitch from '../atoms/ToggleSwitch.jsx'
8
8
  import Rail from './Rail.jsx'
9
9
  import FullscreenOverlay from '../molecules/FullscreenOverlay.jsx'
10
+ import ModalShell from '../molecules/ModalShell.jsx'
10
11
  import { Tooltip } from '../utilities/Popover.jsx'
11
12
  import { RailHeader } from './RailKit.jsx'
12
13
 
@@ -97,16 +98,19 @@ export default function SettingsPanel({
97
98
  const width = widthProp ?? 'min(32rem, calc(100vw - 32px))'
98
99
  return (
99
100
  <FullscreenOverlay open scrim closeButton={false} onClose={onClose}>
100
- <div
101
- className={`kol-overlay-panel flex flex-col p-[var(--kol-pad-overlay)] ${className}`}
101
+ {/* the panel is ModalShell's (W2.2, 2026-11-08) — the lift and the one modal radius; ShortcutsOverlay draws here */}
102
+ <ModalShell
103
+ className={`p-[var(--kol-pad-overlay)] ${className}`}
102
104
  style={{ width: typeof width === 'number' ? `${width}px` : width, maxWidth: '100%', maxHeight: '85vh', overflowY: 'auto' }}
105
+ header={(
106
+ <div className="mb-6 flex items-center gap-4">
107
+ <div className="min-w-0 flex-1">{header}</div>
108
+ <CloseButton onClick={onClose} hover={false} className="shrink-0" />
109
+ </div>
110
+ )}
103
111
  >
104
- <div className="mb-6 flex items-center gap-4">
105
- <div className="min-w-0 flex-1">{header}</div>
106
- <CloseButton onClick={onClose} hover={false} className="shrink-0" />
107
- </div>
108
112
  <div className="flex flex-col gap-4"><Divider />{body}{footer && <div className="mt-2">{footer}</div>}</div>
109
- </div>
113
+ </ModalShell>
110
114
  </FullscreenOverlay>
111
115
  )
112
116
  }