@kolkrabbi/kol-shell 0.122.0 → 0.123.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.122.0",
3
+ "version": "0.123.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.364.0",
15
+ "@kolkrabbi/kol-component": ">=0.365.0",
16
16
  "@kolkrabbi/kol-framework": ">=0.55.0",
17
17
  "@kolkrabbi/kol-icons": ">=0.69.0",
18
18
  "@kolkrabbi/kol-theme": ">=0.220.0",
@@ -21,10 +21,10 @@
21
21
  "react-dom": "^18.3.0 || ^19.0.0"
22
22
  },
23
23
  "devDependencies": {
24
- "@kolkrabbi/kol-component": "^0.364.0",
24
+ "@kolkrabbi/kol-component": "^0.365.0",
25
25
  "@kolkrabbi/kol-icons": "^0.70.1",
26
- "@kolkrabbi/kol-theme": "^0.220.0",
27
- "@kolkrabbi/kol-framework": "^0.74.1"
26
+ "@kolkrabbi/kol-framework": "^0.74.1",
27
+ "@kolkrabbi/kol-theme": "^0.220.0"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -1,8 +1,7 @@
1
- import { useState } from 'react'
2
- import { Button, Input, Dropdown, LabeledControl, Slider, ToggleSwitch, TabsRow, floatSurfaceClass } from '@kolkrabbi/kol-component'
1
+ import { Button, Input, Dropdown, FloatModule, LabeledControl, Slider, ToggleSwitch, TabsRow } from '@kolkrabbi/kol-component'
3
2
  import { IconLoader } from '@kolkrabbi/kol-icons'
4
3
 
5
- /* taxonomy-ok: organism — a float sheet of kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
4
+ /* taxonomy-ok: organism — kol-component's FloatModule holding kol-component fields (Input · Dropdown · Slider · ToggleSwitch · TabsRow) */
6
5
 
7
6
  /**
8
7
  * PropertyRail — The float inspector (float-everything W5 rows 65 · 66, 2026-11-04): a 272 sheet (`--kol-float-menu-r`,
@@ -11,6 +10,8 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
11
10
  * rows that kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
12
11
  * 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
13
12
  * exploration's `Floating properties inspector` (kol-float--style 9:9273); the section hairlines stay out (no-borders law).
13
+ * Since 0.123.0 the sheet, header, fold and folded pill are kol-component's `FloatModule` (plan-2026-11-12-float-system
14
+ * W4.1) — the one shell NavRail float and ReadingContents draw on too; the body scrolls under the header.
14
15
  *
15
16
  * @param {string} title the header (Properties)
16
17
  * @param {Function} onCollapse the ⇥'s press; unset, no ⇥
@@ -46,20 +47,14 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
46
47
  */
47
48
  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 = '' }) {
48
49
  const compact = density === 'compact'
49
- const [ownFolded, setOwnFolded] = useState(defaultFolded)
50
- const isFolded = foldable && (folded ?? ownFolded)
51
- const fold = () => { const next = !isFolded; if (folded === undefined) setOwnFolded(next); onFold?.(next) }
50
+ const actions = (onExpand || onCollapse) && <>
51
+ {onExpand && <Button variant="float" tone="ghost" size="sm" iconOnly="arrow-upright" aria-label="Expand" onClick={onExpand} />}
52
+ {onCollapse && <Button variant="float" tone="ghost" size="sm" iconOnly="panel-right" aria-label="Collapse" onClick={onCollapse} />}
53
+ </>
52
54
  return (
53
- <div className={`kol-property-rail kol-float-chrome flex flex-col ${compact ? 'gap-2' : 'gap-[var(--kol-float-module-gap)]'} p-4 rounded-[var(--kol-float-menu-r)] ${floatSurfaceClass(surface, true)} ${className}`.trim()} style={{ width: width ?? `var(--kol-float-module-w${wide ? '-wide' : ''})` }}>
54
- <div className="flex items-center justify-between">
55
- <span className="kol-float-panel text-emphasis">{title}</span>
56
- <span className="flex items-center gap-1">
57
- {foldable && <Button variant="float" tone="ghost" size="sm" iconOnly={isFolded ? 'chevron-down' : 'chevron-up'} aria-label={isFolded ? 'Open' : 'Fold'} aria-expanded={!isFolded} onClick={fold} />}
58
- {onExpand && <Button variant="float" tone="ghost" size="sm" iconOnly="arrow-upright" aria-label="Expand" onClick={onExpand} />}
59
- {onCollapse && <Button variant="float" tone="ghost" size="sm" iconOnly="panel-right" aria-label="Collapse" onClick={onCollapse} />}
60
- </span>
61
- </div>
62
- {!isFolded && <>
55
+ <FloatModule title={title} actions={actions} foldable={foldable} folded={folded} defaultFolded={defaultFolded} onFold={onFold}
56
+ 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>}>
63
58
  {tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
64
59
  {selected && (
65
60
  <div className="flex items-center gap-2">
@@ -90,9 +85,7 @@ export default function PropertyRail({ title, onCollapse, onExpand, density = 'r
90
85
  </section>
91
86
  ))}
92
87
  {children}
93
- {footer && <div className={compact ? 'pt-4' : undefined}>{footer}</div>}
94
- </>}
95
- </div>
88
+ </FloatModule>
96
89
  )
97
90
  }
98
91
 
package/src/index.js CHANGED
@@ -22,6 +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
26
  export { default as DocumentCapsule } from './DocumentCapsule.jsx'
26
27
  export { default as GlobalActions } from './GlobalActions.jsx'
27
28
  export { ZoomReadout, SceneBreadcrumb, CanvasHint, SelectionMeasure } from './CanvasReadouts.jsx'