@kolkrabbi/kol-shell 0.99.3 → 0.100.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/AppFloatNav.jsx +12 -7
- package/src/AppShell.jsx +12 -6
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.100.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"./src/*": "./src/*"
|
|
13
13
|
},
|
|
14
14
|
"peerDependencies": {
|
|
15
|
-
"@kolkrabbi/kol-component": ">=0.
|
|
15
|
+
"@kolkrabbi/kol-component": ">=0.333.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.16.0",
|
|
18
18
|
"@kolkrabbi/kol-theme": ">=0.207.0",
|
|
@@ -21,7 +21,7 @@
|
|
|
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.333.0",
|
|
25
25
|
"@kolkrabbi/kol-framework": "^0.69.0",
|
|
26
26
|
"@kolkrabbi/kol-icons": "^0.60.0",
|
|
27
27
|
"@kolkrabbi/kol-theme": "^0.210.0"
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -38,6 +38,9 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
|
38
38
|
* @param {'fill'|'circle'} active the lit slot's shape (TabsRow `active`); frame E is `circle`
|
|
39
39
|
* @param {boolean} foldable a sideways swipe folds the pill into a left edge tab; a tap on the tab restores it
|
|
40
40
|
* @param {boolean} folded · {Function} onFoldChange the folded state, so the app can keep it (else PhoneNav holds it)
|
|
41
|
+
* @param {'left'|'right'|'swipe'} foldSide · {'ground'|'handle'} foldTone TabsRow's, forwarded (FloatFoldBothSidesGrey, kol-fxr
|
|
42
|
+
* 2026-11-03): `swipe` folds to the edge the swipe went toward, `handle` is the grey edge tab.
|
|
43
|
+
* Unset: the nav's left edge (the transport's right) and the pill's ground, as before
|
|
41
44
|
* @param {boolean} moreKeepsOpen More opens its sheet without collapsing the pill to the ×, and More lights only while
|
|
42
45
|
* its sheet is open; nothing else closes
|
|
43
46
|
* An item may carry `onPress` (a panel, not a route — the app owns what it opens and whether a second tap closes it) and
|
|
@@ -48,7 +51,7 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
|
48
51
|
* any prop still overrides it. `PHONE_NAV_VARIANTS` is the table, and TransportPill reads its own row from it.
|
|
49
52
|
* @param {'mobile'|'dock'|'panel'|'transport'} variant `mobile` (was `nav`) — an app's phone nav: no hairline, no shadow, the lit slot a circle
|
|
50
53
|
* (AppShell's default). `panel` — frame E's panel picker: on top, foldable, More keeps the panel
|
|
51
|
-
* open, no hairline. `transport` — TransportPill's look: the shadow, it floats over content.
|
|
54
|
+
* open, no hairline, the shadow (it floats over the stage and the Rail — FloatsRailOverlaysShadow). `transport` — TransportPill's look: the shadow, it floats over content.
|
|
52
55
|
* Unset, the props alone decide, as before
|
|
53
56
|
* @param {boolean} shadow the pill's drop shadow (TabsRow `shadow`) — for a pill that floats over content
|
|
54
57
|
*
|
|
@@ -94,7 +97,7 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
|
94
97
|
export const APP_FLOAT_NAV_VARIANTS = {
|
|
95
98
|
/* `mobile` was PhoneNav's `nav` (user ruling 2026-10-30: renamed so it is not reached for off mobile); there is no `nav` */
|
|
96
99
|
mobile: { border: false, shadow: false, active: 'circle' },
|
|
97
|
-
panel: { placement: 'top', foldable: true, moreKeepsOpen: true, border: false, shadow:
|
|
100
|
+
panel: { placement: 'top', foldable: true, moreKeepsOpen: true, border: false, shadow: true, active: 'circle' },
|
|
98
101
|
transport: { border: false, shadow: true, active: 'circle' },
|
|
99
102
|
dock: { dock: true, border: false, shadow: false, active: 'circle' },
|
|
100
103
|
}
|
|
@@ -110,7 +113,7 @@ export default function AppFloatNav(props) {
|
|
|
110
113
|
return props.variant === 'transport' ? <Transport {...props} /> : <FloatNav {...props} />
|
|
111
114
|
}
|
|
112
115
|
|
|
113
|
-
function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], shape = 'bar', variant, placement: placementProp, border: borderProp, shadow: shadowProp, active: activeProp, foldable: foldableProp, folded, onFoldChange, moreKeepsOpen: keepsOpenProp, moreItems, sheetItems, dock: dockProp, menuBorder = false, surface = 'solid', labels = false }) {
|
|
116
|
+
function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], shape = 'bar', variant, placement: placementProp, border: borderProp, shadow: shadowProp, active: activeProp, foldable: foldableProp, folded, onFoldChange, moreKeepsOpen: keepsOpenProp, moreItems, sheetItems, dock: dockProp, menuBorder = false, surface = 'solid', labels = false, foldSide = 'left', foldTone }) {
|
|
114
117
|
const preset = APP_FLOAT_NAV_VARIANTS[variant] ?? {}
|
|
115
118
|
const placement = placementProp ?? preset.placement ?? 'bottom'
|
|
116
119
|
const border = borderProp ?? preset.border ?? true
|
|
@@ -257,7 +260,8 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
257
260
|
foldable={foldable}
|
|
258
261
|
folded={folded}
|
|
259
262
|
onFoldChange={(v) => { if (v) setOpen(false); onFoldChange?.(v) }}
|
|
260
|
-
foldSide=
|
|
263
|
+
foldSide={foldSide}
|
|
264
|
+
foldTone={foldTone}
|
|
261
265
|
tabs={tabs}
|
|
262
266
|
value={value}
|
|
263
267
|
onChange={press}
|
|
@@ -270,7 +274,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
270
274
|
/**
|
|
271
275
|
* Transport (`variant="transport"`, was TransportPill) — The transport, on a phone, as a pill (TransportPill, kol-fxr 2026-10-27, frame E). PhoneNav's pill —
|
|
272
276
|
* the same TabsRow, so the slots, the 28px glyphs and the 44×44 circle are the nav's — holding ACTIONS instead of
|
|
273
|
-
* destinations. It floats over the open
|
|
277
|
+
* destinations. It floats over the open Rail and carries the shadow, as the `panel` nav does, and folds to a RIGHT edge tab.
|
|
274
278
|
*
|
|
275
279
|
* A slot fires `onPress`; `selected` lights it (play and pause are a radio pair the consumer owns, so both are just
|
|
276
280
|
* `selected`). A slot named in `sheetFor` opens a sheet of rows anchored above it instead, lit while open; a row runs its
|
|
@@ -283,7 +287,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
283
287
|
* @param {boolean} foldable a sideways swipe folds it into the right edge tab
|
|
284
288
|
* @param {boolean} folded · {Function} onFoldChange the folded state, controlled (else the pill holds it)
|
|
285
289
|
*/
|
|
286
|
-
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false, surface = 'solid', labels = false }) {
|
|
290
|
+
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false, surface = 'solid', labels = false, foldSide = 'right', foldTone }) {
|
|
287
291
|
const [sheet, setSheet] = useState(null)
|
|
288
292
|
useEffect(() => {
|
|
289
293
|
if (!sheet) return undefined
|
|
@@ -339,7 +343,8 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
339
343
|
foldable={foldable}
|
|
340
344
|
folded={folded}
|
|
341
345
|
onFoldChange={(v) => { if (v) setSheet(null); onFoldChange?.(v) }}
|
|
342
|
-
foldSide=
|
|
346
|
+
foldSide={foldSide}
|
|
347
|
+
foldTone={foldTone}
|
|
343
348
|
ariaLabel="Transport"
|
|
344
349
|
tabs={tabs}
|
|
345
350
|
onChange={press}
|
package/src/AppShell.jsx
CHANGED
|
@@ -91,7 +91,10 @@ import { TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, MastheadContext, RAIL_PRESE
|
|
|
91
91
|
* More's actions, wherever the app passes them — the page's route, typically. THE ONE RULE:
|
|
92
92
|
* the More keeps the app's whole nav (`barItems`, else items + bottomItems) — the page's
|
|
93
93
|
* rows replace the slots, never the way back (a `phoneNav.sheetItems` still wins). Unset,
|
|
94
|
-
* the top float is the app's nav and `barActions`, as 0.97.0
|
|
94
|
+
* the top float is the app's nav and `barActions`, as 0.97.0.
|
|
95
|
+
* `floats.fold` (`{ side, tone }`, FloatFoldBothSidesGrey, kol-fxr 2026-11-03) is the top float's
|
|
96
|
+
* and the transport's `foldSide` · `foldTone` (AppFloatNav) — `{ side: 'swipe', tone: 'handle' }`
|
|
97
|
+
* folds either way into the grey handle. Unset, each folds to its own edge on its ground
|
|
95
98
|
* @param {Array} [props.barActions] `[{ label, icon?, onPress }]` — the page's buttons in the bar's More sheet, under the nav (PhoneNav `actions`)
|
|
96
99
|
* @param {'mobile'|'panel'|'transport'} [props.navVariant='mobile'] THE PHONE PILL'S PRESET (PhoneNavVariants, kol-fxr 2026-10-28 —
|
|
97
100
|
* the Home pill kept its hairline while Labs tuned its own by hand): `mobile` (was `nav`) is no hairline,
|
|
@@ -424,8 +427,8 @@ export default function AppShell({
|
|
|
424
427
|
onClick={() => setDrawerOpen(false)}
|
|
425
428
|
/>
|
|
426
429
|
)}
|
|
427
|
-
{bar && <AppFloatNav items={pageRows ?? appNav} actions={floats && floatsProp?.actions ? floatsProp.actions : barActions} shape={touch === 'bar' ? 'bar' : 'pill'} variant={floats ? 'panel' : navVariant} moreItems={moreItems} {...(pageRows && { sheetItems: appNav })} {...phoneNav} currentPath={currentPath} onNavigate={navigate} />}
|
|
428
|
-
{floats && floatsProp?.transport?.items?.length > 0 && <AppFloatNav variant="transport" foldable {...floatsProp.transport} />}
|
|
430
|
+
{bar && <AppFloatNav items={pageRows ?? appNav} actions={floats && floatsProp?.actions ? floatsProp.actions : barActions} shape={touch === 'bar' ? 'bar' : 'pill'} variant={floats ? 'panel' : navVariant} moreItems={moreItems} {...(pageRows && { sheetItems: appNav })} {...phoneNav} {...(floats && floatsProp?.fold && { foldSide: floatsProp.fold.side, foldTone: floatsProp.fold.tone })} currentPath={currentPath} onNavigate={navigate} />}
|
|
431
|
+
{floats && floatsProp?.transport?.items?.length > 0 && <AppFloatNav variant="transport" foldable {...(floatsProp.fold && { foldSide: floatsProp.fold.side, foldTone: floatsProp.fold.tone })} {...floatsProp.transport} />}
|
|
429
432
|
{!navHidden && !bar && !barAside && (
|
|
430
433
|
<Rail
|
|
431
434
|
items={items}
|
|
@@ -450,15 +453,18 @@ export default function AppShell({
|
|
|
450
453
|
...(bar && touch === 'bar' && { '--kol-shell-bar-h': `calc(${TABBAR_H}px + env(safe-area-inset-bottom, 0px))`, paddingBottom: 'var(--kol-shell-bar-h)' }),
|
|
451
454
|
...(bar && touch === 'pill' && { '--kol-shell-bar-h': '0px', '--kol-shell-bar-clear': `calc(${TABBAR_PILL_H + TABBAR_PILL_INSET}px + env(safe-area-inset-bottom, 0px))` }), ...(barAside && { '--kol-shell-bar-h': '0px' }), ...(floats && { '--kol-shell-bar-h': '0px' }) }}>
|
|
452
455
|
{floats ? (
|
|
453
|
-
<div className="
|
|
456
|
+
<div className="relative h-dvh">
|
|
454
457
|
{/* THE STAGE OWNS THE PAGE'S GROUND (PhoneTwoFloatLayout): it paints the wash under the top float too and hands
|
|
455
458
|
* the page `transparent` — PageLayout's rule (kol-components-shell.css), one owner per pixel, no band under the float */}
|
|
456
459
|
{/* the stage starts at y=0, UNDER the status bar and the top float — no band (FloatsOverlayNoBands, kol-fxr 2026-11-03) */}
|
|
457
|
-
|
|
460
|
+
{/* the stage is the whole screen and never resizes: the Rail OVERLAYS it, so opening, closing or dragging the Rail
|
|
461
|
+
* leaves the stage's box alone (FloatsRailOverlaysShadow, kol-fxr 2026-11-03); `isolate` keeps the stage's own
|
|
462
|
+
* stacking under the Rail */}
|
|
463
|
+
<div className="isolate h-full overflow-y-auto" style={{ background: pageWash ?? undefined, '--kol-shell-page-wash': pageWash ? 'transparent' : undefined, '--kol-shell-bar-h': floatClear }}>{children}</div>
|
|
458
464
|
{floatsProp?.rail != null && (
|
|
459
465
|
/* the Rail's rows run UNDER the transport float; the clear is an absolute spacer past the last row, so it adds
|
|
460
466
|
* scroll range (the last row scrolls clear) but no height — no band while unscrolled (FloatsOverlayNoBands) */
|
|
461
|
-
<div className="
|
|
467
|
+
<div className="absolute inset-x-0 bottom-0 overflow-y-auto bg-surface-primary shadow-[var(--kol-shadow-rail-up)]" style={{ maxHeight: floatsProp.railHeight ?? '50dvh' }}>
|
|
462
468
|
<div className="relative">{floatsProp.rail}<div aria-hidden className="pointer-events-none absolute inset-x-0 top-full" style={{ height: `calc(${floatClear} + env(safe-area-inset-bottom, 0px))` }} /></div>
|
|
463
469
|
</div>
|
|
464
470
|
)}
|