@kolkrabbi/kol-shell 0.133.0 → 0.135.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 +7 -7
- package/src/MenuBar.jsx +18 -37
- package/src/ToolRail.jsx +24 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.135.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,19 +12,19 @@
|
|
|
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.237.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-
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-
|
|
27
|
-
"@kolkrabbi/kol-
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.391.0",
|
|
25
|
+
"@kolkrabbi/kol-framework": "^0.74.1",
|
|
26
|
+
"@kolkrabbi/kol-icons": "^0.75.0",
|
|
27
|
+
"@kolkrabbi/kol-theme": "^0.237.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
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
|
|
package/src/ToolRail.jsx
CHANGED
|
@@ -98,29 +98,31 @@ function ToolMore({ items, surface, chevron = false, label = 'More tools', onPic
|
|
|
98
98
|
)
|
|
99
99
|
}
|
|
100
100
|
|
|
101
|
-
/* ── kolbox
|
|
102
|
-
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
*
|
|
108
|
-
*
|
|
109
|
-
*
|
|
110
|
-
*
|
|
111
|
-
* `
|
|
101
|
+
/* ── dock (kolbox's ToolDock, plan-2026-11-18-kolbox-system W31.2 batch 5, 2026-11-18; a plain variant since
|
|
102
|
+
* plan-2026-11-29-one-set-fold W4 run 1) ─────────────────────────────────────────────────────────────────────────────
|
|
103
|
+
* The file's ToolDock 28:9326 (plan 10.8; W19.2), carried from apps/kolbox/src/ui/ToolDock.jsx: the panel fill, radius 13,
|
|
104
|
+
* padding 8, on the one floating surface (`kol-kolbox-surface`); chrome in kol-theme `.kol-tool-rail--dock`. The tools, 8
|
|
105
|
+
* apart; a rule 1 by 24 between groups (`--kol-rail-line`); `end` a second group after a rule (kolbox's well; the design
|
|
106
|
+
* draws none, the transport fills it). ToolRail's words: `tools` [{ id, icon, label, kbd, more: [{ id, icon, label, kbd,
|
|
107
|
+
* action }] }] (kolbox's `variants`), `value` a tool's id or one of its `more` ids (the tool shows its current member's
|
|
108
|
+
* glyph), `onChange(id)`. Two more kinds in `tools`, as the real ToolPalette's: `{ divider: true }` and a one-shot
|
|
109
|
+
* `{ id, icon, label, kbd, disabled, onClick }` that is never the armed tool. A tool with `more` is ButtonSplit in its
|
|
110
|
+
* icon-only form (`iconOnly` and `onMenu`): the tool a tile, its chevron a separate 16 by 32 button 1 beside it,
|
|
111
|
+
* `onVariants(tool, element)` its press (the host opens its own menu), `variantsOpen` the id of the tool whose menu is open
|
|
112
|
+
* (its chevron keeps the quiet fill). `children` replace the tools (the transport's own cells).
|
|
112
113
|
* 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
114
|
* 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
|
-
*
|
|
115
|
+
* 22 in the full ink (his "bigger icons", R3.4): drawn 14 to 15, Figma's 16 to 17 inside its 24 box.
|
|
116
|
+
* ToolRailSlot is the dock's slot, one look: chrome in kol-theme `.kol-tool-slot`. */
|
|
115
117
|
export function ToolRailSlot({ icon, label, kbd, active = false, lit = false, className = '', ...rest }) {
|
|
116
118
|
return (
|
|
117
|
-
<Tooltip
|
|
119
|
+
<Tooltip label={kbd ? <>{label}<KbdKeys size="sm" keys={kbd} className="ml-2" /></> : label}>
|
|
118
120
|
<button
|
|
119
121
|
type="button"
|
|
120
122
|
aria-label={label}
|
|
121
123
|
aria-pressed={active || lit}
|
|
122
124
|
data-dock-cell
|
|
123
|
-
className={`kol-tool-slot
|
|
125
|
+
className={`kol-tool-slot${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
126
|
{...rest}
|
|
125
127
|
>
|
|
126
128
|
<IconLoader name={icon} size={22} className="kol-kolbox-icon shrink-0" />
|
|
@@ -129,10 +131,10 @@ export function ToolRailSlot({ icon, label, kbd, active = false, lit = false, cl
|
|
|
129
131
|
)
|
|
130
132
|
}
|
|
131
133
|
|
|
132
|
-
function
|
|
134
|
+
function ToolRailDock({ tools = [], value, onChange, onVariants, variantsOpen, end, children, className = '' }) {
|
|
133
135
|
const rule = (key) => <span key={key} className="kol-tool-rail-rule h-6 w-px shrink-0" />
|
|
134
136
|
return (
|
|
135
|
-
<div data-kol-dock className={`kol-tool-rail--
|
|
137
|
+
<div data-kol-dock className={`kol-tool-rail--dock 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
138
|
<div className="flex items-center gap-2">
|
|
137
139
|
{children ??
|
|
138
140
|
tools.map((t, i) => {
|
|
@@ -146,8 +148,8 @@ function ToolRailKolbox({ tools = [], value, onChange, onVariants, variantsOpen,
|
|
|
146
148
|
const arm = () => onChange?.(current?.id ?? t.id)
|
|
147
149
|
if (!t.more?.length) return <ToolRailSlot key={t.id} icon={icon} label={label} kbd={kbd} active={active} onClick={arm} />
|
|
148
150
|
return (
|
|
149
|
-
<ButtonSplit key={t.id}
|
|
150
|
-
tooltip={kbd ? <>{label}<KbdKeys
|
|
151
|
+
<ButtonSplit key={t.id} iconOnly={icon} aria-label={label} pressed={active} onClick={arm}
|
|
152
|
+
tooltip={kbd ? <>{label}<KbdKeys size="sm" keys={kbd} className="ml-2" /></> : label}
|
|
151
153
|
menuLabel={`${t.label} variants`} menuOpen={variantsOpen === t.id} onMenu={(e) => onVariants?.(t, e.currentTarget)} />
|
|
152
154
|
)
|
|
153
155
|
})}
|
|
@@ -162,15 +164,10 @@ function ToolRailKolbox({ tools = [], value, onChange, onVariants, variantsOpen,
|
|
|
162
164
|
)
|
|
163
165
|
}
|
|
164
166
|
|
|
165
|
-
/*
|
|
166
|
-
*
|
|
167
|
-
|
|
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
|
-
}
|
|
167
|
+
/* the old theme words: accepted, they draw `dock` (W4 run 1, on the retirement ledger). Folio's toolbar row went to
|
|
168
|
+
* `_tmp/2026-11-29-one-set-fold/ToolRail.pre-w4a.jsx`; apps/folio draws its row itself. */
|
|
169
|
+
const THEME_WORDS = ['kolbox', 'folio']
|
|
172
170
|
|
|
173
171
|
export default function ToolRail(props) {
|
|
174
|
-
|
|
175
|
-
return props.variant === 'kolbox' ? <ToolRailKolbox {...props} /> : <ToolRailDefault {...props} />
|
|
172
|
+
return props.variant === 'dock' || THEME_WORDS.includes(props.variant) ? <ToolRailDock {...props} /> : <ToolRailDefault {...props} />
|
|
176
173
|
}
|