@shellui/core 0.5.0-beta.2 → 0.5.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 (70) hide show
  1. package/README.md +5 -5
  2. package/package.json +3 -2
  3. package/schemas/shellui.config.schema.json +10 -2
  4. package/src/app.tsx +8 -4
  5. package/src/components/ContentView.tsx +12 -5
  6. package/src/components/ui/alert-dialog.tsx +1 -1
  7. package/src/components/ui/dialog.tsx +5 -1
  8. package/src/components/ui/dropdown-menu.tsx +39 -4
  9. package/src/components/ui/sheet.tsx +1 -1
  10. package/src/components/ui/sidebar.tsx +60 -20
  11. package/src/components/ui/tabs.tsx +52 -0
  12. package/src/constants/urls.ts +1 -0
  13. package/src/features/auth/AuthProvider.tsx +17 -6
  14. package/src/features/chromeActions/ChromeActionIcons.tsx +261 -0
  15. package/src/features/chromeActions/ChromeActionsDemoView.tsx +149 -0
  16. package/src/features/chromeActions/ChromeActionsHost.tsx +1511 -0
  17. package/src/features/chromeActions/ChromeActionsProvider.tsx +141 -0
  18. package/src/features/chromeActions/chromeActionsStore.spec.ts +61 -0
  19. package/src/features/chromeActions/chromeActionsStore.ts +77 -0
  20. package/src/features/chromeActions/computeActionInsets.spec.ts +360 -0
  21. package/src/features/chromeActions/computeActionInsets.ts +326 -0
  22. package/src/features/chromeActions/index.ts +26 -0
  23. package/src/features/chromeActions/resolveUuidForRemoveIframe.spec.ts +49 -0
  24. package/src/features/config/types.ts +16 -2
  25. package/src/features/layouts/AppLayout.tsx +30 -3
  26. package/src/features/layouts/OverlayShell.tsx +63 -13
  27. package/src/features/layouts/app-bar-inset/AppBarInsetLayout.tsx +22 -0
  28. package/src/features/layouts/appbar/AppBarLayout.tsx +230 -86
  29. package/src/features/layouts/chrome/DesktopChrome.tsx +17 -3
  30. package/src/features/layouts/chrome/InsetMobileRadiusOverlay.tsx +18 -0
  31. package/src/features/layouts/chrome/index.ts +8 -0
  32. package/src/features/layouts/chrome/runtime.ts +73 -0
  33. package/src/features/layouts/chrome/useScrollHideChrome.ts +210 -0
  34. package/src/features/layouts/floating/FloatingBottomDock.tsx +410 -0
  35. package/src/features/layouts/floating/FloatingLayout.tsx +152 -0
  36. package/src/features/layouts/floating/FloatingSidebar.tsx +327 -0
  37. package/src/features/layouts/floating/FloatingStatusScrim.tsx +36 -0
  38. package/src/features/layouts/floating/computeFloatingInsets.spec.ts +83 -0
  39. package/src/features/layouts/floating/computeFloatingInsets.ts +155 -0
  40. package/src/features/layouts/floating/isShellOwnedPath.spec.ts +25 -0
  41. package/src/features/layouts/floating/isShellOwnedPath.ts +17 -0
  42. package/src/features/layouts/floating/layoutChromeStore.spec.ts +138 -0
  43. package/src/features/layouts/floating/layoutChromeStore.ts +209 -0
  44. package/src/features/layouts/floating/scrollChrome.spec.ts +49 -0
  45. package/src/features/layouts/floating/useFloatingChrome.ts +206 -0
  46. package/src/features/layouts/sidebar/SidebarLayout.tsx +119 -37
  47. package/src/features/layouts/sidebar/types.ts +4 -0
  48. package/src/features/layouts/sidebar-inset/SidebarInsetLayout.tsx +15 -0
  49. package/src/features/layouts/windows/WindowsLayout.tsx +240 -110
  50. package/src/features/overlays/ResponsiveModal.tsx +201 -21
  51. package/src/features/overlays/overlaySize.spec.ts +18 -0
  52. package/src/features/overlays/overlaySize.ts +89 -0
  53. package/src/features/settings/SettingsProvider.tsx +36 -9
  54. package/src/features/settings/SettingsView.tsx +6 -6
  55. package/src/features/settings/components/Develop.tsx +33 -13
  56. package/src/features/settings/components/develop/ChromeActionsTestButtons.tsx +63 -0
  57. package/src/features/settings/utils/buildSettingsForPropagation.ts +16 -0
  58. package/src/features/storage/StoragePickerContext.tsx +1 -0
  59. package/src/features/storage/uploads/uploadQueue.spec.ts +56 -1
  60. package/src/features/storage/uploads/uploadQueue.ts +42 -1
  61. package/src/features/theme/applyTheme.ts +23 -5
  62. package/src/hooks/use-mobile.tsx +21 -7
  63. package/src/hooks/use-viewport.ts +40 -0
  64. package/src/i18n/translations/en/settings.json +17 -2
  65. package/src/i18n/translations/fr/settings.json +17 -2
  66. package/src/index.css +473 -12
  67. package/src/index.html +6 -4
  68. package/src/index.ts +8 -0
  69. package/src/routes/components/RouteFallback.tsx +21 -2
  70. package/src/routes/routes.tsx +14 -0
