@kolkrabbi/kol-shell 0.132.0 → 0.134.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 +6 -6
- package/src/AppFloatNav.jsx +3 -3
- package/src/MenuBar.jsx +18 -37
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.134.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,18 +12,18 @@
|
|
|
12
12
|
"./src/*": "./src/*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@kolkrabbi/kol-component": ">=0.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.389.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.69.0",
|
|
18
|
-
"@kolkrabbi/kol-theme": ">=0.
|
|
18
|
+
"@kolkrabbi/kol-theme": ">=0.235.0",
|
|
19
19
|
"gsap": "^3.13.0",
|
|
20
20
|
"react": "^18.3.0 || ^19.0.0",
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
25
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
26
|
-
"@kolkrabbi/kol-icons": "^0.
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.389.0",
|
|
25
|
+
"@kolkrabbi/kol-theme": "^0.235.0",
|
|
26
|
+
"@kolkrabbi/kol-icons": "^0.74.1",
|
|
27
27
|
"@kolkrabbi/kol-framework": "^0.74.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -492,9 +492,9 @@ function TransportFolio({ playing = false, onPlay, onStop, loop = false, onLoop,
|
|
|
492
492
|
const tc = timecode == null ? {} : typeof timecode === 'string' ? { current: timecode } : timecode
|
|
493
493
|
return (
|
|
494
494
|
<span role="group" aria-label="Transport" className={`kol-transport--folio flex shrink-0 items-center gap-[4px] ${className}`.trim()}>
|
|
495
|
-
<Button variant="folio" iconOnly={playing ? 'pause' : 'play'} aria-label={playing ? 'Pause' : 'Play'} pressed={playing} onClick={() => onPlay?.(!playing)} />
|
|
496
|
-
<Button variant="folio" iconOnly="stop" aria-label="Stop" onClick={onStop} />
|
|
497
|
-
<Button variant="folio" iconOnly="repeat" aria-label="Loop" pressed={loop} onClick={() => onLoop?.(!loop)} />
|
|
495
|
+
<Button variant="folio" keepFocus iconOnly={playing ? 'pause' : 'play'} aria-label={playing ? 'Pause' : 'Play'} pressed={playing} onClick={() => onPlay?.(!playing)} />
|
|
496
|
+
<Button variant="folio" keepFocus iconOnly="stop" aria-label="Stop" onClick={onStop} />
|
|
497
|
+
<Button variant="folio" keepFocus iconOnly="repeat" aria-label="Loop" pressed={loop} onClick={() => onLoop?.(!loop)} />
|
|
498
498
|
<span className="kol-transport-time whitespace-pre px-[8px] tabular-nums">{tc.current}{tc.total != null && <span className="kol-transport-total">{` / ${tc.total}`}</span>}</span>
|
|
499
499
|
</span>
|
|
500
500
|
)
|
package/src/MenuBar.jsx
CHANGED
|
@@ -17,12 +17,12 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
17
17
|
* @param {string|Object} app the app's name ("FXR"), or a menu `{ label, items }` when the name opens the app menu
|
|
18
18
|
* @param {Array} menus `[{ label, items, width? }]` — `width` the list's (default 250)
|
|
19
19
|
* @param {Array} end the same, at the bar's far end (Help)
|
|
20
|
-
* @param {'bar'|'capsule'} variant `capsule` (plan-2026-11-05-float-editor W2b; his phone frame 06, 19:9544 — the Section 4
|
|
20
|
+
* @param {'bar'|'capsule'|'rail'} variant `capsule` (plan-2026-11-05-float-editor W2b; his phone frame 06, 19:9544 — the Section 4
|
|
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
|
-
* `
|
|
25
|
-
* `kolbox
|
|
24
|
+
* `rail`: the top rail's bar, `menus` and `children` only (see `MenuBarRail`).
|
|
25
|
+
* `kolbox` and `folio` are accepted and draw `rail` (on the retirement ledger).
|
|
26
26
|
* @param {string} className
|
|
27
27
|
*
|
|
28
28
|
* A row in `items` (Menu's own row keys): `{ label, onClick, kbd?, disabled?, checked?, indicator?, icon?, tone? }` ·
|
|
@@ -62,54 +62,35 @@ function Rows({ items, width }) {
|
|
|
62
62
|
})
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
/* `variant="
|
|
66
|
-
*
|
|
67
|
-
*
|
|
68
|
-
*
|
|
69
|
-
*
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
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 }) {
|
|
65
|
+
/* `variant="rail"` (kolbox's own menu bar, Folio on kolbox 2026-11-22; a plain variant since plan-2026-11-29-one-set-fold W3
|
|
66
|
+
* run 2; round 2, retired from kolbox's top rail in round 3, `_tmp/2026-11-18-menubar/MenuBar.jsx` and its TopRail),
|
|
67
|
+
* the chrome in kol-theme `.kol-menubar--rail`, its look `--kol-menubar-*`: the top rail's 56 on the panel fill, 16 in, the
|
|
68
|
+
* rails' line under it; each trigger the control height, 8 in, radius 4, the label role in the ink, the field fill on
|
|
69
|
+
* hover and while its list is open. The lists are `Menu`s dropped from their trigger; once one is open, pointing at
|
|
70
|
+
* another opens it; Escape or a press outside closes. `menus` `[{ label, items }]` (Menu's rows) and `children` at the
|
|
71
|
+
* far right. Folio's own bar (48, inline lists) went to `_tmp/2026-11-29-one-set-fold/MenuBar.pre-w3b.jsx`. */
|
|
72
|
+
function MenuBarRail({ menus = [], children }) {
|
|
94
73
|
const [open, setOpen] = useState(null)
|
|
95
74
|
const refs = useRef({})
|
|
96
75
|
const current = menus.find((m) => m.label === open)
|
|
97
76
|
return (
|
|
98
|
-
<nav aria-label="Menu bar" className="kol-menubar--
|
|
77
|
+
<nav aria-label="Menu bar" className="kol-menubar--rail flex h-14 shrink-0 items-center border-b px-4">
|
|
99
78
|
{menus.map(({ label }) => (
|
|
100
79
|
<button key={label} ref={(el) => { refs.current[label] = el }} type="button" aria-haspopup="menu" aria-expanded={open === label}
|
|
101
80
|
onMouseDown={(e) => e.preventDefault()} onClick={() => setOpen((o) => (o === label ? null : label))} onPointerEnter={() => { if (open && open !== label) setOpen(label) }}
|
|
102
|
-
className={`kol-menubar-trigger
|
|
81
|
+
className={`kol-menubar-trigger${open === label ? ' is-open' : ''} inline-flex items-center px-2 outline-none focus-visible:outline-1`}>{label}</button>
|
|
103
82
|
))}
|
|
104
|
-
{current && <Menu key={open}
|
|
83
|
+
{current && <Menu key={open} aria-label={open} anchor={refs.current[open]} open onClose={() => setOpen(null)} items={current.items} />}
|
|
105
84
|
<div className="ml-auto flex items-center gap-1">{children}</div>
|
|
106
85
|
</nav>
|
|
107
86
|
)
|
|
108
87
|
}
|
|
109
88
|
|
|
89
|
+
/* the old theme words: accepted, they draw `rail` (W3 run 2, on the retirement ledger) */
|
|
90
|
+
const THEME_WORDS = ['kolbox', 'folio']
|
|
91
|
+
|
|
110
92
|
export default function MenuBar(props) {
|
|
111
|
-
if (props.variant === '
|
|
112
|
-
if (props.variant === 'folio') return <MenuBarFolio {...props} />
|
|
93
|
+
if (props.variant === 'rail' || THEME_WORDS.includes(props.variant)) return <MenuBarRail {...props} />
|
|
113
94
|
return <MenuBarOn {...props} />
|
|
114
95
|
}
|
|
115
96
|
|