@justanarthur/modo-ui 2.7.0 → 2.8.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.
Files changed (150) hide show
  1. package/blocks/desktop-shell/examples.mdx +40 -0
  2. package/blocks/desktop-shell/index.tsx +141 -8
  3. package/dist/blocks/desktop-shell/index.d.ts +15 -2
  4. package/dist/blocks/desktop-shell/index.js +23 -23
  5. package/dist/blocks/shell-card/index.js +3 -3
  6. package/dist/blocks/sidebar-app/index.js +33 -33
  7. package/dist/components/actions/button/index.js +3 -3
  8. package/dist/components/actions/button-group/index.js +23 -23
  9. package/dist/components/actions/copy/index.js +8 -8
  10. package/dist/components/containers/accordion/index.js +10 -10
  11. package/dist/components/containers/card/index.js +12 -12
  12. package/dist/components/data-display/avatar/index.js +4 -4
  13. package/dist/components/data-display/badge/index.js +3 -3
  14. package/dist/components/data-display/diff/index.js +4 -4
  15. package/dist/components/data-display/log-view/index.js +7 -7
  16. package/dist/components/data-display/markdown/index.js +11 -11
  17. package/dist/components/data-display/table/index.js +5 -5
  18. package/dist/components/feedback/empty-state/index.js +3 -3
  19. package/dist/components/feedback/meter/index.js +2 -2
  20. package/dist/components/feedback/progress/index.js +2 -2
  21. package/dist/components/feedback/status-dot/index.js +2 -2
  22. package/dist/components/inputs/checkbox/index.js +7 -7
  23. package/dist/components/inputs/choice-list/index.js +4 -4
  24. package/dist/components/inputs/color-picker/index.js +16 -16
  25. package/dist/components/inputs/combobox/index.js +15 -15
  26. package/dist/components/inputs/date-time/calendar/index.js +5 -5
  27. package/dist/components/inputs/date-time/date-picker/index.js +23 -23
  28. package/dist/components/inputs/date-time/date-range-picker/index.js +23 -23
  29. package/dist/components/inputs/date-time/duration-picker/index.js +22 -22
  30. package/dist/components/inputs/date-time/month-picker/index.js +21 -21
  31. package/dist/components/inputs/date-time/time-picker/index.js +22 -22
  32. package/dist/components/inputs/editable-text/index.js +4 -4
  33. package/dist/components/inputs/field/index.js +5 -5
  34. package/dist/components/inputs/file-dropzone/index.js +8 -8
  35. package/dist/components/inputs/input/index.js +6 -6
  36. package/dist/components/inputs/key-value/index.js +13 -13
  37. package/dist/components/inputs/number-input/index.js +8 -8
  38. package/dist/components/inputs/radio/index.js +5 -5
  39. package/dist/components/inputs/search/index.js +18 -18
  40. package/dist/components/inputs/select/index.js +16 -16
  41. package/dist/components/inputs/slider/index.js +4 -4
  42. package/dist/components/inputs/switch/index.js +5 -5
  43. package/dist/components/inputs/textarea/index.js +5 -5
  44. package/dist/components/navigation/breadcrumb/index.js +20 -20
  45. package/dist/components/navigation/navigation-menu/index.js +11 -11
  46. package/dist/components/navigation/pagination/index.js +14 -14
  47. package/dist/components/navigation/sidebar/index.js +21 -21
  48. package/dist/components/navigation/tabs/index.js +6 -6
  49. package/dist/components/navigation/tree/index.js +5 -5
  50. package/dist/components/overlays/alert-dialog/index.js +12 -12
  51. package/dist/components/overlays/command/index.js +16 -16
  52. package/dist/components/overlays/context-menu/index.js +20 -20
  53. package/dist/components/overlays/dialog/index.js +11 -11
  54. package/dist/components/overlays/dropdown/index.js +19 -19
  55. package/dist/components/overlays/lightbox/index.js +9 -9
  56. package/dist/components/overlays/popover/index.js +6 -6
  57. package/dist/components/overlays/preview-card/index.js +6 -6
  58. package/dist/components/overlays/sheet/index.js +12 -12
  59. package/dist/components/overlays/toast/index.js +8 -8
  60. package/dist/components/overlays/tooltip/index.js +3 -3
  61. package/dist/docs/index.js +10 -10
  62. package/dist/index.d.ts +15 -2
  63. package/dist/index.js +72 -72
  64. package/dist/lib/field-box.js +3 -3
  65. package/dist/lib/overlay.js +2 -2
  66. package/dist/lib/popup-rows.js +2 -2
  67. package/dist/lib/popup-surface.js +3 -3
  68. package/dist/lib/scroll-column.js +3 -3
  69. package/dist/primitives/content/code/index.js +3 -3
  70. package/dist/primitives/content/skeleton/index.js +3 -3
  71. package/dist/primitives/layout/resizable/index.js +2 -2
  72. package/dist/primitives/layout/sortable/index.js +5 -5
  73. package/dist/primitives/systems/craft/index.js +4 -4
  74. package/dist/primitives/systems/fluid-hover/index.js +2 -2
  75. package/dist/primitives/systems/morph/index.js +8 -8
  76. package/dist/primitives/systems/motion/index.js +5 -5
  77. package/dist/shared/{components-d2g9eqvc.js → components-0v4jxw7z.js} +2 -2
  78. package/dist/shared/{components-kakwfp1e.js → components-1f5624hb.js} +1 -1
  79. package/dist/shared/{components-4e75p7kh.js → components-1qw8hqwq.js} +2 -2
  80. package/dist/shared/{components-vv9m9h0q.js → components-2e77rzb8.js} +1 -1
  81. package/dist/shared/{components-dz05031c.js → components-3qcgeay1.js} +2 -2
  82. package/dist/shared/{components-n9qea1d1.js → components-3rt5c1qt.js} +1 -1
  83. package/dist/shared/{components-hf63wka1.js → components-3sb31vw5.js} +1 -1
  84. package/dist/shared/{components-dw1s0b46.js → components-4fay97sm.js} +2 -2
  85. package/dist/shared/{components-zfntvdd3.js → components-4fhjk3jz.js} +2 -2
  86. package/dist/shared/{components-gmmht6k5.js → components-7rn454aq.js} +1 -1
  87. package/dist/shared/{components-c5p6yy1m.js → components-8m5e493q.js} +1 -1
  88. package/dist/shared/{components-xe82mrwa.js → components-8swhfkqn.js} +1 -1
  89. package/dist/shared/{components-vhq03vx2.js → components-94vd4ck1.js} +3 -3
  90. package/dist/shared/{components-0vhacjrk.js → components-9am5511q.js} +3 -3
  91. package/dist/shared/{components-m78c04dv.js → components-9c3m65ft.js} +3 -3
  92. package/dist/shared/{components-8kkkrf36.js → components-9yrajpy0.js} +2 -2
  93. package/dist/shared/{components-1ck8ct1k.js → components-a8bcq2yc.js} +4 -4
  94. package/dist/shared/{components-4qfzzdvj.js → components-abqfs5fh.js} +1 -1
  95. package/dist/shared/{components-wvxkfhdc.js → components-ac0x7zpq.js} +3 -3
  96. package/dist/shared/{components-fekj7940.js → components-af44r4y9.js} +1 -1
  97. package/dist/shared/{components-mpeg6ca5.js → components-bkg1k36x.js} +3 -3
  98. package/dist/shared/{components-crjcbqrc.js → components-br6t88cb.js} +3 -3
  99. package/dist/shared/{components-pj564a3b.js → components-d4gkhy26.js} +1 -1
  100. package/dist/shared/{components-4dk61qbj.js → components-dk328yn5.js} +118 -15
  101. package/dist/shared/{components-f69fp3t5.js → components-faym1xm6.js} +4 -4
  102. package/dist/shared/{components-kek98pf2.js → components-fnvkq52e.js} +5 -5
  103. package/dist/shared/{components-1t36jzn1.js → components-fpgfs01m.js} +1 -1
  104. package/dist/shared/{components-ee3zdrza.js → components-ftvy33w9.js} +1 -1
  105. package/dist/shared/{components-7phx24n6.js → components-fzmjcn38.js} +1 -1
  106. package/dist/shared/{components-z3wpmrpm.js → components-gd8gmr6w.js} +1 -1
  107. package/dist/shared/{components-ad7h5kmx.js → components-gzve0nkp.js} +7 -7
  108. package/dist/shared/{components-y84j8rjq.js → components-hjk6dwsp.js} +2 -2
  109. package/dist/shared/{components-mcxrkm27.js → components-mb80a9wg.js} +2 -2
  110. package/dist/shared/{components-wtvf17hc.js → components-qrtcc8aw.js} +4 -4
  111. package/dist/shared/{components-1dn3m7pk.js → components-rr3fa4e5.js} +2 -2
  112. package/dist/shared/{components-wb1a41ry.js → components-s0c8gngv.js} +2 -2
  113. package/dist/shared/{components-1zmyane5.js → components-s2pnh8h9.js} +1 -1
  114. package/dist/shared/{components-zzhq9dqb.js → components-t4j0r23n.js} +3 -3
  115. package/dist/shared/{components-rtbme03d.js → components-whfr55xn.js} +6 -6
  116. package/dist/shared/{components-z6nq4z0y.js → components-y9se9mx5.js} +3 -3
  117. package/dist/shared/{components-sas7m9kx.js → components-yfx0skxc.js} +2 -2
  118. package/dist/shared/{components-aa77h13m.js → components-z6wx8fzj.js} +2 -2
  119. package/dist/shared/{components-4xwf317r.js → components-zjeh9zk2.js} +2 -2
  120. package/dist/shared/{components-gpbavh9r.js → components-zv63s4fh.js} +1 -1
  121. package/dist/styles.css +28 -15
  122. package/package.json +1 -1
  123. /package/dist/shared/{components-a8bwyrxf.js → components-1hb27y2e.js} +0 -0
  124. /package/dist/shared/{components-ytqnnpab.js → components-1ztgy933.js} +0 -0
  125. /package/dist/shared/{components-jt66rs4y.js → components-3fg6vabb.js} +0 -0
  126. /package/dist/shared/{components-c2whzzwm.js → components-4m9stj7d.js} +0 -0
  127. /package/dist/shared/{components-wkszeber.js → components-4t2cjav8.js} +0 -0
  128. /package/dist/shared/{components-36x1fh6f.js → components-5xs8pkkj.js} +0 -0
  129. /package/dist/shared/{components-0qq4624z.js → components-60tf8tfa.js} +0 -0
  130. /package/dist/shared/{components-w3sey99z.js → components-895m1f3s.js} +0 -0
  131. /package/dist/shared/{components-w82bvqz6.js → components-8nnhzeb3.js} +0 -0
  132. /package/dist/shared/{components-gbcv8gwc.js → components-92mvpt9h.js} +0 -0
  133. /package/dist/shared/{components-485sbcf9.js → components-arg4h26d.js} +0 -0
  134. /package/dist/shared/{components-v2jc17ge.js → components-dx8f797z.js} +0 -0
  135. /package/dist/shared/{components-ez2psjey.js → components-fbs2602j.js} +0 -0
  136. /package/dist/shared/{components-jh0g2xr9.js → components-ft5dgjg6.js} +0 -0
  137. /package/dist/shared/{components-abm5e6pc.js → components-fymenepq.js} +0 -0
  138. /package/dist/shared/{components-q0qv0fen.js → components-hh1g7r3t.js} +0 -0
  139. /package/dist/shared/{components-4twh6d53.js → components-jw45ck66.js} +0 -0
  140. /package/dist/shared/{components-yb3rnzsc.js → components-knryyjme.js} +0 -0
  141. /package/dist/shared/{components-46zfd71x.js → components-nmbcfwx8.js} +0 -0
  142. /package/dist/shared/{components-a11ssex6.js → components-nxqrw789.js} +0 -0
  143. /package/dist/shared/{components-rkcqr15c.js → components-q0hs5rqn.js} +0 -0
  144. /package/dist/shared/{components-9mgb07je.js → components-qqm2y2cx.js} +0 -0
  145. /package/dist/shared/{components-s3ey5xrk.js → components-s4x951hj.js} +0 -0
  146. /package/dist/shared/{components-h9rgvt1w.js → components-swh0v27s.js} +0 -0
  147. /package/dist/shared/{components-kvbh10e4.js → components-vcmky8ns.js} +0 -0
  148. /package/dist/shared/{components-rtkrpv3p.js → components-ycwhrqe1.js} +0 -0
  149. /package/dist/shared/{components-kq3s7p1d.js → components-ymq8tbq9.js} +0 -0
  150. /package/dist/shared/{components-0mmjd6dt.js → components-zckgawt6.js} +0 -0
