@jskit-ai/shell-web 0.2.9 → 0.2.11

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 (69) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/fixtures/adaptive-shell/src/App.vue +2 -0
  3. package/fixtures/adaptive-shell/src/RecordListPage.vue +22 -0
  4. package/fixtures/adaptive-shell/src/RecordPage.vue +30 -0
  5. package/fixtures/adaptive-shell/src/ScreenPage.vue +7 -3
  6. package/fixtures/adaptive-shell/src/SettingsPage.vue +24 -0
  7. package/fixtures/adaptive-shell/src/main.js +60 -55
  8. package/fixtures/adaptive-shell/src/records.js +13 -0
  9. package/fixtures/adaptive-shell/src/theme/index.js +3 -0
  10. package/locales/en.json +1 -0
  11. package/package.json +17 -5
  12. package/patterns/application-shell/PATTERN.md +3 -1
  13. package/patterns/application-shell/example/expected-existing/src/pages/home/index.vue +5 -18
  14. package/patterns/application-shell/example/expected-existing/src/views/NotFound.vue +14 -0
  15. package/patterns/application-shell/example/src/pages/home/index.vue +21 -57
  16. package/patterns/application-shell/example/src/pages/home/settings/general/index.vue +24 -19
  17. package/patterns/application-shell/example/src/pages/home/settings.vue +27 -84
  18. package/patterns/application-shell/example/src/views/NotFound.vue +15 -0
  19. package/patterns/page-and-placement/example/src/components/SyncStatusElement.vue +2 -2
  20. package/patterns/page-and-placement/example/src/pages/home/reports/activity.vue +1 -1
  21. package/patterns/page-and-placement/example/src/pages/home/reports/overview.vue +1 -1
  22. package/patterns/page-and-placement/example/src/pages/home/reports.vue +6 -3
  23. package/patterns/page-and-placement/example/src/placement.js +1 -1
  24. package/src/client/components/ShellErrorHost.vue +13 -15
  25. package/src/client/components/ShellLayout.vue +388 -186
  26. package/src/client/components/ShellListDetail.vue +77 -0
  27. package/src/client/components/ShellMenuLinkItem.vue +10 -24
  28. package/src/client/components/ShellNavigationItem.vue +175 -0
  29. package/src/client/components/ShellNavigationScope.vue +18 -0
  30. package/src/client/components/ShellOutlet.vue +1 -1
  31. package/src/client/components/ShellOutletMenuWidget.vue +2 -2
  32. package/src/client/components/ShellPageAction.vue +91 -0
  33. package/src/client/components/ShellPageActions.vue +32 -0
  34. package/src/client/components/ShellSurfaceAwareMenuLinkItem.vue +10 -24
  35. package/src/client/components/ShellTabLinkItem.vue +77 -3
  36. package/src/client/composables/useShellDrawer.js +28 -18
  37. package/src/client/composables/useShellPageTitle.js +15 -0
  38. package/src/client/composables/useShellRouteTransition.js +1 -1
  39. package/src/client/composables/useShellWindowSizeClass.js +21 -0
  40. package/src/client/error/presentation.js +3 -5
  41. package/src/client/index.js +7 -0
  42. package/src/client/lib/menuIcons.js +21 -65
  43. package/src/client/navigation/documentNavigation.js +38 -0
  44. package/src/client/navigation/shellNavigationRuntime.js +480 -0
  45. package/src/client/navigation/useShellNavigation.js +94 -0
  46. package/src/client/providers/ShellWebClientProvider.js +11 -0
  47. package/src/client/support/drawerPresentation.js +9 -4
  48. package/src/client/support/drawerWidth.js +18 -1
  49. package/src/client/support/navigationPresentation.js +40 -0
  50. package/src/client/support/shellLayoutClass.js +6 -25
  51. package/src/client/support/windowSizeClass.js +29 -0
  52. package/src/test/adaptiveShellSmoke.js +43 -16
  53. package/src/test/shellNavigation.js +32 -0
  54. package/test/adaptiveShell.browser.test.js +207 -111
  55. package/test/clientUpdate.test.js +6 -1
  56. package/test/drawerPresentation.test.js +7 -7
  57. package/test/errorPresentation.test.js +4 -5
  58. package/test/materialBaselines.browser.test.js +96 -0
  59. package/test/menuIcons.test.js +14 -22
  60. package/test/outletMenuWidgetContract.test.js +2 -3
  61. package/test/playwrightContract.test.js +3 -1
  62. package/test/provider.test.js +9 -1
  63. package/test/settingsPlacementContract.test.js +33 -28
  64. package/test/shellGestureSupport.test.js +21 -9
  65. package/test/translation.test.js +2 -2
  66. package/test/useShellDrawer.test.js +20 -5
  67. package/test/useShellRouteTransition.test.js +3 -3
  68. package/patterns/application-shell/example/src/pages/home/settings/index.vue +0 -7
  69. package/src/client/components/ShellNavigationTooltip.vue +0 -39
