@kolkrabbi/kol-shell 0.124.0 → 0.125.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-shell",
3
- "version": "0.124.0",
3
+ "version": "0.125.0",
4
4
  "private": false,
5
5
  "description": "The application shell",
6
6
  "license": "MIT",
@@ -12,7 +12,7 @@
12
12
  "./src/*": "./src/*"
13
13
  },
14
14
  "peerDependencies": {
15
- "@kolkrabbi/kol-component": ">=0.366.0",
15
+ "@kolkrabbi/kol-component": ">=0.367.0",
16
16
  "@kolkrabbi/kol-framework": ">=0.55.0",
17
17
  "@kolkrabbi/kol-icons": ">=0.69.0",
18
18
  "@kolkrabbi/kol-theme": ">=0.221.0",
@@ -21,7 +21,7 @@
21
21
  "react-dom": "^18.3.0 || ^19.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@kolkrabbi/kol-component": "^0.366.0",
24
+ "@kolkrabbi/kol-component": "^0.367.0",
25
25
  "@kolkrabbi/kol-icons": "^0.70.1",
26
26
  "@kolkrabbi/kol-theme": "^0.221.0",
27
27
  "@kolkrabbi/kol-framework": "^0.74.1"
@@ -1,13 +1,14 @@
1
- import { Button, Input, Dropdown, FloatModule, LabeledControl, Slider, ToggleSwitch, TabsRow } from '@kolkrabbi/kol-component'
1
+ import { Button, Input, Dropdown, FloatModule, LabeledControl, LabeledControlSection, LayerRow, Slider, ToggleSwitch, TabsRow } from '@kolkrabbi/kol-component'
2
2
  import { IconLoader } from '@kolkrabbi/kol-icons'
3
3
 
4
- /* taxonomy-ok: organism — kol-component's FloatModule holding kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
4
+ /* taxonomy-ok: organism — kol-component's FloatModule holding LayerRow, LabeledControlSection and kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
5
5
 
6
6
  /**
7
7
  * PropertyRail — The float inspector (float-everything W5 rows 65 · 66, 2026-11-04): a 264 sheet (`--kol-float-menu-r`,
8
8
  * 16 in, 18 between) holding its header (the title in `kol-float-panel` and the collapse ⇥), chip tabs (TabsRow float),
9
- * the selected object's line (glyph · name · eye) and sections — each a `kol-float-label` head with an optional + and
10
- * rows that kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
9
+ * the selected object's line (kol-component's `LayerRow variant="head"`: glyph, name and eye, W8.1) and sections — each a
10
+ * float `LabeledControlSection` (W10.1: the `kol-float-label` head with an optional + or meta over its rows) of rows that
11
+ * kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
11
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
13
  * exploration's `Floating properties inspector` (kol-float--style 9:9273); the section hairlines stay out (no-borders law).
13
14
  * Since 0.123.0 the sheet, header, fold and folded pill are kol-component's `FloatModule` (plan-2026-11-12-float-system
@@ -25,8 +26,9 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
25
26
  * `{ type: 'switch', id?, label, icon?, on, onChange }` (ToggleSwitch float) ·
26
27
  * `{ id?, render }` — anything else
27
28
  * `{ type: 'labeled', id?, label, render }` — the tool Rail's row (generator Rails, plan-2026-11-05-float-editor
28
- * W7.6): LabeledControl float `inline` — the label in the `--kol-float-label-w` column, the control in the rest ·
29
- * `{ type: 'subhead', id?, label, meta? }` — a group's caps head inside a section (LIGHTS / POINT EDITOR) ·
29
+ * W7.6): LabeledControl float `horizontal` — the label in the `--kol-float-label-w` column, the control in the rest ·
30
+ * `{ type: 'subhead', id?, label, meta? }` — a group's caps head inside a section (LIGHTS / POINT EDITOR): it and the rows
31
+ * under it are a float LabeledControlSection of their own ·
30
32
  * a section may also be `collapsible` (`open` · `onToggle(open)`): its head is the chevron and the
31
33
  * title in `kol-float-panel`, `meta` at the far end, its rows shown while open
32
34
  * @param {'regular'|'compact'} density `compact` — the tool Rail's rhythm (his generator frames 32:16215): 8 between rows,
@@ -41,8 +43,7 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
41
43
  * panel is a module (the user, 2026-11-12: *"EVERYTHING IS FLOAT everything is MODULES"*)
42
44
  * @param {boolean} folded controlled; `defaultFolded` uncontrolled · `onFold(folded)` on every press. Folded, only the
43
45
  * header shows, on the same sheet
44
- * @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents' `bare` body,
45
- * Labs' params)
46
+ * @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents, Labs' params)
46
47
  * @param {string} className
47
48
  */
48
49
  export default function PropertyRail({ title, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width, foldable = false, folded, defaultFolded = false, onFold, children, className = '' }) {
@@ -54,59 +55,58 @@ export default function PropertyRail({ title, onCollapse, onExpand, density = 'r
54
55
  return (
55
56
  <FloatModule title={title} actions={actions} foldable={foldable} folded={folded} defaultFolded={defaultFolded} onFold={onFold}
56
57
  compact={compact} wide={wide} width={width} surface={surface} className={`kol-property-rail ${className}`.trim()}
57
- footer={footer && <div className={compact ? 'pt-4' : undefined}>{footer}</div>}>
58
+ footer={footer && compact ? <div className="pt-4">{footer}</div> : footer}>
58
59
  {tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
59
60
  {selected && (
60
- <div className="flex items-center gap-2">
61
- {selected.icon && <IconLoader name={selected.icon} size={18} className="text-oq-64" />}
62
- <span className="kol-float-panel text-emphasis flex-1 min-w-0 truncate">{selected.name}</span>
63
- {selected.onVisible && (
64
- <Button variant="float" tone="ghost" size="sm" iconOnly={selected.visible === false ? 'eye-off' : 'eye-on'} aria-label={selected.visible === false ? 'Show' : 'Hide'} aria-pressed={selected.visible !== false} onClick={() => selected.onVisible(selected.visible === false)} />
65
- )}
66
- </div>
61
+ <LayerRow variant="head" icon={selected.icon} name={selected.name} visible={selected.visible !== false}
62
+ onToggleVisible={selected.onVisible && (() => selected.onVisible(selected.visible === false))} />
67
63
  )}
68
- {sections.map((s, i) => (
69
- <section key={s.id ?? s.label ?? i} className={`flex flex-col ${compact ? `gap-2${i > 0 ? ' pt-4' : ''}` : 'gap-[var(--kol-float-module-gap)]'}`} data-section={s.id ?? s.label}>
70
- {s.collapsible ? (
71
- <button type="button" aria-expanded={!!s.open} onClick={() => s.onToggle?.(!s.open)}
72
- className="flex items-center gap-1.5 text-left focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] rounded-sm">
73
- <IconLoader name="chevron-down" size="var(--kol-float-chev-sm)" className={`text-oq-64 transition-transform ${s.open ? '' : '-rotate-90'}`} />
74
- <span className="kol-float-panel text-emphasis flex-1 min-w-0">{s.label}</span>
75
- {s.meta && <span className="kol-float-timecode text-oq-64">{s.meta}</span>}
76
- </button>
77
- ) : (s.label || s.onAdd || s.meta) && (
78
- <div className="flex items-center justify-between">
79
- <span className="kol-float-label text-oq-64">{s.label}</span>
80
- {s.onAdd && <Button variant="float" tone="ghost" size="sm" iconOnly="plus" aria-label={`Add to ${s.label}`} onClick={s.onAdd} />}
81
- {s.meta && <span className="kol-float-timecode text-emphasis">{s.meta}</span>}
82
- </div>
83
- )}
84
- {(!s.collapsible || s.open) && (s.rows ?? []).map((r, j) => <Row key={r.id ?? j} row={r} compact={compact} />)}
85
- </section>
86
- ))}
64
+ {sections.map((s, i) => {
65
+ const add = s.onAdd && <Button variant="float" tone="ghost" size="sm" iconOnly="plus" aria-label={`Add to ${s.label}`} onClick={s.onAdd} />
66
+ const meta = s.meta && <span className="kol-float-timecode text-emphasis">{s.meta}</span>
67
+ const label = s.collapsible ? (
68
+ <button type="button" aria-expanded={!!s.open} onClick={() => s.onToggle?.(!s.open)}
69
+ className="flex flex-1 items-center gap-1.5 text-left focus-visible:outline-none focus-visible:shadow-[var(--kol-float-focus)] rounded-sm">
70
+ <IconLoader name="chevron-down" size="var(--kol-float-chev-sm)" className={`text-oq-64 transition-transform ${s.open ? '' : '-rotate-90'}`} />
71
+ <span className="kol-float-panel text-emphasis flex-1 min-w-0">{s.label}</span>
72
+ {s.meta && <span className="kol-float-timecode text-oq-64">{s.meta}</span>}
73
+ </button>
74
+ ) : s.label
75
+ return (
76
+ <LabeledControlSection key={s.id ?? s.label ?? i} variant="float" data-section={s.id ?? s.label} label={label} end={!s.collapsible && (add || meta) && <>{add}{meta}</>}
77
+ gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact && i > 0 ? 'pt-4' : ''}>
78
+ {(!s.collapsible || s.open) && groups(s.rows ?? []).map((g, j) => (g.head
79
+ ? <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>}
80
+ gap={compact ? 2 : 'module'} rowGap={compact ? 2 : 'module'} className={compact ? 'pt-3' : 'pt-1'}>
81
+ {g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)}
82
+ </LabeledControlSection>
83
+ : g.rows.map((r, k) => <Row key={r.id ?? k} row={r} />)))}
84
+ </LabeledControlSection>
85
+ )
86
+ })}
87
87
  {children}
88
88
  </FloatModule>
89
89
  )
90
90
  }
91
91
 
92
+ /* a section's rows in groups: the rows before the first `subhead`, then each subhead with the rows under it — a subhead is
93
+ * a float LabeledControlSection of its own (W10.1), never a loose head row */
94
+ function groups(rows) {
95
+ const out = [{ rows: [] }]
96
+ for (const r of rows) r.type === 'subhead' ? out.push({ head: r, rows: [] }) : out[out.length - 1].rows.push(r)
97
+ return out[0].rows.length ? out : out.slice(1)
98
+ }
99
+
92
100
  /* every row with a label is LabeledControl float (plan-2026-11-12-float-system W2.1): the label column and gap are the
93
101
  * spec's tokens, the control bare in its cell */
94
- function Row({ row: r, compact }) {
102
+ function Row({ row: r }) {
95
103
  if (r.type === 'labeled') {
96
104
  return (
97
- <LabeledControl variant="float" inline label={r.label} className="w-full">
105
+ <LabeledControl variant="float" horizontal label={r.label} className="w-full">
98
106
  <div className="flex w-full min-w-0 items-center gap-1.5" data-control={r.label}>{r.render()}</div>
99
107
  </LabeledControl>
100
108
  )
101
109
  }
102
- if (r.type === 'subhead') {
103
- return (
104
- <div className={`flex items-center justify-between ${compact ? 'pt-3' : 'pt-1'}`}>
105
- <span className="kol-float-label text-oq-64">{r.label}</span>
106
- {r.meta && <span className="kol-float-label text-fg-emphasis">{r.meta}</span>}
107
- </div>
108
- )
109
- }
110
110
  if (r.render) return r.render()
111
111
  if (r.type === 'fields') {
112
112
  return (
@@ -132,7 +132,7 @@ function Row({ row: r, compact }) {
132
132
  if (r.type === 'switch') {
133
133
  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
134
134
  return (
135
- <LabeledControl variant="float" inline label={label}>
135
+ <LabeledControl variant="float" horizontal label={label}>
136
136
  <div className="flex w-full justify-end"><ToggleSwitch variant="float" checked={!!r.on} onChange={r.onChange} aria-label={r.label} /></div>
137
137
  </LabeledControl>
138
138
  )
package/src/index.js CHANGED
@@ -22,7 +22,7 @@ export { default as Timecode } from './Timecode.jsx'
22
22
  // workspace's chrome on the float tokens, every boxed part on its `surface`. Composed from kol-component's float controls.
23
23
  export { default as ToolRail } from './ToolRail.jsx'
24
24
  export { default as PropertyRail } from './PropertyRail.jsx'
25
- export { FloatModule } from '@kolkrabbi/kol-component' // the float Rail shell lives in kol-component (NavRail float draws on it)
25
+ export { FloatModule, FloatModuleHeader } 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'