@@ -92,6 +92,46 @@ With `titleBar="card"` nothing runs across the window: the traffic lights and th
92
92
  </div>
93
93
  </div>
94
94
 
95
+ # Folded sidebar
96
+
97
+ The sidebar starts folded. Hover the window's left edge or the sidebar toggle and it peeks: it slides in over the main card, which doesn't move, and folds back a beat after the pointer leaves; focus inside keeps it open. Click the toggle to pin it. The traffic lights, the toggle and the title share one centre line; `peek={false}` turns the peek off.
98
+
99
+ <div className="w-full overflow-x-auto">
100
+ <div className="h-[560px] w-[960px] overflow-hidden rounded-xl border border-border">
101
+ <DesktopShell
102
+ showControls
103
+ titleBar="card"
104
+ defaultLeftOpen={false}
105
+ title={<span className="truncate text-body weight-medium text-foreground">Businesses</span>}
106
+ trailing={
107
+ <Button variant="ghost" size="icon-compact" aria-label="Search">
108
+ <Search />
109
+ </Button>
110
+ }
111
+ left={
112
+ <Sidebar variant="inset" defaultValue="inbox">
113
+ <Sidebar.Content>
114
+ <Sidebar.Group>
115
+ <Sidebar.GroupLabel>Library</Sidebar.GroupLabel>
116
+ <Sidebar.Menu>
117
+ <Sidebar.MenuItem><Sidebar.MenuButton icon={Inbox} value="inbox">Inbox</Sidebar.MenuButton></Sidebar.MenuItem>
118
+ <Sidebar.MenuItem><Sidebar.MenuButton icon={Star} value="starred">Starred</Sidebar.MenuButton></Sidebar.MenuItem>
119
+ <Sidebar.MenuItem><Sidebar.MenuButton icon={Folder} value="projects">Projects</Sidebar.MenuButton></Sidebar.MenuItem>
120
+ </Sidebar.Menu>
121
+ </Sidebar.Group>
122
+ </Sidebar.Content>
123
+ </Sidebar>
124
+ }
125
+ main={
126
+ <div className="flex flex-1 flex-col gap-2 p-6">
127
+ <span className="text-title text-foreground">Businesses</span>
128
+ <span className="text-body text-muted-foreground">The peek floats over this card instead of pushing it aside.</span>
129
+ </div>
130
+ }
131
+ />
132
+ </div>
133
+ </div>
134
+
95
135
  # Windows and Linux
