@kolkrabbi/kol-shell 0.87.1 → 0.88.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/AppHub.jsx +77 -23
- package/src/HubHome.jsx +14 -2
- package/src/MoreSheet.jsx +5 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kolkrabbi/kol-shell",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.88.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-framework": "^0.62.
|
|
24
|
+
"@kolkrabbi/kol-framework": "^0.62.4",
|
|
25
|
+
"@kolkrabbi/kol-component": "^0.313.0",
|
|
25
26
|
"@kolkrabbi/kol-icons": "^0.52.0",
|
|
26
|
-
"@kolkrabbi/kol-component": "^0.311.2",
|
|
27
27
|
"@kolkrabbi/kol-theme": "^0.196.0"
|
|
28
28
|
},
|
|
29
29
|
"files": [
|
package/src/AppHub.jsx
CHANGED
|
@@ -13,7 +13,7 @@ import SettingsLinks, { SettingsColophon } from './SettingsLinks.jsx'
|
|
|
13
13
|
import About from './About.jsx'
|
|
14
14
|
import { warnJsx } from './warnJsx.js'
|
|
15
15
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
16
|
-
import { Avatar, CommandOverlay, LabeledControlSection, MediaLibrary, ModalProvider, RAIL_PRESETS, SettingsFooter, SettingsPanel, SettingsSections, ShortcutsOverlay, TabsRow, shortcutInScope, useModal } from '@kolkrabbi/kol-component'
|
|
16
|
+
import { Avatar, Button, CommandOverlay, LabeledControlSection, MediaLibrary, ModalProvider, RAIL_PRESETS, SettingsFooter, SettingsPanel, SettingsSections, ShortcutsOverlay, TabsRow, shortcutInScope, useModal } from '@kolkrabbi/kol-component'
|
|
17
17
|
|
|
18
18
|
/* taxonomy-ok: organism — nests AppShell / HubHome / HubSettings / HubDev (relative) + kol-component's CommandOverlay */
|
|
19
19
|
|
|
@@ -92,12 +92,21 @@ import { Avatar, CommandOverlay, LabeledControlSection, MediaLibrary, ModalProvi
|
|
|
92
92
|
* foot, opening `MediaLibrary variant="picker"` (the column browser with the preview pane,
|
|
93
93
|
* Cancel and Use — mirror's) over `client` (kol-media-client's shape, or the media
|
|
94
94
|
* fixture's). OPT-IN: no `media`, no row
|
|
95
|
-
* @param {Object}
|
|
95
|
+
* @param {Object} phoneNav `{ more: (defaults) => rows }` — the phone pill's More sheet, edited by the app (HubAppOwnsItsRows).
|
|
96
|
+
* With `home.menu` · `home.signedOutActions` · `shell.foot`, the four places the Hub draws
|
|
97
|
+
* rows: each takes a function of its default rows, `{ icon, label, onPress | path, avatar? }`
|
|
98
|
+
* @param {Object} signIn `{ signedIn, user?, onProfile?, onPress, account? }` — the user row at the rail's foot. OPT-IN: no
|
|
99
|
+
* `account: { sections, content?, footer? }` (SettingsAccountTab, kol-fxr 2026-10-29 — *"why isnt
|
|
100
|
+
* account just in settings in account tab?"*): an Account tab, first in the settings rail while
|
|
101
|
+
* signed in — typed rows (`sections`), a node for what rows cannot say (`content`: the
|
|
102
|
+
* picture, Upload), and `footer: { label, onPress }` (Sign out). Without `onProfile` the
|
|
103
|
+
* account row opens the rail on that tab
|
|
96
104
|
* `signIn`, no row. THE ACCOUNT (HubAccountRow, kol-fxr 2026-10-28 — user: *"I am the only user.
|
|
97
105
|
* and we will treat me THE ONLY USER as a proper user"* · *"why does it say password for library
|
|
98
106
|
* sync? … stupid."*): with `user: { name, avatar? }` the row is an account — signed out it reads
|
|
99
107
|
* Sign in and the DS dialog asks Email and Password, then `onPress({ email, password })`; signed
|
|
100
|
-
* in it draws the
|
|
108
|
+
* in it draws the picture (`avatar`) or, with none, the outline `user` glyph like every other
|
|
109
|
+
* row (AccountRowNoPictureIsTheIcon — *"if no image then just use outline"*), and the name, and opens `onProfile()` (the
|
|
101
110
|
* app's profile page, which owns sign-out). Without `user` it is the shared-password row it was:
|
|
102
111
|
* a `user` glyph and "Sign in" out, `cloud` and "Signed in" in; the password prompt, then
|
|
103
112
|
* `onPress(password)`; signed in, the sign-out confirm, then `onPress(null)`
|
|
@@ -120,8 +129,9 @@ const SETTINGS_ROW = (path) => [{ icon: 'nav-settings', path, label: 'Settings'
|
|
|
120
129
|
/* the foot's two sentinels (fxr's `#media` and `#sign-in`, made the Hub's) — a press opens, never routes */
|
|
121
130
|
const MEDIA_PATH = '#media'
|
|
122
131
|
const SIGN_IN_PATH = '#sign-in'
|
|
123
|
-
/* the signed-in account row's glyph
|
|
124
|
-
*
|
|
132
|
+
/* the signed-in account row's glyph (HubAccountRow): a name no set ships, drawn by the rail's icon component as the
|
|
133
|
+
* picture at the glyph's 20 when the user has one, else the outline `user` glyph (AccountRowNoPictureIsTheIcon, 2026-10-29 —
|
|
134
|
+
* the initial disc read as a foreign icon set); a phone's pill and More draw the `user` glyph in its place */
|
|
125
135
|
const ACCOUNT_GLYPH = '__hub-account'
|
|
126
136
|
/* the drawer tier's Settings row — a sentinel too: it opens the drawer, it never routes */
|
|
127
137
|
const SETTINGS_DRAWER = '#settings'
|
|
@@ -195,8 +205,12 @@ function HubFrame({
|
|
|
195
205
|
shortcutsRailKey = 'S',
|
|
196
206
|
masthead,
|
|
197
207
|
shell,
|
|
208
|
+
/* `{ more: (defaults) => rows }` — the phone pill's More sheet, the app's edit of the Hub's rows (HubAppOwnsItsRows) */
|
|
209
|
+
phoneNav: phoneNavEdit,
|
|
198
210
|
children,
|
|
199
211
|
}) {
|
|
212
|
+
/* `shell.foot`: the rail's pinned foot as the app edits it — the rest of `shell` is AppShell's */
|
|
213
|
+
const { foot: footEdit, ...shellProps } = shell ?? {}
|
|
200
214
|
const [sheet, setSheet] = useState(false)
|
|
201
215
|
const [rail, setRail] = useState(false)
|
|
202
216
|
const [search, setSearch] = useState(false)
|
|
@@ -209,6 +223,7 @@ function HubFrame({
|
|
|
209
223
|
const { page: settingsPage = false, filters: settingsFilters = false, ...settingsProps } = settings ?? {}
|
|
210
224
|
const settingsDrawer = !!settings && !settingsPage
|
|
211
225
|
const [settingsTab, setSettingsTab] = useState('settings')
|
|
226
|
+
const account = signIn?.signedIn && signIn.account ? signIn.account : null
|
|
212
227
|
const modal = useModal()
|
|
213
228
|
const theme = useTheme()
|
|
214
229
|
/* THE DEFAULT THEME IS A ROOT ATTRIBUTE kol-framework's theme reads (`data-theme-default`): reset (`theme.clear()`)
|
|
@@ -233,14 +248,18 @@ function HubFrame({
|
|
|
233
248
|
if (settingsDrawer && settings.content != null) warnRailJsx('content')
|
|
234
249
|
const railRows = settingsDrawer ? railSections(settings.sections) : []
|
|
235
250
|
/* reset, live everywhere: the theme back to the system, then the app's own */
|
|
236
|
-
const reset = () => { theme.clear(); settings
|
|
251
|
+
const reset = () => { theme.clear(); settings?.drawer?.onReset?.() }
|
|
237
252
|
/* SIGN IN ASKS IN THE DS DIALOG (review 2, § 5.2 — fxr's RailSignIn, verbatim copy): signed out, the password prompt —
|
|
238
253
|
* empty cancels — then `onPress(password)`; signed in, the sign-out confirm, then `onPress(null)` */
|
|
239
254
|
const askSignIn = async () => {
|
|
240
255
|
if (!signIn) return
|
|
241
256
|
/* an account: signed in opens the profile; signed out asks email and password */
|
|
242
|
-
if (signIn.user || signIn.onProfile) {
|
|
243
|
-
if (signIn.signedIn) {
|
|
257
|
+
if (signIn.user || signIn.onProfile || signIn.account) {
|
|
258
|
+
if (signIn.signedIn) {
|
|
259
|
+
if (signIn.onProfile) { signIn.onProfile(); return }
|
|
260
|
+
if (signIn.account) { setSettingsTab('account'); setSettingsOpen(true) }
|
|
261
|
+
return
|
|
262
|
+
}
|
|
244
263
|
const got = await modal.form('Sign in', [
|
|
245
264
|
{ id: 'email', placeholder: 'Email', type: 'email', autoComplete: 'username' },
|
|
246
265
|
{ id: 'password', placeholder: 'Password', type: 'password', autoComplete: 'current-password' },
|
|
@@ -316,16 +335,22 @@ function HubFrame({
|
|
|
316
335
|
* (no More), they stay on the page */
|
|
317
336
|
const barOn = ['bar', 'pill'].includes(shell?.touch ?? RAIL_PRESETS.app.phone)
|
|
318
337
|
const onHome = home && currentPath === homePath
|
|
319
|
-
|
|
338
|
+
/* the signed-in account as a row — Home's menu and the phone's More end on it (HomeMenuAccountRow) */
|
|
339
|
+
const accountAction = signIn?.signedIn && (signIn.user || signIn.account || signIn.onProfile)
|
|
340
|
+
? { label: signIn.user?.name ?? 'Account', icon: 'user', avatar: signIn.user?.avatar, onPress: () => askSignIn() }
|
|
341
|
+
: undefined
|
|
342
|
+
const homeDefaults = onHome && barOn ? [
|
|
320
343
|
...(home.action ? [{ label: home.action.label, icon: 'plus', onPress: home.action.onClick }] : []),
|
|
321
344
|
...(walkthrough?.length ? [{ label: touring ? 'Close walkthrough' : 'Walkthrough', icon: 'book-open', onPress: () => setTouring((t) => !t) }] : []),
|
|
345
|
+
...(accountAction ? [accountAction] : []),
|
|
322
346
|
] : []
|
|
347
|
+
const homeActions = onHome && barOn && typeof home.menu === 'function' ? home.menu(homeDefaults) ?? [] : homeDefaults
|
|
323
348
|
/* SIGNED OUT (HubHomeSignedOut, 2026-10-28): Home is the stage, no files; the desk's round + carries Sign in beside New File
|
|
324
349
|
* and Walkthrough; on a phone the pill is the app's chromes and More is the rail (frame A2) */
|
|
325
350
|
const signedOutHome = onHome && (home.signedOut ?? (home.stage != null && !(home.files?.length)))
|
|
326
351
|
const signInAction = signIn && !signIn.signedIn ? { label: 'Sign in', icon: 'user', onPress: () => askSignIn() } : undefined
|
|
327
352
|
const page = onHome
|
|
328
|
-
? <HubHome app={app} iconComponent={iconComponent} walkthrough={walkthrough} {...home} touring={touring} onTouringChange={setTouring} actionsInBar={barOn} signInAction={signInAction} />
|
|
353
|
+
? <HubHome app={app} iconComponent={iconComponent} walkthrough={walkthrough} {...home} touring={touring} onTouringChange={setTouring} actionsInBar={barOn} signInAction={signInAction} accountAction={accountAction} />
|
|
329
354
|
: settingsPage && currentPath === settingsPath
|
|
330
355
|
? <HubSettings app={app} shortcuts={shortcuts} themeToggle={toggle} filters={settingsFilters} {...settingsProps} drawer={settingsProps.drawer ?? true} />
|
|
331
356
|
: devOn && (currentPath === devPath || currentPath?.startsWith(`${devPath}/`))
|
|
@@ -335,13 +360,22 @@ function HubFrame({
|
|
|
335
360
|
* *"why did the dev tab move? it was fine where it was. below stage"*); Settings keeps the bottom alone */
|
|
336
361
|
const rows = devOn ? [...items, { icon: 'code', path: devPath, label: 'Dev' }] : items
|
|
337
362
|
/* the pinned foot: Media, Sign in, Settings — each only when the app passes it */
|
|
338
|
-
const
|
|
363
|
+
const bottomDefaults = [
|
|
339
364
|
...(media ? [{ icon: 'image', path: MEDIA_PATH, label: 'Media' }] : []),
|
|
340
365
|
...(signIn ? [signIn.signedIn && signIn.user
|
|
341
366
|
? { icon: ACCOUNT_GLYPH, path: SIGN_IN_PATH, label: signIn.user.name ?? 'Account' }
|
|
342
367
|
: { icon: signIn.signedIn ? 'cloud' : 'user', path: SIGN_IN_PATH, label: signIn.signedIn ? 'Signed in' : 'Sign in' }] : []),
|
|
343
368
|
...(settings ? SETTINGS_ROW(settingsDrawer ? SETTINGS_DRAWER : settingsPath) : []),
|
|
344
369
|
]
|
|
370
|
+
/* an app's row may press rather than route (`onPress`): it travels the rail as a sentinel path, and `go` presses it */
|
|
371
|
+
const pressed = {}
|
|
372
|
+
const asRows = (list) => (list ?? []).map((r, i) => {
|
|
373
|
+
if (r.path || !r.onPress) return r
|
|
374
|
+
const path = `#row:${i}:${r.label}`
|
|
375
|
+
pressed[path] = r.onPress
|
|
376
|
+
return { ...r, path }
|
|
377
|
+
})
|
|
378
|
+
const bottom = typeof footEdit === 'function' ? asRows(footEdit(bottomDefaults)) : bottomDefaults
|
|
345
379
|
/* the phone bar lists Home as a tab — the rail draws it as the mark, the bar has no mark */
|
|
346
380
|
const barItems = [...(home ? [{ icon: 'home-01', path: homePath, label: 'Home' }] : []), ...rows, ...bottom.map((r) => (r.icon === ACCOUNT_GLYPH ? { ...r, icon: 'user' } : r))]
|
|
347
381
|
/* the rail's glyphs, with the account's avatar where its row is */
|
|
@@ -349,9 +383,9 @@ function HubFrame({
|
|
|
349
383
|
const railIcon = useMemo(() => {
|
|
350
384
|
if (!user) return iconComponent
|
|
351
385
|
const Base = iconComponent ?? Icon
|
|
352
|
-
const initial = (user.name ?? '?').trim().charAt(0).toUpperCase()
|
|
353
386
|
return function HubRailIcon({ name, ...rest }) {
|
|
354
|
-
|
|
387
|
+
if (name !== ACCOUNT_GLYPH) return <Base name={name} {...rest} />
|
|
388
|
+
return user.avatar ? <Avatar src={user.avatar} alt="" size="xs" /> : <Base name="user" {...rest} />
|
|
355
389
|
}
|
|
356
390
|
}, [iconComponent, user?.name, user?.avatar]) // eslint-disable-line react-hooks/exhaustive-deps
|
|
357
391
|
/* the two sentinels open, everything else routes — the rail, the bar, ⌥-digits and ⌘K all come through here */
|
|
@@ -359,6 +393,7 @@ function HubFrame({
|
|
|
359
393
|
if (path === MEDIA_PATH) { setMediaOpen(true); return }
|
|
360
394
|
if (path === SIGN_IN_PATH) { askSignIn(); return }
|
|
361
395
|
if (path === SETTINGS_DRAWER) { setSettingsOpen((v) => !v); return }
|
|
396
|
+
if (pressed[path]) { pressed[path](); return }
|
|
362
397
|
return onNavigate?.(path, ...rest)
|
|
363
398
|
}
|
|
364
399
|
|
|
@@ -390,7 +425,11 @@ function HubFrame({
|
|
|
390
425
|
bottomItems={bottom}
|
|
391
426
|
barItems={signedOutHome && home.chromes?.length ? home.chromes.map((c) => ({ id: c.label, label: c.label, icon: c.icon, onPress: c.onPress })) : barItems}
|
|
392
427
|
barActions={homeActions}
|
|
393
|
-
phoneNav={
|
|
428
|
+
phoneNav={(() => {
|
|
429
|
+
const sheet = [...rows, ...bottom.map((r) => ({ ...r, icon: r.icon === ACCOUNT_GLYPH ? 'user' : r.icon, foot: true }))]
|
|
430
|
+
if (typeof phoneNavEdit?.more === 'function') return { sheetItems: asRows(phoneNavEdit.more(sheet)), moreKeepsOpen: signedOutHome || undefined }
|
|
431
|
+
return signedOutHome && home.chromes?.length ? { sheetItems: sheet, moreKeepsOpen: true } : undefined
|
|
432
|
+
})()}
|
|
394
433
|
logomark={app.logomark ? { svgUrl: app.logomark, title: app.name } : undefined}
|
|
395
434
|
currentPath={currentPath}
|
|
396
435
|
onNavigate={go}
|
|
@@ -406,7 +445,7 @@ function HubFrame({
|
|
|
406
445
|
touch={RAIL_PRESETS.app.phone}
|
|
407
446
|
masthead={masthead}
|
|
408
447
|
pageWash="var(--kol-fg-02)"
|
|
409
|
-
{...
|
|
448
|
+
{...shellProps}
|
|
410
449
|
>
|
|
411
450
|
{page}
|
|
412
451
|
{/* THE SHEET IS THE ⌘K MODAL WITH NO FIELD (ShortcutsOverlayCategories, kol-monitor 2026-10-18 — user: *"I said
|
|
@@ -426,22 +465,37 @@ function HubFrame({
|
|
|
426
465
|
* TabsRow under the header — Settings first, then the app's (Monitor: Shortcuts, About, Repo; Mirror: Performance)
|
|
427
466
|
* — like the labs rail's levels, never a page. Rows only: the Hub draws every string, so no rail can wear a class
|
|
428
467
|
* the template does not */}
|
|
429
|
-
{settingsDrawer && (
|
|
468
|
+
{(settingsDrawer || account) && (
|
|
430
469
|
<SettingsPanel
|
|
431
470
|
open={settingsOpen}
|
|
432
471
|
variant="rail"
|
|
433
|
-
title={settings
|
|
472
|
+
title={settings?.drawer?.title ?? 'Settings'}
|
|
434
473
|
onClose={() => setSettingsOpen(false)}
|
|
435
474
|
/* the footer on every rail: the toggle, and a live reset */
|
|
436
475
|
footer={<SettingsFooter onReset={reset}>{toggle}</SettingsFooter>}
|
|
437
476
|
>
|
|
438
477
|
{/* the tab row wraps in the 380 rail — five tabs (Mirror's Performance beside the Hub's three) overran it */}
|
|
439
|
-
{
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
478
|
+
{(() => {
|
|
479
|
+
/* the Account tab first, while signed in (SettingsAccountTab); then Settings and the Hub's named tabs */
|
|
480
|
+
const tabs = [...(account ? [{ id: 'account', label: 'Account' }] : []), ...(settingsDrawer ? [{ id: 'settings', label: 'Settings' }] : []), ...railTabs.map((t) => ({ id: t.value, label: t.label }))]
|
|
481
|
+
const tab = tabs.some((t) => t.id === settingsTab) ? settingsTab : tabs[0]?.id
|
|
482
|
+
return (
|
|
483
|
+
<>
|
|
484
|
+
{tabs.length > 1 && <TabsRow look="text" size={12} tracked className="flex-wrap gap-x-6 gap-y-2" tabs={tabs} value={tab} onChange={setSettingsTab} ariaLabel="Settings tabs" />}
|
|
485
|
+
{tab === 'account'
|
|
486
|
+
? (
|
|
487
|
+
<div className="flex flex-col gap-8">
|
|
488
|
+
{account.content}
|
|
489
|
+
{account.sections?.length > 0 && <SettingsSections sections={railSections(account.sections)} divided />}
|
|
490
|
+
{account.footer && <Button tone="outline" size="sm" className="self-start" onClick={account.footer.onPress}>{account.footer.label}</Button>}
|
|
491
|
+
</div>
|
|
492
|
+
)
|
|
493
|
+
: tab === 'settings'
|
|
494
|
+
? (railRows.length > 0 && <SettingsSections sections={railRows} divided />)
|
|
495
|
+
: railTabs.find((x) => x.value === tab)?.named?.draw({ app, shortcuts })}
|
|
496
|
+
</>
|
|
497
|
+
)
|
|
498
|
+
})()}
|
|
445
499
|
</SettingsPanel>
|
|
446
500
|
)}
|
|
447
501
|
</AppShell>
|
package/src/HubHome.jsx
CHANGED
|
@@ -158,6 +158,15 @@ export default function HubHome({
|
|
|
158
158
|
stage,
|
|
159
159
|
chromes = [],
|
|
160
160
|
signInAction,
|
|
161
|
+
/* AppHub's: the signed-in account row (HomeMenuAccountRow, kol-fxr 2026-10-29 — *"here is supposed to be user space as
|
|
162
|
+
* well"*), the menu's last row */
|
|
163
|
+
accountAction,
|
|
164
|
+
/* THE APP OWNS ITS ROWS (HubAppOwnsItsRows, kol-fxr 2026-10-29 — *"I dont wanna file every goddamn change"*): each a
|
|
165
|
+
* function of the Hub's rows, `(defaults) => rows` — keep them and edit, or replace them. Rows keep the Hub's shape
|
|
166
|
+
* `{ icon, label, onPress, avatar? }` and the Hub still draws them. `menu` is the masthead's round button signed in,
|
|
167
|
+
* `signedOutActions` the + on the signed-out page. */
|
|
168
|
+
menu,
|
|
169
|
+
signedOutActions,
|
|
161
170
|
...unknown
|
|
162
171
|
}) {
|
|
163
172
|
if (import.meta.env.DEV) warnUnknown(unknown)
|
|
@@ -224,10 +233,12 @@ export default function HubHome({
|
|
|
224
233
|
* the phone bar's More draws (MoreRows in `.kol-more-sheet`). The foot row it replaces was a row of buttons under the
|
|
225
234
|
* catalog, hence a bottom pad that read as a clipped last row. With the bar on a phone the bar's More carries both
|
|
226
235
|
* and the button hides below `md`; with the drawer it stays on every width. */
|
|
227
|
-
const
|
|
236
|
+
const baseActions = [
|
|
228
237
|
...(action ? [{ label: action.label, icon: 'plus', onPress: action.onClick }] : []),
|
|
229
238
|
...(steps.length ? [{ label: touring ? 'Close walkthrough' : 'Walkthrough', icon: 'book-open', onPress: () => setTouring((t) => !t) }] : []),
|
|
230
239
|
]
|
|
240
|
+
const menuDefaults = [...baseActions, ...(accountAction ? [accountAction] : [])]
|
|
241
|
+
const menuActions = typeof menu === 'function' ? menu(menuDefaults) ?? [] : menuDefaults
|
|
231
242
|
/* with the drawer the button stays on the phone, stepped left of the shell's drawer trigger (fixed top-right, 32 at 12;
|
|
232
243
|
* the variants gate caught the overlap on editor-hub at 390) */
|
|
233
244
|
const headerMenu = menuActions.length ? <HomeMenu actions={menuActions} className={actionsInBar ? 'max-md:hidden' : 'max-md:mr-11'} /> : undefined
|
|
@@ -245,7 +256,8 @@ export default function HubHome({
|
|
|
245
256
|
) : undefined
|
|
246
257
|
|
|
247
258
|
if (signedOut ?? (stage != null && files.length === 0)) {
|
|
248
|
-
const
|
|
259
|
+
const outDefaults = [...baseActions, ...(signInAction ? [signInAction] : [])]
|
|
260
|
+
const outActions = typeof signedOutActions === 'function' ? signedOutActions(outDefaults) ?? [] : outDefaults
|
|
249
261
|
return (
|
|
250
262
|
<div className="relative min-h-dvh overflow-hidden" data-hub-signed-out>
|
|
251
263
|
{stage && <div className="absolute inset-0" aria-hidden="true">{stage}</div>}
|
package/src/MoreSheet.jsx
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Button } from '@kolkrabbi/kol-component'
|
|
1
|
+
import { Avatar, Button } from '@kolkrabbi/kol-component'
|
|
2
2
|
import { Icon } from '@kolkrabbi/kol-icons'
|
|
3
3
|
|
|
4
4
|
/* taxonomy-ok: molecule — a column of nav Buttons */
|
|
@@ -9,7 +9,8 @@ import { Icon } from '@kolkrabbi/kol-icons'
|
|
|
9
9
|
* (user 2026-10-23: *"we could even make similar dropdown as we use in phone nav"*). The sheet's chrome is
|
|
10
10
|
* `.kol-more-sheet` — the pill's ground and hairline, a 24px rounding, 8px pad — on whatever box holds the rows.
|
|
11
11
|
*
|
|
12
|
-
* @param {Array} actions `[{ label, icon?, onPress, checked? }]` — the page's own buttons, first.
|
|
12
|
+
* @param {Array} actions `[{ label, icon?, avatar?, onPress, checked? }]` — the page's own buttons, first. `avatar` (a picture
|
|
13
|
+
* url — the account row) draws in the glyph's place. A row with `checked`
|
|
13
14
|
* (a pick list — TransportPill's loop lengths) draws the 22px check, or keeps its space when false
|
|
14
15
|
* @param {Array} items `[{ path, label, icon? }]` — destinations, after a divider's worth of nothing
|
|
15
16
|
* @param {string} active the item path that is current
|
|
@@ -21,7 +22,8 @@ export default function MoreRows({ actions = [], items = [], active, onPick, ite
|
|
|
21
22
|
const acts = (
|
|
22
23
|
<>
|
|
23
24
|
{actions.map((a) => (
|
|
24
|
-
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined ? a.icon : undefined} iconSize={22} className="w-full justify-start h-11 gap-3" onClick={() => { onPick?.(a); a.onPress?.() }}>
|
|
25
|
+
<Button key={a.label} variant="nav" size="lg" iconLeft={a.checked === undefined && !a.avatar ? a.icon : undefined} iconSize={22} className="w-full justify-start h-11 gap-3" onClick={() => { onPick?.(a); a.onPress?.() }}>
|
|
26
|
+
{a.avatar && <Avatar src={a.avatar} alt="" size="xs" />}
|
|
25
27
|
{a.checked !== undefined && (
|
|
26
28
|
<span className="inline-flex items-center justify-center shrink-0" style={{ width: 22, height: 22 }}>{a.checked && <Icon name="check" size={22} />}</span>
|
|
27
29
|
)}
|