@kolkrabbi/kol-shell 0.94.0 → 0.95.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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kolkrabbi/kol-shell",
3
- "version": "0.94.0",
3
+ "version": "0.95.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.321.0",
24
+ "@kolkrabbi/kol-framework": "^0.66.0",
25
+ "@kolkrabbi/kol-component": "^0.322.0",
25
26
  "@kolkrabbi/kol-icons": "^0.54.0",
26
- "@kolkrabbi/kol-theme": "^0.204.0",
27
- "@kolkrabbi/kol-framework": "^0.65.0"
27
+ "@kolkrabbi/kol-theme": "^0.205.0"
28
28
  },
29
29
  "files": [
30
30
  "src",
@@ -1,5 +1,5 @@
1
- import { useEffect, useState } from 'react'
2
- import { TabsRow, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass } from '@kolkrabbi/kol-component'
1
+ import { useCallback, useEffect, useState } from 'react'
2
+ import { TabsRow, TABBAR_H, TABBAR_PILL_H, TABBAR_PILL_INSET, tabbarPillWidth, tabbarPillSlot, floatSurfaceClass, usePopover, PopoverPanel } 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 */
@@ -62,8 +62,11 @@ import MoreRows from './MoreSheet.jsx'
62
62
  *
63
63
  * `dock` (PhoneNavDock, kol-fxr 2026-10-28, frame B2): the pill on a DESK — md and up, at the content's bottom-left (TabsRow
64
64
  * `dock`). An app shows it beside the rail, not instead of it. With `sheetItems` or `actions` it has a More (the Round 3
65
- * board, 2026-10-30: the signed-out desk has no rail, so ··· is the whole nav); its sheet opens above the pill, on its left
66
- * edge, and More turns to × while it is open.
65
+ * board, 2026-10-30: the signed-out desk has no rail, so ··· is the whole nav). ROUND 4 (HomeDockRound4, kol-fxr 2026-10-31 —
66
+ * user: *"I dont love this being disconnected"*): ··· is the pill's last slot, not its own circle, and opens a card BESIDE
67
+ * it the way HubHome's + opens its menu — the same `usePopover` + `PopoverPanel` card, right of the pill, bottom edges on
68
+ * one line, ··· lit while open (no × swap, no "Close"). Every dock slot lights on hover as a menu row does: the nav row's
69
+ * `--kol-oq-04` ground and `--kol-surface-on-primary` ink (`.kol-btn-nav`'s hover tokens).
67
70
  *
68
71
  * THE FLOAT (AppFloatNav, 2026-10-30):
69
72
  * @param {Array} items[].sub `[{ label, icon?, onPress }]` — a row that opens its own rows above its slot instead of
@@ -110,9 +113,14 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
110
113
  const activeShape = activeProp ?? preset.active
111
114
  const foldable = foldableProp ?? preset.foldable ?? false
112
115
  const dock = dockProp ?? preset.dock ?? false
113
- /* the dock keeps its pill whole: More turns to × in place (the board) */
116
+ /* the dock keeps its pill whole (the board); its ··· opens a card beside it (round 4) */
114
117
  const moreKeepsOpen = keepsOpenProp ?? preset.moreKeepsOpen ?? dock
115
118
  const [open, setOpen] = useState(false)
119
+ /* the dock's ··· card is the +'s (HubHome HomeMenu): a popover anchored to the ··· slot, which TabsRow draws */
120
+ const [moreEl, setMoreEl] = useState(null)
121
+ const findMore = useCallback((n) => setMoreEl(n?.querySelector('button[aria-label="More"]') ?? null), [])
122
+ /* offset: 12 off the pill — the slot sits 4 inside it; crossAxis drops the card's bottom to the pill's */
123
+ const morePop = usePopover({ open: dock && open, onOpenChange: setOpen, placement: 'right-end', offset: { mainAxis: 16, crossAxis: 4 }, click: false, referenceElement: moreEl })
116
124
  /* the row whose `sub` rows are open */
117
125
  const [sub, setSub] = useState(null)
118
126
  useEffect(() => { setOpen(false); setSub(null) }, [currentPath])
@@ -139,13 +147,14 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
139
147
  const tabs = inBar.map((i) => ({ value: key(i), label: i.label, icon: i.icon, selected: sub === key(i) || (i.selected ?? (moreKeepsOpen ? key(i) === active : undefined)) }))
140
148
  /* with the pill kept whole, the More slot itself turns to × while its sheet is open, and a press closes it
141
149
  * (PhonePillMoreTurnsToClose, kol-fxr 2026-10-28 — frame A2: *"[...] that makes a list and nav turns to (X)"*) */
142
- if (hasMore) tabs.push({ value: MORE, label: open && moreKeepsOpen ? 'Close' : 'More', icon: open && moreKeepsOpen ? 'x' : 'more', selected: moreKeepsOpen ? open : undefined })
150
+ const turnsToX = open && moreKeepsOpen && !dock
151
+ if (hasMore) tabs.push({ value: MORE, label: turnsToX ? 'Close' : 'More', icon: turnsToX ? 'x' : 'more', selected: moreKeepsOpen ? open : undefined })
143
152
  /* THE SHEET HUGS ITS WORDS AND SITS BESIDE THE × (user 2026-10-23, his reference: iOS Photos' menu next to its ×, *"but
144
153
  * align to bottom"*) — to the left of the collapsed ×, a 12px gap, the two bottom edges on one line */
145
154
  const pill = shape === 'pill'
146
155
  const top = pill && placement === 'top'
147
- /* ··· is its own circle on a pill (round 3) */
148
- const split = pill && hasMore
156
+ /* ··· is its own circle on a pill (round 3) — but inside the dock's pill (round 4) */
157
+ const split = pill && hasMore && !dock
149
158
  const geo = { count: tabs.length, labels, split }
150
159
  /* 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
160
  * slot's centre (`tabbarPillSlot`); the sheet stands 12 off the pill's face */
@@ -160,9 +169,7 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
160
169
  left: `${((at + 0.5) * 100) / tabs.length}%`, right: 'auto', transform: 'translateX(-50%)',
161
170
  bottom: `calc(env(safe-area-inset-bottom, 0px) + ${TABBAR_H + 8}px)`, width: 'max-content', minWidth: 220,
162
171
  })