@@ -1,5 +1,6 @@
1
1
  <script setup>
2
- import { computed, inject, ref } from "vue";
2
+ import { computed, inject, onBeforeUnmount, onMounted, provide, ref } from "vue";
3
+ import { useRoute } from "vue-router";
3
4
  import { useDisplay } from "vuetify";
4
5
  import { useShellDrawer } from "../composables/useShellDrawer.js";
5
6
  import { useShellLayoutState } from "../composables/useShellLayoutState.js";
@@ -8,8 +9,14 @@ import {
8
9
  DEFAULT_SHELL_NAVIGATION_ITEM_SPACING,
9
10
  DEFAULT_SHELL_RAIL_WIDTH
10
11
  } from "../support/drawerWidth.js";
12
+ import { normalizeDesktopDrawerClosedMode } from "../support/drawerPresentation.js";
13
+ import { SHELL_PAGE_ACTIONS_ID, SHELL_PAGE_ACTIONS_TARGET_KEY } from "../support/navigationPresentation.js";
11
14
  import { resolveShellLayoutClass } from "../support/shellLayoutClass.js";
15
+ import { resolveWindowSizeClass } from "../support/windowSizeClass.js";
12
16
  import { NO_SHELL_WEB_REFRESH_RUNTIME, SHELL_WEB_REFRESH_RUNTIME_KEY } from "../runtime/refreshRuntime.js";
17
+ import { PAGE_TITLE_ID, resolvePageTitle } from "../navigation/shellNavigationRuntime.js";
18
+ import { useShellNavigation, useShellNavigationRuntime } from "../navigation/useShellNavigation.js";
19
+ import ShellNavigationScope from "./ShellNavigationScope.vue";
13
20
  import ShellOutlet from "./ShellOutlet.vue";
14
21
  import ShellRouteTransition from "./ShellRouteTransition.vue";
15
22
  import { useJskitText } from "../i18n.js";
