@kolkrabbi/kol-shell 0.107.0 → 0.108.1
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/AppStudio.jsx +1 -1
- package/src/FloatActionMenu.jsx +16 -5
- package/src/FloatLayout.jsx +28 -13
- package/src/RailFlyout.jsx +7 -4
- package/src/RailTrigger.jsx +6 -4
- package/src/TopControlsBar.jsx +4 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.108.1",
|
|
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.341.0",
|
|
16
16
|
"@kolkrabbi/kol-framework": ">=0.55.0",
|
|
17
17
|
"@kolkrabbi/kol-icons": ">=0.16.0",
|
|
18
|
-
"@kolkrabbi/kol-theme": ">=0.
|
|
18
|
+
"@kolkrabbi/kol-theme": ">=0.212.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.
|
|
25
|
-
"@kolkrabbi/kol-
|
|
26
|
-
"@kolkrabbi/kol-
|
|
27
|
-
"@kolkrabbi/kol-
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.341.1",
|
|
25
|
+
"@kolkrabbi/kol-icons": "^0.65.0",
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.212.0",
|
|
27
|
+
"@kolkrabbi/kol-framework": "^0.70.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/AppStudio.jsx
CHANGED
|
@@ -79,7 +79,7 @@ export default function AppStudio({
|
|
|
79
79
|
const slot = (cfg, path, label, icon) => cfg && { ...cfg, path: cfg.path ?? path, label: cfg.label ?? label, icon: cfg.icon ?? icon }
|
|
80
80
|
const lib = slot(library, '/library', 'Library', 'nav-library')
|
|
81
81
|
const make = slot(create, '/create', 'Create', 'nav-create')
|
|
82
|
-
const tool = slot(use, '/use', 'Use', '
|
|
82
|
+
const tool = slot(use, '/use', 'Use', 'rack-v')
|
|
83
83
|
const rows = [lib, make, tool, ...pages].filter(Boolean)
|
|
84
84
|
const at = (p) => currentPath === p || currentPath.startsWith(`${p}/`)
|
|
85
85
|
/* THE BAR STEPS ASIDE on the tool and on any page that owns the phone's bottom edge (mirror's bottom sheet, the rack's
|
package/src/FloatActionMenu.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { Button, PopoverPanel, usePopover, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, PopoverPanel, usePopover, floatSurfaceClass, floatMotion } from '@kolkrabbi/kol-component'
|
|
3
3
|
import MoreRows from './MoreSheet.jsx'
|
|
4
4
|
|
|
5
5
|
/* taxonomy-ok: molecule — a round Button that opens the More sheet's rows */
|
|
@@ -14,21 +14,32 @@ import MoreRows from './MoreSheet.jsx'
|
|
|
14
14
|
* @param {'more'|'plus'|string} [icon='more'] the button's glyph; anything but `more` turns to × while open
|
|
15
15
|
* @param {'float'} [variant] the sheet in the float look (`kol-more-sheet-float` on `surface`); unset, the plain sheet
|
|
16
16
|
* @param {'solid'|'glass-dark'|'glass-light'} [surface='solid'] what the float sheet is made of — the button never changes
|
|
17
|
+
* @param {'rotate'|'swap'} [iconMotion='rotate'] how a glyph that is not `more` becomes the × while open: `rotate` turns
|
|
18
|
+
* the one glyph 45° (the + into the ×) and back on close; `swap` exchanges the icon
|
|
19
|
+
* @param {boolean|Object} [motion=true] the button's states, the turn and the sheet's enter and leave: `true` the
|
|
20
|
+
* `--kol-float-*` tokens · `false` none · `{ duration, ease }` per app (floatMotion)
|
|
17
21
|
* @param {string} [className]
|
|
22
|
+
*
|
|
23
|
+
* The button's ladder (FloatActionStatesAndMotion, kol-website 2026-11-04): rest the solid inverted circle with the float
|
|
24
|
+
* shadow · hover the same fill at `--kol-float-hover-opacity` · pressed `--kol-float-press-scale` · open the × on the same
|
|
25
|
+
* fill and shadow (`.kol-float-action`; the shadow with `variant="float"`, so Home's plain masthead button is not lifted).
|
|
18
26
|
*/
|
|
19
|
-
export default function FloatActionMenu({ actions, icon = 'more', variant, surface = 'solid', className = '' }) {
|
|
27
|
+
export default function FloatActionMenu({ actions, icon = 'more', variant, surface = 'solid', iconMotion = 'rotate', motion = true, className = '' }) {
|
|
20
28
|
const [open, setOpen] = useState(false)
|
|
21
29
|
/* 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 × */
|
|
22
30
|
const popover = usePopover({ open, onOpenChange: setOpen, placement: 'left-start', offset: 12 })
|
|
31
|
+
const turn = icon !== 'more' && iconMotion === 'rotate'
|
|
32
|
+
const glyph = icon === 'more' ? 'more' : open && !turn ? 'x' : icon
|
|
23
33
|
return (
|
|
24
|
-
<div className={className}>
|
|
34
|
+
<div className={className} style={floatMotion(motion).style}>
|
|
25
35
|
<span ref={popover.refs.setReference} {...popover.getReferenceProps()} className="inline-flex">
|
|
26
36
|
{/* `icon` — `more` on Home, `plus` signed out (frame B2), the × while its sheet is open */}
|
|
27
37
|
{/* always the inverted round button — `surface` dresses its menu only (HomeDockRound4, kol-fxr 2026-10-31 — user: *"this
|
|
28
38
|
* also changed the action button, but it is not supposed to change"*) */}
|
|
29
|
-
<Button iconOnly={
|
|
39
|
+
<Button iconOnly={glyph} size="lg" tone="inverted" radius="full" aria-label={open ? 'Close' : 'Actions'} pressed={open}
|
|
40
|
+
className={`kol-float-action${variant === 'float' ? ' is-float' : ''}${turn ? ` kol-float-turn${open ? ' is-open' : ''}` : ''}`} />
|
|
30
41
|
</span>
|
|
31
|
-
<PopoverPanel popover={popover} panel={false} className={`kol-more-sheet${variant === 'float' ? ` kol-more-sheet-float ${floatSurfaceClass(surface, true)}` : ''}`} style={{ minWidth: 220 }}>
|
|
42
|
+
<PopoverPanel popover={popover} panel={false} motion={motion} className={`kol-more-sheet${variant === 'float' ? ` kol-more-sheet-float ${floatSurfaceClass(surface, true)}` : ''}`} style={{ minWidth: 220 }}>
|
|
32
43
|
<MoreRows actions={actions} variant={variant} onPick={() => setOpen(false)} />
|
|
33
44
|
</PopoverPanel>
|
|
34
45
|
</div>
|
package/src/FloatLayout.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useRef, useState } from 'react'
|
|
2
|
-
import { NavRail, CommandOverlay, useMediaQuery, useRailKeys } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { NavRail, CommandOverlay, useMediaQuery, useRailKeys, floatMotion, useFloatPresence } from '@kolkrabbi/kol-component'
|
|
3
3
|
import TopControlsBar from './TopControlsBar.jsx'
|
|
4
4
|
import RailTrigger from './RailTrigger.jsx'
|
|
5
5
|
import RailFlyout from './RailFlyout.jsx'
|
|
@@ -46,6 +46,10 @@ import RailDisplayControls from './RailDisplayControls.jsx'
|
|
|
46
46
|
* RailTrigger's "Show navigation" row and `⇧\` (FloatSearchAndPanels, 2026-11-04)
|
|
47
47
|
* @param {Object} [search] CommandOverlay's props (`open` · `onClose` · `results` · `query` · `onQueryChange` · `onSelect` …):
|
|
48
48
|
* the search modal, drawn on this frame's `surface`; the app keeps the data
|
|
49
|
+
* @param {boolean|Object} [motion=true] the float family's motion, handed to every piece (FloatActionStatesAndMotion,
|
|
50
|
+
* 2026-11-04): the nav Rail's expand ↔ collapse (width) and hide ↔ show (the width opens from and
|
|
51
|
+
* closes to 0, fading), RailFlyout and RailTrigger's card in and out, the search modal, and the
|
|
52
|
+
* + and its card. `true` the `--kol-float-*` tokens · `false` none · `{ duration, ease }` per app
|
|
49
53
|
* @param {ReactNode} children the content
|
|
50
54
|
* @param {string} [className]
|
|
51
55
|
*/
|
|
@@ -53,7 +57,7 @@ export default function FloatLayout({
|
|
|
53
57
|
nav = [], currentPath = '', onNavigate, title, icon, onSwitch, onSearch,
|
|
54
58
|
rail, defaultRail = 'expanded', onRailChange, railKeys, railMode = 'push', defaultExpanded, railFooter, breadcrumb,
|
|
55
59
|
bar = {}, eyebrow, inspector, bottom, inspectorLabel = 'Inspector', inspectorHidden, defaultInspectorHidden = false, onInspectorHiddenChange,
|
|
56
|
-
surface = 'solid', panels = true, search, children, className = '',
|
|
60
|
+
surface = 'solid', panels = true, search, motion = true, children, className = '',
|
|
57
61
|
}) {
|
|
58
62
|
const [ownRail, setOwnRail] = useState(defaultRail)
|
|
59
63
|
const [ownHidden, setOwnHidden] = useState(defaultInspectorHidden)
|
|
@@ -67,9 +71,19 @@ export default function FloatLayout({
|
|
|
67
71
|
const phone = useMediaQuery('(max-width: 767px)')
|
|
68
72
|
const shown = phone ? 'hidden' : railNow
|
|
69
73
|
const overlay = railMode === 'overlay'
|
|
74
|
+
const fm = floatMotion(motion)
|
|
75
|
+
/* the rail is held while it hides, so its width closes to 0 instead of the page jumping (FloatActionStatesAndMotion) */
|
|
76
|
+
const railShown = shown !== 'hidden'
|
|
77
|
+
const railPresence = useFloatPresence(railShown, fm.rail)
|
|
78
|
+
const lastRail = useRef(shown)
|
|
79
|
+
if (railShown) lastRail.current = shown
|
|
80
|
+
const railState = railShown ? shown : lastRail.current
|
|
70
81
|
|
|
71
82
|
// the hover flyout: a section's rows beside the 72 Rail, kept open while the pointer is on the slot or the card
|
|
72
83
|
const [fly, setFly] = useState(null)
|
|
84
|
+
/* the last card is kept so RailFlyout can play its leave after `fly` clears */
|
|
85
|
+
const lastFly = useRef(null)
|
|
86
|
+
if (fly) lastFly.current = fly
|
|
73
87
|
const timer = useRef(0)
|
|
74
88
|
const hold = () => clearTimeout(timer.current)
|
|
75
89
|
const drop = () => { hold(); timer.current = setTimeout(() => setFly(null), 160) }
|
|
@@ -92,18 +106,19 @@ export default function FloatLayout({
|
|
|
92
106
|
const body = typeof inspector === 'function' ? inspector({ hide: () => setHidden(true) }) : inspector
|
|
93
107
|
|
|
94
108
|
return (
|
|
95
|
-
<div className={`kol-float-layout relative flex h-dvh gap-6 overflow-hidden bg-surface-primary p-6 max-md:p-4 ${className}`.trim()}>
|
|
96
|
-
{
|
|
97
|
-
<NavRail variant="float" items={nav} currentPath={currentPath} onNavigate={onNavigate}
|
|
98
|
-
collapsed={
|
|
109
|
+
<div className={`kol-float-layout relative flex h-dvh gap-6 overflow-hidden bg-surface-primary p-6 max-md:p-4 ${className}`.trim()} style={fm.style}>
|
|
110
|
+
{railPresence.mounted && (
|
|
111
|
+
<NavRail variant="float" items={nav} currentPath={currentPath} onNavigate={onNavigate} motion={motion}
|
|
112
|
+
collapsed={railState === 'collapsed'} onCollapsedChange={(c) => { setFly(null); setRail(c ? 'collapsed' : 'expanded') }}
|
|
99
113
|
title={title} icon={icon} onSwitch={onSwitch} onSearch={onSearch} onHide={() => setRail('hidden')}
|
|
100
114
|
onItemHover={shown === 'collapsed' ? onItemHover : undefined} defaultExpanded={defaultExpanded}
|
|
101
|
-
footer={
|
|
102
|
-
className={overlay ? 'absolute inset-y-6 left-6 z-[var(--kol-z-sticky)] !h-auto' : 'shrink-0'} />
|
|
115
|
+
footer={railState === 'expanded' ? (railFooter ?? <RailDisplayControls onCollapse={() => setRail('collapsed')} onHide={() => setRail('hidden')} />) : undefined}
|
|
116
|
+
className={`${overlay ? 'absolute inset-y-6 left-6 z-[var(--kol-z-sticky)] !h-auto' : 'shrink-0'}${railPresence.entering ? ' is-entering' : ''}${railPresence.exiting ? ' is-exiting' : ''}`} />
|
|
103
117
|
)}
|
|
104
|
-
{shown === 'collapsed' &&
|
|
118
|
+
{shown === 'collapsed' && lastFly.current && (
|
|
105
119
|
<span className="contents" onMouseEnter={hold} onMouseLeave={drop}>
|
|
106
|
-
<RailFlyout icon={
|
|
120
|
+
<RailFlyout icon={lastFly.current.item.icon} title={lastFly.current.item.label} items={lastFly.current.item.sub} active={currentPath}
|
|
121
|
+
anchor={lastFly.current.el} open={!!fly} surface={surface} motion={motion}
|
|
107
122
|
onOpenChange={(o) => { if (!o) setFly(null) }}
|
|
108
123
|
onPick={(i) => { setFly(null); if (i.path) onNavigate?.(i.path) }} />
|
|
109
124
|
</span>
|
|
@@ -111,10 +126,10 @@ export default function FloatLayout({
|
|
|
111
126
|
<div className="flex min-w-0 flex-1 flex-col gap-10 max-md:gap-6">
|
|
112
127
|
<div className="relative min-w-0 shrink-0">
|
|
113
128
|
<div className="flex min-w-0 items-center gap-4">
|
|
114
|
-
{shown === 'hidden' && <RailTrigger items={nav} currentPath={currentPath} onNavigate={onNavigate} title={title} breadcrumb={phone ? undefined : breadcrumb} surface={surface}
|
|
129
|
+
{shown === 'hidden' && <RailTrigger items={nav} currentPath={currentPath} onNavigate={onNavigate} title={title} breadcrumb={phone ? undefined : breadcrumb} surface={surface} motion={motion}
|
|
115
130
|
onRestore={phone ? undefined : () => setRail(lastShown.current)}
|
|
116
131
|
className={overlay && !phone ? 'absolute inset-y-0 left-0 z-[var(--kol-z-sticky)]' : 'shrink-0'} />}
|
|
117
|
-
<TopControlsBar {...bar} panels={panels && restore.length ? { items: restore } : undefined} surface={surface}
|
|
132
|
+
<TopControlsBar motion={motion} {...bar} panels={panels && restore.length ? { items: restore } : undefined} surface={surface}
|
|
118
133
|
className={`min-w-0 flex-1 max-md:overflow-x-auto max-md:[scrollbar-width:none] ${bar.className ?? ''}`.trim()} />
|
|
119
134
|
</div>
|
|
120
135
|
{eyebrow && <div className="kol-float-layout-eyebrow absolute inset-x-0 top-full pt-[25px] max-md:static max-md:pt-6">{eyebrow}</div>}
|
|
@@ -127,7 +142,7 @@ export default function FloatLayout({
|
|
|
127
142
|
{bottom && <div className="kol-float-layout-bottom min-w-0 shrink-0">{bottom}</div>}
|
|
128
143
|
</div>
|
|
129
144
|
</div>
|
|
130
|
-
{search && <CommandOverlay {...search} surface={surface} />}
|
|
145
|
+
{search && <CommandOverlay {...search} surface={surface} motion={motion} />}
|
|
131
146
|
</div>
|
|
132
147
|
)
|
|
133
148
|
}
|
package/src/RailFlyout.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
1
|
+
import { Button, usePopover, PopoverPanel, floatSurfaceClass, floatMotion } from '@kolkrabbi/kol-component'
|
|
2
2
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
3
3
|
|
|
4
4
|
/* taxonomy-ok: molecule — a float card of nav Buttons with counts */
|
|
@@ -18,12 +18,15 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
18
18
|
* @param {boolean} open · {Function} onOpenChange
|
|
19
19
|
* @param {number} width the card's width (default 302)
|
|
20
20
|
* @param {'solid'|'glass-dark'|'glass-light'} surface what the card is made of (default `solid`)
|
|
21
|
+
* @param {boolean|Object} [motion=true] with `anchor`, the card's enter and leave (it is held while it leaves — keep it mounted
|
|
22
|
+
* and set `open` false) and its rows' hover: `true` the `--kol-float-*` tokens · `false` none ·
|
|
23
|
+
* `{ duration, ease }` per app (FloatActionStatesAndMotion, 2026-11-04)
|
|
21
24
|
* @param {string} className
|
|
22
25
|
*/
|
|
23
|
-
export default function RailFlyout({ icon, title, items = [], active, onPick, anchor, open = true, onOpenChange, width = 302, surface = 'solid', className = '' }) {
|
|
26
|
+
export default function RailFlyout({ icon, title, items = [], active, onPick, anchor, open = true, onOpenChange, width = 302, surface = 'solid', motion = true, className = '' }) {
|
|
24
27
|
const popover = usePopover({ open: !!anchor && open, onOpenChange, placement: 'right-start', offset: 8, click: false, referenceElement: anchor ?? null, role: 'menu' })
|
|
25
28
|
const card = (
|
|
26
|
-
<div role="menu" aria-label={title} className={`kol-rail-flyout kol-float-chrome flex flex-col gap-0.5 p-2 rounded-[var(--kol-float-menu-r)] ${floatSurfaceClass(surface, true)} ${anchor ? '' : className}`.trim()} style={{ width }}>
|
|
29
|
+
<div role="menu" aria-label={title} className={`kol-rail-flyout kol-float-chrome flex flex-col gap-0.5 p-2 rounded-[var(--kol-float-menu-r)] ${floatSurfaceClass(surface, true)} ${anchor ? '' : className}`.trim()} style={{ width, ...(anchor ? null : floatMotion(motion).style) }}>
|
|
27
30
|
<div className="flex items-center gap-3 px-2 pt-2 pb-3">
|
|
28
31
|
{icon && <Icon name={icon} size={18} className="text-oq-96" />}
|
|
29
32
|
<span className="kol-float-body text-emphasis">{title}</span>
|
|
@@ -37,5 +40,5 @@ export default function RailFlyout({ icon, title, items = [], active, onPick, an
|
|
|
37
40
|
</div>
|
|
38
41
|
)
|
|
39
42
|
if (!anchor) return card
|
|
40
|
-
return <PopoverPanel popover={popover} panel={false} focus={false} className={className}>{card}</PopoverPanel>
|
|
43
|
+
return <PopoverPanel popover={popover} panel={false} focus={false} motion={motion} className={className}>{card}</PopoverPanel>
|
|
41
44
|
}
|
package/src/RailTrigger.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { Button, usePopover, PopoverPanel, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, usePopover, PopoverPanel, floatSurfaceClass, floatMotion } from '@kolkrabbi/kol-component'
|
|
3
3
|
import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
4
4
|
|
|
5
5
|
/* taxonomy-ok: molecule — a float Button that opens the More sheet's rows */
|
|
@@ -20,20 +20,22 @@ import MoreRows, { FloatMenu } from './MoreSheet.jsx'
|
|
|
20
20
|
* @param {'solid'|'glass-dark'|'glass-light'} surface what the button and the card are made of (default `solid`)
|
|
21
21
|
* @param {Function} [onRestore] a "Show navigation" row at the card's foot brings the rail back as it was (FloatRailOverlayShadowRestore,
|
|
22
22
|
* 2026-11-04 — FloatLayout passes its `lastShown`, the same path as Panels ⌄); unset, no row
|
|
23
|
+
* @param {boolean|Object} [motion=true] the card's enter and leave and the button's states: `true` the `--kol-float-*` tokens ·
|
|
24
|
+
* `false` none · `{ duration, ease }` per app (FloatActionStatesAndMotion, 2026-11-04)
|
|
23
25
|
* @param {string} className
|
|
24
26
|
*/
|
|
25
|
-
export default function RailTrigger({ items = [], currentPath = '/', onNavigate, title, breadcrumb, surface = 'solid', onRestore, className = '' }) {
|
|
27
|
+
export default function RailTrigger({ items = [], currentPath = '/', onNavigate, title, breadcrumb, surface = 'solid', onRestore, motion = true, className = '' }) {
|
|
26
28
|
const [open, setOpen] = useState(false)
|
|
27
29
|
const popover = usePopover({ open, onOpenChange: setOpen, placement: 'bottom-start', offset: 8, dismiss: { outsidePress: (e) => !e.target?.closest?.('.kol-float-level') } })
|
|
28
30
|
const card = `kol-more-sheet kol-more-sheet-float ${floatSurfaceClass(surface, true)}`
|
|
29
31
|
const pick = (x) => { setOpen(false); if (x.restore) { onRestore?.(); return } if (x.onPress) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }
|
|
30
32
|
return (
|
|
31
|
-
<div className={`kol-rail-trigger kol-float-chrome inline-flex items-center gap-4 ${className}`.trim()}>
|
|
33
|
+
<div className={`kol-rail-trigger kol-float-chrome inline-flex items-center gap-4 ${className}`.trim()} style={floatMotion(motion).style}>
|
|
32
34
|
<span ref={popover.refs.setReference} {...popover.getReferenceProps()} className="inline-flex">
|
|
33
35
|
<Button variant="float" size="lg" iconOnly="hamburger" aria-label="Open navigation" aria-haspopup="menu" aria-expanded={open} className={floatSurfaceClass(surface)} />
|
|
34
36
|
</span>
|
|
35
37
|
{breadcrumb && <span className="kol-float-hint text-oq-64">{Array.isArray(breadcrumb) ? breadcrumb.join(' / ') : breadcrumb}</span>}
|
|
36
|
-
<PopoverPanel popover={popover} panel={false} focus={false} className={`${card} w-[280px]`} style={{ maxWidth: 'calc(100vw - 24px)' }}>
|
|
38
|
+
<PopoverPanel popover={popover} panel={false} focus={false} motion={motion} className={`${card} w-[280px]`} style={{ maxWidth: 'calc(100vw - 24px)' }}>
|
|
37
39
|
{title && (
|
|
38
40
|
<div className="flex items-center justify-between pl-3 pr-1 pt-1 pb-2">
|
|
39
41
|
<span className="kol-float-body text-emphasis">{title}</span>
|
package/src/TopControlsBar.jsx
CHANGED
|
@@ -51,9 +51,11 @@ export function PanelsRestore({ label = 'Panels', children, items, surface = 'so
|
|
|
51
51
|
* @param {Array} menu `[{ label, icon?, onPress }]` — FloatActionMenu at the very end, the + and its float sheet (fxr's Home corner)
|
|
52
52
|
* @param {ReactNode} start · {ReactNode} center · {ReactNode} end the three regions, when the props above are not the bar
|
|
53
53
|
* @param {'solid'|'glass-dark'|'glass-light'} surface what every float on the bar is made of (default `solid`)
|
|
54
|
+
* @param {boolean|Object} [motion=true] FloatActionMenu's (`menu`): `true` the `--kol-float-*` tokens · `false` none ·
|
|
55
|
+
* `{ duration, ease }` per app (FloatActionStatesAndMotion, 2026-11-04)
|
|
54
56
|
* @param {string} className
|
|
55
57
|
*/
|
|
56
|
-
export default function TopControlsBar({ document, tabs, tab, onTab, onSearch, panels, action, menu, start, center, end, surface = 'solid', className = '' }) {
|
|
58
|
+
export default function TopControlsBar({ document, tabs, tab, onTab, onSearch, panels, action, menu, start, center, end, surface = 'solid', motion = true, className = '' }) {
|
|
57
59
|
return (
|
|
58
60
|
<div className={`kol-top-controls kol-float-chrome flex items-center gap-4 h-16 ${className}`.trim()}>
|
|
59
61
|
<div className="flex items-center gap-4">
|
|
@@ -72,7 +74,7 @@ export default function TopControlsBar({ document, tabs, tab, onTab, onSearch, p
|
|
|
72
74
|
<>
|
|
73
75
|
{panels && <PanelsRestore {...panels} surface={surface} />}
|
|
74
76
|
{action && <Button variant="float" tone="inverted" size="lg" iconLeft={action.icon ?? 'plus'} onClick={action.onPress}>{action.label}</Button>}
|
|
75
|
-
{menu?.length > 0 && <FloatActionMenu actions={menu} icon="plus" variant="float" surface={surface} />}
|
|
77
|
+
{menu?.length > 0 && <FloatActionMenu actions={menu} icon="plus" variant="float" surface={surface} motion={motion} />}
|
|
76
78
|
</>
|
|
77
79
|
)}
|
|
78
80
|
</div>
|