163
- const sheetStyle = dock ? {
164
- left: pillLeft, right: 'auto', bottom: face, width: 'max-content', minWidth: 220, maxWidth: 'calc(100vw - 24px)',
165
- } : moreKeepsOpen && pill ? {
172
+ const sheetStyle = moreKeepsOpen && pill ? {
166
173
  /* the pill stays whole, so the sheet hangs off its right end, 12 off its face (frame E: below a top pill) */
167
174
  left: 'auto',
168
175
  right: `calc(50% - ${W / 2}px)`,
@@ -196,18 +203,26 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
196
203
  <MoreRows variant="float" actions={inBar.find((i) => key(i) === sub)?.sub} onPick={() => setSub(null)} />
197
204
  </div>
198
205
  )}
199
- {open && (
206
+ {open && !dock && (
200
207
  /* a BUTTON scrim — iOS does not bubble a tap from a div (OverlayScrimTapDismiss, 2026-09-01) */
201
208
  /* with `moreKeepsOpen` the panel under it stays in view: a clear scrim, a tap off the sheet still closes it */
202
209
  <button type="button" aria-label="Close more" className={`kol-phone-nav-scrim${moreKeepsOpen ? '' : ' kol-overlay-scrim'}`} onClick={() => setOpen(false)} />
203
210
  )}
204
- {open && (
211
+ {open && !dock && (
205
212
  <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}>
206
213
  {/* the nav, the page's actions, then the pinned foot (frame A2) */}
207
214
  <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) }} />
208
215
  {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) }} />}
209
216
  </div>
210
217
  )}
