@kolkrabbi/kol-shell 0.91.2 → 0.92.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 +4 -4
- package/src/AccountForm.jsx +12 -9
- package/src/AppFloatNav.jsx +36 -19
- package/src/AppShell.jsx +2 -2
- package/src/HubHome.jsx +9 -6
- package/src/MoreSheet.jsx +12 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.92.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "The application shell",
|
|
6
6
|
"license": "MIT",
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
"react-dom": "^18.3.0 || ^19.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@kolkrabbi/kol-component": "^0.
|
|
25
|
-
"@kolkrabbi/kol-icons": "^0.53.5",
|
|
24
|
+
"@kolkrabbi/kol-component": "^0.320.0",
|
|
26
25
|
"@kolkrabbi/kol-framework": "^0.65.0",
|
|
27
|
-
"@kolkrabbi/kol-theme": "^0.
|
|
26
|
+
"@kolkrabbi/kol-theme": "^0.203.0",
|
|
27
|
+
"@kolkrabbi/kol-icons": "^0.54.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
|
30
30
|
"src",
|
package/src/AccountForm.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useState } from 'react'
|
|
2
|
-
import { Button, Input } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, Input, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
3
3
|
|
|
4
4
|
/* taxonomy-ok: molecule — Inputs + a Button */
|
|
5
5
|
|
|
@@ -10,8 +10,9 @@ import { Button, Input } from '@kolkrabbi/kol-component'
|
|
|
10
10
|
*
|
|
11
11
|
* Two looks, one form:
|
|
12
12
|
* - `column` (default) — style A, 360 wide: the desk's sign-in column over Home (HubHome) and the phone column.
|
|
13
|
-
* - `box` — style
|
|
14
|
-
* `variant="float"` to its fields and button (
|
|
13
|
+
* - `box` — the floating style, the user's phone sign-in box (round 3, W16 2026-10-31): 340 wide, 28 round, 20 in, 8 between
|
|
14
|
+
* rows, on its `surface`; it passes `variant="float"` to its fields and button (capsules at the float height), so the
|
|
15
|
+
* consumer never does.
|
|
15
16
|
*
|
|
16
17
|
* @param {string} title the eyebrow ("Sign in", "Create account", "Request an invite")
|
|
17
18
|
* @param {Array} fields `[{ id, placeholder, type?, autoComplete? }]` — the placeholder is the field's name
|
|
@@ -21,9 +22,11 @@ import { Button, Input } from '@kolkrabbi/kol-component'
|
|
|
21
22
|
* @param {Function} check `(values) => string | null` — a message stops the submit
|
|
22
23
|
* @param {string} done a line shown after success (Request sent.); the button disables
|
|
23
24
|
* @param {'column'|'box'} variant
|
|
25
|
+
* @param {'solid'|'glass-dark'|'glass-light'} surface `box` only: what the box is made of (default `solid`, surface-secondary
|
|
26
|
+
* with the float shadow); glass-dark puts dark-theme ink on the form in either theme
|
|
24
27
|
* @param {string} className
|
|
25
28
|
*/
|
|
26
|
-
export default function AccountForm({ title, fields = [], okLabel, footer, onSubmit, check, done, variant = 'column', className = '' }) {
|
|
29
|
+
export default function AccountForm({ title, fields = [], okLabel, footer, onSubmit, check, done, variant = 'column', surface = 'solid', className = '' }) {
|
|
27
30
|
const [vals, setVals] = useState(() => Object.fromEntries(fields.map((f) => [f.id, ''])))
|
|
28
31
|
const [error, setError] = useState('')
|
|
29
32
|
const [busy, setBusy] = useState(false)
|
|
@@ -37,7 +40,7 @@ export default function AccountForm({ title, fields = [], okLabel, footer, onSub
|
|
|
37
40
|
}
|
|
38
41
|
const body = (
|
|
39
42
|
<>
|
|
40
|
-
<span className={`kol-eyebrow text-body${box ? '
|
|
43
|
+
<span className={`kol-eyebrow text-body${box ? ' mx-1 mt-0.5 mb-1' : ''}`}>{title}</span>
|
|
41
44
|
{fields.map((f, i) => (
|
|
42
45
|
<Input
|
|
43
46
|
key={f.id}
|
|
@@ -53,10 +56,10 @@ export default function AccountForm({ title, fields = [], okLabel, footer, onSub
|
|
|
53
56
|
className="w-full"
|
|
54
57
|
/>
|
|
55
58
|
))}
|
|
56
|
-
{error && <p className={`kol-mono-12 text-ui-error${box ? '
|
|
57
|
-
{done && <p className={`kol-mono-12 text-emphasis${box ? '
|
|
59
|
+
{error && <p className={`kol-mono-12 text-ui-error${box ? ' m-1' : ''}`}>{error}</p>}
|
|
60
|
+
{done && <p className={`kol-mono-12 text-emphasis${box ? ' m-1' : ''}`}>{done}</p>}
|
|
58
61
|
{footer && (
|
|
59
|
-
<p className={`kol-mono-12 text-meta ${box ? '
|
|
62
|
+
<p className={`kol-mono-12 text-meta ${box ? 'm-1' : 'mt-2'}`}>
|
|
60
63
|
{footer.text} <a href={footer.href ?? '#'} onClick={(e) => { if (footer.onPress) { e.preventDefault(); footer.onPress() } }} className="text-emphasis underline">{footer.link}</a>
|
|
61
64
|
</p>
|
|
62
65
|
)}
|
|
@@ -64,6 +67,6 @@ export default function AccountForm({ title, fields = [], okLabel, footer, onSub
|
|
|
64
67
|
</>
|
|
65
68
|
)
|
|
66
69
|
return box
|
|
67
|
-
? <form onSubmit={submit} aria-label={title} className={`flex flex-col gap-
|
|
70
|
+
? <form onSubmit={submit} aria-label={title} className={`flex flex-col gap-2 p-5 rounded-[28px] w-[340px] max-w-full ${floatSurfaceClass(surface, true)} ${className}`.trim()}>{body}</form>
|
|
68
71
|
: <form onSubmit={submit} aria-label={title} className={`flex flex-col gap-2 w-[360px] max-w-full ${className}`.trim()}>{body}</form>
|
|
69
72
|
}
|
package/src/AppFloatNav.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
|
-
import { TabsRow, TABBAR_H,
|
|
2
|
+
import { TabsRow, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
3
3
|
import MoreRows from './MoreSheet.jsx'
|
|
4
4
|
|
|
5
5
|
/* taxonomy-ok: molecule — TabsRow's pill + MoreRows sheets of Buttons */
|
|
@@ -71,6 +71,14 @@ import MoreRows from './MoreSheet.jsx'
|
|
|
71
71
|
* Its menus are the floating style B (`variant="float"` on the rows, `.kol-more-sheet-float`) — the board's.
|
|
72
72
|
* @param {boolean} menuBorder the sheets' 1px hairline (`.kol-more-sheet-bordered`) — off by default, the board's menus have none
|
|
73
73
|
* THE FOUR VARIANTS (user ruling 2026-10-30): `mobile` · `dock` · `panel` · `transport` — nothing else.
|
|
74
|
+
*
|
|
75
|
+
* ROUND 3 (W16, accepted 2026-10-31 — *"accept the style, both glass styles"*): the pill is fxr's live nav, 66 tall, 56 buttons
|
|
76
|
+
* 4 apart, 28 glyphs, the same on mouse and touch; ··· stands apart as its own 66 circle, 8 off the bar; the menus are r 26
|
|
77
|
+
* (30 on touch), 6 in, pill rows 40 (48).
|
|
78
|
+
* @param {'solid'|'glass-dark'|'glass-light'} surface what the pill, its circle and its menus are made of (default `solid`).
|
|
79
|
+
* A glass is kol-theme's `.kol-float-glass-*` — no hairline, its own shadow; glass-dark puts
|
|
80
|
+
* dark-theme ink on what sits on it in either theme. Every variant takes it
|
|
81
|
+
* @param {boolean} labels the tab bar with labels: items 58 tall, 84 wide, a 24 glyph over an 11 label (pill only)
|
|
74
82
|
* @param {'transport'} variant `transport` — Labs' transport, what TransportPill drew: `items` are actions
|
|
75
83
|
* `[{ id, icon, label, onPress?, selected? }]`, `sheetFor` `{ [id]: rows }` opens rows above a
|
|
76
84
|
* slot, it folds to the RIGHT edge; see `Transport` below
|
|
@@ -94,7 +102,7 @@ export default function AppFloatNav(props) {
|
|
|
94
102
|
return props.variant === 'transport' ? <Transport {...props} /> : <FloatNav {...props} />
|
|
95
103
|
}
|
|
96
104
|
|
|
97
|
-
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 }) {
|
|
105
|
+
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 }) {
|
|
98
106
|
const preset = APP_FLOAT_NAV_VARIANTS[variant] ?? {}
|
|
99
107
|
const placement = placementProp ?? preset.placement ?? 'bottom'
|
|
100
108
|
const border = borderProp ?? preset.border ?? true
|
|
@@ -136,13 +144,16 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
136
144
|
* align to bottom"*) — to the left of the collapsed ×, a 12px gap, the two bottom edges on one line */
|
|
137
145
|
const pill = shape === 'pill'
|
|
138
146
|
const top = pill && placement === 'top'
|
|
139
|
-
/*
|
|
140
|
-
|
|
141
|
-
const
|
|
147
|
+
/* ··· is its own circle on a pill (round 3) */
|
|
148
|
+
const split = pill && hasMore
|
|
149
|
+
const geo = { count: tabs.length, labels, split }
|
|
150
|
+
/* a sheet over one slot — a row's `sub`, the dock's More: the pill's left edge (the dock's 64 in, else centred), then the
|
|
151
|
+
* slot's centre (`tabbarPillSlot`); the sheet stands 12 off the pill's face */
|
|
152
|
+
const W = tabbarPillWidth(tabs.length, geo)
|
|
142
153
|
const pillLeft = dock ? 'calc(var(--kol-shell-rail-width, 48px) + 64px)' : `calc(50% - ${W / 2}px)`
|
|
143
|
-
const face = dock ? `${64 +
|
|
154
|
+
const face = dock ? `${64 + TABBAR_PILL_H + 12}px` : `calc(env(safe-area-inset-${top ? 'top' : 'bottom'}, 0px) + ${TABBAR_PILL_INSET + TABBAR_PILL_H + 12}px)`
|
|
144
155
|
const overSlot = (at) => (pill ? {
|
|
145
|
-
left: `calc(${pillLeft} +
|
|
156
|
+
left: `calc(${pillLeft} + ${tabbarPillSlot(at, geo)}px)`, right: 'auto', transform: 'translateX(-50%)',
|
|
146
157
|
[top ? 'top' : 'bottom']: face, ...(top ? { bottom: 'auto' } : {}), width: 'max-content', minWidth: 220,
|
|
147
158
|
} : {
|
|
148
159
|
/* the bar: over the slot's share of the width, 8 off the bar */
|
|
@@ -154,17 +165,17 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
154
165
|
} : moreKeepsOpen && pill ? {
|
|
155
166
|
/* the pill stays whole, so the sheet hangs off its right end, 12 off its face (frame E: below a top pill) */
|
|
156
167
|
left: 'auto',
|
|
157
|
-
right: `calc(50% - ${
|
|
158
|
-
[top ? 'top' : 'bottom']:
|
|
168
|
+
right: `calc(50% - ${W / 2}px)`,
|
|
169
|
+
[top ? 'top' : 'bottom']: face,
|
|
159
170
|
...(top ? { bottom: 'auto' } : {}),
|
|
160
171
|
width: 'max-content', minWidth: 220, maxWidth: 'calc(100vw - 24px)',
|
|
161
172
|
} : {
|
|
162
173
|
left: 'auto',
|
|
163
|
-
right: pill ? `calc(50% - ${
|
|
174
|
+
right: pill ? `calc(50% - ${W / 2}px + ${TABBAR_PILL_H + 12}px)` : `calc(${100 / tabs.length}% + 8px)`,
|
|
164
175
|
...(top
|
|
165
176
|
? { top: `calc(env(safe-area-inset-top, 0px) + ${TABBAR_PILL_INSET}px)`, bottom: 'auto' }
|
|
166
177
|
: { bottom: pill ? `calc(env(safe-area-inset-bottom, 0px) + ${TABBAR_PILL_INSET}px)` : 'env(safe-area-inset-bottom, 0px)' }),
|
|
167
|
-
width: 'max-content', minWidth: 220, maxWidth: `calc(100vw - ${TABBAR_H + 36}px)`,
|
|
178
|
+
width: 'max-content', minWidth: 220, maxWidth: `calc(100vw - ${(pill ? TABBAR_PILL_H : TABBAR_H) + 36}px)`,
|
|
168
179
|
}
|
|
169
180
|
const press = (v) => {
|
|
170
181
|
if (v === MORE) { setSub(null); setOpen((o) => !o); return }
|
|
@@ -181,7 +192,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
181
192
|
<button type="button" aria-label="Close" className="kol-phone-nav-scrim" onClick={() => setSub(null)} />
|
|
182
193
|
)}
|
|
183
194
|
{sub && (
|
|
184
|
-
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label={inBar.find((i) => key(i) === sub)?.label} style={overSlot(inBar.findIndex((i) => key(i) === sub))}>
|
|
195
|
+
<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={inBar.find((i) => key(i) === sub)?.label} style={overSlot(inBar.findIndex((i) => key(i) === sub))}>
|
|
185
196
|
<MoreRows variant="float" actions={inBar.find((i) => key(i) === sub)?.sub} onPick={() => setSub(null)} />
|
|
186
197
|
</div>
|
|
187
198
|
)}
|
|
@@ -191,7 +202,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
191
202
|
<button type="button" aria-label="Close more" className={`kol-phone-nav-scrim${moreKeepsOpen ? '' : ' kol-overlay-scrim'}`} onClick={() => setOpen(false)} />
|
|
192
203
|
)}
|
|
193
204
|
{open && (
|
|
194
|
-
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label="More" style={sheetStyle}>
|
|
205
|
+
<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="More" style={sheetStyle}>
|
|
195
206
|
{/* the nav, the page's actions, then the pinned foot (frame A2) */}
|
|
196
207
|
<MoreRows 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) }} />
|
|
197
208
|
{after.length > 0 && <MoreRows variant="float" items={after} active={active} onPick={(x) => { setOpen(false); if (x.onPress) { x.onPress(); return } if (x.path) onNavigate?.(x.path) }} />}
|
|
@@ -206,6 +217,9 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
206
217
|
edge={top ? 'top' : 'bottom'}
|
|
207
218
|
border={border}
|
|
208
219
|
shadow={shadow}
|
|
220
|
+
surface={surface}
|
|
221
|
+
split={split}
|
|
222
|
+
labels={labels}
|
|
209
223
|
dock={dock}
|
|
210
224
|
active={activeShape}
|
|
211
225
|
foldable={foldable}
|
|
@@ -236,7 +250,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
|
|
|
236
250
|
* @param {boolean} foldable a sideways swipe folds it into the right edge tab
|
|
237
251
|
* @param {boolean} folded · {Function} onFoldChange the folded state, controlled (else the pill holds it)
|
|
238
252
|
*/
|
|
239
|
-
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false }) {
|
|
253
|
+
function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable = false, folded, onFoldChange, menuBorder = false, surface = 'solid', labels = false }) {
|
|
240
254
|
const [sheet, setSheet] = useState(null)
|
|
241
255
|
useEffect(() => {
|
|
242
256
|
if (!sheet) return undefined
|
|
@@ -252,14 +266,15 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
252
266
|
setSheet(null)
|
|
253
267
|
items.find((i) => i.id === id)?.onPress?.()
|
|
254
268
|
}
|
|
255
|
-
/* the sheet centres on its slot: the pill's left edge +
|
|
256
|
-
const
|
|
269
|
+
/* the sheet centres on its slot: the pill's left edge + the slot's centre */
|
|
270
|
+
const geo = { count: items.length, labels }
|
|
271
|
+
const W = tabbarPillWidth(items.length, geo)
|
|
257
272
|
const at = items.findIndex((i) => i.id === sheet)
|
|
258
273
|
const sheetStyle = {
|
|
259
|
-
left: `calc(50% - ${W / 2}px +
|
|
274
|
+
left: `calc(50% - ${W / 2}px + ${tabbarPillSlot(at, geo)}px)`,
|
|
260
275
|
right: 'auto',
|
|
261
276
|
transform: 'translateX(-50%)',
|
|
262
|
-
[top ? 'top' : 'bottom']: `calc(env(safe-area-inset-${top ? 'top' : 'bottom'}, 0px) + ${TABBAR_PILL_INSET +
|
|
277
|
+
[top ? 'top' : 'bottom']: `calc(env(safe-area-inset-${top ? 'top' : 'bottom'}, 0px) + ${TABBAR_PILL_INSET + TABBAR_PILL_H + 12}px)`,
|
|
263
278
|
...(top ? { bottom: 'auto' } : {}),
|
|
264
279
|
width: 'max-content', minWidth: 160,
|
|
265
280
|
}
|
|
@@ -271,7 +286,7 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
271
286
|
<button type="button" aria-label="Close" className="kol-phone-nav-scrim" onClick={() => setSheet(null)} />
|
|
272
287
|
)}
|
|
273
288
|
{sheet && (
|
|
274
|
-
<div className={`kol-phone-nav-more kol-more-sheet kol-more-sheet-float${menuBorder ? ' kol-more-sheet-bordered' : ''}`} role="menu" aria-label={items[at]?.label} style={sheetStyle}>
|
|
289
|
+
<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}>
|
|
275
290
|
<MoreRows variant="float" actions={sheetFor[sheet]} onPick={() => setSheet(null)} />
|
|
276
291
|
</div>
|
|
277
292
|
)}
|
|
@@ -284,6 +299,8 @@ function Transport({ items = [], sheetFor = {}, placement = 'bottom', foldable =
|
|
|
284
299
|
border={APP_FLOAT_NAV_VARIANTS.transport.border}
|
|
285
300
|
shadow={APP_FLOAT_NAV_VARIANTS.transport.shadow}
|
|
286
301
|
active={APP_FLOAT_NAV_VARIANTS.transport.active}
|
|
302
|
+
surface={surface}
|
|
303
|
+
labels={labels}
|
|
287
304
|
foldable={foldable}
|
|
288
305
|
folded={folded}
|
|
289
306
|
onFoldChange={(v) => { if (v) setSheet(null); onFoldChange?.(v) }}
|
package/src/AppShell.jsx
CHANGED
|
@@ -5,7 +5,7 @@ import { NavHiddenContext } from './navHidden.js'
|
|
|
5
5
|
import { SettingsToggleContext } from './settingsToggle.js'
|
|
6
6
|
import TouchDeviceOverlay, { useTouchPrimary } from './TouchDeviceOverlay.jsx'
|
|
7
7
|
import AppFloatNav from './AppFloatNav.jsx'
|
|
8
|
-
import { TABBAR_H, TABBAR_PILL_INSET, MastheadContext, RAIL_PRESETS } from '@kolkrabbi/kol-component'
|
|
8
|
+
import { TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, MastheadContext, RAIL_PRESETS } from '@kolkrabbi/kol-component'
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* AppShell — layout root: the rail + the content column. No header, no
|
|
@@ -426,7 +426,7 @@ export default function AppShell({
|
|
|
426
426
|
<div className="bg-surface-primary min-w-0" style={{ marginLeft: `var(--kol-shell-rail-width)`, '--kol-shell-page-wash': pageWash, /* `bar` pads the page by its height; `pill` FLOATS OVER the page (user 2026-10-23: *"why doesn't it overlay the bottom"*) —
|
|
427
427
|
* no pad, the page runs under it, and `--kol-shell-bar-clear` is what a scroll region's last row and a fixed foot clear */
|
|
428
428
|
...(bar && touch !== 'pill' && { '--kol-shell-bar-h': `calc(${TABBAR_H}px + env(safe-area-inset-bottom, 0px))`, paddingBottom: 'var(--kol-shell-bar-h)' }),
|
|
429
|
-
...(bar && touch === 'pill' && { '--kol-shell-bar-h': '0px', '--kol-shell-bar-clear': `calc(${
|
|
429
|
+
...(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' }) }}>
|
|
430
430
|
{children}
|
|
431
431
|
</div>
|
|
432
432
|
</div>
|
package/src/HubHome.jsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useEffect, useState } from 'react'
|
|
2
|
-
import { Button, PopoverPanel, usePopover, useMediaQuery, VectorLoader } from '@kolkrabbi/kol-component'
|
|
2
|
+
import { Button, PopoverPanel, usePopover, useMediaQuery, VectorLoader, floatSurfaceClass } from '@kolkrabbi/kol-component'
|
|
3
3
|
import AppFloatNav from './AppFloatNav.jsx'
|
|
4
4
|
import WalkthroughPanel from './WalkthroughPanel.jsx'
|
|
5
5
|
import MoreRows from './MoreSheet.jsx'
|
|
@@ -171,7 +171,7 @@ export default function HubHome({
|
|
|
171
171
|
/* SIGN IN OVER HOME (FloatingStyleAndSignInDemos, kol-fxr 2026-10-30, canvas Round 3) — AppHub's, from `signIn.form`:
|
|
172
172
|
* `{ open, onClose, ...AccountForm's props }`. Signed out and open: on a desk the sign-in column (672, surface-primary)
|
|
173
173
|
* slides in from the left over Home, the mark stays where it is above it, the rest of Home turns surface-secondary and
|
|
174
|
-
* the stage
|
|
174
|
+
* the stage slides half the column right (never resized), the + and the nav stay; on a phone the form is the style-B box, centred over the
|
|
175
175
|
* stage at the 16 gutter, the nav stays. Escape closes it */
|
|
176
176
|
signInForm,
|
|
177
177
|
/* AppHub's: the whole nav, the desk dock's ··· (the board — the signed-out desk has no rail). A chrome may carry `sub`
|
|
@@ -280,8 +280,10 @@ export default function HubHome({
|
|
|
280
280
|
<div className="relative min-h-dvh overflow-hidden" data-hub-signed-out>
|
|
281
281
|
{/* the rest of Home turns surface-secondary under an open sign-in column (a desk only) */}
|
|
282
282
|
<div className={`absolute inset-0 bg-surface-secondary transition-opacity duration-300 max-md:hidden ${formOpen ? 'opacity-100' : 'opacity-0'}`} aria-hidden="true" />
|
|
283
|
-
{/* the column overlays the stage, never resizes it — a stage that sizes to its box would reseed
|
|
284
|
-
|
|
283
|
+
{/* the column overlays the stage, never resizes it — a stage that sizes to its box would reseed. It SLIDES half the
|
|
284
|
+
* column right instead, so the growth's centre sits in the middle of the grey that is left (kol-fxr 2026-10-30 — user:
|
|
285
|
+
* *"when shelf opens, then growth center shifts to center the gray visible area"*) */}
|
|
286
|
+
{stage && <div className={`absolute inset-0 transition-transform duration-300 ${formOpen ? 'md:translate-x-[336px]' : ''}`} aria-hidden="true">{stage}</div>}
|
|
285
287
|
{signInForm && (
|
|
286
288
|
<aside aria-label={form.title} aria-hidden={!formOpen} inert={!formOpen} className={`absolute inset-y-0 left-0 w-[672px] px-16 flex flex-col justify-center bg-surface-primary transition-transform duration-300 max-md:hidden ${formOpen ? 'translate-x-0' : '-translate-x-full'}`}>
|
|
287
289
|
{formOpen && <AccountForm {...form} />}
|
|
@@ -303,7 +305,8 @@ export default function HubHome({
|
|
|
303
305
|
{/* the + on the phone too (Round 3: the phone had no way to sign in from Home) — top-right on the mark's line, 16 in
|
|
304
306
|
* and 24 down; its menu is the floating style (`variant="float"`, the board's menus), as the dock's sheets are */}
|
|
305
307
|
{outActions.length > 0 && <HomeMenu actions={outActions} icon="plus" variant="float" className="absolute z-10 right-4 top-6 md:right-16 md:top-16" />}
|
|
306
|
-
{
|
|
308
|
+
{/* over a stage the dock floats: the transport's shadow (HomeDockShadow, kol-fxr 2026-10-31) */}
|
|
309
|
+
{chromes.length > 0 && <AppFloatNav variant="dock" shape="pill" shadow={stage != null} items={chromes.map((c) => ({ id: c.label, label: c.label, icon: c.icon, onPress: c.onPress, sub: c.sub }))} sheetItems={dockMore} />}
|
|
307
310
|
{/* the walkthrough over the stage, where the catalog's would sit — on the mark's left line */}
|
|
308
311
|
{touring && steps.length > 0 && (
|
|
309
312
|
<div className="absolute inset-x-4 top-24 md:left-16 md:right-auto md:top-52 md:w-[560px]">
|
|
@@ -349,7 +352,7 @@ function HomeMenu({ actions, icon = 'more', variant, className = '' }) {
|
|
|
349
352
|
{/* `icon` — `more` on Home, `plus` signed out (frame B2), the × while its sheet is open */}
|
|
350
353
|
<Button iconOnly={icon === 'more' ? 'more' : open ? 'x' : icon} size="lg" tone="inverted" radius="full" aria-label={open ? 'Close' : 'Actions'} pressed={open} />
|
|
351
354
|
</span>
|
|
352
|
-
<PopoverPanel popover={popover} panel={false} className={`kol-more-sheet${variant === 'float' ?
|
|
355
|
+
<PopoverPanel popover={popover} panel={false} className={`kol-more-sheet${variant === 'float' ? ` kol-more-sheet-float ${floatSurfaceClass('solid', true)}` : ''}`} style={{ minWidth: 220 }}>
|
|
353
356
|
<MoreRows actions={actions} variant={variant} onPick={() => setOpen(false)} />
|
|
354
357
|
</PopoverPanel>
|
|
355
358
|
</div>
|
package/src/MoreSheet.jsx
CHANGED
|
@@ -15,20 +15,25 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
15
15
|
* @param {Array} items `[{ path, label, icon? }]` — destinations, after a divider's worth of nothing
|
|
16
16
|
* @param {string} active the item path that is current
|
|
17
17
|
* @param {Function} onPick `(item | action) => void` — after the row's own press; the sheet closes here
|
|
18
|
-
* @param {'float'} variant the floating style
|
|
19
|
-
*
|
|
18
|
+
* @param {'float'} variant the floating style (round 3, W16 2026-10-31): each row a `kol-btn-float` pill — 40 (48 on touch)
|
|
19
|
+
* tall, 12 in, an 18 (20) glyph, the current row oq-16 — in a `.kol-more-sheet-float`; AppFloatNav
|
|
20
|
+
* and the signed-out Home pass it. Unset, the rows are A
|
|
20
21
|
* @param {boolean} itemsFirst the destinations above the actions (PhoneNav's More, 2026-10-28: the whole nav, then the
|
|
21
22
|
* page's buttons); Home's masthead button keeps actions first
|
|
22
23
|
*/
|
|
23
24
|
export default function MoreRows({ actions = [], items = [], active, onPick, itemsFirst = false, variant }) {
|
|
24
|
-
|
|
25
|
+
/* the float row's height, inset and gap are the theme's (`.kol-more-sheet-float`, round 3) — no h-11 / gap-3 utility,
|
|
26
|
+
* which would outrank the components layer */
|
|
27
|
+
const float = variant === 'float'
|
|
28
|
+
const rowCls = float ? 'w-full justify-start kol-btn-float' : 'w-full justify-start h-11 gap-3'
|
|
29
|
+
const glyph = float ? 'var(--kol-float-ic)' : 22
|
|
25
30
|
const acts = (
|
|
26
31
|
<>
|
|
27
32
|
{actions.map((a) => (
|
|
28
|
-
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined && !a.avatar ? a.icon : undefined} iconSize={
|
|
33
|
+
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined && !a.avatar ? a.icon : undefined} iconSize={glyph} className={rowCls} onClick={() => { onPick?.(a); a.onPress?.() }}>
|
|
29
34
|
{a.avatar && <Avatar src={a.avatar} alt="" size="xs" />}
|
|
30
35
|
{a.checked !== undefined && (
|
|
31
|
-
<span className="inline-flex items-center justify-center shrink-0" style={{ width: 22, height: 22 }}>{a.checked && <Icon name="check" size={22} />}</span>
|
|
36
|
+
<span className="inline-flex items-center justify-center shrink-0" style={{ width: float ? 'var(--kol-float-ic)' : 22, height: float ? 'var(--kol-float-ic)' : 22 }}>{a.checked && <Icon name="check" size={22} />}</span>
|
|
32
37
|
)}
|
|
33
38
|
{a.label}
|
|
34
39
|
</Button>
|
|
@@ -43,9 +48,9 @@ export default function MoreRows({ actions = [], items = [], active, onPick, ite
|
|
|
43
48
|
variant="nav"
|
|
44
49
|
size="lg"
|
|
45
50
|
iconLeft={i.icon}
|
|
46
|
-
iconSize={
|
|
51
|
+
iconSize={glyph}
|
|
47
52
|
aria-current={i.path === active ? 'page' : undefined}
|
|
48
|
-
className={
|
|
53
|
+
className={rowCls}
|
|
49
54
|
onClick={() => onPick?.(i)}
|
|
50
55
|
>
|
|
51
56
|
{i.label}
|