package/src/index.css CHANGED
@@ -43,6 +43,15 @@
43
43
  --sidebar-border: oklch(0.9276 0.0059 264.5182);
44
44
  --sidebar-ring: oklch(0.6894 0.1397 83.6763);
45
45
  --sidebar: var(--sidebar-background);
46
+ /* Tray behind inset content — slight darken of sidebar for edge contrast. */
47
+ --shellui-inset-chrome: color-mix(in oklch, var(--sidebar) 97%, black);
48
+ /* Hover / selected chips on the inset tray — subtle contrast against chrome. */
49
+ --shellui-inset-accent: color-mix(
50
+ in oklch,
51
+ var(--shellui-inset-chrome) 90%,
52
+ var(--sidebar-foreground)
53
+ );
54
+ --shellui-inset-accent-foreground: var(--sidebar-foreground);
46
55
  }
47
56
 
48
57
  .dark {
@@ -75,6 +84,15 @@
75
84
  --sidebar-border: oklch(0.2781 0.0296 256.8577);
76
85
  --sidebar-ring: oklch(0.8061 0.1364 84.8895);
77
86
  --sidebar: var(--sidebar-background);
87
+ /* Dark: lift the tray slightly — sidebar is already lighter than background, so darkening hides the edge. */
88
+ --shellui-inset-chrome: color-mix(in oklch, var(--sidebar) 88%, white);
89
+ /* Hover / selected chips on the inset tray — subtle contrast against chrome. */
90
+ --shellui-inset-accent: color-mix(
91
+ in oklch,
92
+ var(--shellui-inset-chrome) 88%,
93
+ var(--sidebar-foreground)
94
+ );
95
+ --shellui-inset-accent-foreground: var(--sidebar-foreground);
78
96
  }
79
97
 