96
136
 
97
137
  Off macOS the title bar starts at the edge; the stand-in window controls sit at its end. Here the side pane starts folded and there is no left sidebar.
@@ -6,7 +6,17 @@
6
6
 
7
7
  'use client'
8
8
 
9
- import { type ReactNode, useCallback, useLayoutEffect, useMemo, useRef, useState } from 'react'
9
+ import {
10
+ type FocusEvent,
11
+ type PointerEvent,
12
+ type ReactNode,
13
+ useCallback,
14
+ useEffect,
15
+ useLayoutEffect,
16
+ useMemo,
17
+ useRef,
18
+ useState,
19
+ } from 'react'
10
20
  import Button from '../../components/actions/button'
11
21
  import Sidebar from '../../components/navigation/sidebar'
12
22
  import { useSidebarShortcut } from '../../components/navigation/sidebar/sidebar-shortcut'
@@ -41,6 +51,25 @@ const CORNER_ROOM: Record<DesktopPlatform, string> = {
41
51
  linux: 'w-6 shrink-0',
42
52
  }
43
53
 
54
+ // While it peeks, the folded sidebar floats over the main card, on the card's own 8px inset, instead of reflowing it.
55
+ // The panel's side padding is that inset; it also leaves the shadow room inside the sidebar's clip.
56
+ const PEEK_OVERLAY =
57
+ '[&>[data-slot=sidebar]]:absolute [&>[data-slot=sidebar]]:inset-y-0 [&>[data-slot=sidebar]]:left-0 [&>[data-slot=sidebar]]:z-10 [&>[data-slot=sidebar]>div]:px-2 [&>[data-slot=sidebar]_[data-sidebar=sidebar]]:shadow-surface-3'
58
+ const PEEK_BG: Record<number, string> = {
59
+ 4: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:bg-surface-4',
60
+ 5: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:bg-surface-5',
61
+ 6: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:bg-surface-6',
62
+ 7: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:bg-surface-7',
63
+ 8: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:bg-surface-8',
64
+ }
65
+ const PEEK_RADIUS = {
66
+ rounded: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:rounded-xl',
67
+ pill: '[&>[data-slot=sidebar]_[data-sidebar=sidebar]]:rounded-3xl',
68
+ }
69
+
70
+ // The peek folds back this long after the pointer leaves, like Sidebar's open on hover.
71
+ const PEEK_CLOSE_MS = 300
72
+
44
73
  // Below this window width the side pane takes the main card's place.
45
74
  const NARROW = 768
46
75
 
@@ -71,6 +100,8 @@ interface DesktopShellProps {
71
100
  defaultLeftOpen?: boolean
72
101
  /** Called when the left sidebar opens or folds. */
73
102
  onLeftOpenChange?: (open: boolean) => void
103
+ /** While the left sidebar is folded, hovering the window's left edge or the sidebar toggle slides it in over the main card without reflowing it; it folds back a beat after the pointer leaves, and stays while focus is inside it. Defaults to `true`. */
104
+ peek?: boolean
74
105
  /** Controlled open state of the side pane. */
75
106
  rightOpen?: boolean
76
107
  /** The side pane's open state at first. Defaults to `true`. */
@@ -148,6 +179,64 @@ function WindowControls() {
148
179
  )
149
180
  }
150
181
 
