@kolkrabbi/kol-shell 0.130.0 → 0.132.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/src/MenuBar.jsx CHANGED
@@ -21,20 +21,22 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
21
21
  * menu capsule 19:10617): the menus on a float sheet (the secondary surface, the window round,
22
22
  * 20 in), each trigger the float label role in caps at fg-48 with the spec chevron (`--kol-float-chev-sm`), 12 apart,
23
23
  * lit fg-96 while open. The same menus, lists and keys as the bar.
24
+ * `folio`: Folio's editor bar, `menus` and `children` only (see `MenuBarFolio`).
25
+ * `kolbox`: kolbox's bar, the same two props (see `MenuBarKolbox`).
24
26
  * @param {string} className
25
27
  *
26
28
  * A row in `items` (Menu's own row keys): `{ label, onClick, kbd?, disabled?, checked?, indicator?, icon?, tone? }` ·
27
29
  * `{ label, items }` a submenu · `{ divider: true }` · `{ heading }` a section label.
28
30
  */
29
- const ROW = 'kol-menubar-row w-full shrink-0 flex items-center gap-2 h-6 px-2 rounded-[var(--kol-radius-sm)] text-left font-[family-name:var(--kol-font-family-sans)] text-[13px] font-medium leading-normal text-[color:var(--kol-fg-emphasis)] hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
31
+ const ROW = 'kol-menubar-row w-full shrink-0 flex items-center gap-2 h-6 px-2 rounded-[var(--kol-radius-4)] text-left font-[family-name:var(--kol-font-family-sans)] text-[13px] font-medium leading-normal text-[color:var(--kol-fg-emphasis)] hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
30
32
  /* the list: the secondary surface, a 2% rim, 4 in, the large shadow; the key cap on the rim's fill, its ink oq-80 */
31
- const LIST = 'kol-menubar-list flex flex-col bg-[var(--kol-surface-secondary)] border border-[var(--kol-fg-02)] rounded-[var(--kol-radius-sm)] p-1 shadow-[0_10px_15px_rgba(0,0,0,0.1)] [&_.kol-menu-kbd]:bg-[var(--kol-fg-02)] [&_.kol-menu-kbd]:border [&_.kol-menu-kbd]:border-[var(--kol-fg-02)] [&_.kol-menu-kbd]:text-[var(--kol-oq-80)] [&_.kol-menu-kbd]:rounded-[2px]'
33
+ const LIST = 'kol-menubar-list flex flex-col bg-[var(--kol-surface-secondary)] border border-[var(--kol-fg-02)] rounded-[var(--kol-radius-4)] p-1 shadow-[0_10px_15px_rgba(0,0,0,0.1)] [&_.kol-menu-kbd]:bg-[var(--kol-fg-02)] [&_.kol-menu-kbd]:border [&_.kol-menu-kbd]:border-[var(--kol-fg-02)] [&_.kol-menu-kbd]:text-[var(--kol-oq-80)] [&_.kol-menu-kbd]:rounded-[2px]'
32
34
  /* the capsule's trigger (his 19:9544): Inter 11 caps at fg-48, the chevron 8 after, 26 tall, the text on the top */
33
35
  const CAPSULE_TRIGGER = 'kol-menu-btn inline-flex items-start gap-2 h-[26px] p-0 bg-transparent border-0 kol-float-label uppercase whitespace-nowrap text-fg-48 hover:text-(--kol-fg-80) aria-expanded:text-(--kol-fg-96) focus-visible:outline-none focus-visible:text-(--kol-fg-96) [&_svg]:mt-[3px]'
34
36
  /* the trigger: 26 tall, 12 in; lit while its menu is open. The line box is the pill (leading 26, not 13): a 13 line box
35
37
  * centred in 26 starts on a half pixel, and the glyphs rode it — the label's cap centre on the pill's centre, measured
36
38
  * in Chromium and Firefox (±0.5 at 1x is the 9px cap's own rounding). */
37
- const TRIGGER = 'kol-menu-btn inline-flex items-center h-[26px] px-3 rounded-[var(--kol-radius-sm)] font-[family-name:var(--kol-font-family-sans)] text-[13px] leading-[26px] text-[color:var(--kol-fg-emphasis)] whitespace-nowrap hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
39
+ const TRIGGER = 'kol-menu-btn inline-flex items-center h-[26px] px-3 rounded-[var(--kol-radius-4)] font-[family-name:var(--kol-font-family-sans)] text-[13px] leading-[26px] text-[color:var(--kol-fg-emphasis)] whitespace-nowrap hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
38
40
 
39
41
  function Rows({ items, width }) {
40
42
  return items.map((it, i) => {
@@ -60,7 +62,58 @@ function Rows({ items, width }) {
60
62
  })
61
63
  }
62
64
 
63
- export default function MenuBar({ app, menus = [], end = [], variant = 'bar', className = '' }) {
65
+ /* `variant="folio"` (Folio migration batch B, 2026-11-22): Folio's editor menu bar (apps/folio EditorChrome `MenuBar`)
66
+ * carried class for class, the chrome in kol-theme `.kol-menubar--folio`: 48 high between two rules, the menus from 42
67
+ * in, `children` (Folio's word: the tools every format has) at the far right. Each trigger is 32 high, lit while its
68
+ * list is open; once one is open, pointing at another opens it; Esc or a press outside closes. The lists are `Menu
69
+ * variant="folio"` under their trigger, in place. `menus` `[{ label, items }]`, Menu's rows. No app name, no `end`. */
70
+ function MenuBarFolio({ menus = [], children }) {
71
+ const [open, setOpen] = useState(null)
72
+ return (
73
+ <div className="kol-menubar--folio flex h-[48px] shrink-0 items-center gap-[2px] border-y pl-[42px] pr-[48px]">
74
+ {menus.map(({ label, items }) => (
75
+ <span key={label} className="relative">
76
+ <button type="button" aria-haspopup="menu" aria-expanded={open === label} onMouseDown={(e) => e.preventDefault()} onClick={() => setOpen(open === label ? null : label)} onMouseEnter={() => open && setOpen(label)}
77
+ className={`kol-menubar-trigger--folio${open === label ? ' is-open' : ''} flex h-[32px] items-center rounded-[4px] px-[14px]`}>{label}</button>
78
+ <Menu variant="folio" open={open === label} onClose={() => setOpen(null)} aria-label={label} items={items} panelClassName="absolute left-0 top-[calc(100%+4px)]" />
79
+ </span>
80
+ ))}
81
+ <div className="ml-auto flex items-center gap-[4px]">{children}</div>
82
+ </div>
83
+ )
84
+ }
85
+
86
+ /* `variant="kolbox"` (Folio on kolbox, 2026-11-22): kolbox's own menu bar (round 2, retired from kolbox's top rail in
87
+ * round 3, `_tmp/2026-11-18-menubar/MenuBar.jsx` and its TopRail) carried class for class, the chrome in kol-theme
88
+ * `.kol-menubar--kolbox`: the top rail's 56 on the panel fill, 16 in, the rails' line under it; each trigger the kolbox
89
+ * control height (`--kol-kolbox-ctl`), 8 in, radius 4, the label role in the ink, the field fill on hover and while its
90
+ * list is open. The lists are `Menu variant="kolbox"` dropped from their trigger; once one is open, pointing at another
91
+ * opens it; Escape or a press outside closes. Folio's words, so a host switches by the variant alone: `menus`
92
+ * `[{ label, items }]` (Menu's rows) and `children` at the far right. */
93
+ function MenuBarKolbox({ menus = [], children }) {
94
+ const [open, setOpen] = useState(null)
95
+ const refs = useRef({})
96
+ const current = menus.find((m) => m.label === open)
97
+ return (
98
+ <nav aria-label="Menu bar" className="kol-menubar--kolbox flex h-14 shrink-0 items-center border-b px-4">
99
+ {menus.map(({ label }) => (
100
+ <button key={label} ref={(el) => { refs.current[label] = el }} type="button" aria-haspopup="menu" aria-expanded={open === label}
101
+ onMouseDown={(e) => e.preventDefault()} onClick={() => setOpen((o) => (o === label ? null : label))} onPointerEnter={() => { if (open && open !== label) setOpen(label) }}
102
+ className={`kol-menubar-trigger--kolbox${open === label ? ' is-open' : ''} inline-flex h-(--kol-kolbox-ctl) items-center px-2 outline-none focus-visible:outline-1`}>{label}</button>
103
+ ))}
104
+ {current && <Menu key={open} variant="kolbox" aria-label={open} anchor={refs.current[open]} open onClose={() => setOpen(null)} items={current.items} />}
105
+ <div className="ml-auto flex items-center gap-1">{children}</div>
106
+ </nav>
107
+ )
108
+ }
109
+
110
+ export default function MenuBar(props) {
111
+ if (props.variant === 'kolbox') return <MenuBarKolbox {...props} />
112
+ if (props.variant === 'folio') return <MenuBarFolio {...props} />
113
+ return <MenuBarOn {...props} />
114
+ }
115
+
116
+ function MenuBarOn({ app, menus = [], end = [], variant = 'bar', className = '' }) {
64
117
  const capsule = variant === 'capsule'
65
118
  const appMenu = typeof app === 'string' ? { label: app } : app
66
119
  const all = [...(appMenu ? [{ ...appMenu, app: true }] : []), ...menus, ...end]
@@ -9,12 +9,17 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
9
9
  * the selected object's line (kol-component's `LayerRow variant="head"`: glyph, name and eye, W8.1) and sections — each a
10
10
  * float `LabeledControlSection` (W10.1: the `kol-float-label` head with an optional + or meta over its rows) of rows that
11
11
  * kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
12
- * readout, `switch` a ToggleSwitch float, or `render`. Every labelled row is `LabeledControl variant="float"`. Nothing is forked: the sheet is the only new chrome. The
12
+ * readout, `switch` a ToggleSwitch float, or `render`. Every labelled row is `LabeledControl`. Nothing is forked: the sheet is the only new chrome. The
13
13
  * exploration's `Floating properties inspector` (kol-float--style 9:9273); the section hairlines stay out (no-borders law).
14
14
  * Since 0.123.0 the sheet, header, collapse-v and its pill are kol-component's `RailFloat` (plan-2026-11-12-float-system
15
15
  * W4.1) — the one shell NavRail float and ReadingContents draw on too; the body scrolls under the header.
16
16
  *
17
17
  * @param {string} title the header (Properties)
18
+ * @param {ReactNode} kind the quiet second text beside the title (the preset beside the effect — no middot, W10.1)
19
+ * @param {Array} windows `[{ id, title, kind, sections, children, footer, defaultCollapsedV, … }]` — the Rail as a stack
20
+ * of separate RailFloat windows (W10.1): each window takes this component's props over the
21
+ * shared ones, its own Header with collapse-v, collapsing alone; 24 between them; the stack
22
+ * scrolls only when they outgrow it. Unset, one Rail as before
18
23
  * @param {Function} onCollapseH the collapse-h ⇥'s press (the Rail collapses sideways out of view); unset, no ⇥.
19
24
  * `onCollapse` is its deprecated alias
20
25
  * @param {Array} tabs TabsRow tabs `[{ value, label }]` at the inspector size (xs, 26 — float-operational W1.3);
@@ -30,10 +35,11 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
30
35
  * W7.6): LabeledControl float `horizontal` — the label in the `--kol-float-label-w` column, the control in the rest ·
31
36
  * `{ type: 'subhead', id?, label, meta? }` — a group's caps head inside a section (LIGHTS / POINT EDITOR): it and the rows
32
37
  * under it are a float LabeledControlSection of their own ·
33
- * a section may also be `collapsible` (`open` · `onToggle(open)`): its head is the chevron and the
34
- * title in `kol-float-panel`, `meta` at the far end, its rows shown while open
35
- * @param {'regular'|'compact'} density `compact` — the tool Rail's rhythm (his generator frames 32:16215): 8 between rows,
36
- * 24 before a section, 20 before a subhead; `regular` (default) the inspector's 18
38
+ * a section may also be `collapsible` (`open` · `onToggle(open)`): LabeledControlSection's own
39
+ * collapsible head — the title in `kol-float-panel`, `meta`, the 12 chevron at the right end; its
40
+ * rows shown while open. No section pads itself: the space between sections is the body's gap
41
+ * @param {'regular'|'compact'} density `compact` — the tool Rail's rhythm (his generator frames 32:16215): 8 between rows
42
+ * and between sections (the body's gap, W10.1); `regular` (default) the inspector's 18
37
43
  * @param {Function} onExpand the ↗ in the header — the tool's expanded form (the settings dialog); unset, none
38
44
  * @param {ReactNode} footer the Rail's foot (a status line, the tool's action), after the sections
39
45
  * @param {'solid'|'glass-dark'|'glass-light'} surface what the sheet is made of (default `solid`)
@@ -48,35 +54,48 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
48
54
  * @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents, Labs' params)
49
55
  * @param {string} className
50
56
  */
51
- export default function PropertyRail({ title, onCollapseH, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width, collapsibleV, collapsedV, defaultCollapsedV, onCollapseV, foldable, folded, defaultFolded, onFold, children, className = '' }) {
57
+ export default function PropertyRail({ windows, ...props }) {
58
+ /* WINDOWS (plan-2026-11-12-one-header W10.1, P15: *"you just split the content into windows and they expand and collapse as
59
+ * you see fit"*): a vertical stack of separate RailFloat windows, the float layout's gap (24) between them, each its own
60
+ * Header (property, collapse-v) collapsing alone; the stack scrolls only when the windows outgrow it. A window is this
61
+ * component's own props (`{ id, title, kind, sections, children, footer, defaultCollapsedV … }`) over the shared ones. */
62
+ if (windows?.length) {
63
+ const { className = '', title, kind, sections, children, footer, tabs, tab, onTab, selected, ...shared } = props
64
+ return (
65
+ <div data-property-rail-windows="" className={`flex min-h-0 flex-col gap-6 overflow-y-auto [scrollbar-width:none] ${className}`.trim()}>
66
+ {windows.map((w, i) => <PropertyRailWindow key={w.id ?? i} collapsibleV {...shared} {...w} className={`shrink-0 ${w.className ?? ''}`.trim()} />)}
67
+ </div>
68
+ )
69
+ }
70
+ return <PropertyRailWindow {...props} />
71
+ }
72
+
73
+ function PropertyRailWindow({ title, kind, onCollapseH, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width, collapsibleV, collapsedV, defaultCollapsedV, onCollapseV, foldable, folded, defaultFolded, onFold, children, className = '' }) {
52
74
  const compact = density === 'compact'
53
75
  return (
54
- <RailFloat title={title} onExpand={onExpand} onCollapseH={onCollapseH ?? onCollapse}
76
+ <RailFloat title={title} kind={kind} onExpand={onExpand} onCollapseH={onCollapseH ?? onCollapse}
55
77
  collapsibleV={collapsibleV ?? foldable} collapsedV={collapsedV ?? folded} defaultCollapsedV={defaultCollapsedV ?? defaultFolded} onCollapseV={onCollapseV ?? onFold}
56
78
  compact={compact} wide={wide} width={width} surface={surface} className={`kol-property-rail ${className}`.trim()}
57
79
  footer={footer && compact ? <div className="pt-4">{footer}</div> : footer}>
58
- {tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
80
+ {tabs?.length > 0 && <TabsRow size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
59
81
  {selected && (
60
82
  <LayerRow variant="head" icon={selected.icon} name={selected.name} visible={selected.visible !== false}
61
83
  onToggleVisible={selected.onVisible && (() => selected.onVisible(selected.visible === false))} />
62
84
  )}
63
85
  {sections.map((s, i) => {
64
- const add = s.onAdd && <Button variant="float" tone="ghost" size="sm" iconOnly="plus" aria-label={`Add to ${s.label}`} onClick={s.onAdd} />
86
+ const add = s.onAdd && <Button tone="ghost" size="sm" iconOnly="plus" aria-label={`Add to ${s.label}`} onClick={s.onAdd} />
65
87
  const meta = s.meta && <span className="kol-float-timecode text-emphasis">{s.meta}</span>
66
- const label = s.collapsible ? (
67
- <button type="button" aria-expanded={!!s.open} onClick={() => s.onToggle?.(!s.open)}
68
- className="flex flex-1 items-center gap-1.5 text-left focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] rounded-sm">
69
- <IconLoader name="chevron-down" size="var(--kol-float-chev-sm)" className={`text-oq-64 transition-transform ${s.open ? '' : '-rotate-90'}`} />
70
- <span className="kol-float-panel text-emphasis flex-1 min-w-0">{s.label}</span>
71
- {s.meta && <span className="kol-float-timecode text-oq-64">{s.meta}</span>}
72
- </button>
73
- ) : s.label
88
+ /* a collapsible section is LabeledControlSection's own `collapsible`: the title, the meta, the 12 chevron at the head's
89
+ * right end (W10.1). No section pads itself: the space between sections is the body's gap */
90
+ const label = s.collapsible ? <span className="kol-float-panel text-emphasis min-w-0">{s.label}</span> : s.label
91
+ const end = s.collapsible ? (s.meta && <span className="kol-float-timecode text-oq-64">{s.meta}</span>) : (add || meta) && <>{add}{meta}</>
74
92
  return (
75
- <LabeledControlSection key={s.id ?? s.label ?? i} variant="float" data-section={s.id ?? s.label} label={label} end={!s.collapsible && (add || meta) && <>{add}{meta}</>}
76
- gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact && i > 0 ? 'pt-4' : ''}>
77
- {(!s.collapsible || s.open) && groups(s.rows ?? []).map((g, j) => (g.head
78
- ? <LabeledControlSection key={g.head.id ?? `g${j}`} variant="float" label={g.head.label} end={g.head.meta && <span className="kol-float-label text-fg-emphasis">{g.head.meta}</span>}
79
- gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact ? 'pt-3' : 'pt-1'}>
93
+ <LabeledControlSection key={s.id ?? s.label ?? i} data-section={s.id ?? s.label} label={label} end={end}
94
+ collapsible={!!s.collapsible} open={s.collapsible ? !!s.open : undefined} onToggle={s.onToggle}
95
+ gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'}>
96
+ {groups(s.rows ?? []).map((g, j) => (g.head
97
+ ? <LabeledControlSection key={g.head.id ?? `g${j}`} label={g.head.label} end={g.head.meta && <span className="kol-float-label text-fg-emphasis">{g.head.meta}</span>}
98
+ gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'}>
80
99
  {g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)}
81
100
  </LabeledControlSection>
82
101
  : g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)))}
@@ -101,7 +120,7 @@ function groups(rows) {
101
120
  function Row({ row: r }) {
102
121
  if (r.type === 'labeled') {
103
122
  return (
104
- <LabeledControl variant="float" horizontal label={r.label} className="w-full">
123
+ <LabeledControl horizontal label={r.label} className="w-full">
105
124
  <div className="flex w-full min-w-0 items-center gap-1.5" data-control={r.label}>{r.render()}</div>
106
125
  </LabeledControl>
107
126
  )
@@ -111,28 +130,28 @@ function Row({ row: r }) {
111
130
  return (
112
131
  <div className="flex gap-2">
113
132
  {r.fields.map((f) => (
114
- <Input key={f.id} variant="float" size="md" prefix={f.prefix} suffix={f.unit} value={f.value} onChange={(e) => f.onChange?.(e.target.value)} aria-label={f.label ?? f.prefix ?? f.id} className="flex-1 min-w-0" />
133
+ <Input key={f.id} size="md" prefix={f.prefix} suffix={f.unit} value={f.value} onChange={(e) => f.onChange?.(e.target.value)} aria-label={f.label ?? f.prefix ?? f.id} className="flex-1 min-w-0" />
115
134
  ))}
116
135
  </div>
117
136
  )
118
137
  }
119
138
  if (r.type === 'select') {
120
- const dd = <Dropdown variant="float" size="md" options={r.options} value={r.value} onChange={r.onChange} aria-label={r.label} className="w-full" />
121
- return r.label ? <LabeledControl variant="float" label={r.label}>{dd}</LabeledControl> : dd
139
+ const dd = <Dropdown size="md" options={r.options} value={r.value} onChange={r.onChange} aria-label={r.label} className="w-full" />
140
+ return r.label ? <LabeledControl label={r.label}>{dd}</LabeledControl> : dd
122
141
  }
123
142
  if (r.type === 'slider') {
124
143
  const shown = r.formatValue ? r.formatValue(r.value) : r.value
125
144
  return (
126
- <LabeledControl variant="float" label={r.label} hint={shown}>
127
- <Slider variant="float" aria-label={r.label} value={r.value} onChange={r.onChange} min={r.min} max={r.max} step={r.step} className="w-full" />
145
+ <LabeledControl label={r.label} hint={shown}>
146
+ <Slider aria-label={r.label} value={r.value} onChange={r.onChange} min={r.min} max={r.max} step={r.step} className="w-full" />
128
147
  </LabeledControl>
129
148
  )
130
149
  }
131
150
  if (r.type === 'switch') {
132
151
  const label = r.icon ? <span className="inline-flex items-center gap-1.5"><IconLoader name={r.icon} size={16} className="text-oq-96" />{r.label}</span> : r.label
133
152
  return (
134
- <LabeledControl variant="float" horizontal label={label}>
135
- <div className="flex w-full justify-end"><ToggleSwitch variant="float" checked={!!r.on} onChange={r.onChange} aria-label={r.label} /></div>
153
+ <LabeledControl horizontal label={label}>
154
+ <div className="flex w-full justify-end"><ToggleSwitch checked={!!r.on} onChange={r.onChange} aria-label={r.label} /></div>
136
155
  </LabeledControl>
137
156
  )
138
157
  }
@@ -19,8 +19,8 @@ export default function RailDisplayControls({ onCollapse, onHide, theme = true,
19
19
  <div className={`kol-rail-display kol-float-chrome flex flex-col gap-2 ${className}`.trim()}>
20
20
  {theme && <ThemeToggle size="sm" fill="none" className="kol-float-label self-start" />}
21
21
  <div className="flex items-center gap-1 p-1 rounded-[var(--kol-float-list-r)] bg-[var(--kol-float-well)]">
22
- <Button variant="float" tone="ghost" size="md" iconLeft="panel-left" iconGap={10} className="flex-1 justify-start kol-float-label" onClick={onCollapse}>{collapseLabel}</Button>
23
- <Button variant="float" tone="ghost" size="md" iconLeft="hamburger" iconGap={10} className="flex-1 justify-start kol-float-label" onClick={onHide}>{hideLabel}</Button>
22
+ <Button tone="ghost" size="md" iconLeft="panel-left" iconGap={10} className="flex-1 justify-start kol-float-label" onClick={onCollapse}>{collapseLabel}</Button>
23
+ <Button tone="ghost" size="md" iconLeft="hamburger" iconGap={10} className="flex-1 justify-start kol-float-label" onClick={onHide}>{hideLabel}</Button>
24
24
  </div>
25
25
  </div>
26
26
  )
@@ -32,13 +32,13 @@ export default function RailTrigger({ items = [], currentPath = '/', onNavigate,
32
32
  return (
33
33
  <div className={`kol-rail-trigger kol-float-chrome inline-flex items-center gap-4 ${className}`.trim()} style={floatMotion(motion).style}>
34
34
  <span ref={popover.refs.setReference} {...popover.getReferenceProps()} className="inline-flex">
35
- <Button variant="float" size="lg" iconOnly="hamburger" aria-label="Open navigation" aria-haspopup="menu" aria-expanded={open} className={floatSurfaceClass(surface)} />
35
+ <Button size="lg" iconOnly="hamburger" aria-label="Open navigation" aria-haspopup="menu" aria-expanded={open} className={floatSurfaceClass(surface)} />
36
36
  </span>
37
37
  {breadcrumb && <span className="kol-float-hint text-oq-64">{Array.isArray(breadcrumb) ? breadcrumb.join(' / ') : breadcrumb}</span>}
38
38
  <PopoverPanel popover={popover} panel={false} focus={false} motion={motion} className={`${card} w-[280px]`} style={{ maxWidth: 'calc(100vw - 24px)' }}>
39
39
  <MenuFloat cardClass={card} onLeaf={pick} title={title}
40
- titleActions={<Button variant="float" tone="ghost" size="sm" iconOnly="x" aria-label="Close" onClick={() => setOpen(false)} />}>
41
- <MenuFloatRows variant="float" items={items.filter((i) => !i.heading)} active={currentPath} onPick={pick} itemsFirst
40
+ titleActions={<Button tone="ghost" size="sm" iconOnly="x" aria-label="Close" onClick={() => setOpen(false)} />}>
41
+ <MenuFloatRows items={items.filter((i) => !i.heading)} active={currentPath} onPick={pick} itemsFirst
42
42
  actions={onRestore ? [{ label: 'Show navigation', icon: 'panel-left', restore: true }] : undefined} />
43
43
  </MenuFloat>
44
44
  </PopoverPanel>
package/src/ReaderBar.jsx CHANGED
@@ -23,15 +23,15 @@ export default function ReaderBar({ path, onBack, onContents, onSearch, onBookma
23
23
  const surf = floatSurfaceClass(surface)
24
24
  return (
25
25
  <div className={`kol-reader-bar kol-float-chrome flex items-center justify-between gap-4 ${className}`.trim()}>
26
- <Button variant="float" size="lg" iconLeft="arrow-left" iconGap={12} onClick={onBack} className={`${surf} pr-5`}>
26
+ <Button size="lg" iconLeft="arrow-left" iconGap={12} onClick={onBack} className={`${surf} pr-5`}>
27
27
  {Array.isArray(path) ? path.join(' / ') : path}
28
28
  </Button>
29
29
  <div className="flex items-center gap-3">
30
- {onContents && <Button variant="float" size="lg" iconLeft="list-bullet" onClick={onContents} className={surf}>Contents</Button>}
31
- {onSearch && <Button variant="float" size="lg" iconOnly="search" aria-label="Search" onClick={onSearch} className={surf} />}
32
- {onBookmark && <Button variant="float" size="lg" iconOnly="bookmark" aria-label="Bookmark" pressed={bookmarked} onClick={onBookmark} className={surf} />}
30
+ {onContents && <Button size="lg" iconLeft="list-bullet" onClick={onContents} className={surf}>Contents</Button>}
31
+ {onSearch && <Button size="lg" iconOnly="search" aria-label="Search" onClick={onSearch} className={surf} />}
32
+ {onBookmark && <Button size="lg" iconOnly="bookmark" aria-label="Bookmark" pressed={bookmarked} onClick={onBookmark} className={surf} />}
33
33
  {onTools && (
34
- <Button variant="float" size="lg" iconRight="chevron-down" onClick={onTools} className={`${surf} pl-4`}>
34
+ <Button size="lg" iconRight="chevron-down" onClick={onTools} className={`${surf} pl-4`}>
35
35
  <span className="kol-float-body-lg text-emphasis">Aa</span>
36
36
  <span>{toolsLabel}</span>
37
37
  </Button>
@@ -58,15 +58,15 @@ export function ProgressDock({ page = 1, pages = 1, onPrev, onNext, onSeek, form
58
58
  const pct = pages > 1 ? Math.round(((page - 1) / (pages - 1)) * 100) : 100
59
59
  return (
60
60
  <div className={`kol-progress-dock kol-float-chrome flex items-center gap-4 h-16 px-2.5 rounded-full ${floatSurfaceClass(surface)} ${className}`.trim()} style={{ width }}>
61
- <Button variant="float" tone="ghost" size="lg" iconOnly="chevron-left" aria-label="Previous page" onClick={onPrev} disabled={page <= 1} />
61
+ <Button tone="ghost" size="lg" iconOnly="chevron-left" aria-label="Previous page" onClick={onPrev} disabled={page <= 1} />
62
62
  <div className="flex-1 min-w-0 flex flex-col gap-1">
63
63
  <div className="flex items-center justify-between">
64
64
  <span className="kol-float-hint text-emphasis">{formatPage(page, pages)}</span>
65
65
  <span className="kol-float-timecode text-oq-64">{pct}%</span>
66
66
  </div>
67
- <Slider variant="float" readout="none" aria-label="Reading position" min={1} max={pages} step={1} value={page} onChange={onSeek} className="w-full" />
67
+ <Slider readout="none" aria-label="Reading position" min={1} max={pages} step={1} value={page} onChange={onSeek} className="w-full" />
68
68
  </div>
69
- <Button variant="float" tone="ghost" size="lg" iconOnly="chevron-right" aria-label="Next page" onClick={onNext} disabled={page >= pages} />
69
+ <Button tone="ghost" size="lg" iconOnly="chevron-right" aria-label="Next page" onClick={onNext} disabled={page >= pages} />
70
70
  </div>
71
71
  )
72
72
  }
package/src/ToolRail.jsx CHANGED
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react'
2
- import { Button, Tooltip, MenuPanel, MenuRow, PopoverPanel, usePopover, floatSurfaceClass } from '@kolkrabbi/kol-component'
2
+ import { Button, ButtonSplit, KbdKeys, Tooltip, MenuPanel, MenuRow, PopoverPanel, usePopover, floatSurfaceClass } from '@kolkrabbi/kol-component'
3
3
  import { IconLoader } from '@kolkrabbi/kol-icons'
4
4
 
5
5
  /* taxonomy-ok: molecule — a column of float Buttons, each named by the float Tooltip */
@@ -25,12 +25,12 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
25
25
  * @param {ReactNode} end after a rule — the dock's hand and undo
26
26
  * @param {Object} search `{ onPress, kbd?, label?, pressed? }` — the ⌘K pill at the dock's end, after a rule
27
27
  */
28
- export default function ToolRail({ tools = [], value, onChange, surface = 'solid', more, orientation = 'vertical', end, search, className = '' }) {
28
+ function ToolRailDefault({ tools = [], value, onChange, surface = 'solid', more, orientation = 'vertical', end, search, className = '' }) {
29
29
  const row = orientation === 'horizontal'
30
30
  if (more?.length && !row) {
31
31
  return (
32
32
  <div className={`inline-flex flex-col items-center gap-4 ${className}`.trim()}>
33
- <ToolRail tools={tools} value={value} onChange={onChange} surface={surface} />
33
+ <ToolRailDefault tools={tools} value={value} onChange={onChange} surface={surface} />
34
34
  <ToolMore items={more} surface={surface} />
35
35
  </div>
36
36
  )
@@ -41,9 +41,9 @@ export default function ToolRail({ tools = [], value, onChange, surface = 'solid
41
41
  /* a slot with its own ▾ shows the member armed from it (the dock's Shapes slot reads Ellipse once Ellipse is picked) */
42
42
  const shown = t.more?.find((m) => m.id != null && m.id === value) ?? t
43
43
  const slot = (
44
- <Tooltip key={t.id} variant="float" placement={row ? 'top' : 'right'} offset={12} label={shown.label} shortcut={shown.kbd}>
44
+ <Tooltip key={t.id} placement={row ? 'top' : 'right'} offset={12} label={shown.label} shortcut={shown.kbd}>
45
45
  {/* every slot at full ink, armed or not (his frame 19:6071 — W1.3; the ghost tone's oq-48 read as disabled) */}
46
- <Button variant="float" tone="ghost" iconOnly={shown.icon} aria-label={shown.label} pressed={shown.id === value || t.id === value}
46
+ <Button tone="ghost" iconOnly={shown.icon} aria-label={shown.label} pressed={shown.id === value || t.id === value}
47
47
  onClick={() => (shown.onClick ? shown.onClick() : onChange?.(shown.id))} className="[--kol-tone-fg:var(--kol-oq-96)]" />
48
48
  </Tooltip>
49
49
  )
@@ -61,8 +61,8 @@ export default function ToolRail({ tools = [], value, onChange, surface = 'solid
61
61
  * `kbd: null` (a phone has no ⌘) draws the glyph alone */
62
62
  function ToolSearchPill({ onPress, kbd = '⌘K', label = 'Search', pressed }) {
63
63
  return (
64
- <Tooltip variant="float" placement="top" offset={12} label={label} shortcut={kbd}>
65
- <Button variant="float" tone="ghost" aria-label={label} pressed={pressed} onClick={onPress}
64
+ <Tooltip placement="top" offset={12} label={label} shortcut={kbd}>
65
+ <Button tone="ghost" aria-label={label} pressed={pressed} onClick={onPress}
66
66
  className={`kol-tool-search gap-2 ${kbd ? 'px-4' : 'px-2.5'} bg-[var(--kol-float-well)] [--kol-tone-fg:var(--kol-oq-96)]`}>
67
67
  <IconLoader name="search" size="var(--kol-float-ic)" />
68
68
  {kbd && <span className="kol-float-panel">{kbd}</span>}
@@ -79,12 +79,12 @@ function ToolMore({ items, surface, chevron = false, label = 'More tools', onPic
79
79
  return (
80
80
  <>
81
81
  <span ref={pop.refs.setReference} {...pop.getReferenceProps()} className={chevron ? 'inline-flex' : `kol-float-chrome inline-flex rounded-full ${floatSurfaceClass(surface)}`}>
82
- <Button variant="float" tone="ghost" iconOnly={chevron ? 'chevron-down' : 'more-vertical'} aria-label={label} pressed={open}
82
+ <Button tone="ghost" iconOnly={chevron ? 'chevron-down' : 'more-vertical'} aria-label={label} pressed={open}
83
83
  className={chevron ? 'kol-tool-chevron [--kol-tone-fg:var(--kol-oq-64)]' : '[--kol-tone-fg:var(--kol-oq-96)]'} />
84
84
  </span>
85
85
  {open && (
86
86
  <PopoverPanel popover={pop} panel={false} focus={false}>
87
- <MenuPanel variant="float" className="min-w-[200px]">
87
+ <MenuPanel className="min-w-[200px]">
88
88
  {items.map((it) => (
89
89
  <MenuRow key={it.label} rowClass="kol-menu-row kol-helper-12" kbd={it.kbd} disabled={it.disabled}
90
90
  indicator={chevron && it.id != null && it.id === active ? 'dot' : undefined}
@@ -97,3 +97,80 @@ function ToolMore({ items, surface, chevron = false, label = 'More tools', onPic
97
97
  </>
98
98
  )
99
99
  }
100
+
101
+ /* ── kolbox (plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18) ─────────────────────────────────────────────────
102
+ * kolbox's ToolDock (the file's ToolDock 28:9326, plan 10.8; W19.2), carried from apps/kolbox/src/ui/ToolDock.jsx: the
103
+ * panel fill, radius 12, padding 8, on the one floating surface (`kol-kolbox-surface`). The tools, 4 apart; a rule 1 by
104
+ * 24 between groups; `end` a second group after a rule (kolbox's well; the design draws none, the transport fills it).
105
+ * ToolRail's words: `tools` [{ id, icon, label, kbd, more: [{ id, icon, label, kbd, action }] }] (kolbox's `variants`),
106
+ * `value` a tool's id or one of its `more` ids (the tool shows its current member's glyph), `onChange(id)`. Two more
107
+ * kinds in `tools`, as the real ToolPalette's: `{ divider: true }` and a one-shot `{ id, icon, label, kbd, disabled,
108
+ * onClick }` that is never the armed tool. A tool with `more` is `ButtonSplit variant="kolbox"` in its icon-only form:
109
+ * the tool a tile, its chevron a separate 16 by 32 button 1 beside it, `onVariants(tool, element)` its press (the host
110
+ * opens its own menu), `variantsOpen` the id of the tool whose menu is open (its chevron keeps the quiet fill).
111
+ * `children` replace the tools (the transport's own cells).
112
+ * Under 768 the dock and its end wrap onto a second row. Sizes are Figma's dock as measured 2026-11-20 (W16.3): 48 high,
113
+ * padding 8, a slot 32 square, 8 between a tool's chevron and the next tool. Glyphs are your icons by the set's names at
114
+ * 20 in the full ink (his "bigger icons", R3.4): drawn 14 to 15, Figma's 16 to 17 inside its 24 box. */
115
+ export function ToolRailSlot({ icon, label, kbd, active = false, lit = false, className = '', ...rest }) {
116
+ return (
117
+ <Tooltip variant="kolbox" label={kbd ? <>{label}<KbdKeys variant="kolbox" size="sm" keys={kbd} className="ml-2" /></> : label}>
118
+ <button
119
+ type="button"
120
+ aria-label={label}
121
+ aria-pressed={active || lit}
122
+ data-dock-cell
123
+ className={`kol-tool-slot--kolbox${active ? ' is-active' : lit ? ' is-lit' : ''} inline-flex size-8 shrink-0 items-center justify-center outline-none focus-visible:outline-solid focus-visible:outline-1 ${active || lit ? '' : 'disabled:opacity-40'} ${className}`.trim()}
124
+ {...rest}
125
+ >
126
+ <IconLoader name={icon} size={22} className="kol-kolbox-icon shrink-0" />
127
+ </button>
128
+ </Tooltip>
129
+ )
130
+ }
131
+
132
+ function ToolRailKolbox({ tools = [], value, onChange, onVariants, variantsOpen, end, children, className = '' }) {
133
+ const rule = (key) => <span key={key} className="kol-tool-rail-rule h-6 w-px shrink-0" />
134
+ return (
135
+ <div data-kol-dock className={`kol-tool-rail--kolbox kol-kolbox-surface inline-flex items-center gap-2 p-2 max-md:max-w-full max-md:flex-wrap max-md:justify-center ${className}`.trim()}>
136
+ <div className="flex items-center gap-2">
137
+ {children ??
138
+ tools.map((t, i) => {
139
+ if (t.divider) return rule(`d${i}`)
140
+ if (t.onClick) return <ToolRailSlot key={t.id} icon={t.icon} label={t.label} kbd={t.kbd} disabled={t.disabled} onClick={t.onClick} />
141
+ const current = t.more?.find((v) => v.id === value)
142
+ const icon = current?.icon ?? t.icon
143
+ const label = current?.label ?? t.label
144
+ const kbd = current ? current.kbd : t.kbd
145
+ const active = value === t.id || !!current
146
+ const arm = () => onChange?.(current?.id ?? t.id)
147
+ if (!t.more?.length) return <ToolRailSlot key={t.id} icon={icon} label={label} kbd={kbd} active={active} onClick={arm} />
148
+ return (
149
+ <ButtonSplit key={t.id} variant="kolbox" iconOnly={icon} aria-label={label} pressed={active} onClick={arm}
150
+ tooltip={kbd ? <>{label}<KbdKeys variant="kolbox" size="sm" keys={kbd} className="ml-2" /></> : label}
151
+ menuLabel={`${t.label} variants`} menuOpen={variantsOpen === t.id} onMenu={(e) => onVariants?.(t, e.currentTarget)} />
152
+ )
153
+ })}
154
+ </div>
155
+ {end && (
156
+ <>
157
+ {rule('end')}
158
+ <div className="flex items-center gap-1 max-md:flex-wrap max-md:justify-center">{end}</div>
159
+ </>
160
+ )}
161
+ </div>
162
+ )
163
+ }
164
+
165
+ /* ── folio (Folio migration batch D, 2026-11-22) ──────────────────────────────────────────────────────────────────────
166
+ * Folio's toolbar row under the menus (ToolRow), carried from apps/folio's EditorChrome.jsx: 56 high, 56 in, 8 between
167
+ * its tools, a rule under it in Folio's rule ink; a row wider than the window scrolls sideways with no scrollbar. Its
168
+ * tools are the format's own, as `children` (kolbox's word for cells in the dock's place). */
169
+ function ToolRailFolio({ children, className = '' }) {
170
+ return <div className={`kol-tool-rail--folio flex h-[56px] shrink-0 items-center gap-[8px] overflow-x-auto border-b px-[56px] [scrollbar-width:none] ${className}`.trim()}>{children}</div>
171
+ }
172
+
173
+ export default function ToolRail(props) {
174
+ if (props.variant === 'folio') return <ToolRailFolio {...props} />
175
+ return props.variant === 'kolbox' ? <ToolRailKolbox {...props} /> : <ToolRailDefault {...props} />
176
+ }
@@ -24,12 +24,12 @@ export function PanelsRestore({ label = 'Panels', children, items, surface = 'so
24
24
  return (
25
25
  <>
26
26
  <span ref={popover.refs.setReference} {...popover.getReferenceProps()} className="inline-flex">
27
- <Button variant="float" size="lg" iconRight="chevron-down" aria-haspopup="menu" aria-expanded={open} className={`${floatSurfaceClass(surface)} ${className}`.trim()}>{label}</Button>
27
+ <Button size="lg" iconRight="chevron-down" aria-haspopup="menu" aria-expanded={open} className={`${floatSurfaceClass(surface)} ${className}`.trim()}>{label}</Button>
28
28
  </span>
29
29
  <PopoverPanel popover={popover} panel={false} focus={false} className={card} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
30
30
  {children ?? (
31
31
  <MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)} title={label}>
32
- <MenuFloatRows variant="float" actions={items ?? []} onPick={() => setOpen(false)} />
32
+ <MenuFloatRows actions={items ?? []} onPick={() => setOpen(false)} />
33
33
  </MenuFloat>
34
34
  )}
35
35
  </PopoverPanel>
@@ -64,8 +64,8 @@ export default function TopControlsBar({ document, tabs, tab, onTab, onSearch, p
64
64
  <div className="flex-1 flex items-center justify-center gap-4 min-w-0">
65
65
  {center ?? (
66
66
  <>
67
- {tabs?.length > 0 && <TabsRow variant="float" tabs={tabs} value={tab} onChange={onTab} className={`rounded-full p-1.5 ${floatSurfaceClass(surface)}`} />}
68
- {onSearch && <Button variant="float" tone="ghost" size="lg" iconOnly="search" aria-label="Search" onClick={onSearch} className={floatSurfaceClass(surface)} />}
67
+ {tabs?.length > 0 && <TabsRow tabs={tabs} value={tab} onChange={onTab} className={`rounded-full p-1.5 ${floatSurfaceClass(surface)}`} />}
68
+ {onSearch && <Button tone="ghost" size="lg" iconOnly="search" aria-label="Search" onClick={onSearch} className={floatSurfaceClass(surface)} />}
69
69
  </>
70
70
  )}
71
71
  </div>
@@ -73,8 +73,8 @@ export default function TopControlsBar({ document, tabs, tab, onTab, onSearch, p
73
73
  {end ?? (
74
74
  <>
75
75
  {panels && <PanelsRestore {...panels} surface={surface} />}
76
- {action && <Button variant="float" tone="inverted" size="lg" iconLeft={action.icon ?? 'plus'} onClick={action.onPress}>{action.label}</Button>}
77
- {menu?.length > 0 && <FloatActionMenu actions={menu} icon="plus" variant="float" surface={surface} motion={motion} />}
76
+ {action && <Button size="lg" iconLeft={action.icon ?? 'plus'} onClick={action.onPress}>{action.label}</Button>}
77
+ {menu?.length > 0 && <FloatActionMenu actions={menu} icon="plus" surface={surface} motion={motion} />}
78
78
  </>
79
79
  )}
80
80
  </div>
@@ -98,9 +98,9 @@ export function FooterStrip({ start, end, className = '' }) {
98
98
  export function PeriodNav({ label = 'Today', onPrev, onNext, onToday, surface = 'solid', className = '' }) {
99
99
  return (
100
100
  <div className={`kol-period-nav kol-float-chrome inline-flex items-center h-9 rounded-full ${floatSurfaceClass(surface)} ${className}`.trim()}>
101
- <Button variant="float" tone="ghost" size="md" iconOnly="chevron-left" aria-label="Previous" onClick={onPrev} />
102
- <Button variant="float" tone="ghost" size="md" onClick={onToday} className="kol-float-hint px-3">{label}</Button>
103
- <Button variant="float" tone="ghost" size="md" iconOnly="chevron-right" aria-label="Next" onClick={onNext} />
101
+ <Button tone="ghost" size="md" iconOnly="chevron-left" aria-label="Previous" onClick={onPrev} />
102
+ <Button tone="ghost" size="md" onClick={onToday} className="kol-float-hint px-3">{label}</Button>
103
+ <Button tone="ghost" size="md" iconOnly="chevron-right" aria-label="Next" onClick={onNext} />
104
104
  </div>
105
105
  )
106
106
  }
package/src/index.js CHANGED
@@ -20,9 +20,9 @@ export { default as AppFloatNav, APP_FLOAT_NAV_VARIANTS } from './AppFloatNav.js
20
20
  export { default as Timecode } from './Timecode.jsx'
21
21
  // THE FLOAT CHROME (float-everything W5 · W9, 2026-11-04 — the gap map's rows 63–81 and 129–144): the editor's and the
22
22
  // workspace's chrome on the float tokens, every boxed part on its `surface`. Composed from kol-component's float controls.
23
- export { default as ToolRail } from './ToolRail.jsx'
23
+ export { default as ToolRail, ToolRailSlot } from './ToolRail.jsx'
24
24
  export { default as PropertyRail } from './PropertyRail.jsx'
25
- export { RailFloat, RailHeader, FloatModule, FloatModuleHeader } from '@kolkrabbi/kol-component' // the float Rail shell and its header live in kol-component (NavRail float draws on it)
25
+ export { RailFloat, RailHeader, FloatModule } from '@kolkrabbi/kol-component' // the float Rail shell and its header live in kol-component (NavRail float draws on it)
26
26
  export { default as DocumentCapsule } from './DocumentCapsule.jsx'
27
27
  export { default as GlobalActions } from './GlobalActions.jsx'
28
28
  export { ZoomReadout, SceneBreadcrumb, CanvasHint, SelectionMeasure } from './CanvasReadouts.jsx'
@@ -37,8 +37,6 @@ export { default as MenuBar } from './MenuBar.jsx'
37
37
  export { default as RailFlyout } from './RailFlyout.jsx'
38
38
  export { default as RailDisplayControls } from './RailDisplayControls.jsx'
39
39
  export { AccountFooter, StatusStrip, Breadcrumb, FooterStrip, PeriodNav, DataStatus } from './WorkspaceStrips.jsx'
40
- // the float page frame, assembled from the chrome above (plan-2026-11-04-float-views W1.1)
41
- export { default as FloatLayout } from './FloatLayout.jsx'
42
40
  export { default as PhoneNav, PHONE_NAV_VARIANTS } from './PhoneNav.jsx'
43
41
  export { default as TransportPill } from './TransportPill.jsx'
44
42
  export { default as PageShell, PageBleed } from './PageShell.jsx'