80
98
  /*
@@ -107,6 +125,324 @@
107
125
  padding-left: calc(var(--shellui-safe-pad-x, 1.5rem) + var(--shellui-safe-area-left));
108
126
  }
109
127
 
128
+ /*
129
+ * Floating layout glass chrome (frosted blur + translucent fill).
130
+ * Colors follow sidebar tokens so themes restyle chrome with the rest of nav.
131
+ *
132
+ * Radius:
133
+ * - Desktop sidebar: theme radius, capped at 0.5rem
134
+ * - Mobile tab bar: binary — 0 when theme radius is 0, else full pill (50%)
135
+ */
136
+ :root {
137
+ --shellui-inset-top: 0px;
138
+ --shellui-inset-right: 0px;
139
+ --shellui-inset-bottom: 0px;
140
+ --shellui-inset-left: 0px;
141
+ --shellui-floating-sidebar-radius: min(var(--radius), 5rem);
142
+ /* Any positive --radius → huge radius (pill); 0 → square. */
143
+ --shellui-floating-mobile-radius: calc(var(--radius) * 999);
144
+ }
145
+
146
+ .shellui-floating-glass {
147
+ color: var(--sidebar-foreground);
148
+ background:
149
+ linear-gradient(
150
+ 145deg,
151
+ color-mix(in oklch, white 40%, transparent) 0%,
152
+ color-mix(in oklch, white 10%, transparent) 42%,
153
+ color-mix(in oklch, white 16%, transparent) 100%
154
+ ),
155
+ /* Frost from sidebar surface so chrome tracks theme, not raw background grey */
156
+ color-mix(in oklch, var(--sidebar) 82%, transparent);
157
+ backdrop-filter: blur(40px) saturate(160%);
158
+ -webkit-backdrop-filter: blur(40px) saturate(160%);
159
+ border: 1px solid color-mix(in oklch, var(--sidebar-border) 80%, transparent);
160
+ box-shadow:
161
+ 0 1px 0 color-mix(in oklch, white 40%, transparent) inset,
162
+ 0 -1px 0 color-mix(in oklch, black 6%, transparent) inset,
163
+ 0 10px 32px color-mix(in oklch, black 14%, transparent),
164
+ 0 2px 6px color-mix(in oklch, black 6%, transparent);
165
+ }
166
+
167
+ .shellui-floating-sidebar-panel .shellui-floating-glass,
168
+ .shellui-floating-sidebar-chip .shellui-floating-glass {
169
+ border-radius: var(--shellui-floating-sidebar-radius);
170
+ }
171
+
172
+ .dark .shellui-floating-glass {
173
+ background:
174
+ linear-gradient(
175
+ 145deg,
176
+ color-mix(in oklch, white 16%, transparent) 0%,
177
+ color-mix(in oklch, white 4%, transparent) 45%,
178
+ color-mix(in oklch, white 9%, transparent) 100%
179
+ ),
180
+ color-mix(in oklch, var(--sidebar) 78%, transparent);
181
+ border-color: color-mix(in oklch, var(--sidebar-border) 90%, transparent);
182
+ box-shadow:
183
+ 0 1px 0 color-mix(in oklch, white 12%, transparent) inset,
184
+ 0 -1px 0 color-mix(in oklch, black 30%, transparent) inset,
185
+ 0 14px 40px color-mix(in oklch, black 40%, transparent),
186
+ 0 2px 8px color-mix(in oklch, black 22%, transparent);
187
+ }
188
+
189
+ /* Desktop floating nav rows / chrome controls: match capped sidebar radius. */
190
+ .shellui-floating-sidebar-panel .shellui-floating-nav-item,
191
+ .shellui-floating-sidebar-panel .shellui-floating-nav-control {
192
+ border-radius: var(--shellui-floating-sidebar-radius);
193
+ }
194
+
195
+ /* Phone/tablet floating dock + pill FAB: binary radius (0 theme → square). */
196
+ [data-shellui-floating-dock-list],
197
+ [data-shellui-floating-dock-tab],
198
+ [data-shellui-chrome-actions-fab][data-shellui-floating-fab='true'] {
199
+ border-radius: var(--shellui-floating-mobile-radius) !important;
200
+ }
201
+
202
+ /* Floating desktop sidebar collapse — transform/opacity only; respect reduced motion. */
203
+ @media (prefers-reduced-motion: reduce) {
204
+ .shellui-floating-sidebar-panel .shellui-floating-glass,
205
+ .shellui-floating-sidebar-chip .shellui-floating-glass,
206
+ [data-shellui-floating-dock],
207
+ [data-shellui-floating-dock-row],
208
+ [data-shellui-floating-dock-fab] {
209
+ transition: none !important;
210
+ animation: none !important;
211
+ }
212
+ }
213
+
214
+ /*
215
+ * Floating bottom dock hide-on-scroll (phone/tablet).
216
+ * Slide the whole dock (Tabs + FAB); appear slower, dismiss faster.
217
+ */
218
+ [data-shellui-floating-dock] {
219
+ translate: 0 0;
220
+ transition-property: translate, opacity;
221
+ transition-duration: 380ms;
222
+ transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
223
+ }
224
+
225
+ [data-shellui-floating-dock][data-chrome-visible='false'] {
226
+ translate: 0 120%;
227
+ opacity: 0;
228
+ pointer-events: none;
229
+ transition-duration: 160ms;
230
+ transition-timing-function: ease-in;
231
+ }
232
+
233
+ @media (prefers-reduced-motion: reduce) {
234
+ [data-shellui-floating-dock] {
235
+ transition: none !important;
236
+ }
237
+ }
238
+
239
+ /*
240
+ * Floating action chrome hide-on-scroll (phone/tablet) — same timings as the
241
+ * dock: slide the wrapper, fade opacity. Appear slower; dismiss faster.
242
+ * Presence (set/clear) uses data-visible; scroll hide uses data-scroll-hidden.
243
+ * Corner FAB slot still used on non-docked layouts.
244
+ *
245
+ * Shell header layouts (sidebar / app-bar) opt into `data-shell-scroll-sync` and
246
+ * follow the shared `--shellui-chrome-hide-*` vars on <html> instead — see below.
247
+ */
248
+ [data-shellui-chrome-actions-top='overlay'],
249
+ [data-shellui-chrome-actions-fab-slot] {
250
+ opacity: 1;
251
+ translate: 0 0;
252
+ transition-property: translate, opacity;
253
+ transition-duration: 380ms;
254
+ transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
255
+ }
256
+
257
+ [data-shellui-chrome-actions-top='overlay'][data-visible='false'],
258
+ [data-shellui-chrome-actions-fab-slot][data-visible='false'] {
259
+ opacity: 0;
260
+ pointer-events: none;
261
+ }
262
+
263
+ /* Presence-only dismiss stays snappy (not scroll hide). */
264
+ [data-shellui-chrome-actions-top='overlay'][data-visible='false']:not([data-scroll-hidden='true']),
265
+ [data-shellui-chrome-actions-fab-slot][data-visible='false']:not([data-scroll-hidden='true']) {
266
+ transition-duration: 200ms;
267
+ transition-timing-function: ease-out;
268
+ }
269
+
270
+ /* Floating / FAB scroll hide — own slide+fade (not shell-synced). */
271
+ [data-shellui-chrome-actions-top='overlay'][data-scroll-hidden='true']:not(
272
+ [data-shell-scroll-sync]
273
+ ),
274
+ [data-shellui-chrome-actions-fab-slot][data-scroll-hidden='true'] {
275
+ opacity: 0;
276
+ pointer-events: none;
277
+ transition-duration: 160ms;
278
+ transition-timing-function: ease-in;
279
+ }
280
+
281
+ [data-shellui-chrome-actions-top='overlay'][data-scroll-hidden='true']:not(
282
+ [data-shell-scroll-sync]
283
+ ) {
284
+ translate: 0 -120%;
285
+ }
286
+
287
+ [data-shellui-chrome-actions-fab-slot][data-scroll-hidden='true'] {
288
+ translate: 0 120%;
289
+ }
290
+
291
+ /*
292
+ * Shared mobile shell chrome motion (header + inset tray + top action row).
293
+ * One attribute on <html> sets the target; both consumers run the same local
294
+ * translate + opacity transition (same idea as the floating dock).
295
+ */
296
+ [data-shellui-mobile-chrome-stack],
297
+ [data-shellui-chrome-actions-top='overlay'][data-shell-scroll-sync] {
298
+ translate: 0 0;
299
+ opacity: 1;
300
+ transition-property: translate, opacity;
301
+ transition-duration: 380ms;
302
+ transition-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
303
+ }
304
+
305
+ html[data-shellui-chrome-hidden='true'] [data-shellui-mobile-chrome-stack],
306
+ html[data-shellui-chrome-hidden='true']
307
+ [data-shellui-chrome-actions-top='overlay'][data-shell-scroll-sync] {
308
+ translate: 0 -120%;
309
+ opacity: 0;
310
+ transition-duration: 160ms;
311
+ transition-timing-function: ease-in;
312
+ }
313
+
314
+ [data-shellui-mobile-chrome-stack][data-chrome-visible='false'],
315
+ [data-shellui-chrome-actions-top='overlay'][data-shell-scroll-sync][data-scroll-hidden='true'] {
316
+ pointer-events: none;
317
+ }
318
+
319
+ /* Presence clear still fades locally when actions are removed. */
320
+ [data-shellui-chrome-actions-top='overlay'][data-shell-scroll-sync][data-visible='false'] {
321
+ opacity: 0;
322
+ transition: opacity 200ms ease-out;
323
+ }
324
+
325
+ /*
326
+ * Full-bleed iframe under inset chrome: tray band + box-shadow cutout for the
327
+ * top radius. Overlay is pointer-events: none so taps reach the iframe.
328
+ */
329
+ [data-shellui-inset-radius-overlay]::before {
330
+ content: '';
331
+ position: absolute;
332
+ inset-inline: 0;
333
+ top: 0;
334
+ height: var(--shellui-shell-header-height, 0px);
335
+ background: var(--shellui-inset-chrome);
336
+ }
337
+
338
+ [data-shellui-inset-radius-cutout] {
339
+ position: absolute;
340
+ inset: 0;
341
+ top: var(--shellui-shell-header-height, 0px);
342
+ overflow: hidden;
343
+ }
344
+
345
+ [data-shellui-inset-radius-cutout]::before {
346
+ content: '';
347
+ position: absolute;
348
+ inset: 0;
349
+ border-radius: 1rem 1rem 0 0;
350
+ border: 1px solid var(--border);
351
+ border-bottom-width: 0;
352
+ box-shadow: 0 0 0 100vmax var(--shellui-inset-chrome);
353
+ }
354
+
355
+ @media (prefers-reduced-motion: reduce) {
356
+ [data-shellui-chrome-actions-top='overlay'],
357
+ [data-shellui-chrome-actions-fab-slot] {
358
+ transition: none !important;
359
+ }
360
+
361
+ [data-shellui-mobile-chrome-stack],
362
+ [data-shellui-chrome-actions-top='overlay'][data-shell-scroll-sync] {
363
+ transition: none !important;
364
+ }
365
+ }
366
+
367
+ /*
368
+ * Layout chrome safe insets — applied INSIDE the iframe app, never by shrinking
369
+ * the host iframe (main layout content stays 100%×100% under floating chrome).
370
+ * SDK auto-padding toggles `.shellui-apply-layout-chrome-pad` on `document.body`
371
+ * (and apps may put the class on their own scroll root).
372
+ */
373
+ .shellui-apply-layout-chrome-pad {
374
+ padding-top: var(--shellui-inset-top, 0px);
375
+ padding-right: var(--shellui-inset-right, 0px);
376
+ padding-bottom: var(--shellui-inset-bottom, 0px);
377
+ padding-left: var(--shellui-inset-left, 0px);
378
+ box-sizing: border-box;
379
+ }
380
+
381
+ /* Animate live inset changes (action chrome, sidebar collapse, etc.). */
382
+ @property --shellui-inset-top {
383
+ syntax: '<length>';
384
+ inherits: true;
385
+ initial-value: 0px;
386
+ }
387
+ @property --shellui-inset-right {
388
+ syntax: '<length>';
389
+ inherits: true;
390
+ initial-value: 0px;
391
+ }
392
+ @property --shellui-inset-bottom {
393
+ syntax: '<length>';
394
+ inherits: true;
395
+ initial-value: 0px;
396
+ }
397
+ @property --shellui-inset-left {
398
+ syntax: '<length>';
399
+ inherits: true;
400
+ initial-value: 0px;
401
+ }
402
+ @property --shellui-chrome-actions-leading-extra {
403
+ syntax: '<length>';
404
+ inherits: true;
405
+ initial-value: 0px;
406
+ }
407
+
408
+ /* Host: always animate inset CSS vars (sidebar collapse / floating chrome). */
409
+ html {
410
+ transition:
411
+ --shellui-inset-top 200ms cubic-bezier(0.22, 1, 0.36, 1),
412
+ --shellui-inset-right 200ms cubic-bezier(0.22, 1, 0.36, 1),
413
+ --shellui-inset-bottom 200ms cubic-bezier(0.22, 1, 0.36, 1),
414
+ --shellui-inset-left 200ms cubic-bezier(0.22, 1, 0.36, 1),
415
+ --shellui-chrome-actions-leading-extra 200ms cubic-bezier(0.22, 1, 0.36, 1);
416
+ }
417
+
418
+ /* App body padding: only after SDK enables animations (skip initial load). */
419
+ html[data-shellui-layout-chrome-animate] .shellui-apply-layout-chrome-pad {
420
+ transition:
421
+ padding-top 200ms cubic-bezier(0.22, 1, 0.36, 1),
422
+ padding-right 200ms cubic-bezier(0.22, 1, 0.36, 1),
423
+ padding-bottom 200ms cubic-bezier(0.22, 1, 0.36, 1),
424
+ padding-left 200ms cubic-bezier(0.22, 1, 0.36, 1);
425
+ }
426
+
427
+ @media (prefers-reduced-motion: reduce) {
428
+ html {
429
+ transition: none;
430
+ }
431
+ html[data-shellui-layout-chrome-animate] .shellui-apply-layout-chrome-pad {
432
+ transition: none;
433
+ }
434
+ }
435
+
436
+ /* Scroll clearance so anchors/focus land clear of floating chrome. */
437
+ html[data-shellui-layout-chrome-pad] .overflow-y-auto,
438
+ html[data-shellui-layout-chrome-pad] .overflow-auto,
439
+ html[data-shellui-layout-chrome-pad] [data-shellui-chrome-scroll] {
440
+ scroll-padding-top: var(--shellui-inset-top, 0px);
441
+ scroll-padding-bottom: var(--shellui-inset-bottom, 0px);
442
+ scroll-padding-left: var(--shellui-inset-left, 0px);
443
+ scroll-padding-right: var(--shellui-inset-right, 0px);
444
+ }
445
+
110
446
  /*
111
447
  * Installed web app: make <body> the containing block for fixed descendants
112
448
  * (overlays, sheets, toasts). Pure CSS via display-mode — no JS attributes.
@@ -124,6 +460,38 @@
124
460
  * {
125
461
  border-color: var(--border);
126
462
  }
463
+ /*
464
+ * Interactive controls: pointer everywhere for consistency (raw <button>/links
465
+ * in layouts often omit Tailwind `cursor-pointer`; native UA default varies).
466
+ */
467
+ button:not(:disabled):not([disabled]),
468
+ [role='button']:not([aria-disabled='true']),
469
+ [role='menuitem'],
470
+ [role='tab'],
471
+ [role='option'],
472
+ [role='switch'],
473
+ [role='checkbox'],
474
+ [role='radio'],
475
+ [role='link'],
476
+ a[href],
477
+ summary,
478
+ label[for],
479
+ input[type='button']:not(:disabled),
480
+ input[type='submit']:not(:disabled),
481
+ input[type='reset']:not(:disabled),
482
+ input[type='checkbox']:not(:disabled),
483
+ input[type='radio']:not(:disabled),
484
+ input[type='file']:not(:disabled),
485
+ select:not(:disabled) {
486
+ cursor: pointer;
487
+ }
488
+ button:disabled,
489
+ button[disabled],
490
+ [role='button'][aria-disabled='true'],
491
+ input:disabled,
492
+ select:disabled {
493
+ cursor: not-allowed;
494
+ }
127
495
  body {
128
496
  background-color: var(--background);
129
497
  color: var(--foreground);
@@ -185,6 +553,16 @@
185
553
  filter: brightness(0.95);
186
554
  }
