@kolkrabbi/kol-shell 0.109.0 → 0.110.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 +4 -2
- 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.110.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.
|
|
25
|
-
"@kolkrabbi/kol-framework": "^0.70.0",
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.342.0",
|
|
26
25
|
"@kolkrabbi/kol-icons": "^0.65.0",
|
|
26
|
+
"@kolkrabbi/kol-framework": "^0.70.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
|
@@ -25,8 +25,10 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
25
25
|
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
26
|
/* 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
27
|
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: 26 tall, 12 in; lit while its menu is open
|
|
29
|
-
|
|
28
|
+
/* 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
|
|
29
|
+
* centred in 26 starts on a half pixel, and the glyphs rode it — the label's cap centre on the pill's centre, measured
|
|
30
|
+
* in Chromium and Firefox (±0.5 at 1x is the 9px cap's own rounding). */
|
|
31
|
+
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
32
|
|
|
31
33
|
function Rows({ items, width }) {
|
|
32
34
|
return items.map((it, 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>
|