182
+ /**
183
+ * The folded sidebar's peek. Zones (`data-peek`) are the edge strip, the
184
+ * toggle, the corner and the sidebar: entering an opening one (the strip,
185
+ * the toggle) with a mouse peeks; leaving for anything that isn't a zone
186
+ * folds it back after `PEEK_CLOSE_MS`, unless focus is inside the sidebar.
187
+ */
188
+ function usePeek(enabled: boolean) {
189
+ const [open, setOpen] = useState(false)
190
+ // The last opening was a peek: the sidebar stays out of flow until it is pinned, so folding back never reflows the card.
191
+ const [overlay, setOverlay] = useState(false)
192
+ const sidebar = useRef<HTMLDivElement | null>(null)
193
+ const over = useRef(false)
194
+ const timer = useRef<ReturnType<typeof setTimeout>>()
195
+
196
+ useEffect(() => {
197
+ if (enabled) return
198
+ clearTimeout(timer.current)
199
+ setOpen(false)
200
+ setOverlay(false)
201
+ }, [enabled])
202
+ useEffect(() => () => clearTimeout(timer.current), [])
203
+
204
+ const close = () => {
205
+ clearTimeout(timer.current)
206
+ timer.current = setTimeout(() => {
207
+ if (!over.current && !sidebar.current?.contains(document.activeElement)) setOpen(false)
208
+ }, PEEK_CLOSE_MS)
209
+ }
210
+ const zone = (opens: boolean) => ({
211
+ 'data-peek': '',
212
+ onPointerEnter: (event: PointerEvent) => {
213
+ over.current = true
214
+ clearTimeout(timer.current)
215
+ if (!opens || !enabled || event.pointerType !== 'mouse') return
216
+ setOpen(true)
217
+ setOverlay(true)
218
+ },
219
+ onPointerLeave: (event: PointerEvent) => {
220
+ if (event.relatedTarget instanceof Element && event.relatedTarget.closest('[data-peek]')) return
221
+ over.current = false
222
+ close()
223
+ },
224
+ })
225
+ const onBlur = (event: FocusEvent) => {
226
+ if (!(event.relatedTarget instanceof Node && event.currentTarget.contains(event.relatedTarget))) close()
227
+ }
228
+
229
+ return {
230
+ enabled,
231
+ open: enabled && open,
232
+ overlay: enabled && overlay,
233
+ dismiss: () => setOpen(false),
234
+ sidebar,
235
+ zone,
236
+ onBlur,
237
+ }
238
+ }
239
+
151
240
  /** The main region: an inset card two surface levels up, like Sidebar.Inset. */