187
555
 
556
+ /* Shell chrome nav uses its own accent hover — don't stack the global brightness. */
557
+ [data-shellui-sidebar-layout] button:hover,
558
+ [data-shellui-sidebar-layout] [role='button']:hover,
559
+ [data-shellui-app-bar-layout] button:hover,
560
+ [data-shellui-app-bar-layout] [role='button']:hover,
561
+ [data-shellui-collapsed-titlebar] button:hover,
562
+ [data-shellui-collapsed-titlebar] [role='button']:hover {
563
+ filter: none;
564
+ }
565
+
188
566
  /* Playful input styling */
189
567
  input,
190
568
  textarea,
@@ -246,6 +624,7 @@
246
624
  --color-sidebar-border: var(--sidebar-border);
247
625
  --color-sidebar-ring: var(--sidebar-ring);
248
626
  --color-sidebar: var(--sidebar);
627
+ --color-shellui-inset-chrome: var(--shellui-inset-chrome);
249
628
 
250
629
  /* Border radius tokens */
251
630
  --radius-lg: var(--radius);
@@ -253,6 +632,23 @@
253
632
  --radius-sm: calc(var(--radius) - 4px);
254
633
  }
255
634
 
635
+ /* Inset layouts: keep Tauri collapsed titlebar on the chrome tray. */
636
+ [data-shellui-layout-variant='inset'] [data-shellui-collapsed-titlebar] {
637
+ background-color: var(--shellui-inset-chrome);
638
+ border-bottom-color: transparent;
639
+ }
640
+
641
+ /*
642
+ * Inset layouts: remap sidebar accent tokens so hover / selected nav chips
643
+ * contrast against --shellui-inset-chrome (transparent sidebar / app-bar).
644
+ */
645
+ [data-shellui-layout-variant='inset'] {
646
+ --sidebar-accent: var(--shellui-inset-accent);
647
+ --sidebar-accent-foreground: var(--shellui-inset-accent-foreground);
648
+ --color-sidebar-accent: var(--shellui-inset-accent);
649
+ --color-sidebar-accent-foreground: var(--shellui-inset-accent-foreground);
650
+ }
651
+
256
652
  /*
257
653
  * While switching themes, disable CSS transitions so colors snap instead of morphing.
258
654
  * Do NOT disable animations — that restarts Radix dialog/drawer open animations and
@@ -287,6 +683,11 @@ html.shellui-theme-switching
287
683
  pointer-events: auto !important;
288
684
  }
289
685
 
686
+ /* Chrome-action controls portaled above overlay iframes (modal/drawer). */
687
+ [data-shellui-chrome-actions] [data-shellui-chrome-actions-hit] {
688
+ pointer-events: auto !important;
689
+ }
690
+
290
691
  /* Ensure Sonner toasts use theme variables - override Sonner defaults */