@@ -25,6 +32,7 @@ const props = defineProps({
25
32
  type: String,
26
33
  default: ""
27
34
  },
35
+ // The app bar title of pages that declare none (meta.jskit.title) and set none (useShellPageTitle).
28
36
  title: {
29
37
  type: String,
30
38
  default: ""
@@ -37,8 +45,9 @@ const props = defineProps({
37
45
  type: String,
38
46
  default: "rail"
39
47
  },
48
+ // Material 3's 360dp when unset; a number fixes the width, "content" fits the drawer to its labels.
40
49
  drawerWidth: {
41
- type: Number,
50
+ type: [Number, String],
42
51
  default: null
43
52
  },
44
53
  railWidth: {
@@ -63,12 +72,24 @@ const {
63
72
  resolvedSurfaceLabel
64
73
  } = layoutState;
65
74
  const display = useDisplay();
75
+ const route = useRoute();
66
76
  /** @type {import("../types.js").ShellRefreshRuntime} */
67
77
  const refreshRuntime = inject(SHELL_WEB_REFRESH_RUNTIME_KEY, NO_SHELL_WEB_REFRESH_RUNTIME);
78
+ const navigationRuntime = useShellNavigationRuntime();
79
+ const { canGoUp, up } = useShellNavigation();
68
80
  const navigationToggle = ref(null);
81
+ const scrolled = ref(false);
82
+ let releaseShell = null;
69
83
 
70
- const layoutClass = computed(() => resolveShellLayoutClass(display.name.value));
84
+ const viewportWidth = computed(() => display.width.value);
85
+ const sizeClass = computed(() => resolveWindowSizeClass(display.width.value));
86
+ const layoutClass = computed(() => resolveShellLayoutClass(display.width.value));
71
87
  const isCompactLayout = computed(() => layoutClass.value === "compact");
88
+ // Compact and medium windows open the drawer over the page; a medium window keeps a navigation rail beside it.
89
+ const modalLayout = computed(() => layoutClass.value !== "expanded");
90
+ const showsMediumRail = computed(() =>
91
+ layoutClass.value === "medium" && normalizeDesktopDrawerClosedMode(props.desktopDrawerClosedMode) === "rail"
92
+ );
72
93
  const {
73
94
  pullRefreshing,
74
95
  pullProgress,
@@ -84,42 +105,102 @@ const {
84
105
  resolvedDrawerWidth,
85
106
  resolvedNavigationItemSpacing,
86
107
  resolvedRailWidth
87
- } = useShellDrawer({ props, isCompactLayout, navigationToggle, layoutState });
108
+ } = useShellDrawer({ props, modalLayout, viewportWidth, navigationToggle, layoutState });
109
+
110
+ const standardDrawerVisible = computed(() => !modalLayout.value && drawerPresentation.value.visible);
111
+ // The menu control sits in the rail or drawer header when one shows, otherwise first in the app bar of a top-level
112
+ // page; an inner page's leading slot is its Up arrow.
113
+ const toggleInAppBar = computed(() => !showsMediumRail.value && !standardDrawerVisible.value);
114
+ const pageTitle = computed(() => {
115
+ const source = navigationRuntime.pageTitleSource.value;
116
+ const runtimeTitle = typeof source === "function" ? source() : "";
117
+ return (
118
+ text(runtimeTitle) ||
119
+ text(resolvePageTitle(route.matched)) ||
120
+ text(props.title) ||
121
+ resolvedSurfaceLabel.value
122
+ );
123
+ });
124
+ const navigationStyle = computed(() => ({
125
+ "--shell-navigation-item-spacing": `${resolvedNavigationItemSpacing.value}px`,
126
+ "--shell-navigation-rail-width": `${resolvedRailWidth.value}px`
127
+ }));
128
+
129
+ provide(SHELL_PAGE_ACTIONS_TARGET_KEY, `#${SHELL_PAGE_ACTIONS_ID}`);
130
+
131
+ function updateScrolled() {
132
+ scrolled.value = window.scrollY > 0;
133
+ }
134
+
135
+ function goUp() {
136
+ void up();
137
+ }
138
+
139
+ onMounted(() => {
140
+ releaseShell = navigationRuntime.attachShell();
141
+ window.addEventListener("scroll", updateScrolled, { passive: true });
142
+ updateScrolled();
143
+ });
144
+
145
+ onBeforeUnmount(() => {
146
+ releaseShell?.();
147
+ window.removeEventListener("scroll", updateScrolled);
148
+ });
88
149
  </script>
89
150
 
90
151
  <template>
91
152
  <v-app-bar
92
- :density="isCompactLayout ? 'compact' : 'comfortable'"
93
- elevation="0"
153
+ :color="scrolled ? 'surface-container' : 'surface'"
154
+ flat
155
+ :height="64"
94
156
  class="shell-layout__app-bar"
157
+ :class="`shell-layout--size-${sizeClass}`"
95
158
  data-testid="jskit-shell-app-bar"
159
+ :data-size-class="sizeClass"
96
160
  >
97
- <v-app-bar-nav-icon
98
- ref="navigationToggle"
99
- class="shell-layout__nav-toggle"
100
- data-testid="jskit-shell-nav-toggle"
101
- :aria-label="drawerToggleLabel"
102
- :aria-expanded="drawerOpen"
103
- aria-controls="jskit-shell-drawer"
104
- @click="toggleDrawer"
105
- />
106
-
107
- <slot name="top-left" :surface="resolvedSurface">
108
- <div class="shell-layout__top-left d-flex align-center ga-2">
109
- <span class="shell-layout__surface-label">
110
- {{ resolvedSurfaceLabel }}
111
- </span>
112
- <ShellOutlet target="shell-layout:top-left" />
161
+ <div class="shell-layout__app-bar-row">
162
+ <v-btn
163
+ v-if="canGoUp"
164
+ class="shell-layout__leading"
165
+ icon
166
+ variant="text"
167
+ color="on-surface"
168
+ data-testid="jskit-shell-back"
169
+ :aria-label="t('jskit.shell.actions.back')"
170
+ @click="goUp"
171
+ >
172
+ <v-icon icon="$arrowBack" />
173
+ <v-tooltip activator="parent" location="bottom" :text="t('jskit.shell.actions.back')" />
174
+ </v-btn>
175
+ <v-btn
176
+ v-else-if="toggleInAppBar"
177
+ ref="navigationToggle"
178
+ class="shell-layout__leading"
179
+ icon="$menu"
180
+ variant="text"
181
+ color="on-surface"
182
+ data-testid="jskit-shell-nav-toggle"
183
+ :aria-label="drawerToggleLabel"
184
+ :aria-expanded="drawerOpen"
185
+ aria-controls="jskit-shell-drawer"
186
+ @click="toggleDrawer"
187
+ />
188
+
189
+ <div class="shell-layout__headline" :class="{ 'shell-layout__headline--leading': canGoUp || toggleInAppBar }">
190
+ <h1 :id="PAGE_TITLE_ID" class="shell-layout__page-title" tabindex="-1" data-testid="jskit-shell-page-title">
191
+ {{ pageTitle }}
192
+ </h1>
193
+ <p v-if="props.subtitle" class="shell-layout__page-subtitle">{{ text(props.subtitle) }}</p>
113
194
  </div>
114
- </slot>
115
195
 
116
- <v-spacer />
196
+ <div :id="SHELL_PAGE_ACTIONS_ID" class="shell-layout__page-actions" />
117
197
 
118
- <slot name="top-right" :surface="resolvedSurface">
119
- <div class="shell-layout__top-right d-flex align-center ga-2">
120
- <ShellOutlet target="shell-layout:top-right" />
121
- </div>
122
- </slot>
198
+ <slot name="top-right" :surface="resolvedSurface">
199
+ <div class="shell-layout__top-right">
200
+ <ShellOutlet target="shell-layout:top-right" />
201
+ </div>
202
+ </slot>
203
+ </div>
123
204
  </v-app-bar>
124
205
 
125
206
  <div
@@ -140,6 +221,39 @@ const {
140
221
  <span class="shell-layout__pull-refresh-label">{{ pullRefreshLabel }}</span>
141
222
  </div>
142
223
 
224
+ <v-navigation-drawer
225
+ v-if="showsMediumRail"
226
+ class="shell-layout__rail"
227
+ data-testid="jskit-shell-rail"
228
+ data-presentation="rail"
229
+ :style="navigationStyle"
230
+ permanent
231
+ rail
232
+ :rail-width="resolvedRailWidth"
233
+ color="surface"
234
+ >
235
+ <div class="shell-layout__rail-header">
236
+ <v-btn
237
+ ref="navigationToggle"
238
+ icon="$menu"
239
+ variant="text"
240
+ color="on-surface-variant"
241
+ data-testid="jskit-shell-nav-toggle"
242
+ :aria-label="drawerToggleLabel"
243
+ :aria-expanded="drawerOpen"
244
+ aria-controls="jskit-shell-drawer"
245
+ @click="toggleDrawer"
246
+ />
247
+ </div>
248
+ <ShellNavigationScope presentation="rail">
249
+ <v-list nav class="shell-layout__rail-list">
250
+ <ShellOutlet target="shell-layout:primary-menu" default />
251
+ <ShellOutlet target="shell-layout:secondary-menu" />
252
+ </v-list>
253
+ </ShellNavigationScope>
254
+ </v-navigation-drawer>
255
+
256
+ <!-- A modal drawer is the outermost layout item, so it opens from the window's edge over the rail and app bar. -->
143
257
  <v-navigation-drawer
144
258
  id="jskit-shell-drawer"
145
259
  :model-value="drawerPresentation.visible"
@@ -151,52 +265,70 @@ const {
151
265
  :data-drawer-width="resolvedDrawerWidth"
152
266
  :data-navigation-item-spacing="resolvedNavigationItemSpacing"
153
267
  :data-rail-width="resolvedRailWidth"
154
- :style="{
155
- '--shell-navigation-item-spacing': `${resolvedNavigationItemSpacing}px`,
156
- '--shell-navigation-rail-width': `${resolvedRailWidth}px`
157
- }"
158
- :temporary="isCompactLayout"
159
- :permanent="!isCompactLayout"
268
+ :style="navigationStyle"
269
+ :color="modalLayout ? 'surface-container-low' : 'surface'"
270
+ :temporary="modalLayout"
271
+ :permanent="!modalLayout"
272
+ :order="modalLayout ? -1 : 0"
160
273
  :width="resolvedDrawerWidth"
161
274
  :rail="drawerPresentation.rail"
162
275
  :rail-width="resolvedRailWidth"
163
276
  @update:model-value="handleDrawerVisibilityChange"
164
277
  >
278
+ <div class="shell-layout__drawer-header">
279
+ <v-btn
280
+ v-if="standardDrawerVisible"
281
+ ref="navigationToggle"
282
+ :icon="drawerPresentation.rail ? '$menu' : '$menuOpen'"
283
+ variant="text"
284
+ color="on-surface-variant"
285
+ data-testid="jskit-shell-nav-toggle"
286
+ :aria-label="drawerToggleLabel"
287
+ :aria-expanded="drawerOpen"
288
+ aria-controls="jskit-shell-drawer"
289
+ @click="toggleDrawer"
290
+ />
291
+ <span v-if="!drawerPresentation.rail" class="shell-layout__surface-label">{{ resolvedSurfaceLabel }}</span>
292
+ </div>
293
+ <div v-if="!drawerPresentation.rail" class="shell-layout__identity">
294
+ <slot name="top-left" :surface="resolvedSurface">
295
+ <ShellOutlet target="shell-layout:top-left" />
296
+ </slot>
297
+ </div>
165
298
  <slot name="menu" :surface="resolvedSurface" :rail="drawerPresentation.rail">
166
- <v-list
167
- nav
168
- density="comfortable"
169
- class="pt-2"
170
- :prepend-gap="resolvedNavigationItemSpacing"
171
- >
172
- <ShellOutlet
173
- target="shell-layout:primary-menu"
174
- default
175
- />
176
- <v-divider class="my-2" />
177
- <ShellOutlet target="shell-layout:secondary-menu" />
178
- </v-list>
299
+ <ShellNavigationScope :presentation="drawerPresentation.rail ? 'rail' : 'drawer'">
300
+ <v-list
301
+ nav
302
+ class="shell-layout__drawer-list"
303
+ :prepend-gap="resolvedNavigationItemSpacing"
304
+ >
305
+ <ShellOutlet
306
+ target="shell-layout:primary-menu"
307
+ default
308
+ />
309
+ <v-divider class="shell-layout__drawer-divider" />
310
+ <ShellOutlet target="shell-layout:secondary-menu" />
311
+ </v-list>
312
+ </ShellNavigationScope>
179
313
  </slot>
180
314
  </v-navigation-drawer>
181
315
 
182
316
  <v-main class="bg-background">
183
- <v-container fluid class="shell-layout__content">
184
- <h1 v-if="title" class="shell-layout__title text-h5">{{ text(title) }}</h1>
185
- <p v-if="subtitle" class="shell-layout__subtitle text-body-2 text-medium-emphasis">{{ text(subtitle) }}</p>
317
+ <div class="shell-layout__content" :class="{ 'shell-layout__content--compact': isCompactLayout }">
186
318
  <ShellRouteTransition>
187
319
  <slot />
188
320
  </ShellRouteTransition>
189
- </v-container>
321
+ </div>
190
322
  </v-main>
191
323
 
192
324
  <v-bottom-navigation
193
325
  v-if="isCompactLayout"
194
326
  class="shell-layout__bottom-nav"
195
327
  data-testid="jskit-shell-bottom-nav"
196
- color="primary"
197
- density="comfortable"
328
+ bg-color="surface-container"
329
+ :elevation="0"
330
+ :height="80"
198
331
  grow
199
- mandatory
200
332
  >
201
333
  <ShellOutlet target="shell-layout:primary-bottom-nav" />
202
334
  </v-bottom-navigation>
@@ -206,21 +338,22 @@ const {
206
338
  :model-value="supportingContentOpen"
207
339
  @update:model-value="setSupportingContentOpen"
208
340
  >
209
- <v-card rounded="t-xl" class="shell-layout__supporting-sheet" data-testid="jskit-shell-supporting-bottom-sheet">
210
- <v-card-title class="shell-layout__supporting-title">
211
- <span>{{ text(supportingContentTitle) || t("jskit.shell.layout.details") }}</span>
212
- <v-btn variant="text" @click="closeSupportingContent">{{ t("jskit.shell.actions.close") }}</v-btn>
213
- </v-card-title>
214
- <v-card-text>
341
+ <v-card class="shell-layout__supporting-sheet" data-testid="jskit-shell-supporting-bottom-sheet">
342
+ <div class="shell-layout__supporting-title">
343
+ <h2 class="shell-layout__supporting-headline">{{ text(supportingContentTitle) || t("jskit.shell.layout.details") }}</h2>
344
+ <v-btn icon="$close" variant="text" color="on-surface-variant" :aria-label="t('jskit.shell.actions.close')" @click="closeSupportingContent" />
345
+ </div>
346
+ <div class="shell-layout__supporting-body">
215
347
  <ShellOutlet target="shell-layout:supporting-bottom-sheet" />
216
- </v-card-text>
348
+ </div>
217
349
  </v-card>
218
350
  </v-bottom-sheet>
219
351
 
220
352
  <v-navigation-drawer
221
353
  v-if="!isCompactLayout"
222
354
  :model-value="supportingContentOpen"
223
- border
355
+ class="shell-layout__supporting-side-sheet"
356
+ color="surface-container-low"
224
357
  temporary
225
358
  location="right"
226
359
  :width="384"
@@ -229,8 +362,8 @@ const {
229
362
  >
230
363
  <div class="shell-layout__supporting-side-panel">
231
364
  <div class="shell-layout__supporting-title">
232
- <strong>{{ text(supportingContentTitle) || t("jskit.shell.layout.details") }}</strong>
233
- <v-btn variant="text" @click="closeSupportingContent">{{ t("jskit.shell.actions.close") }}</v-btn>
365
+ <h2 class="shell-layout__supporting-headline">{{ text(supportingContentTitle) || t("jskit.shell.layout.details") }}</h2>
366
+ <v-btn icon="$close" variant="text" color="on-surface-variant" :aria-label="t('jskit.shell.actions.close')" @click="closeSupportingContent" />
234
367
  </div>
235
368
  <ShellOutlet target="shell-layout:supporting-side-panel" />
236
369
  </div>
@@ -238,62 +371,161 @@ const {
238
371
  </template>
239
372
 
240
373
  <style scoped>
241
- /*
242
- * Shell chrome follows the app's Vuetify theme and is restyled through these
243
- * custom properties (set them on :root or any ancestor):
244
- * --shell-chrome-border-width / --shell-chrome-border-color shared dividers
245
- * --shell-app-bar-border-width, --shell-navigation-border-width,
246
- * --shell-bottom-navigation-border-width per-edge overrides
247
- * --shell-app-bar-background, --shell-navigation-background,
248
- * --shell-bottom-navigation-background surfaces
249
- * A Material 3 restyle sets the border widths to 0 and separates surfaces
250
- * tonally, e.g. --shell-navigation-background: rgb(var(--v-theme-surface-container-low)).
251
- */
374
+ /* Material 3 small top app bar: 64dp, surface at rest and surface-container once the page scrolls under it. */
252
375
  .shell-layout__app-bar {
253
- border-style: solid;
254
- border-color: var(--shell-chrome-border-color, rgba(var(--v-border-color), var(--v-border-opacity)));
255
- border-width: 0 0 var(--shell-app-bar-border-width, var(--shell-chrome-border-width, thin));
256
- background: var(--shell-app-bar-background, rgb(var(--v-theme-surface)));
376
+ transition: background-color 200ms cubic-bezier(0.2, 0, 0, 1);
377
+ }
378
+
379
+ .shell-layout__app-bar :deep(.v-toolbar__content) {
380
+ padding: 0;
381
+ }
382
+
383
+ .shell-layout__app-bar-row {
384
+ align-items: center;
385
+ display: flex;
386
+ height: 100%;
387
+ inline-size: 100%;
388
+ min-width: 0;
389
+ padding-inline: 4px;
390
+ }
391
+
392
+ .shell-layout__leading {
393
+ flex: 0 0 auto;
394
+ }
395
+
396
+ .shell-layout__headline {
397
+ flex: 1 1 auto;
398
+ min-width: 0;
399
+ padding-inline: 12px 4px;
400
+ }
401
+
402
+ .shell-layout__headline--leading {
403
+ padding-inline-start: 4px;
404
+ }
405
+
406
+ .shell-layout__page-title {
257
407
  color: rgb(var(--v-theme-on-surface));
408
+ font-size: 1.375rem;
409
+ font-weight: 400;
410
+ letter-spacing: 0;
411
+ line-height: 1.75rem;
412
+ margin: 0;
413
+ outline: none;
414
+ overflow: hidden;
415
+ text-overflow: ellipsis;
416
+ white-space: nowrap;
417
+ }
418
+
419
+ .shell-layout__page-subtitle {
420
+ color: rgb(var(--v-theme-on-surface-variant));
421
+ font-size: 0.75rem;
422
+ font-weight: 500;
423
+ letter-spacing: 0.03125rem;
424
+ line-height: 1rem;
425
+ margin: 0;
426
+ overflow: hidden;
427
+ text-overflow: ellipsis;
428
+ white-space: nowrap;
429
+ }
430
+
431
+ .shell-layout__page-actions,
432
+ .shell-layout__top-right {
433
+ align-items: center;
434
+ color: rgb(var(--v-theme-on-surface-variant));
435
+ display: flex;
436
+ flex: 0 0 auto;
437
+ min-width: 0;
438
+ }
439
+
440
+ .shell-layout__page-actions:empty {
441
+ display: none;
258
442
  }
259
443
 
444
+ /* Navigation rail (medium windows, and expanded ones with the drawer collapsed): 80dp, menu control on top. */
445
+ .shell-layout__rail,
260
446
  .shell-layout__drawer {
261
- border-style: solid;
262
- border-color: var(--shell-chrome-border-color, rgba(var(--v-border-color), var(--v-border-opacity)));
263
- border-width: 0;
264
- border-inline-end-width: var(--shell-navigation-border-width, var(--shell-chrome-border-width, thin));
265
- background: var(--shell-navigation-background, rgb(var(--v-theme-surface)));
447
+ border: 0;
266
448
  }
267
449
 
268
- .shell-layout__content {
269
- padding: 0.75rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
450
+ .shell-layout__rail-header,
451
+ .shell-layout__drawer-header {
452
+ align-items: center;
453
+ display: flex;
454
+ gap: 4px;
455
+ min-height: 56px;
456
+ padding-block: 4px;
270
457
  }
271
458
 
272
- .shell-layout__top-left,
273
- .shell-layout__top-right {
459
+ .shell-layout__rail-header,
460
+ .shell-layout__drawer[data-presentation="rail"] .shell-layout__drawer-header {
461
+ justify-content: center;
462
+ }
463
+
464
+ .shell-layout__drawer:not([data-presentation="rail"]) .shell-layout__drawer-header {
465
+ padding-inline: 24px 12px;
466
+ }
467
+
468
+ .shell-layout__drawer[data-presentation="drawer"] .shell-layout__drawer-header {
469
+ padding-inline-start: max(0px, calc(var(--shell-navigation-rail-width) / 2 - 24px));
470
+ }
471
+
472
+ .shell-layout__surface-label {
473
+ color: rgb(var(--v-theme-on-surface-variant));
474
+ font-size: 0.875rem;
475
+ font-weight: 500;
476
+ letter-spacing: 0.00625rem;
477
+ line-height: 1.25rem;
478
+ min-width: 0;
479
+ overflow: hidden;
480
+ padding-inline-start: 4px;
481
+ text-overflow: ellipsis;
482
+ white-space: nowrap;
483
+ }
484
+
485
+ .shell-layout__identity {
274
486
  min-width: 0;
487
+ padding-inline: 12px;
275
488
  }
276
489
 
277
- .shell-layout__nav-toggle {
278
- min-height: 48px;
490
+ .shell-layout__identity:empty {
491
+ display: none;
492
+ }
493
+
494
+ .shell-layout__rail-list,
495
+ .shell-layout__drawer[data-presentation="rail"] .shell-layout__drawer-list {
496
+ display: flex;
497
+ flex-direction: column;
498
+ gap: 4px;
499
+ padding: 0;
500
+ }
501
+
502
+ .shell-layout__rail-list :deep(.v-list-item),
503
+ .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item) {
504
+ inline-size: 100%;
505
+ justify-content: center;
506
+ margin: 0;
507
+ min-height: 56px;
279
508
  min-width: 48px;
280
509
  }
281
510
 
282
- .shell-layout__drawer :deep(.v-list-item-title) {
283
- white-space: nowrap;
511
+ .shell-layout__drawer[data-presentation="rail"] .shell-layout__drawer-divider {
512
+ display: none;
284
513
  }
285
514
 
515
+ /* Navigation drawer: items 56dp pills inset 12dp, icons lined up with the rail's. */
286
516
  .shell-layout__drawer {
287
517
  --shell-navigation-drawer-inset: 12px;
288
518
  --shell-navigation-icon-size: 24px;
289
519
  }
290
520
 
291
- .shell-layout__drawer[data-presentation="drawer"] :deep(.v-list--nav) {
521
+ .shell-layout__drawer:not([data-presentation="rail"]) .shell-layout__drawer-list {
522
+ padding-block: 0 12px;
292
523
  padding-inline-end: calc(var(--shell-navigation-item-spacing) / 2);
293
524
  padding-inline-start: var(--shell-navigation-drawer-inset);
294
525
  }
295
526
 
296
- .shell-layout__drawer[data-presentation="drawer"] :deep(.v-list-item) {
527
+ .shell-layout__drawer:not([data-presentation="rail"]) :deep(.v-list-item) {
528
+ margin-bottom: 0;
297
529
  padding-inline-end: calc(var(--shell-navigation-item-spacing) / 2);
298
530
  padding-inline-start: max(
299
531
  0px,
@@ -305,82 +537,45 @@ const {
305
537
  );
306
538
  }
307
539
 
308
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item) {
309
- grid-template-areas: "prepend";
310
- grid-template-columns: minmax(0, 1fr);
311
- inline-size: 100%;
312
- min-height: 48px;
313
- min-width: 48px;
314
- padding-inline: 0;
540
+ .shell-layout__drawer :deep(.v-list-item-title) {
541
+ white-space: nowrap;
315
542
  }
316
543
 
317
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item__prepend) {
318
- inline-size: 100%;
319
- justify-content: center;
320
- min-width: 0;
544
+ .shell-layout__drawer-divider {
545
+ margin-block: 8px;
546
+ margin-inline: 16px;
321
547
  }
322
548
 
323
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item__prepend .v-list-item__spacer),
324
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item__content),
325
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item__append) {
549
+ /* The divider separates the secondary destinations from the primary ones, so it goes when either group is empty
550
+ (a compact window's drawer has no primary destinations: they are in the navigation bar). */
551
+ .shell-layout__drawer-divider:first-child,
552
+ .shell-layout__drawer-divider:last-child {
326
553
  display: none;
327
554
  }
328
555
 
329
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item__overlay) {
330
- border-radius: 999px;
331
- inset-block: 8px;
332
- inset-inline: 4px;
333
- }
334
-
335
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item--active > .v-list-item__overlay) {
336
- background: color-mix(
337
- in srgb,
338
- rgb(var(--v-theme-primary)) 18%,
339
- rgb(var(--v-theme-surface))
340
- );
341
- opacity: 1;
342
- }
343
-
344
- .shell-layout__drawer[data-presentation="rail"] :deep(.v-list-item--active .v-icon) {
345
- color: rgb(var(--v-theme-primary));
346
- opacity: 1;
347
- }
348
-
349
- .shell-layout__top-right {
350
- max-width: min(45vw, 18rem);
351
- overflow: hidden;
352
- }
353
-
354
- .shell-layout__surface-label {
355
- color: rgb(var(--v-theme-on-surface));
356
- display: block;
357
- font-size: 0.95rem;
358
- font-weight: 650;
359
- letter-spacing: -0.01em;
360
- line-height: 1.2;
361
- max-width: 12rem;
362
- overflow: hidden;
363
- text-overflow: ellipsis;
364
- white-space: nowrap;
556
+ /* Modal drawer: Material 3 rounds its trailing corners 16dp. */
557
+ .shell-layout__drawer[data-presentation="modal"] {
558
+ border-end-end-radius: 16px;
559
+ border-start-end-radius: 16px;
365
560
  }
366
561
 
367
- .shell-layout__title {
368
- margin-bottom: 0.25rem;
562
+ /* Material 3 window margins: 16dp on compact windows, 24dp wider. */
563
+ .shell-layout__content {
564
+ padding: 8px 24px calc(24px + env(safe-area-inset-bottom, 0px));
369
565
  }
370
566
 
371
- .shell-layout__subtitle {
372
- margin-bottom: 0.75rem;
567
+ .shell-layout__content--compact {
568
+ padding-inline: 16px;
373
569
  }
374
570
 
571
+ /* Navigation bar (compact windows): 80dp on surface-container. */
375
572
  .shell-layout__bottom-nav {
376
- border-top: var(--shell-bottom-navigation-border-width, var(--shell-chrome-border-width, thin)) solid
377
- var(--shell-chrome-border-color, rgba(var(--v-border-color), var(--v-border-opacity)));
378
- background: var(--shell-bottom-navigation-background, rgb(var(--v-theme-surface)));
379
573
  padding-bottom: env(safe-area-inset-bottom, 0px);
380
574
  }
381
575
 
382
- .shell-layout__bottom-nav :deep(.v-btn) {
383
- min-height: 48px;
576
+ .shell-layout__bottom-nav :deep(.v-bottom-navigation__content) {
577
+ gap: 8px;
578
+ padding-inline: 8px;
384
579
  }
385
580
 
386
581
  .shell-layout__supporting-sheet {
@@ -388,42 +583,63 @@ const {
388
583
  overflow: auto;
389
584
  }
390
585
 
586
+ .shell-layout__supporting-side-sheet {
587
+ border: 0;
588
+ border-end-start-radius: 16px;
589
+ border-start-start-radius: 16px;
590
+ }
591
+
391
592
  .shell-layout__supporting-side-panel {
392
593
  display: flex;
393
594
  flex-direction: column;
394
- gap: 1rem;
395
- padding: 1rem;
595
+ gap: 16px;
596
+ padding: 12px 12px 24px 24px;
396
597
  }
397
598
 
398
599
  .shell-layout__supporting-title {
399
600
  align-items: center;
400
601
  display: flex;
401
- gap: 0.75rem;
602
+ gap: 12px;
402
603
  justify-content: space-between;
604
+ min-height: 56px;
605
+ }
606
+
607
+ .shell-layout__supporting-sheet .shell-layout__supporting-title {
608
+ padding: 12px 12px 0 24px;
609
+ }
610
+
611
+ .shell-layout__supporting-body {
612
+ padding: 0 24px 24px;
403
613
  }
404
614
 
405
- .shell-layout__supporting-title :deep(.v-btn) {
406
- min-height: 48px;
615
+ .shell-layout__supporting-headline {
616
+ color: rgb(var(--v-theme-on-surface-variant));
617
+ font-size: 1.375rem;
618
+ font-weight: 400;
619
+ line-height: 1.75rem;
620
+ margin: 0;
407
621
  }
408
622
 
409
623
  .shell-layout__pull-refresh {
410
624
  align-items: center;
411
- background: rgb(var(--v-theme-surface));
412
- border: 1px solid rgba(var(--v-border-color), var(--v-border-opacity));
413
- border-radius: 999px;
414
- box-shadow: var(--v-shadow-3);
625
+ background: rgb(var(--v-theme-surface-container-low));
626
+ border-radius: 9999px;
627
+ box-shadow:
628
+ 0 1px 2px 0 rgba(var(--v-theme-shadow), 0.3),
629
+ 0 2px 6px 2px rgba(var(--v-theme-shadow), 0.15);
630
+ color: rgb(var(--v-theme-on-surface));
415
631
  display: flex;
416
- gap: 0.5rem;
632
+ gap: 8px;
417
633
  left: 50%;
418
634
  opacity: min(1, calc(var(--shell-pull-refresh-distance) / 56));
419
- padding: 0.45rem 0.75rem;
635
+ padding: 8px 12px;
420
636
  pointer-events: none;
421
637
  position: fixed;
422
- top: calc(env(safe-area-inset-top, 0px) + 3.75rem);
638
+ top: calc(env(safe-area-inset-top, 0px) + 72px);
423
639
  transform: translate3d(-50%, calc((var(--shell-pull-refresh-distance) - 72px) * 0.35), 0);
424
640
  transition:
425
- opacity 160ms ease,
426
- transform 160ms ease;
641
+ opacity 200ms cubic-bezier(0.2, 0, 0, 1),
642
+ transform 200ms cubic-bezier(0.2, 0, 0, 1);
427
643
  z-index: 2700;
428
644
  }
429
645
 
@@ -432,24 +648,10 @@ const {
432
648
  }
433
649
 
434
650
  .shell-layout__pull-refresh-label {
435
- font-size: 0.78rem;
436
- font-weight: 600;
651
+ font-size: 0.75rem;
652
+ font-weight: 500;
653
+ letter-spacing: 0.03125rem;
654
+ line-height: 1rem;
437
655
  white-space: nowrap;
438
656
  }
439
-
440
- @media (max-width: 640px) {
441
- .shell-layout__content {
442
- padding-inline:
443
- calc(1px + env(safe-area-inset-left, 0px))
444
- calc(1px + env(safe-area-inset-right, 0px));
445
- }
446
-
447
- .shell-layout__surface-label {
448
- max-width: 8rem;
449
- }
450
-
451
- .shell-layout__top-right {
452
- max-width: 40vw;
453
- }
454
- }
455
657
  </style>