@kolkrabbi/kol-shell 0.126.0 → 0.128.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 +5 -5
- package/src/AppFloatNav.jsx +22 -22
- package/src/DocumentCapsule.jsx +5 -5
- package/src/FloatActionMenu.jsx +7 -4
- package/src/HubHome.jsx +1 -1
- package/src/{MoreSheet.jsx → MenuFloat.jsx} +20 -11
- package/src/PropertyRail.jsx +5 -5
- package/src/RailTrigger.jsx +5 -10
- package/src/TopControlsBar.jsx +4 -4
- package/src/index.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.128.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.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.373.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.69.0",
|
|
18
18
|
"@kolkrabbi/kol-theme": ">=0.222.0",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
25
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
26
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.375.0",
|
|
25
|
+
"@kolkrabbi/kol-icons": "^0.71.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.223.0",
|
|
27
27
|
"@kolkrabbi/kol-framework": "^0.74.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useCallback, useEffect, useState } from 'react'
|
|
2
2
|
import { Button, TabsRow, Tooltip, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass, usePopover, PopoverPanel, useMediaQuery } from '@kolkrabbi/kol-component'
|
|
3
3
|
import { hasIcon } from '@kolkrabbi/kol-icons'
|
|
4
|
-
import
|
|
4
|
+
import MenuFloatRows, { MenuFloat } from './MenuFloat.jsx'
|
|
5
5
|
import Timecode from './Timecode.jsx'
|
|
6
6
|
|
|
7
|
-
/* taxonomy-ok: molecule — TabsRow's pill +
|
|
7
|
+
/* taxonomy-ok: molecule — TabsRow's pill + MenuFloatRows sheets of Buttons */
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* AppFloatNav — The floating nav, one family. (AppFloatNav, kol-fxr 2026-10-30 — the user's name, canvas Round 3's board:
|
|
@@ -78,7 +78,7 @@ import Timecode from './Timecode.jsx'
|
|
|
78
78
|
* routing (fxr: Randomiser → Generate, Effects); lit while they are open. A row without
|
|
79
79
|
* `onPress` routes to its `path`
|
|
80
80
|
* NESTED LEVELS (FloatsOwnItems, kol-fxr 2026-10-31): a sub row with its own `sub` opens a level, the same row shape to any
|
|
81
|
-
* depth — `sub`, the More's `actions` and the transport's `sheetFor` rows alike (
|
|
81
|
+
* depth — `sub`, the More's `actions` and the transport's `sheetFor` rows alike (MenuFloat). On the `dock` a
|
|
82
82
|
* level opens BESIDE its row (the + menu's popover); on every phone variant it REPLACES the card's rows under a Back row. A
|
|
83
83
|
* leaf runs and closes every level; Escape and an outside press close all; ↑ ↓ move, → / Enter open a level, ← goes back one.
|
|
84
84
|
* Its menus are the floating style B (`variant="float"` on the rows, `.kol-more-sheet-float`) — the board's.
|
|
@@ -130,7 +130,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
130
130
|
const [moreEl, setMoreEl] = useState(null)
|
|
131
131
|
const findMore = useCallback((n) => setMoreEl(n?.querySelector('button[aria-label="More"]') ?? null), [])
|
|
132
132
|
/* offset: 12 off the pill — the slot sits 4 inside it; crossAxis drops the card's bottom to the pill's */
|
|
133
|
-
/* an outside press closes it — except one on a nested level, which hangs beside it in its own portal (
|
|
133
|
+
/* an outside press closes it — except one on a nested level, which hangs beside it in its own portal (MenuFloat) */
|
|
134
134
|
const morePop = usePopover({ open: dock && open, onOpenChange: setOpen, placement: 'right-end', offset: { mainAxis: 16, crossAxis: 4 }, click: false, referenceElement: moreEl, dismiss: { outsidePress: (e) => !e.target?.closest?.('.kol-float-level') } })
|
|
135
135
|
/* the row whose `sub` rows are open */
|
|
136
136
|
const [sub, setSub] = useState(null)
|
|
@@ -216,9 +216,9 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
216
216
|
)}
|
|
217
217
|
{sub && (
|
|
218
218
|
<div className={`kol-phone-nav-more ${card}`} role="menu" aria-label={inBar.find((i) => key(i) === sub)?.label} style={overSlot(inBar.findIndex((i) => key(i) === sub))}>
|
|
219
|
-
<
|
|
220
|
-
<
|
|
221
|
-
</
|
|
219
|
+
<MenuFloat beside={dock} cardClass={card} onLeaf={pickSub} title={inBar.find((i) => key(i) === sub)?.label}>
|
|
220
|
+
<MenuFloatRows variant="float" actions={inBar.find((i) => key(i) === sub)?.sub} onPick={pickSub} />
|
|
221
|
+
</MenuFloat>
|
|
222
222
|
</div>
|
|
223
223
|
)}
|
|
224
224
|
{open && !dock && (
|
|
@@ -229,18 +229,18 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
229
229
|
{open && !dock && (
|
|
230
230
|
<div className={`kol-phone-nav-more ${card}`} role="menu" aria-label="More" style={sheetStyle}>
|
|
231
231
|
{/* the nav, the page's actions, then the pinned foot (frame A2) */}
|
|
232
|
-
<
|
|
233
|
-
<
|
|
234
|
-
{after.length > 0 && <
|
|
235
|
-
</
|
|
232
|
+
<MenuFloat cardClass={card} onLeaf={pickMoreLeaf} title="More">
|
|
233
|
+
<MenuFloatRows variant="float" actions={actions} items={before} itemsFirst active={active} onPick={(x) => { setOpen(false); if (x.onPress && !actions.includes(x)) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }} />
|
|
234
|
+
{after.length > 0 && <MenuFloatRows variant="float" items={after} active={active} onPick={(x) => { setOpen(false); if (x.onPress) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }} />}
|
|
235
|
+
</MenuFloat>
|
|
236
236
|
</div>
|
|
237
237
|
)}
|
|
238
238
|
{dock && (
|
|
239
239
|
<PopoverPanel popover={morePop} panel={false} focus={false} className={card} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
|
|
240
|
-
<
|
|
241
|
-
<
|
|
242
|
-
{after.length > 0 && <
|
|
243
|
-
</
|
|
240
|
+
<MenuFloat beside cardClass={card} onLeaf={pickMoreLeaf} title="More">
|
|
241
|
+
<MenuFloatRows variant="float" actions={actions} items={before} itemsFirst active={active} onPick={(x) => { setOpen(false); if (x.onPress && !actions.includes(x)) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }} />
|
|
242
|
+
{after.length > 0 && <MenuFloatRows variant="float" items={after} active={active} onPick={(x) => { setOpen(false); if (x.onPress) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }} />}
|
|
243
|
+
</MenuFloat>
|
|
244
244
|
</PopoverPanel>
|
|
245
245
|
)}
|
|
246
246
|
{/* `contents` — no box; it only hands the ··· slot to the popover */}
|
|
@@ -284,7 +284,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
284
284
|
*
|
|
285
285
|
* @param {Array} items `[{ id, icon, label, onPress?, selected? }]` in pill order
|
|
286
286
|
* @param {Object} sheetFor `{ [id]: [{ label, icon?, onPress, checked?, sub? }] }` — rows for a slot that opens a sheet;
|
|
287
|
-
* `checked` marks the current pick with the 22px check (
|
|
287
|
+
* `checked` marks the current pick with the 22px check (MenuFloatRows); `sub` opens a level in place
|
|
288
288
|
* @param {'bottom'|'top'} placement the pill's edge (default bottom)
|
|
289
289
|
* @param {boolean} foldable a sideways swipe folds it into the right edge tab
|
|
290
290
|
* @param {boolean} folded · {Function} onFoldChange the folded state, controlled (else the pill holds it)
|
|
@@ -343,9 +343,9 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
343
343
|
{sheet && <button type="button" aria-label="Close" className="kol-phone-nav-scrim" onClick={() => setSheet(null)} />}
|
|
344
344
|
{sheet && (
|
|
345
345
|
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float ${floatSurfaceClass(surface, true)}${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label={items[at]?.label} style={capsuleSheet}>
|
|
346
|
-
<
|
|
347
|
-
<
|
|
348
|
-
</
|
|
346
|
+
<MenuFloat onLeaf={() => setSheet(null)} title={items[at]?.label}>
|
|
347
|
+
<MenuFloatRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
348
|
+
</MenuFloat>
|
|
349
349
|
</div>
|
|
350
350
|
)}
|
|
351
351
|
{tabs.map((t) => (
|
|
@@ -366,9 +366,9 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
366
366
|
)}
|
|
367
367
|
{sheet && (
|
|
368
368
|
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float ${floatSurfaceClass(surface, true)}${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label={items[at]?.label} style={sheetStyle}>
|
|
369
|
-
<
|
|
370
|
-
<
|
|
371
|
-
</
|
|
369
|
+
<MenuFloat onLeaf={() => setSheet(null)} title={items[at]?.label}>
|
|
370
|
+
<MenuFloatRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
371
|
+
</MenuFloat>
|
|
372
372
|
</div>
|
|
373
373
|
)}
|
|
374
374
|
<TabsRow
|
package/src/DocumentCapsule.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { Button, MenuTrigger, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
3
3
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
4
|
-
import
|
|
4
|
+
import MenuFloatRows, { MenuFloat } from './MenuFloat.jsx'
|
|
5
5
|
|
|
6
6
|
/* taxonomy-ok: molecule — a float Button, a float MenuTrigger (the name), the More sheet's rows */
|
|
7
7
|
|
|
@@ -16,7 +16,7 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
|
16
16
|
* @param {string} statusIcon an icon before the status (`check` for a saved document) — a glyph is an Icon, never a text
|
|
17
17
|
* character (plan-2026-11-06-buttons-page 1.4: the "✓" was a string)
|
|
18
18
|
* @param {Function} onBack the ← press; unset, no ←
|
|
19
|
-
* @param {Array} menuItems `[{ label, icon?, onPress, sub? }]` — the ▾ menu's rows (
|
|
19
|
+
* @param {Array} menuItems `[{ label, icon?, onPress, sub? }]` — the ▾ menu's rows (MenuFloatRows float); unset with `onMenu`, the ▾ runs it
|
|
20
20
|
* @param {Function} onMenu `() => void` — the ▾ press when the consumer owns the menu
|
|
21
21
|
* @param {'solid'|'glass-dark'|'glass-light'} surface what the capsule (and its menu) is made of (default `solid`)
|
|
22
22
|
* @param {string} className
|
|
@@ -51,9 +51,9 @@ export default function DocumentCapsule({ name, status, statusIcon, onBack, menu
|
|
|
51
51
|
)}
|
|
52
52
|
{hasMenu && (
|
|
53
53
|
<PopoverPanel popover={popover} panel={false} focus={false} className={card} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
</
|
|
54
|
+
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)} title={name}>
|
|
55
|
+
<MenuFloatRows variant="float" actions={menuItems} onPick={() => setOpen(false)} />
|
|
56
|
+
</MenuFloat>
|
|
57
57
|
</PopoverPanel>
|
|
58
58
|
)}
|
|
59
59
|
</div>
|
package/src/FloatActionMenu.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { Button, PopoverPanel, usePopover, floatSurfaceClass, floatMotion } from '@kolkrabbi/kol-component'
|
|
3
|
-
import
|
|
3
|
+
import MenuFloatRows, { MenuFloat } from './MenuFloat.jsx'
|
|
4
4
|
|
|
5
5
|
/* taxonomy-ok: molecule — a round Button that opens the More sheet's rows */
|
|
6
6
|
|
|
@@ -10,7 +10,7 @@ import MoreRows from './MoreSheet.jsx'
|
|
|
10
10
|
* beside it to the LEFT, top edges on one line, 12 off (user 2026-10-23), the phone More's rows. The catalog's
|
|
11
11
|
* VariantsButton shape. FloatLayout draws it at the bar's end from `bar.menu`.
|
|
12
12
|
*
|
|
13
|
-
* @param {Array} actions `[{ label, icon?, onPress }]` —
|
|
13
|
+
* @param {Array} actions `[{ label, icon?, onPress }]` — MenuFloatRows' actions
|
|
14
14
|
* @param {'more'|'plus'|string} [icon='more'] the button's glyph; anything but `more` turns to × while open
|
|
15
15
|
* @param {'float'} [variant] the sheet in the float look (`kol-more-sheet-float` on `surface`); unset, the plain sheet
|
|
16
16
|
* @param {'solid'|'glass-dark'|'glass-light'} [surface='solid'] what the float sheet is made of — the button never changes
|
|
@@ -18,13 +18,14 @@ import MoreRows from './MoreSheet.jsx'
|
|
|
18
18
|
* the one glyph 45° (the + into the ×) and back on close; `swap` exchanges the icon
|
|
19
19
|
* @param {boolean|Object} [motion=true] the button's states, the turn and the sheet's enter and leave: `true` the
|
|
20
20
|
* `--kol-float-*` tokens · `false` none · `{ duration, ease }` per app (floatMotion)
|
|
21
|
+
* @param {string} [title='Actions'] the float sheet's header (MenuFloat's RailHeader float) — the button's label
|
|
21
22
|
* @param {string} [className]
|
|
22
23
|
*
|
|
23
24
|
* The button's ladder (FloatActionStatesAndMotion, kol-website 2026-11-04): rest the solid inverted circle with the float
|
|
24
25
|
* shadow · hover the same fill at `--kol-float-hover-opacity` · pressed `--kol-float-press-scale` · open the × on the same
|
|
25
26
|
* fill and shadow (`.kol-float-action`; the shadow with `variant="float"`, so Home's plain masthead button is not lifted).
|
|
26
27
|
*/
|
|
27
|
-
export default function FloatActionMenu({ actions, icon = 'more', variant, surface = 'solid', iconMotion = 'rotate', motion = true, className = '' }) {
|
|
28
|
+
export default function FloatActionMenu({ actions, icon = 'more', variant, surface = 'solid', iconMotion = 'rotate', motion = true, title = 'Actions', className = '' }) {
|
|
28
29
|
const [open, setOpen] = useState(false)
|
|
29
30
|
/* the sheet opens to the LEFT of the button, top edges on one line (user 2026-10-23) — as the phone's sits beside its × */
|
|
30
31
|
const popover = usePopover({ open, onOpenChange: setOpen, placement: 'left-start', offset: 12 })
|
|
@@ -40,7 +41,9 @@ export default function FloatActionMenu({ actions, icon = 'more', variant, surfa
|
|
|
40
41
|
className={`kol-float-action${variant === 'float' ? ' is-float' : ''}${turn ? ` kol-float-turn${open ? ' is-open' : ''}` : ''}`} />
|
|
41
42
|
</span>
|
|
42
43
|
<PopoverPanel popover={popover} panel={false} motion={motion} className={`kol-more-sheet${variant === 'float' ? ` kol-more-sheet-float ${floatSurfaceClass(surface, true)}` : ''}`} style={{ minWidth: 220 }}>
|
|
43
|
-
|
|
44
|
+
{variant === 'float'
|
|
45
|
+
? <MenuFloat title={title} onLeaf={() => setOpen(false)}><MenuFloatRows actions={actions} variant="float" onPick={() => setOpen(false)} /></MenuFloat>
|
|
46
|
+
: <MenuFloatRows actions={actions} variant={variant} onPick={() => setOpen(false)} />}
|
|
44
47
|
</PopoverPanel>
|
|
45
48
|
</div>
|
|
46
49
|
)
|
package/src/HubHome.jsx
CHANGED
|
@@ -270,7 +270,7 @@ export default function HubHome({
|
|
|
270
270
|
|
|
271
271
|
/* NEW AND WALKTHROUGH LIVE IN THE MASTHEAD'S ROUND BUTTON (user 2026-10-23: *"New and more should go into a component
|
|
272
272
|
* like apps/catalog"*): the catalog's inverted full-radius Button in PageHeader's `actions` slot, opening the same sheet
|
|
273
|
-
* the phone bar's More draws (
|
|
273
|
+
* the phone bar's More draws (MenuFloatRows in `.kol-more-sheet`). The foot row it replaces was a row of buttons under the
|
|
274
274
|
* catalog, hence a bottom pad that read as a clipped last row. With the bar on a phone the bar's More carries both
|
|
275
275
|
* and the button hides below `md`; with the drawer it stays on every width. */
|
|
276
276
|
const baseActions = [
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { Button, ModalHeader, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, ModalHeader, RailHeader, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
3
3
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
4
4
|
|
|
5
|
-
/* the open level a row sits in (
|
|
5
|
+
/* the open level a row sits in (MenuFloat); null outside one, where a row's `sub` is ignored as before */
|
|
6
6
|
const Level = (globalThis[Symbol.for('@kolkrabbi/kol-shell/FloatMenuLevel')] ??= createContext(null))
|
|
7
7
|
const FLOAT_ROW = 'w-full justify-start kol-btn-float'
|
|
8
8
|
|
|
9
9
|
/* taxonomy-ok: molecule — a column of nav Buttons */
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
|
-
*
|
|
12
|
+
* MenuFloatRows — The sheet's rows, wherever the sheet opens. the one list of 44px nav rows (mono-16, 22px glyphs,
|
|
13
13
|
* the pill's rounding on each) that the phone bar's More sheet and Home's masthead button both draw
|
|
14
14
|
* (user 2026-10-23: *"we could even make similar dropdown as we use in phone nav"*). The sheet's chrome is
|
|
15
15
|
* `.kol-more-sheet` — the pill's ground and hairline, a 24px rounding, 8px pad — on whatever box holds the rows.
|
|
@@ -26,7 +26,7 @@ const FLOAT_ROW = 'w-full justify-start kol-btn-float'
|
|
|
26
26
|
* @param {boolean} itemsFirst the destinations above the actions (PhoneNav's More, 2026-10-28: the whole nav, then the
|
|
27
27
|
* page's buttons); Home's masthead button keeps actions first
|
|
28
28
|
*/
|
|
29
|
-
export default function
|
|
29
|
+
export default function MenuFloatRows({ actions = [], items = [], active, onPick, itemsFirst = false, variant }) {
|
|
30
30
|
/* the float row's height, inset and gap are the theme's (`.kol-more-sheet-float`, round 3) — no h-11 / gap-3 utility,
|
|
31
31
|
* which would outrank the components layer */
|
|
32
32
|
const float = variant === 'float'
|
|
@@ -36,7 +36,7 @@ export default function MoreRows({ actions = [], items = [], active, onPick, ite
|
|
|
36
36
|
const acts = (
|
|
37
37
|
<>
|
|
38
38
|
{actions.map((a) => {
|
|
39
|
-
/* a row with `sub` inside a
|
|
39
|
+
/* a row with `sub` inside a MenuFloat opens its level instead of picking — the chevron at the row's end */
|
|
40
40
|
const nests = level && a.sub?.length > 0
|
|
41
41
|
/* the account row is the ModalHeader (menu-system W4.1) — avatar · title, pressable */
|
|
42
42
|
if (a.avatar && !nests) return <ModalHeader key={a.label} variant={float ? 'float' : 'default'} avatar={a.avatar} title={a.label} onClick={() => { onPick?.(a); a.onPress?.() }} />
|
|
@@ -79,8 +79,8 @@ export default function MoreRows({ actions = [], items = [], active, onPick, ite
|
|
|
79
79
|
const rowKey = (r) => r.id ?? r.path ?? r.label
|
|
80
80
|
|
|
81
81
|
/**
|
|
82
|
-
*
|
|
83
|
-
* menus"*). Wraps the card's first level (`children`,
|
|
82
|
+
* MenuFloat — A float's card with NESTED LEVELS (FloatsOwnItems, kol-fxr 2026-10-31 — *"does the float nav offer nested
|
|
83
|
+
* menus"*). Wraps the card's first level (`children`, MenuFloatRows); a MenuFloatRows action with `sub` opens the next level, the same
|
|
84
84
|
* row shape to any depth (`sub[].sub[].sub…`). How a level opens is one rule, by room:
|
|
85
85
|
* - `beside` (the desk's `dock`) — a card of the same chrome beside its parent row, right of it, the bottom edges on one
|
|
86
86
|
* line, through the existing popover (`usePopover` + `PopoverPanel`, flips and shifts at the window's edge);
|
|
@@ -91,8 +91,12 @@ const rowKey = (r) => r.id ?? r.path ?? r.label
|
|
|
91
91
|
* @param {boolean} beside levels open beside their row (else they replace the card's rows)
|
|
92
92
|
* @param {string} cardClass a beside level's chrome — the first card's classes
|
|
93
93
|
* @param {Function} onLeaf `(row) => void` — a nested leaf was picked (its `onPress` has run); close everything here
|
|
94
|
+
* @param {ReactNode} [title] the card's header — RailHeader variant="float", the header every float Rail wears (the user
|
|
95
|
+
* 2026-11-12: *"why is it so hard TO USE THE SAME FUCKING HEADER"*); each opener passes the label of
|
|
96
|
+
* the button that opened it. Unset, no header
|
|
97
|
+
* @param {ReactNode} [titleActions] the header's actions slot (RailTrigger's ×)
|
|
94
98
|
*/
|
|
95
|
-
export function
|
|
99
|
+
export function MenuFloat({ beside = false, cardClass = '', onLeaf, title, titleActions, children }) {
|
|
96
100
|
/* the open rows, outermost first — `{ row, el }`, `el` the row a beside level hangs off.
|
|
97
101
|
* ponytail: the row object is kept as opened; a consumer that rebuilds its rows mid-open sees the old `sub` until reopened */
|
|
98
102
|
const [trail, setTrail] = useState([])
|
|
@@ -115,19 +119,24 @@ export function FloatMenu({ beside = false, cardClass = '', onLeaf, children })
|
|
|
115
119
|
<Level.Provider value={at(depth)}>
|
|
116
120
|
<LevelRows key={`${depth}:${rowKey(trail[depth - 1].row)}`} onKeyDown={keys(depth)}>
|
|
117
121
|
{lead}
|
|
118
|
-
<
|
|
122
|
+
<MenuFloatRows variant="float" actions={rows} onPick={onLeaf} />
|
|
119
123
|
</LevelRows>
|
|
120
124
|
</Level.Provider>
|
|
121
125
|
)
|
|
122
126
|
|
|
127
|
+
/* the header stays on top while a level replaces the rows; title 12 in, as the rows' labels */
|
|
128
|
+
const head = title != null && title !== false && (
|
|
129
|
+
<RailHeader variant="float" title={title} actions={titleActions} className={`pl-3 ${titleActions ? 'pr-1' : 'pr-3'} pt-1 pb-2`} />
|
|
130
|
+
)
|
|
123
131
|
if (!beside && trail.length) {
|
|
124
132
|
const d = trail.length
|
|
125
|
-
return level(d, trail[d - 1].row.sub, (
|
|
133
|
+
return <>{head}{level(d, trail[d - 1].row.sub, (
|
|
126
134
|
<Button variant="nav" size="lg" iconLeft="chevron-left" iconSize="var(--kol-float-ic)" className={FLOAT_ROW} onClick={() => back(d)}>{trail[d - 1].row.label}</Button>
|
|
127
|
-
))
|
|
135
|
+
))}</>
|
|
128
136
|
}
|
|
129
137
|
return (
|
|
130
138
|
<Level.Provider value={at(0)}>
|
|
139
|
+
{head}
|
|
131
140
|
<div className="contents" onKeyDown={keys(0)}>{children}</div>
|
|
132
141
|
{beside && trail.map((s, i) => (
|
|
133
142
|
<Beside key={i} anchor={s.el} cardClass={cardClass}>{level(i + 1, s.row.sub)}</Beside>
|
package/src/PropertyRail.jsx
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Button, Input, Dropdown,
|
|
1
|
+
import { Button, Input, Dropdown, RailFloat, 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
|
|
4
|
+
/* taxonomy-ok: organism — kol-component's RailFloat 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`,
|
|
@@ -11,7 +11,7 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
11
11
|
* kol-component draws: `fields` two-up Inputs float, `select` a Dropdown, `slider` a Slider float with its
|
|
12
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
|
|
13
13
|
* exploration's `Floating properties inspector` (kol-float--style 9:9273); the section hairlines stay out (no-borders law).
|
|
14
|
-
* Since 0.123.0 the sheet, header, fold and folded pill are kol-component's `
|
|
14
|
+
* Since 0.123.0 the sheet, header, fold and folded 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)
|
|
@@ -53,7 +53,7 @@ export default function PropertyRail({ title, onCollapse, onExpand, density = 'r
|
|
|
53
53
|
{onCollapse && <Button variant="float" tone="ghost" size="sm" iconOnly="panel-right" aria-label="Collapse" onClick={onCollapse} />}
|
|
54
54
|
</>
|
|
55
55
|
return (
|
|
56
|
-
<
|
|
56
|
+
<RailFloat title={title} actions={actions} foldable={foldable} folded={folded} defaultFolded={defaultFolded} onFold={onFold}
|
|
57
57
|
compact={compact} wide={wide} width={width} surface={surface} className={`kol-property-rail ${className}`.trim()}
|
|
58
58
|
footer={footer && compact ? <div className="pt-4">{footer}</div> : footer}>
|
|
59
59
|
{tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
|
|
@@ -85,7 +85,7 @@ export default function PropertyRail({ title, onCollapse, onExpand, density = 'r
|
|
|
85
85
|
)
|
|
86
86
|
})}
|
|
87
87
|
{children}
|
|
88
|
-
</
|
|
88
|
+
</RailFloat>
|
|
89
89
|
)
|
|
90
90
|
}
|
|
91
91
|
|
package/src/RailTrigger.jsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
2
|
import { Button, usePopover, PopoverPanel, floatSurfaceClass, floatMotion } from '@kolkrabbi/kol-component'
|
|
3
|
-
import
|
|
3
|
+
import MenuFloatRows, { MenuFloat } from './MenuFloat.jsx'
|
|
4
4
|
|
|
5
5
|
/* taxonomy-ok: molecule — a float Button that opens the More sheet's rows */
|
|
6
6
|
|
|
@@ -36,16 +36,11 @@ export default function RailTrigger({ items = [], currentPath = '/', onNavigate,
|
|
|
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
|
-
{
|
|
40
|
-
<
|
|
41
|
-
|
|
42
|
-
<Button variant="float" tone="ghost" size="sm" iconOnly="x" aria-label="Close" onClick={() => setOpen(false)} />
|
|
43
|
-
</div>
|
|
44
|
-
)}
|
|
45
|
-
<FloatMenu cardClass={card} onLeaf={pick}>
|
|
46
|
-
<MoreRows variant="float" items={items.filter((i) => !i.heading)} active={currentPath} onPick={pick} itemsFirst
|
|
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
|
|
47
42
|
actions={onRestore ? [{ label: 'Show navigation', icon: 'panel-left', restore: true }] : undefined} />
|
|
48
|
-
</
|
|
43
|
+
</MenuFloat>
|
|
49
44
|
</PopoverPanel>
|
|
50
45
|
</div>
|
|
51
46
|
)
|
package/src/TopControlsBar.jsx
CHANGED
|
@@ -2,7 +2,7 @@ import { useState } from 'react'
|
|
|
2
2
|
import FloatActionMenu from './FloatActionMenu.jsx'
|
|
3
3
|
import { Button, TabsRow, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
4
4
|
import DocumentCapsule from './DocumentCapsule.jsx'
|
|
5
|
-
import
|
|
5
|
+
import MenuFloatRows, { MenuFloat } from './MenuFloat.jsx'
|
|
6
6
|
|
|
7
7
|
/* taxonomy-ok: organism — the top bar: DocumentCapsule · TabsRow float · float Buttons · PanelsRestore */
|
|
8
8
|
|
|
@@ -28,9 +28,9 @@ export function PanelsRestore({ label = 'Panels', children, items, surface = 'so
|
|
|
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
|
-
<
|
|
32
|
-
<
|
|
33
|
-
</
|
|
31
|
+
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)} title={label}>
|
|
32
|
+
<MenuFloatRows variant="float" actions={items ?? []} onPick={() => setOpen(false)} />
|
|
33
|
+
</MenuFloat>
|
|
34
34
|
)}
|
|
35
35
|
</PopoverPanel>
|
|
36
36
|
</>
|
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, 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, 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'
|