291
692
  [data-sonner-toast] {
292
693
  background-color: var(--background) !important;
@@ -416,13 +817,18 @@ html.shellui-theme-switching
416
817
 
417
818
  /* Dialog / modal — sheet & custom geometry overrides (base left/top come from component classes) */
418
819
 
419
- /* Responsive openModal: sheet presentation (mobile) — override centered dialog geometry */
820
+ /* Responsive openModal: sheet presentation (mobile) — override centered dialog geometry.
821
+ * Do not set `transform: none` — enter/exit slide and swipe-dismiss own transform.
822
+ * Morph transitions omit `transform` so keyframes / drag aren’t fought. */
420
823
  [data-dialog-content][data-presentation='sheet'] {
421
824
  left: 0;
422
825
  right: 0;
423
826
  top: auto;
424
827
  bottom: 0;
425
- transform: none;
828
+ transition-property:
829
+ width, height, max-width, max-height, border-radius, left, right, top, bottom, padding;
830
+ transition-duration: 220ms;
831
+ transition-timing-function: ease;
426
832
  }
427
833
 
428
834
  /* User-moved / resized dialog — inline left/top/width/height own layout */
@@ -443,7 +849,7 @@ html.shellui-theme-switching
443
849
  }
444
850
 
445
851
  /* Morph dialog ↔ sheet on resize without remounting iframe content */
