@kolkrabbi/kol-shell 0.109.0 → 0.111.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 +3 -3
- package/src/DocumentCapsule.jsx +2 -2
- package/src/MenuBar.jsx +21 -4
- package/src/MoreSheet.jsx +1 -1
- package/src/ToolRail.jsx +7 -4
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.111.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,9 +21,9 @@
|
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.343.0",
|
|
25
|
+
"@kolkrabbi/kol-icons": "^0.66.0",
|
|
25
26
|
"@kolkrabbi/kol-framework": "^0.70.0",
|
|
26
|
-
"@kolkrabbi/kol-icons": "^0.65.0",
|
|
27
27
|
"@kolkrabbi/kol-theme": "^0.212.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
package/src/DocumentCapsule.jsx
CHANGED
|
@@ -31,8 +31,8 @@ export default function DocumentCapsule({ name, status, onBack, menuItems, onMen
|
|
|
31
31
|
<button
|
|
32
32
|
type="button"
|
|
33
33
|
ref={hasMenu ? popover.refs.setReference : undefined}
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
/* the popover's own press when there are rows — an `onClick={undefined}` after the spread wiped it */
|
|
35
|
+
{...(hasMenu ? popover.getReferenceProps() : { onClick: onMenu })}
|
|
36
36
|
aria-haspopup="menu"
|
|
37
37
|
aria-expanded={hasMenu ? open : undefined}
|
|
38
38
|
className="kol-float-panel text-emphasis inline-flex items-center gap-3 h-9 rounded-full bg-transparent border-0 p-0 cursor-pointer"
|
package/src/MenuBar.jsx
CHANGED
|
@@ -17,6 +17,10 @@ import { Icon } 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
|
|
21
|
+
* menu capsule 19:10617): the menus on a float sheet (the secondary surface, the window round,
|
|
22
|
+
* 20 in), each trigger the float label role in caps at fg-48 with a 10 chevron, 12 apart,
|
|
23
|
+
* lit fg-96 while open. The same menus, lists and keys as the bar.
|
|
20
24
|
* @param {string} className
|
|
21
25
|
*
|
|
22
26
|
* A row in `items` (Menu's own row keys): `{ label, onClick, kbd?, disabled?, checked?, indicator?, icon?, tone? }` ·
|
|
@@ -25,8 +29,12 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
25
29
|
const ROW = 'kol-menubar-row w-full shrink-0 flex items-center gap-2 h-6 px-2 rounded-[var(--kol-radius-sm)] text-left font-[family-name:var(--kol-font-family-sans)] text-[13px] font-medium leading-normal text-[color:var(--kol-fg-emphasis)] hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] disabled:opacity-40 disabled:cursor-not-allowed focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
|
|
26
30
|
/* the list: the secondary surface, a 2% rim, 4 in, the large shadow; the key cap on the rim's fill, its ink oq-80 */
|
|
27
31
|
const LIST = 'kol-menubar-list flex flex-col bg-[var(--kol-surface-secondary)] border border-[var(--kol-fg-02)] rounded-[var(--kol-radius-sm)] p-1 shadow-[0_10px_15px_rgba(0,0,0,0.1)] [&_.kol-menu-kbd]:bg-[var(--kol-fg-02)] [&_.kol-menu-kbd]:border [&_.kol-menu-kbd]:border-[var(--kol-fg-02)] [&_.kol-menu-kbd]:text-[var(--kol-oq-80)] [&_.kol-menu-kbd]:rounded-[2px]'
|
|
28
|
-
/* the trigger:
|
|
29
|
-
const
|
|
32
|
+
/* the capsule's trigger (his 19:9544): Inter 11 caps at fg-48, the chevron 8 after, 26 tall, the text on the top */
|
|
33
|
+
const CAPSULE_TRIGGER = 'kol-menu-btn inline-flex items-start gap-2 h-[26px] p-0 bg-transparent border-0 kol-float-label uppercase whitespace-nowrap text-fg-48 hover:text-(--kol-fg-80) aria-expanded:text-(--kol-fg-96) focus-visible:outline-none focus-visible:text-(--kol-fg-96) [&_svg]:mt-[3px]'
|
|
34
|
+
/* the trigger: 26 tall, 12 in; lit while its menu is open. The line box is the pill (leading 26, not 13): a 13 line box
|
|
35
|
+
* centred in 26 starts on a half pixel, and the glyphs rode it — the label's cap centre on the pill's centre, measured
|
|
36
|
+
* in Chromium and Firefox (±0.5 at 1x is the 9px cap's own rounding). */
|
|
37
|
+
const TRIGGER = 'kol-menu-btn inline-flex items-center h-[26px] px-3 rounded-[var(--kol-radius-sm)] font-[family-name:var(--kol-font-family-sans)] text-[13px] leading-[26px] text-[color:var(--kol-fg-emphasis)] whitespace-nowrap hover:bg-[var(--kol-fg-08)] aria-expanded:bg-[var(--kol-fg-08)] focus-visible:outline-none focus-visible:bg-[var(--kol-fg-08)]'
|
|
30
38
|
|
|
31
39
|
function Rows({ items, width }) {
|
|
32
40
|
return items.map((it, i) => {
|
|
@@ -52,7 +60,8 @@ function Rows({ items, width }) {
|
|
|
52
60
|
})
|
|
53
61
|
}
|
|
54
62
|
|
|
55
|
-
export default function MenuBar({ app, menus = [], end = [], className = '' }) {
|
|
63
|
+
export default function MenuBar({ app, menus = [], end = [], variant = 'bar', className = '' }) {
|
|
64
|
+
const capsule = variant === 'capsule'
|
|
56
65
|
const appMenu = typeof app === 'string' ? { label: app } : app
|
|
57
66
|
const all = [...(appMenu ? [{ ...appMenu, app: true }] : []), ...menus, ...end]
|
|
58
67
|
const [open, setOpen] = useState(null)
|
|
@@ -91,8 +100,9 @@ export default function MenuBar({ app, menus = [], end = [], className = '' }) {
|
|
|
91
100
|
<button {...props} ref={(el) => { triggers.current[i] = el }} type="button" aria-expanded={isOpen}
|
|
92
101
|
/* the bar is live once a menu is open: pointing at another opens it (the mac menu bar) */
|
|
93
102
|
onPointerEnter={() => { if (open != null && open !== i) setOpen(i) }}
|
|
94
|
-
className={`${TRIGGER} ${m.app ? 'font-bold' : 'font-medium'}`}>
|
|
103
|
+
className={capsule ? CAPSULE_TRIGGER : `${TRIGGER} ${m.app ? 'font-bold' : 'font-medium'}`}>
|
|
95
104
|
{m.label}
|
|
105
|
+
{capsule && <Icon name="chevron-down" size={10} className="text-oq-48" />}
|
|
96
106
|
</button>
|
|
97
107
|
)}
|
|
98
108
|
>
|
|
@@ -102,6 +112,13 @@ export default function MenuBar({ app, menus = [], end = [], className = '' }) {
|
|
|
102
112
|
}
|
|
103
113
|
|
|
104
114
|
const startCount = (appMenu ? 1 : 0) + menus.length
|
|
115
|
+
if (capsule) {
|
|
116
|
+
return (
|
|
117
|
+
<div role="menubar" aria-label="Menu bar" className={`kol-menubar kol-menubar--capsule flex items-start gap-3 p-5 rounded-[var(--kol-float-window-r)] bg-[var(--kol-surface-secondary)] ${className}`.trim()}>
|
|
118
|
+
{all.map((m, i) => item(m, i))}
|
|
119
|
+
</div>
|
|
120
|
+
)
|
|
121
|
+
}
|
|
105
122
|
return (
|
|
106
123
|
<div role="menubar" aria-label="Menu bar" className={`kol-menubar flex items-center gap-1 h-10 px-4 shrink-0 bg-[var(--kol-surface-secondary)] border-b border-[var(--kol-fg-02)] ${className}`.trim()}>
|
|
107
124
|
{all.slice(0, startCount).map((m, i) => item(m, i))}
|
package/src/MoreSheet.jsx
CHANGED
|
@@ -3,7 +3,7 @@ import { Avatar, Button, usePopover, PopoverPanel } from '@kolkrabbi/kol-compone
|
|
|
3
3
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
4
4
|
|
|
5
5
|
/* the open level a row sits in (FloatMenu); null outside one, where a row's `sub` is ignored as before */
|
|
6
|
-
const Level = createContext(null)
|
|
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 */
|
package/src/ToolRail.jsx
CHANGED
|
@@ -17,9 +17,12 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
17
17
|
* `[{ label, icon?, kbd?, onClick }]` — a 36 ⋮ circle 16 under the rail, on the rail's surface,
|
|
18
18
|
* its rows a float list beside it (Hand, Zoom, Fill/stroke, Reset colours). Unset, no ⋮.
|
|
19
19
|
* @param {string} className the rail's — or, with `more`, the column's that holds the rail and its ⋮
|
|
20
|
+
* @param {'vertical'|'horizontal'} orientation THE PHONE ROW (plan-2026-11-05-float-editor W2.7; his frame 06 19:8598):
|
|
21
|
+
* `horizontal` lays the slots in a row and names them above; default `vertical`
|
|
20
22
|
*/
|
|
21
|
-
export default function ToolRail({ tools = [], value, onChange, surface = 'solid', more, className = '' }) {
|
|
22
|
-
|
|
23
|
+
export default function ToolRail({ tools = [], value, onChange, surface = 'solid', more, orientation = 'vertical', className = '' }) {
|
|
24
|
+
const row = orientation === 'horizontal'
|
|
25
|
+
if (more?.length && !row) {
|
|
23
26
|
return (
|
|
24
27
|
<div className={`inline-flex flex-col items-center gap-4 ${className}`.trim()}>
|
|
25
28
|
<ToolRail tools={tools} value={value} onChange={onChange} surface={surface} />
|
|
@@ -28,9 +31,9 @@ export default function ToolRail({ tools = [], value, onChange, surface = 'solid
|
|
|
28
31
|
)
|
|
29
32
|
}
|
|
30
33
|
return (
|
|
31
|
-
<div role="toolbar" aria-orientation=
|
|
34
|
+
<div role="toolbar" aria-orientation={orientation} aria-label="Tools" className={`kol-tool-rail kol-float-chrome inline-flex ${row ? 'flex-row' : 'flex-col'} gap-1 p-1.5 rounded-full ${floatSurfaceClass(surface)} ${className}`.trim()}>
|
|
32
35
|
{tools.map((t) => (
|
|
33
|
-
<Tooltip key={t.id} variant="float" placement=
|
|
36
|
+
<Tooltip key={t.id} variant="float" placement={row ? 'top' : 'right'} offset={12} label={t.label} shortcut={t.kbd}>
|
|
34
37
|
{/* every slot at full ink, armed or not (his frame 19:6071 — W1.3; the ghost tone's oq-48 read as disabled) */}
|
|
35
38
|
<Button variant="float" tone="ghost" iconOnly={t.icon} aria-label={t.label} pressed={t.id === value} onClick={() => onChange?.(t.id)} className="[--kol-tone-fg:var(--kol-oq-96)]" />
|
|
36
39
|
</Tooltip>
|