152
241
  function MainCard({ children }: { children: ReactNode }) {
153
242
  const level = useLift(2)
@@ -183,7 +272,18 @@ function MainCard({ children }: { children: ReactNode }) {
183
272
  * sidebar's content starts below them), and the title, `trailing` and the
184
273
  * side pane toggle head the main card, which drags the window too. With the
185
274
  * sidebar folded, the corner controls stay put and the card's header makes
186
- * room for them.
275
+ * room for them. The corner sits on the card's 8px inset, so the window
276
+ * controls, the toggle and the title share one centre line, 26px from the
277
+ * window's top (22px compact). A native macOS window must put its traffic
278
+ * lights on that line too: with an overlay title bar, set the window's traffic
279
+ * light position (Tauri's `trafficLightPosition`) so they centre there,
280
+ * inside the 72px the corner keeps for them.
281
+ *
282
+ * While the sidebar is folded, hovering the window's left edge or the sidebar
283
+ * toggle peeks it: it slides in over the main card as a card of its own,
284
+ * without reflowing it, stays while the pointer is over it or focus is inside
285
+ * it, and folds back a beat after the pointer leaves. Clicking the toggle
286
+ * pins it open. `peek={false}` turns it off.
187
287
  *
188
288
  * Under it, the main content is an inset card. The left Sidebar is yours
189
289
  * (`left`): it resizes from its rail and folds from its toggle, its rail or
@@ -211,6 +311,7 @@ export default function DesktopShell({
211
311
  leftOpen: leftOpenProp,
212
312
  defaultLeftOpen = true,
213
313
  onLeftOpenChange,
314
+ peek = true,
214
315
  rightOpen: rightOpenProp,
215
316
  defaultRightOpen = true,
216
317
  onRightOpenChange,
@@ -229,6 +330,10 @@ export default function DesktopShell({
229
330
  const hasRight = right !== undefined
230
331
  const paneOpen = hasRight && rightOpen
231
332
  const inCard = titleBar === 'card'
333
+ const shape = useShape()
334
+ const substrate = useLift(0)
335
+ const peekLevel = useLift(3)
336
+ const peeking = usePeek(peek && hasLeft && !leftOpen)
232
337
  const paneSizes = useMemo(() => (paneOpen ? [100 - paneSize, paneSize] : [100, 0]), [paneOpen, paneSize])
233
338
 
234
339
  // The window's own width, not the viewport's: a framed or resized window doesn't follow the viewport.
@@ -259,7 +364,11 @@ export default function DesktopShell({
259
364
  {showControls && <TrafficLights />}
260
365
  </div>
261
366
  )}
262
- {hasLeft && <Toggle side="left" label={leftLabel} open={leftOpen} onClick={() => setLeftOpen(!leftOpen)} />}
367
+ {hasLeft && (
368
+ <span className="contents" {...peeking.zone(true)}>
369
+ <Toggle side="left" label={leftLabel} open={leftOpen} onClick={() => setLeftOpen(!leftOpen)} />
370
+ </span>
371
+ )}
263
372
  {leading}
264
373
  </>
265
374
  )
@@ -294,7 +403,8 @@ export default function DesktopShell({
294
403
  <div ref={root} className={cn('relative flex h-full w-full flex-col bg-background', className)}>
295
404
  <SizeProvider size={size.variant}>
296
405
  {inCard ? (
297
- <div data-tauri-drag-region className={cn(bar, 'absolute top-0 left-0 z-20')}>
406
+ // On the card's 8px inset, so the corner and the card's header share one centre line.
407
+ <div data-tauri-drag-region className={cn(bar, 'absolute top-2 left-0 z-20')} {...peeking.zone(false)}>
298
408
  {corner}
299
409
  </div>
300
410
  ) : (
@@ -306,14 +416,37 @@ export default function DesktopShell({
306
416
  </SizeProvider>
307
417
  {/* Sidebar defaults to the viewport's height; under the title bar it takes the body's. */}
308
418
  <Sidebar.Provider
309
- className={cn('min-h-0 flex-1 [&>[data-slot=sidebar]]:h-full', inCard && CORNER_CLEARANCE[size.variant])}
419
+ className="min-h-0 flex-1"
310
420
  persist={false}
311
421
  mobileBreakpoint={0}
312
422
  shortcut={hasLeft ? undefined : null}
313
- open={leftOpen}
314
- onOpenChange={setLeftOpen}
423
+ open={leftOpen || peeking.open}
424
+ onOpenChange={open => {
425
+ // `[` or the rail folds a peek; only the toggle pins it.
426
+ if (!open) peeking.dismiss()
427
+ setLeftOpen(open)
428
+ }}
315
429
  >
316
- {left}
430
+ {peeking.enabled && <div className="absolute inset-y-0 left-0 z-10 w-2" {...peeking.zone(true)} />}
431
+ <SurfaceProvider value={peeking.overlay ? peekLevel : substrate}>
432
+ {/* biome-ignore lint/a11y/noStaticElementInteractions: it only watches focus leaving the sidebar; the controls inside are the focusable ones. */}
433
+ <div
434
+ ref={peeking.sidebar}
435
+ className={cn(
436
+ 'contents [&>[data-slot=sidebar]]:h-full',
437
+ inCard && CORNER_CLEARANCE[size.variant],
438
+ peeking.overlay && [
439
+ PEEK_OVERLAY,
440
+ PEEK_BG[peekLevel],
441
+ PEEK_RADIUS[shape.bgRadius >= 20 ? 'pill' : 'rounded'],
442
+ ],
443
+ )}
444
+ onBlur={peeking.onBlur}
445
+ {...peeking.zone(false)}
446
+ >
447
+ {left}
448
+ </div>
449
+ </SurfaceProvider>
317
450
  {/* Flush with an open sidebar (its rows bring their own gutter), 8px from the window edge once it folds. */}
318
451
  <div
319
452
  className={cn(
@@ -31,6 +31,8 @@ interface DesktopShellProps {
31
31
  defaultLeftOpen?: boolean;
32
32
  /** Called when the left sidebar opens or folds. */
33
33
  onLeftOpenChange?: (open: boolean) => void;
34
+ /** While the left sidebar is folded, hovering the window's left edge or the sidebar toggle slides it in over the main card without reflowing it; it folds back a beat after the pointer leaves, and stays while focus is inside it. Defaults to `true`. */
35
+ peek?: boolean;
34
36
  /** Controlled open state of the side pane. */
35
37
  rightOpen?: boolean;
36
38
  /** The side pane's open state at first. Defaults to `true`. */
@@ -66,7 +68,18 @@ type Element_12xgc = JSX_1kxb["Element"];
66
68
  * sidebar's content starts below them), and the title, `trailing` and the
67
69
  * side pane toggle head the main card, which drags the window too. With the
68
70
  * sidebar folded, the corner controls stay put and the card's header makes
69
- * room for them.
71
+ * room for them. The corner sits on the card's 8px inset, so the window
72
+ * controls, the toggle and the title share one centre line, 26px from the
73
+ * window's top (22px compact). A native macOS window must put its traffic
74
+ * lights on that line too: with an overlay title bar, set the window's traffic
75
+ * light position (Tauri's `trafficLightPosition`) so they centre there,
76
+ * inside the 72px the corner keeps for them.
77
+ *
78
+ * While the sidebar is folded, hovering the window's left edge or the sidebar
79
+ * toggle peeks it: it slides in over the main card as a card of its own,
80
+ * without reflowing it, stays while the pointer is over it or focus is inside
81
+ * it, and folds back a beat after the pointer leaves. Clicking the toggle
82
+ * pins it open. `peek={false}` turns it off.
70
83
  *
71
84
  * Under it, the main content is an inset card. The left Sidebar is yours
72
85
  * (`left`): it resizes from its rail and folds from its toggle, its rail or
@@ -80,5 +93,5 @@ type Element_12xgc = JSX_1kxb["Element"];
80
93
  *
81
94
  * @example {@include ./examples.mdx}
82
95
  */
83
- declare function DesktopShell({ platform, showControls, titleBar, size: sizeProp, title, leading, trailing, left, right, main, leftOpen: leftOpenProp, defaultLeftOpen, onLeftOpenChange, rightOpen: rightOpenProp, defaultRightOpen, onRightOpenChange, defaultPaneSize, minPaneSize, maxPaneSize, leftLabel, rightLabel, className }: DesktopShellProps): Element_12xgc;
96
+ declare function DesktopShell({ platform, showControls, titleBar, size: sizeProp, title, leading, trailing, left, right, main, leftOpen: leftOpenProp, defaultLeftOpen, onLeftOpenChange, peek, rightOpen: rightOpenProp, defaultRightOpen, onRightOpenChange, defaultPaneSize, minPaneSize, maxPaneSize, leftLabel, rightLabel, className }: DesktopShellProps): Element_12xgc;
84
97
  export { DesktopPlatform, DesktopShell, DesktopShellProps, DesktopTitleBar, DesktopShell as default };
@@ -1,44 +1,44 @@
1
1
  import {
2
2
  DesktopShell2
3
- } from "../../shared/components-4dk61qbj.js";
4
- import"../../shared/components-mpeg6ca5.js";
3
+ } from "../../shared/components-dk328yn5.js";
4
+ import"../../shared/components-bkg1k36x.js";
5
5
  import"../../shared/components-2myjk2zf.js";
6
+ import"../../shared/components-7rn454aq.js";
6
7
  import"../../shared/components-8wp8d8q1.js";
7
- import"../../shared/components-grxgqa75.js";
8
- import"../../shared/components-y09nr7fe.js";
9
- import"../../shared/components-5wykqxph.js";
10
- import"../../shared/components-ez2psjey.js";
11
- import"../../shared/components-5fet4gqt.js";
12
- import"../../shared/components-6f5pyzb2.js";
13
- import"../../shared/components-v2j3jx89.js";
14
- import"../../shared/components-wvxkfhdc.js";
15
- import"../../shared/components-crjcbqrc.js";
16
- import"../../shared/components-a11ssex6.js";
17
- import"../../shared/components-jnhpgpfk.js";
18
- import"../../shared/components-gmmht6k5.js";
19
- import"../../shared/components-jh0g2xr9.js";
8
+ import"../../shared/components-ac0x7zpq.js";
9
+ import"../../shared/components-br6t88cb.js";
10
+ import"../../shared/components-nxqrw789.js";
11
+ import"../../shared/components-ft5dgjg6.js";
20
12
  import"../../shared/components-wq9hrera.js";
21
13
  import"../../shared/components-pa43g2r2.js";
14
+ import"../../shared/components-ycwhrqe1.js";
15
+ import"../../shared/components-ywgqahmg.js";
16
+ import"../../shared/components-3hgk57s0.js";
17
+ import"../../shared/components-y09nr7fe.js";
18
+ import"../../shared/components-5wykqxph.js";
22
19
  import"../../shared/components-9b2m90st.js";
23
20
  import"../../shared/components-bxqmbcz2.js";
24
21
  import"../../shared/components-21hcwp85.js";
25
22
  import"../../shared/components-8pnvkrbw.js";
26
23
  import"../../shared/components-pva1wj1r.js";
27
- import"../../shared/components-nz14rwtd.js";
28
- import"../../shared/components-rtkrpv3p.js";
29
- import"../../shared/components-ywgqahmg.js";
30
- import"../../shared/components-3hgk57s0.js";
24
+ import"../../shared/components-grxgqa75.js";
31
25
  import"../../shared/components-7wjkag2j.js";
26
+ import"../../shared/components-nz14rwtd.js";
32
27
  import"../../shared/components-bkwjvvkh.js";
33
- import"../../shared/components-wwd093xg.js";
28
+ import"../../shared/components-fbs2602j.js";
29
+ import"../../shared/components-jnhpgpfk.js";
34
30
  import"../../shared/components-45r18egt.js";
35
- import"../../shared/components-tz0axc0f.js";
36
- import"../../shared/components-kxpcj2ry.js";
37
- import"../../shared/components-s217vq1n.js";
31
+ import"../../shared/components-wwd093xg.js";
38
32
  import"../../shared/components-znspksk0.js";
39
33
  import"../../shared/components-ew4wq7mj.js";
34
+ import"../../shared/components-tz0axc0f.js";
40
35
  import"../../shared/components-ceyn28cf.js";
41
36
  import"../../shared/components-nwa2a9tq.js";
37
+ import"../../shared/components-5fet4gqt.js";
38
+ import"../../shared/components-6f5pyzb2.js";
39
+ import"../../shared/components-v2j3jx89.js";
40
+ import"../../shared/components-kxpcj2ry.js";
41
+ import"../../shared/components-s217vq1n.js";
42
42
  import"../../shared/components-xnp09586.js";
43
43
  export {
44
44
  DesktopShell2 as DesktopShell,
@@ -1,11 +1,11 @@
1
1
  import {
2
2
  ShellCard2,
3
3
  shell_card_default
4
- } from "../../shared/components-q0qv0fen.js";
5
- import"../../shared/components-kxpcj2ry.js";
6
- import"../../shared/components-s217vq1n.js";
4
+ } from "../../shared/components-hh1g7r3t.js";
7
5
  import"../../shared/components-ceyn28cf.js";
8
6
  import"../../shared/components-nwa2a9tq.js";
7
+ import"../../shared/components-kxpcj2ry.js";
8
+ import"../../shared/components-s217vq1n.js";
9
9
  import"../../shared/components-xnp09586.js";
10
10
  export {
11
11
  ShellCard2 as ShellCard,
@@ -2,56 +2,56 @@ import {
2
2
  SidebarInsetTopbar2,
3
3
  SidebarSearchField2,
4
4
  SidebarApp2
5
- } from "../../shared/components-rtbme03d.js";
6
- import"../../shared/components-mpeg6ca5.js";
7
- import"../../shared/components-7phx24n6.js";
5
+ } from "../../shared/components-whfr55xn.js";
6
+ import"../../shared/components-bkg1k36x.js";
8
7
  import"../../shared/components-2myjk2zf.js";
8
+ import"../../shared/components-fzmjcn38.js";
9
+ import"../../shared/components-94vd4ck1.js";
10
+ import"../../shared/components-t84071ay.js";
11
+ import"../../shared/components-7rn454aq.js";
12
+ import"../../shared/components-q0hs5rqn.js";
13
+ import"../../shared/components-mse06t0x.js";
9
14
  import"../../shared/components-8wp8d8q1.js";
10
- import"../../shared/components-grxgqa75.js";
11
- import"../../shared/components-vhq03vx2.js";
15
+ import"../../shared/components-ac0x7zpq.js";
16
+ import"../../shared/components-br6t88cb.js";
17
+ import"../../shared/components-nxqrw789.js";
18
+ import"../../shared/components-ft5dgjg6.js";
19
+ import"../../shared/components-wq9hrera.js";
20
+ import"../../shared/components-pa43g2r2.js";
21
+ import"../../shared/components-ycwhrqe1.js";
22
+ import"../../shared/components-ywgqahmg.js";
23
+ import"../../shared/components-3hgk57s0.js";
24
+ import"../../shared/components-jw45ck66.js";
25
+ import"../../shared/components-9h3g4mnq.js";
26
+ import"../../shared/components-cp5ym3g2.js";
27
+ import"../../shared/components-eawe4nxm.js";
12
28
  import"../../shared/components-y09nr7fe.js";
13
29
  import"../../shared/components-vcte8p75.js";
14
30
  import"../../shared/components-5wykqxph.js";
15
- import"../../shared/components-eawe4nxm.js";
16
- import"../../shared/components-rkcqr15c.js";
17
- import"../../shared/components-mse06t0x.js";
18
- import"../../shared/components-t84071ay.js";
19
- import"../../shared/components-5fet4gqt.js";
20
- import"../../shared/components-6f5pyzb2.js";
21
- import"../../shared/components-v2j3jx89.js";
22
- import"../../shared/components-wvxkfhdc.js";
23
- import"../../shared/components-crjcbqrc.js";
24
- import"../../shared/components-a11ssex6.js";
25
- import"../../shared/components-jnhpgpfk.js";
26
- import"../../shared/components-gmmht6k5.js";
27
- import"../../shared/components-jh0g2xr9.js";
28
- import"../../shared/components-wq9hrera.js";
29
- import"../../shared/components-pa43g2r2.js";
30
- import"../../shared/components-j3q9kaps.js";
31
31
  import"../../shared/components-9b2m90st.js";
32
32
  import"../../shared/components-bxqmbcz2.js";
33
+ import"../../shared/components-j3q9kaps.js";
33
34
  import"../../shared/components-21hcwp85.js";
34
35
  import"../../shared/components-8pnvkrbw.js";
35
36
  import"../../shared/components-pva1wj1r.js";
36
- import"../../shared/components-nz14rwtd.js";
37
- import"../../shared/components-4twh6d53.js";
38
- import"../../shared/components-9h3g4mnq.js";
39
- import"../../shared/components-rtkrpv3p.js";
40
- import"../../shared/components-ywgqahmg.js";
41
- import"../../shared/components-3hgk57s0.js";
37
+ import"../../shared/components-grxgqa75.js";
42
38
  import"../../shared/components-7wjkag2j.js";
39
+ import"../../shared/components-nz14rwtd.js";
43
40
  import"../../shared/components-bkwjvvkh.js";
44
- import"../../shared/components-wwd093xg.js";
41
+ import"../../shared/components-jnhpgpfk.js";
45
42
  import"../../shared/components-45r18egt.js";
46
- import"../../shared/components-tz0axc0f.js";
47
- import"../../shared/components-kxpcj2ry.js";
48
- import"../../shared/components-s217vq1n.js";
43
+ import"../../shared/components-wwd093xg.js";
44
+ import"../../shared/components-azrjnfxn.js";
49
45
  import"../../shared/components-znspksk0.js";
50
46
  import"../../shared/components-ew4wq7mj.js";
51
- import"../../shared/components-cp5ym3g2.js";
47
+ import"../../shared/components-tz0axc0f.js";
52
48
  import"../../shared/components-ceyn28cf.js";
53
49
  import"../../shared/components-nwa2a9tq.js";
54
- import"../../shared/components-azrjnfxn.js";
50
+ import"../../shared/components-5fet4gqt.js";
51
+ import"../../shared/components-6f5pyzb2.js";
52
+ import"../../shared/components-v2j3jx89.js";
53
+ import"../../shared/components-kxpcj2ry.js";
54
+ import"../../shared/components-s217vq1n.js";
55
55
  import"../../shared/components-xnp09586.js";
56
56
  export {
57
57
  SidebarApp2 as SidebarApp,
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  Button2,
3
3
  button_default
4
- } from "../../../shared/components-rtkrpv3p.js";
4
+ } from "../../../shared/components-ycwhrqe1.js";
5
5
  import {
6
6
  buttonVariants2
7
7
  } from "../../../shared/components-ywgqahmg.js";
@@ -9,11 +9,11 @@ import"../../../shared/components-3hgk57s0.js";
9
9
  import"../../../shared/components-7wjkag2j.js";
10
10
  import"../../../shared/components-bkwjvvkh.js";
11
11
  import"../../../shared/components-45r18egt.js";
12
+ import"../../../shared/components-znspksk0.js";
13
+ import"../../../shared/components-ew4wq7mj.js";
12
14
  import"../../../shared/components-tz0axc0f.js";
13
15
  import"../../../shared/components-kxpcj2ry.js";
14
16
  import"../../../shared/components-s217vq1n.js";
15
- import"../../../shared/components-znspksk0.js";
16
- import"../../../shared/components-ew4wq7mj.js";
17
17
  import"../../../shared/components-xnp09586.js";
18
18
  export {
19
19
  Button2 as Button,
@@ -3,44 +3,44 @@ import {
3
3
  ButtonGroupMenu2,
4
4
  ButtonGroup2,
5
5
  button_group_default
6
- } from "../../../shared/components-1dn3m7pk.js";
7
- import"../../../shared/components-vhq03vx2.js";
8
- import"../../../shared/components-y09nr7fe.js";
9
- import"../../../shared/components-vcte8p75.js";
10
- import"../../../shared/components-5wykqxph.js";
11
- import"../../../shared/components-eawe4nxm.js";
12
- import"../../../shared/components-rkcqr15c.js";
13
- import"../../../shared/components-mse06t0x.js";
6
+ } from "../../../shared/components-rr3fa4e5.js";
7
+ import"../../../shared/components-94vd4ck1.js";
14
8
  import"../../../shared/components-t84071ay.js";
15
- import"../../../shared/components-5fet4gqt.js";
16
- import"../../../shared/components-6f5pyzb2.js";
17
- import"../../../shared/components-v2j3jx89.js";
18
- import"../../../shared/components-a11ssex6.js";
19
- import"../../../shared/components-jnhpgpfk.js";
20
- import"../../../shared/components-jh0g2xr9.js";
9
+ import"../../../shared/components-q0hs5rqn.js";
10
+ import"../../../shared/components-mse06t0x.js";
11
+ import"../../../shared/components-nxqrw789.js";
12
+ import"../../../shared/components-ft5dgjg6.js";
21
13
  import"../../../shared/components-wq9hrera.js";
22
14
  import"../../../shared/components-pa43g2r2.js";
15
+ import"../../../shared/components-ycwhrqe1.js";
16
+ import"../../../shared/components-ywgqahmg.js";
17
+ import"../../../shared/components-3hgk57s0.js";
18
+ import"../../../shared/components-cp5ym3g2.js";
19
+ import"../../../shared/components-eawe4nxm.js";
20
+ import"../../../shared/components-y09nr7fe.js";
21
+ import"../../../shared/components-vcte8p75.js";
22
+ import"../../../shared/components-5wykqxph.js";
23
23
  import"../../../shared/components-9b2m90st.js";
24
24
  import"../../../shared/components-bxqmbcz2.js";
25
25
  import"../../../shared/components-21hcwp85.js";
26
26
  import"../../../shared/components-8pnvkrbw.js";
27
27
  import"../../../shared/components-pva1wj1r.js";
28
- import"../../../shared/components-nz14rwtd.js";
29
- import"../../../shared/components-rtkrpv3p.js";
30
- import"../../../shared/components-ywgqahmg.js";
31
- import"../../../shared/components-3hgk57s0.js";
32
28
  import"../../../shared/components-7wjkag2j.js";
29
+ import"../../../shared/components-nz14rwtd.js";
33
30
  import"../../../shared/components-bkwjvvkh.js";
34
- import"../../../shared/components-wwd093xg.js";
31
+ import"../../../shared/components-jnhpgpfk.js";
35
32
  import"../../../shared/components-45r18egt.js";
36
- import"../../../shared/components-tz0axc0f.js";
37
- import"../../../shared/components-kxpcj2ry.js";
38
- import"../../../shared/components-s217vq1n.js";
33
+ import"../../../shared/components-wwd093xg.js";
39
34
  import"../../../shared/components-znspksk0.js";
40
35
  import"../../../shared/components-ew4wq7mj.js";
41
- import"../../../shared/components-cp5ym3g2.js";
36
+ import"../../../shared/components-tz0axc0f.js";
42
37
  import"../../../shared/components-ceyn28cf.js";
43
38
  import"../../../shared/components-nwa2a9tq.js";
39
+ import"../../../shared/components-5fet4gqt.js";
40
+ import"../../../shared/components-6f5pyzb2.js";
41
+ import"../../../shared/components-v2j3jx89.js";
42
+ import"../../../shared/components-kxpcj2ry.js";
43
+ import"../../../shared/components-s217vq1n.js";
44
44
  import"../../../shared/components-xnp09586.js";
45
45
  export {
46
46
  ButtonGroup2 as ButtonGroup,
@@ -1,24 +1,24 @@
1
1
  import {
2
2
  Copy2,
3
3
  copy_default
4
- } from "../../../shared/components-1t36jzn1.js";
5
- import"../../../shared/components-jnhpgpfk.js";
6
- import"../../../shared/components-gmmht6k5.js";
7
- import"../../../shared/components-jh0g2xr9.js";
4
+ } from "../../../shared/components-fpgfs01m.js";
5
+ import"../../../shared/components-7rn454aq.js";
6
+ import"../../../shared/components-ft5dgjg6.js";
8
7
  import"../../../shared/components-wq9hrera.js";
9
8
  import"../../../shared/components-pa43g2r2.js";
10
9
  import"../../../shared/components-8pnvkrbw.js";
11
10
  import"../../../shared/components-pva1wj1r.js";
12
11
  import"../../../shared/components-7wjkag2j.js";
13
12
  import"../../../shared/components-bkwjvvkh.js";
14
- import"../../../shared/components-wwd093xg.js";
13
+ import"../../../shared/components-jnhpgpfk.js";
15
14
  import"../../../shared/components-45r18egt.js";
16
- import"../../../shared/components-tz0axc0f.js";
17
- import"../../../shared/components-kxpcj2ry.js";
18
- import"../../../shared/components-s217vq1n.js";
15
+ import"../../../shared/components-wwd093xg.js";
19
16
  import"../../../shared/components-znspksk0.js";
20
17
  import"../../../shared/components-ew4wq7mj.js";
18
+ import"../../../shared/components-tz0axc0f.js";
21
19
  import"../../../shared/components-nwa2a9tq.js";
20
+ import"../../../shared/components-kxpcj2ry.js";
21
+ import"../../../shared/components-s217vq1n.js";
22
22
  import"../../../shared/components-xnp09586.js";
23
23
  export {
24
24
  Copy2 as Copy,
@@ -5,30 +5,30 @@ import {
5
5
  AccordionItem2,
6
6
  AccordionTrigger2,
7
7
  accordion_default
8
- } from "../../../shared/components-485sbcf9.js";
8
+ } from "../../../shared/components-arg4h26d.js";
9
+ import"../../../shared/components-wq9hrera.js";
10
+ import"../../../shared/components-pa43g2r2.js";
9
11
  import"../../../shared/components-y09nr7fe.js";
10
12
  import"../../../shared/components-vcte8p75.js";
11
13
  import"../../../shared/components-5wykqxph.js";
12
- import"../../../shared/components-v2j3jx89.js";
13
- import"../../../shared/components-jnhpgpfk.js";
14
- import"../../../shared/components-wq9hrera.js";
15
- import"../../../shared/components-pa43g2r2.js";
16
- import"../../../shared/components-j3q9kaps.js";
17
14
  import"../../../shared/components-9b2m90st.js";
18
15
  import"../../../shared/components-bxqmbcz2.js";
16
+ import"../../../shared/components-j3q9kaps.js";
19
17
  import"../../../shared/components-21hcwp85.js";
20
18
  import"../../../shared/components-8pnvkrbw.js";
21
19
  import"../../../shared/components-pva1wj1r.js";
22
- import"../../../shared/components-nz14rwtd.js";
23
20
  import"../../../shared/components-7wjkag2j.js";
21
+ import"../../../shared/components-nz14rwtd.js";
24
22
  import"../../../shared/components-bkwjvvkh.js";
25
- import"../../../shared/components-wwd093xg.js";
23
+ import"../../../shared/components-jnhpgpfk.js";
26
24
  import"../../../shared/components-45r18egt.js";
25
+ import"../../../shared/components-wwd093xg.js";
26
+ import"../../../shared/components-znspksk0.js";
27
+ import"../../../shared/components-ew4wq7mj.js";
27
28
  import"../../../shared/components-tz0axc0f.js";
29
+ import"../../../shared/components-v2j3jx89.js";
28
30
  import"../../../shared/components-kxpcj2ry.js";
29
31
  import"../../../shared/components-s217vq1n.js";
30
- import"../../../shared/components-znspksk0.js";
31
- import"../../../shared/components-ew4wq7mj.js";
32
32
  import"../../../shared/components-xnp09586.js";
33
33
  export {
34
34
  Accordion2 as Accordion,