446
- [data-dialog-content][data-presentation] {
852
+ [data-dialog-content][data-presentation='dialog'] {
447
853
  transition-property:
448
854
  width, height, max-width, max-height, border-radius, left, right, top, bottom, transform,
449
855
  padding;
@@ -488,7 +894,8 @@ html.shellui-theme-switching
488
894
  }
489
895
  }
490
896
 
491
- /* Opacity-only enter/exit for responsive modal so presentation morph does not re-slide */
897
+ /* Opacity-only enter/exit for responsive modal *dialog* so presentation morph
898
+ (dialog ↔ sheet on resize) does not re-slide. Sheets get a real slide below. */
492
899
  @keyframes responsive-modal-fade-in {
493
900
  from {
494
901
  opacity: 0;
@@ -506,11 +913,33 @@ html.shellui-theme-switching
506
913
  }
507
914
  }
508
915
 
916
+ /* Mobile openModal-as-sheet — native-like bottom sheet (Vaul-aligned easing). */
917
+ @keyframes responsive-modal-sheet-in {
918
+ from {
919
+ opacity: 1;
920
+ transform: translateY(100%);
921
+ }
922
+ to {
923
+ opacity: 1;
924
+ transform: translateY(0);
925
+ }
926
+ }
927
+ @keyframes responsive-modal-sheet-out {
928
+ from {
929
+ opacity: 1;
930
+ transform: translateY(0);
931
+ }
932
+ to {
933
+ opacity: 1;
934
+ transform: translateY(100%);
935
+ }
936
+ }
937
+
509
938
  [data-dialog-overlay][data-state='open'] {
510
- animation: dialog-overlay-fade-in 0.1s ease-out;
939
+ animation: dialog-overlay-fade-in 0.2s ease-out;
511
940
  }
