@kolkrabbi/kol-shell 0.127.0 → 0.129.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 +5 -5
- package/src/DocumentCapsule.jsx +1 -1
- package/src/FloatActionMenu.jsx +6 -3
- package/src/MenuFloat.jsx +13 -4
- package/src/PropertyRail.jsx +12 -13
- package/src/RailTrigger.jsx +2 -7
- package/src/TopControlsBar.jsx +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.129.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.376.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.224.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.
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.376.0",
|
|
25
25
|
"@kolkrabbi/kol-icons": "^0.71.0",
|
|
26
|
-
"@kolkrabbi/kol-
|
|
27
|
-
"@kolkrabbi/kol-
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.224.0",
|
|
27
|
+
"@kolkrabbi/kol-framework": "^0.74.1"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -216,7 +216,7 @@ 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
|
-
<MenuFloat beside={dock} cardClass={card} onLeaf={pickSub}>
|
|
219
|
+
<MenuFloat beside={dock} cardClass={card} onLeaf={pickSub} title={inBar.find((i) => key(i) === sub)?.label}>
|
|
220
220
|
<MenuFloatRows variant="float" actions={inBar.find((i) => key(i) === sub)?.sub} onPick={pickSub} />
|
|
221
221
|
</MenuFloat>
|
|
222
222
|
</div>
|
|
@@ -229,7 +229,7 @@ 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
|
-
<MenuFloat cardClass={card} onLeaf={pickMoreLeaf}>
|
|
232
|
+
<MenuFloat cardClass={card} onLeaf={pickMoreLeaf} title="More">
|
|
233
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
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
235
|
</MenuFloat>
|
|
@@ -237,7 +237,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
237
237
|
)}
|
|
238
238
|
{dock && (
|
|
239
239
|
<PopoverPanel popover={morePop} panel={false} focus={false} className={card} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
|
|
240
|
-
<MenuFloat beside cardClass={card} onLeaf={pickMoreLeaf}>
|
|
240
|
+
<MenuFloat beside cardClass={card} onLeaf={pickMoreLeaf} title="More">
|
|
241
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
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
243
|
</MenuFloat>
|
|
@@ -343,7 +343,7 @@ 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
|
-
<MenuFloat onLeaf={() => setSheet(null)}>
|
|
346
|
+
<MenuFloat onLeaf={() => setSheet(null)} title={items[at]?.label}>
|
|
347
347
|
<MenuFloatRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
348
348
|
</MenuFloat>
|
|
349
349
|
</div>
|
|
@@ -366,7 +366,7 @@ 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
|
-
<MenuFloat onLeaf={() => setSheet(null)}>
|
|
369
|
+
<MenuFloat onLeaf={() => setSheet(null)} title={items[at]?.label}>
|
|
370
370
|
<MenuFloatRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
371
371
|
</MenuFloat>
|
|
372
372
|
</div>
|
package/src/DocumentCapsule.jsx
CHANGED
|
@@ -51,7 +51,7 @@ 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
|
-
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)}>
|
|
54
|
+
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)} title={name}>
|
|
55
55
|
<MenuFloatRows variant="float" actions={menuItems} onPick={() => setOpen(false)} />
|
|
56
56
|
</MenuFloat>
|
|
57
57
|
</PopoverPanel>
|
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 MenuFloatRows from './MenuFloat.jsx'
|
|
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
|
|
|
@@ -18,13 +18,14 @@ import MenuFloatRows from './MenuFloat.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 Header) — 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/MenuFloat.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useEffect, useRef, useState } from 'react'
|
|
2
|
-
import { Button, ModalHeader, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, Header, ModalHeader, usePopover, PopoverPanel } from '@kolkrabbi/kol-component'
|
|
3
3
|
import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
4
4
|
|
|
5
5
|
/* the open level a row sits in (MenuFloat); null outside one, where a row's `sub` is ignored as before */
|
|
@@ -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 — Header variant="property", 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 MenuFloat({ beside = false, cardClass = '', onLeaf, children }) {
|
|
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([])
|
|
@@ -120,14 +124,19 @@ export function MenuFloat({ beside = false, cardClass = '', onLeaf, children })
|
|
|
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
|
+
<Header variant="property" title={title} end={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
|
@@ -5,17 +5,18 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
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`,
|
|
8
|
-
* 16 in, 18 between) holding its header (the title in `kol-float-panel` and the collapse ⇥), chip tabs (TabsRow float),
|
|
8
|
+
* 16 in, 18 between) holding its header (Header variant="property": the title in `kol-float-panel` and the collapse-h ⇥), chip tabs (TabsRow float),
|
|
9
9
|
* the selected object's line (kol-component's `LayerRow variant="head"`: glyph, name and eye, W8.1) and sections — each a
|
|
10
10
|
* float `LabeledControlSection` (W10.1: the `kol-float-label` head with an optional + or meta over its rows) of rows that
|
|
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,
|
|
14
|
+
* Since 0.123.0 the sheet, header, collapse-v and its 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)
|
|
18
|
-
* @param {Function}
|
|
18
|
+
* @param {Function} onCollapseH the collapse-h ⇥'s press (the Rail collapses sideways out of view); unset, no ⇥.
|
|
19
|
+
* `onCollapse` is its deprecated alias
|
|
19
20
|
* @param {Array} tabs TabsRow tabs `[{ value, label }]` at the inspector size (xs, 26 — float-operational W1.3);
|
|
20
21
|
* `tab` the current value, the lit chip (`aria-selected`) · `onTab` `(value) => void`
|
|
21
22
|
* @param {Object} selected `{ icon, name, visible?, onVisible? }` — the object line; unset, none
|
|
@@ -39,21 +40,19 @@ import { IconLoader } from '@kolkrabbi/kol-icons'
|
|
|
39
40
|
* @param {boolean} wide the wide module (`--kol-float-module-w-wide`, 360): a tool Rail whose rows carry two controls;
|
|
40
41
|
* unset, the inspector (`--kol-float-module-w`, 264) — the two module widths of the float spec
|
|
41
42
|
* @param {number|string} width an explicit width (a phone's `100%`); unset, the module width
|
|
42
|
-
* @param {boolean}
|
|
43
|
-
* panel is a module (the user, 2026-11-12: *"EVERYTHING IS FLOAT everything is MODULES"*)
|
|
44
|
-
* @param {boolean}
|
|
45
|
-
* header shows, on the same sheet
|
|
43
|
+
* @param {boolean} collapsibleV the collapse-v ⌃ in the header: the Rail collapses up to its header pill and opens again —
|
|
44
|
+
* every float panel is a module (the user, 2026-11-12: *"EVERYTHING IS FLOAT everything is MODULES"*)
|
|
45
|
+
* @param {boolean} collapsedV controlled; `defaultCollapsedV` uncontrolled · `onCollapseV(collapsedV)` on every press.
|
|
46
|
+
* Collapsed, only the header shows, on the same sheet. Deprecated aliases: `foldable` ·
|
|
47
|
+
* `folded` · `defaultFolded` · `onFold`
|
|
46
48
|
* @param {ReactNode} children the body slot, after the sections — a panel that is not rows (ReadingContents, Labs' params)
|
|
47
49
|
* @param {string} className
|
|
48
50
|
*/
|
|
49
|
-
export default function PropertyRail({ title, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width,
|
|
51
|
+
export default function PropertyRail({ title, onCollapseH, onCollapse, onExpand, density = 'regular', tabs, tab, onTab, selected, sections = [], footer, surface = 'solid', wide = false, width, collapsibleV, collapsedV, defaultCollapsedV, onCollapseV, foldable, folded, defaultFolded, onFold, children, className = '' }) {
|
|
50
52
|
const compact = density === 'compact'
|
|
51
|
-
const actions = (onExpand || onCollapse) && <>
|
|
52
|
-
{onExpand && <Button variant="float" tone="ghost" size="sm" iconOnly="arrow-upright" aria-label="Expand" onClick={onExpand} />}
|
|
53
|
-
{onCollapse && <Button variant="float" tone="ghost" size="sm" iconOnly="panel-right" aria-label="Collapse" onClick={onCollapse} />}
|
|
54
|
-
</>
|
|
55
53
|
return (
|
|
56
|
-
<RailFloat title={title}
|
|
54
|
+
<RailFloat title={title} onExpand={onExpand} onCollapseH={onCollapseH ?? onCollapse}
|
|
55
|
+
collapsibleV={collapsibleV ?? foldable} collapsedV={collapsedV ?? folded} defaultCollapsedV={defaultCollapsedV ?? defaultFolded} onCollapseV={onCollapseV ?? onFold}
|
|
57
56
|
compact={compact} wide={wide} width={width} surface={surface} className={`kol-property-rail ${className}`.trim()}
|
|
58
57
|
footer={footer && compact ? <div className="pt-4">{footer}</div> : footer}>
|
|
59
58
|
{tabs?.length > 0 && <TabsRow variant="float" size="xs" tabs={tabs} value={tab} onChange={onTab} ariaLabel={`${title} tabs`} />}
|
package/src/RailTrigger.jsx
CHANGED
|
@@ -36,13 +36,8 @@ 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
|
-
<span className="kol-float-body text-emphasis">{title}</span>
|
|
42
|
-
<Button variant="float" tone="ghost" size="sm" iconOnly="x" aria-label="Close" onClick={() => setOpen(false)} />
|
|
43
|
-
</div>
|
|
44
|
-
)}
|
|
45
|
-
<MenuFloat cardClass={card} onLeaf={pick}>
|
|
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)} />}>
|
|
46
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>
|
package/src/TopControlsBar.jsx
CHANGED
|
@@ -28,7 +28,7 @@ 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
|
-
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)}>
|
|
31
|
+
<MenuFloat beside cardClass={card} onLeaf={() => setOpen(false)} title={label}>
|
|
32
32
|
<MenuFloatRows variant="float" actions={items ?? []} onPick={() => setOpen(false)} />
|
|
33
33
|
</MenuFloat>
|
|
34
34
|
)}
|