218
+ {dock && (
219
+ <PopoverPanel popover={morePop} panel={false} focus={false} className={`kol-more-sheet kol-more-sheet-float ${floatSurfaceClass(surface, true)}${menuBorder ? ' kol-more-sheet-bordered' : ''}`} style={{ minWidth: 220, maxWidth: 'calc(100vw - 24px)' }}>
220
+ <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) }} />
221
+ {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) }} />}
222
+ </PopoverPanel>
223
+ )}
224
+ {/* `contents` — no box; it only hands the ··· slot to the popover */}
225
+ <div className="contents" ref={dock ? findMore : undefined}>
211
226
  <TabsRow
212
227
  variant="stacked"
213
228
  placement="phone"
@@ -229,7 +244,10 @@ function FloatNav({ items = [], currentPath = '/', onNavigate, actions = [], sha
229
244
  tabs={tabs}
230
245
  value={value}
231
246
  onChange={press}
247
+ /* the dock's slots light like a menu row (round 4); `!` outranks the slot's inline ground and ink */
248
+ className={dock ? '[&_button:not([aria-current]):hover]:bg-[var(--kol-oq-04)]! [&_button:not([aria-current]):hover]:text-[var(--kol-surface-on-primary)]!' : undefined}
232
249
  />
250
+ </div>
233
251
  </>
234
252
  )
235
253
  }
package/src/HubHome.jsx CHANGED
@@ -158,8 +158,9 @@ export default function HubHome({
158
158
  signedOut,
159
159
  stage,
160
160
  chromes = [],
161
- /* what the signed-out dock, its ··· circle, its menus and the + are made of (HubHomeFloatSurface, kol-fxr 2026-10-31 —
162
- * *"we can see it first, but I think probably solid"*): AppFloatNav's `solid · glass-dark · glass-light`; solid is today's */
161
+ /* what the signed-out dock and its menus (the +'s included) are made of (HubHomeFloatSurface, kol-fxr 2026-10-31 —
162
+ * *"we can see it first, but I think probably solid"*): AppFloatNav's `solid · glass-dark · glass-light`; solid is today's.
163
+ * The + itself stays the inverted round button on every surface (HomeDockRound4) */
163
164
  surface = 'solid',
164
165
  signInAction,
165
166
  /* AppHub's: the signed-in account row (HomeMenuAccountRow, kol-fxr 2026-10-29 — *"here is supposed to be user space as
@@ -353,8 +354,9 @@ function HomeMenu({ actions, icon = 'more', variant, surface = 'solid', classNam
353
354
  <div className={className}>
354
355
  <span ref={popover.refs.setReference} {...popover.getReferenceProps()} className="inline-flex">
355
356
  {/* `icon` — `more` on Home, `plus` signed out (frame B2), the × while its sheet is open */}
356
- {/* solid keeps the inverted round button; a glass is the float's material, as the dock's circle (HubHomeFloatSurface) */}
357
- <Button iconOnly={icon === 'more' ? 'more' : open ? 'x' : icon} size="lg" tone={surface === 'solid' ? 'inverted' : 'ghost'} radius="full" className={surface === 'solid' ? '' : floatSurfaceClass(surface)} aria-label={open ? 'Close' : 'Actions'} pressed={open} />
357
+ {/* always the inverted round button — `surface` dresses its menu only (HomeDockRound4, kol-fxr 2026-10-31 — user: *"this
358
+ * also changed the action button, but it is not supposed to change"*) */}
359
+ <Button iconOnly={icon === 'more' ? 'more' : open ? 'x' : icon} size="lg" tone="inverted" radius="full" aria-label={open ? 'Close' : 'Actions'} pressed={open} />
358
360
  </span>
359
361
  <PopoverPanel popover={popover} panel={false} className={`kol-more-sheet${variant === 'float' ? ` kol-more-sheet-float ${floatSurfaceClass(surface, true)}` : ''}`} style={{ minWidth: 220 }}>
360
362
  <MoreRows actions={actions} variant={variant} onPick={() => setOpen(false)} />