512
941
  [data-dialog-overlay][data-state='closed'] {
513
- animation: dialog-overlay-fade-out 0.1s ease-in;
942
+ animation: dialog-overlay-fade-out 0.2s ease-in;
514
943
  }
515
944
 
516
945
  /* Alert dialogs — position/size come from inline styles on the component.
@@ -558,16 +987,32 @@ html.shellui-theme-switching
558
987
  animation: dialog-content-out 0.1s ease-in both;
559
988
  }
560
989
 
561
- /* openModal ResponsiveModal — same fade for dialog and sheet (stable across resize) */
562
- [data-dialog-content][data-presentation][data-state='open'] {
990
+ /* openModal ResponsiveModal — dialog stays fade-only (stable across resize morph). */
991
+ [data-dialog-content][data-presentation='dialog'][data-state='open'] {
563
992
  animation: responsive-modal-fade-in 0.15s ease-out both;
564
993
  }
565
- [data-dialog-content][data-presentation][data-state='closed'] {
994
+ [data-dialog-content][data-presentation='dialog'][data-state='closed'] {
566
995
  animation: responsive-modal-fade-out 0.12s ease-in both;
567
996
  }
568
- /* Sheet swipe-dismiss continues from the dragged translate; keep mounted for the slide */
569
- [data-dialog-content][data-presentation='sheet'][data-state='closed'] {
570
- animation: responsive-modal-fade-out 0.28s cubic-bezier(0.32, 0.72, 0, 1) both;
997
+
998
+ /*
999
+ * Mobile sheet: slide up on open, slide down on close.
1000
+ * `data-enter-motion` is set only for the opening beat so a later dialog↔sheet
1001
+ * morph does not re-run the enter slide. No animation-fill-mode on enter — after
1002
+ * the keyframes finish, inline `transform` (swipe drag) must own the property.
1003
+ * Swipe dismiss already translates off-screen; skip the close keyframe then.
1004
+ */
1005
+ [data-dialog-content][data-presentation='sheet'][data-state='open'][data-enter-motion] {
1006
+ animation: responsive-modal-sheet-in 0.42s cubic-bezier(0.32, 0.72, 0, 1);
1007
+ will-change: transform;
1008
+ }
1009
+ [data-dialog-content][data-presentation='sheet'][data-state='closed']:not([data-dismiss='swipe']) {
1010
+ animation: responsive-modal-sheet-out 0.32s cubic-bezier(0.32, 0.72, 0, 1) forwards;
1011
+ will-change: transform;
1012
+ }
1013
+ [data-dialog-content][data-presentation='sheet'][data-state='closed'][data-dismiss='swipe'] {
1014
+ /* Keep the dragged translate; only a light fade if needed */
1015
+ animation: none;
571
1016
  }
572
1017
 
573
1018
  /* Sheet overlay and panel animations (mobile sidebar) */
@@ -732,6 +1177,22 @@ html.shellui-theme-switching
732
1177
  }
733
1178
  }
734
1179
 
1180
+ /* Chrome action glyph spin (`animate: 'icon-rotate'`). Explicit so we don’t
1181
+ * depend on Tailwind generating `animate-spin` for dynamically applied classes. */
1182
+ @keyframes shellui-chrome-action-spin {
1183
+ to {
1184
+ transform: rotate(360deg);
1185
+ }
1186
+ }
1187
+ [data-shellui-chrome-action-animate='icon-rotate'] {
1188
+ animation: shellui-chrome-action-spin 0.75s linear infinite;
1189
+ }
1190
+ @media (prefers-reduced-motion: reduce) {
1191
+ [data-shellui-chrome-action-animate='icon-rotate'] {
1192
+ animation: none;
1193
+ }
1194
+ }
1195
+
735
1196
  /* Auth account dropdown menu animation (LoginButton) */
736
1197
  @keyframes auth-menu-in {
737
1198
  from {
package/src/index.html CHANGED
@@ -6,7 +6,10 @@
6
6
  name="viewport"
7
7
  content="width=device-width, initial-scale=1.0, viewport-fit=cover"
8
8
  />
9
- <!-- iOS home-screen / standalone: draw under a translucent status bar -->
9
+ <!-- iOS home-screen / standalone: draw under a translucent status bar.
10
+ On iOS 26/27 Home Screen PWAs, the system may still paint Liquid Glass
11
+ status chrome; App Store / Tauri WKWebView does not get that treatment.
12
+ See docs/tauri.md (Browser PWA vs native). -->
10
13
  <meta
11
14
  name="apple-mobile-web-app-capable"
12
15
  content="yes"
@@ -19,9 +22,8 @@
19
22
  name="apple-mobile-web-app-status-bar-style"
20
23
  content="black-translucent"
21
24
  />
22
- <!-- No theme-color here on purpose: in an installed iOS web app it overrides
23
- black-translucent and paints a slab overlays cannot cover. applyTheme adds
24
- one at runtime for the platforms that still honour it. -->
25
+ <!-- No static theme-color: on installed iOS PWAs it can override
26
+ black-translucent. applyTheme sets it only for browser tabs (not PWA / Tauri). -->
25
27
  <title></title>
26
28
  <link
27
29
  rel="icon"
package/src/index.ts CHANGED
@@ -112,3 +112,11 @@ export {
112
112
  getCookieConsentNewHosts,
113
113
  } from './features/cookieConsent/cookieConsent.js';
114
114
  export { useCookieConsent } from './features/cookieConsent/useCookieConsent.js';
115
+ export {
116
+ isTauriRuntime,
117
+ isStandaloneDisplayMode,
118
+ isHomeScreenPwa,
119
+ getShelluiHostKind,
120
+ syncShelluiHostAttribute,
121
+ type ShelluiHostKind,
122
+ } from './features/layouts/chrome/runtime.js';
@@ -1,8 +1,27 @@
1
+ import { LoadingOverlay } from '../../components/LoadingOverlay';
2
+ import { isShellUiRootWindow } from '../../features/layouts/chrome/SafeAreaTopbar';
3
+
4
+ /**
5
+ * Suspense fallback for lazy routes.
6
+ * Nested shell-in-iframe: parent ContentView already shows the loading bar until
7
+ * SHELLUI_INITIALIZED — another bar here reads as a double load / redirect.
8
+ */
1
9
  export function RouteFallback() {
10
+ if (!isShellUiRootWindow()) {
11
+ return (
12
+ <div
13
+ className="h-full min-h-full bg-background"
14
+ aria-hidden
15
+ />
16
+ );
17
+ }
18
+
2
19
  return (
3
20
  <div
4
- className="h-full min-h-full bg-background"
21
+ className="relative h-full min-h-full bg-background"
5
22
  aria-hidden
6
- />
23
+ >
24
+ <LoadingOverlay />
25
+ </div>
7
26
  );
8
27
  }
@@ -22,6 +22,11 @@ const OverlayDynamicDemoView = lazy(() =>
22
22
  default: m.OverlayDynamicDemoView,
23
23
  })),
24
24
  );
25
+ const ChromeActionsDemoView = lazy(() =>
26
+ import('../features/chromeActions/ChromeActionsDemoView').then((m) => ({
27
+ default: m.ChromeActionsDemoView,
28
+ })),
29
+ );
25
30
  const LoginView = lazy(() =>
26
31
  import('../features/auth/components/LoginView').then((m) => ({ default: m.LoginView })),
27
32
  );
@@ -82,6 +87,15 @@ export const createRoutes = (config: ShellUIConfig): RouteObject[] => {
82
87
  </Suspense>
83
88
  ),
84
89
  },
90
+ {
91
+ // Chrome actions demo (develop → iframe set/clear)
92
+ path: urls.chromeActionsDemo.replace(/^\//, ''),
93
+ element: (
94
+ <Suspense fallback={<RouteFallback />}>
95
+ <ChromeActionsDemoView />
96
+ </Suspense>
97
+ ),
98
+ },
85
99
  {
86
100
  // Login route
87
101
  path: urls.login.replace(/^\//, ''),