@metamorph-labs/polymorph-vue-ui 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +134 -0
- package/dist/ai/ArtifactPane.js.map +1 -1
- package/dist/ai/ArtifactPane.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/archetypes/MasterDetailPage.js.map +1 -1
- package/dist/archetypes/MasterDetailPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/archetypes/MasterDetailPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/archetypes/app-shell.css +1 -1
- package/dist/archetypes/app-shell.module.js +2 -2
- package/dist/archetypes/app-shell.module.js.map +1 -1
- package/dist/controls/RichTextInput.js +7 -0
- package/dist/controls/RichTextInput.js.map +1 -0
- package/dist/controls/RichTextInput.vue_vue_type_script_setup_true_lang.js +1123 -0
- package/dist/controls/RichTextInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/controls/rich-text-input.css +1 -0
- package/dist/controls/rich-text-input.module.js +47 -0
- package/dist/controls/rich-text-input.module.js.map +1 -0
- package/dist/controls/selection-bar.css +1 -0
- package/dist/controls/selection-bar.module.js +11 -0
- package/dist/controls/selection-bar.module.js.map +1 -0
- package/dist/index.js +41 -39
- package/dist/index.js.map +1 -1
- package/dist/node/ai/ArtifactPane.js.map +1 -1
- package/dist/node/ai/ArtifactPane.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/archetypes/MasterDetailPage.js.map +1 -1
- package/dist/node/archetypes/MasterDetailPage.vue_vue_type_script_setup_true_lang.js +1 -1
- package/dist/node/archetypes/MasterDetailPage.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/archetypes/app-shell.module.js +2 -2
- package/dist/node/archetypes/app-shell.module.js.map +1 -1
- package/dist/node/controls/RichTextInput.js +7 -0
- package/dist/node/controls/RichTextInput.js.map +1 -0
- package/dist/node/controls/RichTextInput.vue_vue_type_script_setup_true_lang.js +1123 -0
- package/dist/node/controls/RichTextInput.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/node/controls/rich-text-input.module.js +46 -0
- package/dist/node/controls/rich-text-input.module.js.map +1 -0
- package/dist/node/controls/selection-bar.module.js +10 -0
- package/dist/node/controls/selection-bar.module.js.map +1 -0
- package/dist/node/index.js +41 -39
- package/dist/node/index.js.map +1 -1
- package/dist/node/overlays/Toast.js.map +1 -1
- package/dist/node/overlays/Toast.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/node/overlays/Toast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/Accordion.js.map +1 -1
- package/dist/node/structure/Accordion.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/node/structure/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/Collapsible.js.map +1 -1
- package/dist/node/structure/Collapsible.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/node/structure/Collapsible.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/CursorPagination.js.map +1 -1
- package/dist/node/structure/CursorPagination.vue_vue_type_script_setup_true_lang.js +140 -93
- package/dist/node/structure/CursorPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/Image.js.map +1 -1
- package/dist/node/structure/Image.vue_vue_type_script_setup_true_lang.js +30 -18
- package/dist/node/structure/Image.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/Pagination.js.map +1 -1
- package/dist/node/structure/Pagination.vue_vue_type_script_setup_true_lang.js +124 -71
- package/dist/node/structure/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/node/structure/RichTextContent.js +7 -0
- package/dist/node/structure/RichTextContent.js.map +1 -0
- package/dist/node/structure/RichTextContent.vue_vue_type_script_setup_true_lang.js +298 -0
- package/dist/node/structure/RichTextContent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/node/structure/RichTextContentBlocks.js +7 -0
- package/dist/node/structure/RichTextContentBlocks.js.map +1 -0
- package/dist/node/structure/RichTextContentBlocks.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/node/structure/RichTextContentBlocks.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/node/structure/RichTextContentInlines.js +7 -0
- package/dist/node/structure/RichTextContentInlines.js.map +1 -0
- package/dist/node/structure/RichTextContentInlines.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/node/structure/RichTextContentInlines.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/node/structure/RichTextContentItem.js +7 -0
- package/dist/node/structure/RichTextContentItem.js.map +1 -0
- package/dist/node/structure/RichTextContentItem.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/node/structure/RichTextContentItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/node/structure/code-block.module.js +2 -2
- package/dist/node/structure/code-block.module.js.map +1 -1
- package/dist/node/structure/cursor-pagination.module.js +6 -3
- package/dist/node/structure/cursor-pagination.module.js.map +1 -1
- package/dist/node/structure/pagination.module.js +6 -3
- package/dist/node/structure/pagination.module.js.map +1 -1
- package/dist/node/structure/rich-text-content.module.js +18 -0
- package/dist/node/structure/rich-text-content.module.js.map +1 -0
- package/dist/overlays/Toast.js.map +1 -1
- package/dist/overlays/Toast.vue_vue_type_script_setup_true_lang.js +27 -27
- package/dist/overlays/Toast.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/Accordion.js.map +1 -1
- package/dist/structure/Accordion.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/structure/Accordion.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/Collapsible.js.map +1 -1
- package/dist/structure/Collapsible.vue_vue_type_script_setup_true_lang.js +4 -0
- package/dist/structure/Collapsible.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/CursorPagination.js.map +1 -1
- package/dist/structure/CursorPagination.vue_vue_type_script_setup_true_lang.js +140 -93
- package/dist/structure/CursorPagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/Image.js.map +1 -1
- package/dist/structure/Image.vue_vue_type_script_setup_true_lang.js +30 -18
- package/dist/structure/Image.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/Pagination.js.map +1 -1
- package/dist/structure/Pagination.vue_vue_type_script_setup_true_lang.js +124 -71
- package/dist/structure/Pagination.vue_vue_type_script_setup_true_lang.js.map +1 -1
- package/dist/structure/RichTextContent.js +7 -0
- package/dist/structure/RichTextContent.js.map +1 -0
- package/dist/structure/RichTextContent.vue_vue_type_script_setup_true_lang.js +298 -0
- package/dist/structure/RichTextContent.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/structure/RichTextContentBlocks.js +7 -0
- package/dist/structure/RichTextContentBlocks.js.map +1 -0
- package/dist/structure/RichTextContentBlocks.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/structure/RichTextContentBlocks.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/structure/RichTextContentInlines.js +7 -0
- package/dist/structure/RichTextContentInlines.js.map +1 -0
- package/dist/structure/RichTextContentInlines.vue_vue_type_script_setup_true_lang.js +69 -0
- package/dist/structure/RichTextContentInlines.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/structure/RichTextContentItem.js +7 -0
- package/dist/structure/RichTextContentItem.js.map +1 -0
- package/dist/structure/RichTextContentItem.vue_vue_type_script_setup_true_lang.js +94 -0
- package/dist/structure/RichTextContentItem.vue_vue_type_script_setup_true_lang.js.map +1 -0
- package/dist/structure/code-block.css +1 -1
- package/dist/structure/code-block.module.js +2 -2
- package/dist/structure/code-block.module.js.map +1 -1
- package/dist/structure/cursor-pagination.css +1 -1
- package/dist/structure/cursor-pagination.module.js +6 -3
- package/dist/structure/cursor-pagination.module.js.map +1 -1
- package/dist/structure/pagination.css +1 -1
- package/dist/structure/pagination.module.js +6 -3
- package/dist/structure/pagination.module.js.map +1 -1
- package/dist/structure/rich-text-content.css +1 -0
- package/dist/structure/rich-text-content.module.js +19 -0
- package/dist/structure/rich-text-content.module.js.map +1 -0
- package/dist/types/ai/ArtifactPane.vue.d.ts +1 -1
- package/dist/types/ai/AttachmentChip.vue.d.ts +1 -1
- package/dist/types/ai/ToolCall.vue.d.ts +1 -1
- package/dist/types/controls/RichTextInput.vue.d.ts +210 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/overlays/CommandPanel.vue.d.ts +2 -2
- package/dist/types/structure/Accordion.vue.d.ts +7 -0
- package/dist/types/structure/Collapsible.vue.d.ts +7 -0
- package/dist/types/structure/CursorPagination.vue.d.ts +13 -0
- package/dist/types/structure/EmptyState.vue.d.ts +1 -1
- package/dist/types/structure/Image.vue.d.ts +13 -0
- package/dist/types/structure/Pagination.vue.d.ts +8 -0
- package/dist/types/structure/RichTextContent.vue.d.ts +59 -0
- package/dist/types/structure/RichTextContentBlocks.vue.d.ts +7 -0
- package/dist/types/structure/RichTextContentInlines.vue.d.ts +7 -0
- package/dist/types/structure/RichTextContentItem.vue.d.ts +7 -0
- package/package.json +17 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,139 @@
|
|
|
1
1
|
# @polymorph/vue-ui
|
|
2
2
|
|
|
3
|
+
## 1.0.17
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 740bebf: Accordion and Collapsible take `keepMounted`, an optional prop with the name Tabs uses. In React a
|
|
8
|
+
closed region's content then stays in the document, `hidden`, so a page's server markup carries it
|
|
9
|
+
and state inside the region survives a close: an FAQ's answers are in the HTML a crawler reads
|
|
10
|
+
without running a script. The region is hidden once its close animation ends. Without the prop
|
|
11
|
+
React leaves closed content out, as before. The Vue, Svelte, Solid, Angular and elements members
|
|
12
|
+
already keep a closed region's content in the document, `hidden`, so they accept the prop and it
|
|
13
|
+
changes nothing there. The SwiftUI and Compose contracts gain the field, and neither rendering
|
|
14
|
+
draws it: SwiftUI lays a closed region's content out at no height in every case, and Compose
|
|
15
|
+
leaves it out.
|
|
16
|
+
- e761a13: Image takes two optional props that steer the browser's fetch, for a public page whose first
|
|
17
|
+
picture decides how fast it loads:
|
|
18
|
+
|
|
19
|
+
```tsx
|
|
20
|
+
<Image
|
|
21
|
+
src="/harbour-800.jpg"
|
|
22
|
+
srcSet="/harbour-400.jpg 400w, /harbour-800.jpg 800w, /harbour-1600.jpg 1600w"
|
|
23
|
+
alt="A harbour at dusk"
|
|
24
|
+
width={800}
|
|
25
|
+
height={500}
|
|
26
|
+
loading="eager"
|
|
27
|
+
fetchPriority="high"
|
|
28
|
+
/>
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
- `srcSet` is the element's `srcset`, passed unchanged. The browser requests the file that suits
|
|
32
|
+
the screen, so a phone does not download a desktop's file. `src` stays required.
|
|
33
|
+
- The element's `sizes` is not a prop, because the red rules refuse a length in application
|
|
34
|
+
code. The member writes it for a set that gives widths, from the frame's box: `width` pixels
|
|
35
|
+
and never more than the viewport's width for a frame with `width` and `height`, wider by the
|
|
36
|
+
crop for a picture that covers a frame of a narrower ratio, and the element's own laid-out
|
|
37
|
+
width first (`auto`) for a lazy picture drawn as wide as its frame. A set that gives widths
|
|
38
|
+
needs a box, from `width` and `height` or from `aspectRatio`: without one the set is ignored,
|
|
39
|
+
with a development warning, because it would stretch the frame to its container.
|
|
40
|
+
- `fetchPriority` is the element's `fetchpriority`: `high` for the one picture that is the largest
|
|
41
|
+
content of the first view, with `loading="eager"`.
|
|
42
|
+
- A change of `srcSet` is a new request, as a change of `src` is: the frame returns to loading,
|
|
43
|
+
and a failure is forgotten.
|
|
44
|
+
|
|
45
|
+
An element takes them as `src-set` and `fetch-priority`. Without the props the markup is what it
|
|
46
|
+
was. On iOS and Android neither is honoured: the view requests the `src`.
|
|
47
|
+
|
|
48
|
+
- 529dfa9: Pagination takes `getPageHref(page)`, and CursorPagination takes `previousHref` and `nextHref`.
|
|
49
|
+
Both are optional. With them, each control that goes to another page is a real `<a href>` with the
|
|
50
|
+
look of the Button it replaces, so a crawler reaches a public list's later pages and a reader can
|
|
51
|
+
open one in a new tab. In the append form, `nextHref` is the "Load more" action's address. A click
|
|
52
|
+
that would navigate the current tab calls the existing handler (`onPageChange`, `onPrevious`,
|
|
53
|
+
`onNext`) with the browser's navigation stopped, so the app changes the page as it does today; a
|
|
54
|
+
click with a modifier key opens the address. The current page, a control with nowhere to go, a
|
|
55
|
+
held pager and a window in flight stay Buttons. A link follows from Enter and not from Space, as
|
|
56
|
+
a link does. Without the props, the markup is unchanged. On a page written in HTML,
|
|
57
|
+
`previous-href` and `next-href` are attributes, and `getPageHref` is a property set from script.
|
|
58
|
+
The pagers' recipes gain the link's classes, which compose Button's.
|
|
59
|
+
- b33e18c: Each package's registry listing has `keywords`, which it had none of, and a description that
|
|
60
|
+
names the Polymorph design system. A vocabulary's description says it holds the system's
|
|
61
|
+
components for its framework. A search of the registry for a design system or for components in
|
|
62
|
+
a framework matches the packages by those words. No file a consumer imports changes.
|
|
63
|
+
- f525c25: `RichTextContent` in Vue, Svelte, Solid and Angular, and as `<poly-rich-text-content>`, generated
|
|
64
|
+
from one description and held to the React member's contract.
|
|
65
|
+
|
|
66
|
+
- Its `entity` function is each framework's slot that takes an argument: a scoped slot in Vue, a
|
|
67
|
+
snippet in Svelte, a function in Solid, an `ng-template` in Angular and a function property on
|
|
68
|
+
the element. Where it draws nothing for an entity, the member draws the entity's token.
|
|
69
|
+
- `@polymorph/engine/rich-text` exports `richTextDrawing`, which reads a document into the blocks
|
|
70
|
+
and inlines each framework's member draws, with the highlights nested and the positions of
|
|
71
|
+
the plain text. It reads no DOM, so it runs on a server. `@polymorph/engine` exports the
|
|
72
|
+
reading of a selection and of a press or key on a highlight (`mapRichTextSelection`,
|
|
73
|
+
`richTextSelectionBox`, `richTextPressedAnnotation`, `richTextKeyedAnnotation`). The React
|
|
74
|
+
member draws from the same functions, and its markup is unchanged.
|
|
75
|
+
- Each foundation exports `slotDraws`, which says whether a slot that takes an argument draws
|
|
76
|
+
anything for one.
|
|
77
|
+
|
|
78
|
+
- 0619f1f: `RichTextInput` in Vue, Svelte, Solid and Angular, and as `<poly-rich-text-input>`, generated from
|
|
79
|
+
one description and held to the React member's contract.
|
|
80
|
+
|
|
81
|
+
- Its `toolbar`, `selectionActions` and `footer` functions are each framework's slot that takes
|
|
82
|
+
an argument: a scoped slot in Vue, a snippet in Svelte, a function in Solid, an `ng-template` in
|
|
83
|
+
Angular and a function property on the element. The argument is the field's handle.
|
|
84
|
+
- An Angular output and an element's event carry one value, so `submit` there carries the
|
|
85
|
+
document and not the handle; the slots receive the handle.
|
|
86
|
+
- `@polymorph/engine` exports the keyboard of a toolbar with one tab stop (`toolbarKeydown`,
|
|
87
|
+
`syncToolbarStop` and the functions beside them) and the places of a bar at the selected text
|
|
88
|
+
and of a list at a token (`placeSelectionBar`, `followSelectionBar`, `placeTokenList`), which
|
|
89
|
+
every framework's member calls. The React member calls the same functions.
|
|
90
|
+
- `@polymorph/engine` also exports what makes a field of several parts behave as one control:
|
|
91
|
+
`followFieldFocus` (focus entering and leaving the field as a whole), `followFormReset` and
|
|
92
|
+
`focusOnLabelPress`.
|
|
93
|
+
- A states fixture entry can select words once they are drawn: the Svelte foundation's `Held`
|
|
94
|
+
takes `selects`, and the Angular foundation exports `selectOnce`.
|
|
95
|
+
|
|
96
|
+
- 2138e8f: A Vue application that renders on a server hydrates a declared `Toast` with no mismatch. The
|
|
97
|
+
member draws nothing, and its template was empty, which a server renders as no markup and a browser
|
|
98
|
+
as a comment. It now writes a branch that never renders, which is a comment in both.
|
|
99
|
+
|
|
100
|
+
`typeInto` and `pressOnce`, the Angular foundation's helpers for a states fixture, no longer call
|
|
101
|
+
`cancelAnimationFrame` when a server destroys a fixture that asked for no frame. A server has no
|
|
102
|
+
such function, so a server render of a fixture that uses one threw as the server destroyed it, and
|
|
103
|
+
returned no markup.
|
|
104
|
+
|
|
105
|
+
Every states fixture entry of the Vue, Solid and Angular vocabularies is now rendered on a server
|
|
106
|
+
and hydrated by a law (`packages/{vue,solid,angular}-ui/server-render.test.ts`). Vue's and
|
|
107
|
+
Angular's members hydrate. Solid's do except the entries the law lists, in members that are
|
|
108
|
+
given a node inside a value or a slot ([docs/consuming.md](../docs/consuming.md#a-solid-app)).
|
|
109
|
+
|
|
110
|
+
- f673c3c: A Solid application that renders on a server hydrates every member. Before, a development build
|
|
111
|
+
threw on entries of these members (Avatar.Group, DescriptionList, CommentThread, DataTable,
|
|
112
|
+
ArtifactPane, AppShell, ListPage, Dashboard, MasterDetailPage, SearchPage and ConversationPage).
|
|
113
|
+
A slot's content and a prop's value that holds nodes now take their place in the hydration where
|
|
114
|
+
the member declares them, a prop that holds nodes is read once, a member the server did not draw
|
|
115
|
+
is created as new elements, and a portal's content is created outside the hydration. The
|
|
116
|
+
foundation exports what the members use for it: `createKept` and `afresh`.
|
|
117
|
+
|
|
118
|
+
A hydrated Solid `Textarea` and `PromptInput` hold their value. The server wrote it as an
|
|
119
|
+
attribute, which a browser does not read, and now writes it as the textarea's content too.
|
|
120
|
+
|
|
121
|
+
`MasterDetailPage` draws the detail on a server when one is given, in Vue, Svelte, Solid and
|
|
122
|
+
Angular. Its `selected` state started `false` and an effect set it, so a server drew the pane for
|
|
123
|
+
nothing selected.
|
|
124
|
+
|
|
125
|
+
The Solid server-render law now compares each hydrated document with a mount of the same entry
|
|
126
|
+
([docs/consuming.md](../docs/consuming.md#a-solid-app)).
|
|
127
|
+
|
|
128
|
+
- Updated dependencies [1f81f23]
|
|
129
|
+
- Updated dependencies [62e1f8b]
|
|
130
|
+
- Updated dependencies [529dfa9]
|
|
131
|
+
- Updated dependencies [b33e18c]
|
|
132
|
+
- Updated dependencies [f525c25]
|
|
133
|
+
- Updated dependencies [5dc8255]
|
|
134
|
+
- @polymorph/recipes@1.0.17
|
|
135
|
+
- @polymorph/vue@1.0.17
|
|
136
|
+
|
|
3
137
|
## 1.0.16
|
|
4
138
|
|
|
5
139
|
### Patch Changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactPane.js","names":[],"sources":["../../src/ai/ArtifactPane.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A side pane that shows one artifact a turn produced (`design/components/artifact-pane.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/artifact-pane.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n type VNode,\n} from 'vue'\n\nimport { Icon, agentMember, useListening } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/ai/artifact-pane.module.css'\nimport Button from '../controls/Button.vue'\nimport SegmentedControl from '../controls/SegmentedControl.vue'\nimport Spinner from '../structure/Spinner.vue'\n\nexport type ArtifactKind = 'code' | 'document' | 'data' | 'preview'\n\nexport interface ArtifactView {\n id: string\n label: string\n content: VNode | string\n}\n\nexport interface ArtifactPaneProps {\n /**\n * The close button's accessible name (generic default `Close`), which localized hosts replace.\n */\n closeLabel?: string\n defaultView?: string\n /**\n * The artifact's kind, which picks the mark (the tier's `artifact` glyph when absent).\n */\n kind?: '
|
|
1
|
+
{"version":3,"file":"ArtifactPane.js","names":[],"sources":["../../src/ai/ArtifactPane.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A side pane that shows one artifact a turn produced (`design/components/artifact-pane.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/artifact-pane.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n type VNode,\n} from 'vue'\n\nimport { Icon, agentMember, useListening } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/ai/artifact-pane.module.css'\nimport Button from '../controls/Button.vue'\nimport SegmentedControl from '../controls/SegmentedControl.vue'\nimport Spinner from '../structure/Spinner.vue'\n\nexport type ArtifactKind = 'code' | 'document' | 'data' | 'preview'\n\nexport interface ArtifactView {\n id: string\n label: string\n content: VNode | string\n}\n\nexport interface ArtifactPaneProps {\n /**\n * The close button's accessible name (generic default `Close`), which localized hosts replace.\n */\n closeLabel?: string\n defaultView?: string\n /**\n * The artifact's kind, which picks the mark (the tier's `artifact` glyph when absent).\n */\n kind?: 'code' | 'document' | 'data' | 'preview'\n /**\n * One preformatted line under the title, such as \"TypeScript · 142 lines\".\n */\n meta?: string\n /**\n * Whether the artifact is still being written, which shows a spinner and sets `aria-busy`.\n */\n streaming?: boolean\n /**\n * The artifact's name, used as the pane's heading and accessible name.\n */\n title: string\n view?: string\n /**\n * The artifact's views (code, preview). Two or more draw a switch, and a single view is drawn\n * with no switch. When `views` is absent or empty, `children` is the body.\n */\n views?: ArtifactView[]\n /**\n * The switch's accessible name (generic default `View`).\n */\n viewsLabel?: string\n}\n\ndefineOptions({ name: 'ArtifactPane', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ArtifactPaneProps>(), {\n closeLabel: 'Close',\n streaming: false,\n viewsLabel: 'View',\n})\nconst emit = defineEmits<{ close: []; viewChange: [id: string] }>()\ndefineSlots<{\n actions?: (props: Record<string, never>) => unknown\n default?: (props: Record<string, never>) => unknown\n}>()\nconst uid = useId()\nconst listening = useListening()\nconst overflowing = ref(false)\nconst mirror = ref(props.defaultView ?? props.views?.[0]?.id)\nconst body = useTemplateRef<HTMLElement>('body')\nconst closer = useTemplateRef<HTMLElement>('closer')\nconst pane = useTemplateRef<HTMLElement>('pane')\nconst switcher = useTemplateRef<HTMLElement>('switcher')\nconst titleId = computed(() => `${uid}-title`)\nconst current = computed(() => props.view ?? mirror.value)\nconst switching = computed(() => props.views !== undefined && props.views.length > 1)\nconst shown = computed(() =>\n props.views === undefined\n ? undefined\n : (props.views.find((entry) => entry.id === current.value) ?? props.views[0]),\n)\nconst mark = computed(() =>\n props.kind === undefined\n ? 'artifact'\n : ({ code: 'terminal', document: 'document', data: 'table', preview: 'browser' } as const)[\n props.kind\n ],\n)\nconst choices = computed(() =>\n (props.views ?? []).map((entry) => ({ value: entry.id, label: entry.label })),\n)\nlet release1: (() => void) | undefined\nconst effect1 = () => {\n release1?.()\n const run = () => {\n overflowing.value = body.value !== null && body.value.scrollHeight > body.value.clientHeight\n }\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(run)\n for (const element of [body.value, body.value?.firstElementChild])\n if (element) resize?.observe(element)\n release1 = () => {\n resize?.disconnect()\n }\n run()\n}\nonMounted(effect1)\nwatch(() => shown.value?.id, effect1, { flush: 'post' })\nonBeforeUnmount(() => release1?.())\nlet release2: (() => void) | undefined\nconst effect2 = () => {\n release2?.()\n const ran = agentMember({\n member: 'ArtifactPane',\n element: () => pane.value,\n state: () => ({\n view: shown.value?.id ?? null,\n views: (props.views ?? []).map((entry) => ({ id: entry.id, label: entry.label })),\n streaming: props.streaming,\n }),\n actions: {\n choose: {\n argument: 'id',\n run: (value) =>\n value !== shown.value?.id && ((mirror.value = value), emit('viewChange', value)),\n },\n close: () =>\n (() => {\n if (!listening.close) throw new Error('The pane has no close control.')\n emit('close')\n })(),\n },\n withholds: () => [switcher.value, closer.value],\n })\n release2 = () => {\n ran()\n }\n}\nonMounted(effect2)\nonBeforeUnmount(() => release2?.())\n</script>\n\n<template>\n <section\n ref=\"pane\"\n :class=\"styles.pane\"\n :aria-labelledby=\"titleId\"\n :data-kind=\"kind\"\n :data-state=\"streaming ? 'streaming' : undefined\"\n :aria-busy=\"streaming ? true : undefined\"\n data-member=\"artifact-pane\"\n >\n <header :class=\"styles.header\">\n <span :class=\"styles.mark\">\n <Spinner v-if=\"streaming\" size=\"sm\" :label=\"`${title}: still being written`\" />\n <Icon v-else :name=\"mark\" size=\"sm\" />\n </span>\n <div :class=\"styles.heading\">\n <h2 :class=\"styles.title\" :id=\"titleId\">\n {{ title }}\n </h2>\n <p v-if=\"meta !== undefined\" :class=\"styles.meta\">\n {{ meta }}\n </p>\n </div>\n <div v-if=\"switching\" ref=\"switcher\" :class=\"styles.views\">\n <SegmentedControl\n size=\"sm\"\n :label=\"viewsLabel\"\n :options=\"choices\"\n :value=\"current\"\n @change=\"((mirror = $event), emit('viewChange', $event))\"\n />\n </div>\n <div v-if=\"$slots.actions\" :class=\"styles.actions\">\n <slot name=\"actions\" />\n </div>\n <div v-if=\"listening.close\" ref=\"closer\" :class=\"styles.close\">\n <Button\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n :iconOnly=\"true\"\n icon=\"close\"\n :label=\"closeLabel\"\n @click=\"emit('close')\"\n />\n </div>\n </header>\n <div\n ref=\"body\"\n :class=\"styles.body\"\n :data-view=\"shown?.id\"\n :tabindex=\"overflowing ? 0 : undefined\"\n :role=\"overflowing ? 'group' : undefined\"\n :aria-labelledby=\"overflowing ? titleId : undefined\"\n >\n <div :class=\"styles.content\">\n <template v-if=\"shown === undefined\">\n <slot />\n </template>\n <template v-else-if=\"typeof shown.content === 'string'\">{{ shown.content }}</template>\n <template v-else>\n <component :is=\"shown.content\" />\n </template>\n </div>\n </div>\n </section>\n</template>\n"],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ArtifactPane.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/ai/ArtifactPane.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A side pane that shows one artifact a turn produced (`design/components/artifact-pane.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/artifact-pane.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n type VNode,\n} from 'vue'\n\nimport { Icon, agentMember, useListening } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/ai/artifact-pane.module.css'\nimport Button from '../controls/Button.vue'\nimport SegmentedControl from '../controls/SegmentedControl.vue'\nimport Spinner from '../structure/Spinner.vue'\n\nexport type ArtifactKind = 'code' | 'document' | 'data' | 'preview'\n\nexport interface ArtifactView {\n id: string\n label: string\n content: VNode | string\n}\n\nexport interface ArtifactPaneProps {\n /**\n * The close button's accessible name (generic default `Close`), which localized hosts replace.\n */\n closeLabel?: string\n defaultView?: string\n /**\n * The artifact's kind, which picks the mark (the tier's `artifact` glyph when absent).\n */\n kind?: 'document' | 'code' | 'data' | 'preview'\n /**\n * One preformatted line under the title, such as \"TypeScript · 142 lines\".\n */\n meta?: string\n /**\n * Whether the artifact is still being written, which shows a spinner and sets `aria-busy`.\n */\n streaming?: boolean\n /**\n * The artifact's name, used as the pane's heading and accessible name.\n */\n title: string\n view?: string\n /**\n * The artifact's views (code, preview). Two or more draw a switch, and a single view is drawn\n * with no switch. When `views` is absent or empty, `children` is the body.\n */\n views?: ArtifactView[]\n /**\n * The switch's accessible name (generic default `View`).\n */\n viewsLabel?: string\n}\n\ndefineOptions({ name: 'ArtifactPane', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ArtifactPaneProps>(), {\n closeLabel: 'Close',\n streaming: false,\n viewsLabel: 'View',\n})\nconst emit = defineEmits<{ close: []; viewChange: [id: string] }>()\ndefineSlots<{\n actions?: (props: Record<string, never>) => unknown\n default?: (props: Record<string, never>) => unknown\n}>()\nconst uid = useId()\nconst listening = useListening()\nconst overflowing = ref(false)\nconst mirror = ref(props.defaultView ?? props.views?.[0]?.id)\nconst body = useTemplateRef<HTMLElement>('body')\nconst closer = useTemplateRef<HTMLElement>('closer')\nconst pane = useTemplateRef<HTMLElement>('pane')\nconst switcher = useTemplateRef<HTMLElement>('switcher')\nconst titleId = computed(() => `${uid}-title`)\nconst current = computed(() => props.view ?? mirror.value)\nconst switching = computed(() => props.views !== undefined && props.views.length > 1)\nconst shown = computed(() =>\n props.views === undefined\n ? undefined\n : (props.views.find((entry) => entry.id === current.value) ?? props.views[0]),\n)\nconst mark = computed(() =>\n props.kind === undefined\n ? 'artifact'\n : ({ code: 'terminal', document: 'document', data: 'table', preview: 'browser' } as const)[\n props.kind\n ],\n)\nconst choices = computed(() =>\n (props.views ?? []).map((entry) => ({ value: entry.id, label: entry.label })),\n)\nlet release1: (() => void) | undefined\nconst effect1 = () => {\n release1?.()\n const run = () => {\n overflowing.value = body.value !== null && body.value.scrollHeight > body.value.clientHeight\n }\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(run)\n for (const element of [body.value, body.value?.firstElementChild])\n if (element) resize?.observe(element)\n release1 = () => {\n resize?.disconnect()\n }\n run()\n}\nonMounted(effect1)\nwatch(() => shown.value?.id, effect1, { flush: 'post' })\nonBeforeUnmount(() => release1?.())\nlet release2: (() => void) | undefined\nconst effect2 = () => {\n release2?.()\n const ran = agentMember({\n member: 'ArtifactPane',\n element: () => pane.value,\n state: () => ({\n view: shown.value?.id ?? null,\n views: (props.views ?? []).map((entry) => ({ id: entry.id, label: entry.label })),\n streaming: props.streaming,\n }),\n actions: {\n choose: {\n argument: 'id',\n run: (value) =>\n value !== shown.value?.id && ((mirror.value = value), emit('viewChange', value)),\n },\n close: () =>\n (() => {\n if (!listening.close) throw new Error('The pane has no close control.')\n emit('close')\n })(),\n },\n withholds: () => [switcher.value, closer.value],\n })\n release2 = () => {\n ran()\n }\n}\nonMounted(effect2)\nonBeforeUnmount(() => release2?.())\n</script>\n\n<template>\n <section\n ref=\"pane\"\n :class=\"styles.pane\"\n :aria-labelledby=\"titleId\"\n :data-kind=\"kind\"\n :data-state=\"streaming ? 'streaming' : undefined\"\n :aria-busy=\"streaming ? true : undefined\"\n data-member=\"artifact-pane\"\n >\n <header :class=\"styles.header\">\n <span :class=\"styles.mark\">\n <Spinner v-if=\"streaming\" size=\"sm\" :label=\"`${title}: still being written`\" />\n <Icon v-else :name=\"mark\" size=\"sm\" />\n </span>\n <div :class=\"styles.heading\">\n <h2 :class=\"styles.title\" :id=\"titleId\">\n {{ title }}\n </h2>\n <p v-if=\"meta !== undefined\" :class=\"styles.meta\">\n {{ meta }}\n </p>\n </div>\n <div v-if=\"switching\" ref=\"switcher\" :class=\"styles.views\">\n <SegmentedControl\n size=\"sm\"\n :label=\"viewsLabel\"\n :options=\"choices\"\n :value=\"current\"\n @change=\"((mirror = $event), emit('viewChange', $event))\"\n />\n </div>\n <div v-if=\"$slots.actions\" :class=\"styles.actions\">\n <slot name=\"actions\" />\n </div>\n <div v-if=\"listening.close\" ref=\"closer\" :class=\"styles.close\">\n <Button\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n :iconOnly=\"true\"\n icon=\"close\"\n :label=\"closeLabel\"\n @click=\"emit('close')\"\n />\n </div>\n </header>\n <div\n ref=\"body\"\n :class=\"styles.body\"\n :data-view=\"shown?.id\"\n :tabindex=\"overflowing ? 0 : undefined\"\n :role=\"overflowing ? 'group' : undefined\"\n :aria-labelledby=\"overflowing ? titleId : undefined\"\n >\n <div :class=\"styles.content\">\n <template v-if=\"shown === undefined\">\n <slot />\n </template>\n <template v-else-if=\"typeof shown.content === 'string'\">{{ shown.content }}</template>\n <template v-else>\n <component :is=\"shown.content\" />\n </template>\n </div>\n </div>\n </section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAqEA,IAAM,IAAQ,GAKR,IAAO,GAKP,IAAM,EAAM,GACZ,IAAY,EAAa,GACzB,IAAc,EAAI,EAAK,GACvB,IAAS,EAAI,EAAM,eAAe,EAAM,QAAQ,EAAE,EAAE,EAAE,GACtD,IAAO,EAA4B,MAAM,GACzC,IAAS,EAA4B,QAAQ,GAC7C,IAAO,EAA4B,MAAM,GACzC,IAAW,EAA4B,UAAU,GACjD,IAAU,QAAe,GAAG,EAAI,OAAO,GACvC,IAAU,QAAe,EAAM,QAAQ,EAAO,KAAK,GACnD,IAAY,QAAe,EAAM,UAAU,KAAA,KAAa,EAAM,MAAM,SAAS,CAAC,GAC9E,IAAQ,QACZ,EAAM,UAAU,KAAA,IACZ,KAAA,IACC,EAAM,MAAM,MAAM,M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ArtifactPane.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/ai/ArtifactPane.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A side pane that shows one artifact a turn produced (`design/components/artifact-pane.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/artifact-pane.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport {\n computed,\n onBeforeUnmount,\n onMounted,\n ref,\n useId,\n useTemplateRef,\n watch,\n type VNode,\n} from 'vue'\n\nimport { Icon, agentMember, useListening } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/ai/artifact-pane.module.css'\nimport Button from '../controls/Button.vue'\nimport SegmentedControl from '../controls/SegmentedControl.vue'\nimport Spinner from '../structure/Spinner.vue'\n\nexport type ArtifactKind = 'code' | 'document' | 'data' | 'preview'\n\nexport interface ArtifactView {\n id: string\n label: string\n content: VNode | string\n}\n\nexport interface ArtifactPaneProps {\n /**\n * The close button's accessible name (generic default `Close`), which localized hosts replace.\n */\n closeLabel?: string\n defaultView?: string\n /**\n * The artifact's kind, which picks the mark (the tier's `artifact` glyph when absent).\n */\n kind?: 'code' | 'document' | 'data' | 'preview'\n /**\n * One preformatted line under the title, such as \"TypeScript · 142 lines\".\n */\n meta?: string\n /**\n * Whether the artifact is still being written, which shows a spinner and sets `aria-busy`.\n */\n streaming?: boolean\n /**\n * The artifact's name, used as the pane's heading and accessible name.\n */\n title: string\n view?: string\n /**\n * The artifact's views (code, preview). Two or more draw a switch, and a single view is drawn\n * with no switch. When `views` is absent or empty, `children` is the body.\n */\n views?: ArtifactView[]\n /**\n * The switch's accessible name (generic default `View`).\n */\n viewsLabel?: string\n}\n\ndefineOptions({ name: 'ArtifactPane', inheritAttrs: false })\n\nconst props = withDefaults(defineProps<ArtifactPaneProps>(), {\n closeLabel: 'Close',\n streaming: false,\n viewsLabel: 'View',\n})\nconst emit = defineEmits<{ close: []; viewChange: [id: string] }>()\ndefineSlots<{\n actions?: (props: Record<string, never>) => unknown\n default?: (props: Record<string, never>) => unknown\n}>()\nconst uid = useId()\nconst listening = useListening()\nconst overflowing = ref(false)\nconst mirror = ref(props.defaultView ?? props.views?.[0]?.id)\nconst body = useTemplateRef<HTMLElement>('body')\nconst closer = useTemplateRef<HTMLElement>('closer')\nconst pane = useTemplateRef<HTMLElement>('pane')\nconst switcher = useTemplateRef<HTMLElement>('switcher')\nconst titleId = computed(() => `${uid}-title`)\nconst current = computed(() => props.view ?? mirror.value)\nconst switching = computed(() => props.views !== undefined && props.views.length > 1)\nconst shown = computed(() =>\n props.views === undefined\n ? undefined\n : (props.views.find((entry) => entry.id === current.value) ?? props.views[0]),\n)\nconst mark = computed(() =>\n props.kind === undefined\n ? 'artifact'\n : ({ code: 'terminal', document: 'document', data: 'table', preview: 'browser' } as const)[\n props.kind\n ],\n)\nconst choices = computed(() =>\n (props.views ?? []).map((entry) => ({ value: entry.id, label: entry.label })),\n)\nlet release1: (() => void) | undefined\nconst effect1 = () => {\n release1?.()\n const run = () => {\n overflowing.value = body.value !== null && body.value.scrollHeight > body.value.clientHeight\n }\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(run)\n for (const element of [body.value, body.value?.firstElementChild])\n if (element) resize?.observe(element)\n release1 = () => {\n resize?.disconnect()\n }\n run()\n}\nonMounted(effect1)\nwatch(() => shown.value?.id, effect1, { flush: 'post' })\nonBeforeUnmount(() => release1?.())\nlet release2: (() => void) | undefined\nconst effect2 = () => {\n release2?.()\n const ran = agentMember({\n member: 'ArtifactPane',\n element: () => pane.value,\n state: () => ({\n view: shown.value?.id ?? null,\n views: (props.views ?? []).map((entry) => ({ id: entry.id, label: entry.label })),\n streaming: props.streaming,\n }),\n actions: {\n choose: {\n argument: 'id',\n run: (value) =>\n value !== shown.value?.id && ((mirror.value = value), emit('viewChange', value)),\n },\n close: () =>\n (() => {\n if (!listening.close) throw new Error('The pane has no close control.')\n emit('close')\n })(),\n },\n withholds: () => [switcher.value, closer.value],\n })\n release2 = () => {\n ran()\n }\n}\nonMounted(effect2)\nonBeforeUnmount(() => release2?.())\n</script>\n\n<template>\n <section\n ref=\"pane\"\n :class=\"styles.pane\"\n :aria-labelledby=\"titleId\"\n :data-kind=\"kind\"\n :data-state=\"streaming ? 'streaming' : undefined\"\n :aria-busy=\"streaming ? true : undefined\"\n data-member=\"artifact-pane\"\n >\n <header :class=\"styles.header\">\n <span :class=\"styles.mark\">\n <Spinner v-if=\"streaming\" size=\"sm\" :label=\"`${title}: still being written`\" />\n <Icon v-else :name=\"mark\" size=\"sm\" />\n </span>\n <div :class=\"styles.heading\">\n <h2 :class=\"styles.title\" :id=\"titleId\">\n {{ title }}\n </h2>\n <p v-if=\"meta !== undefined\" :class=\"styles.meta\">\n {{ meta }}\n </p>\n </div>\n <div v-if=\"switching\" ref=\"switcher\" :class=\"styles.views\">\n <SegmentedControl\n size=\"sm\"\n :label=\"viewsLabel\"\n :options=\"choices\"\n :value=\"current\"\n @change=\"((mirror = $event), emit('viewChange', $event))\"\n />\n </div>\n <div v-if=\"$slots.actions\" :class=\"styles.actions\">\n <slot name=\"actions\" />\n </div>\n <div v-if=\"listening.close\" ref=\"closer\" :class=\"styles.close\">\n <Button\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n :iconOnly=\"true\"\n icon=\"close\"\n :label=\"closeLabel\"\n @click=\"emit('close')\"\n />\n </div>\n </header>\n <div\n ref=\"body\"\n :class=\"styles.body\"\n :data-view=\"shown?.id\"\n :tabindex=\"overflowing ? 0 : undefined\"\n :role=\"overflowing ? 'group' : undefined\"\n :aria-labelledby=\"overflowing ? titleId : undefined\"\n >\n <div :class=\"styles.content\">\n <template v-if=\"shown === undefined\">\n <slot />\n </template>\n <template v-else-if=\"typeof shown.content === 'string'\">{{ shown.content }}</template>\n <template v-else>\n <component :is=\"shown.content\" />\n </template>\n </div>\n </div>\n </section>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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AAK,EAAE,EAAA,CAAA,CAAM,CAAC,OAAO,EAAA,GAAA,CACT,EAAA,UAAU,KAAA,IACxB,EAAQ,EAAA,QAAA,WAAA,CAAA,GAAA,KAAA,GAAA,KAAA,GAAA,CAAA,IAAA,OAEkB,EAAA,MAAM,WAAO,YAAA,EAAA,GAAzC,EAAsF,GAAA,EAAA,KAAA,EAAA,GAAA,CAAA,EAAA,EAA3B,EAAA,MAAM,OAAO,GAAA,CAAA,CAAA,GAAA,EAAA,MAAA,EAAA,GAEtE,EAAiC,EAAjB,EAAA,MAAM,OAAO,GAAA,EAAA,KAAA,EAAA,CAAA,EAAA,GAAA,CAAA,CAAA,GAAA,IAAA,CAAA,CAAA,GAAA,IAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDetailPage.js","names":[],"sources":["../../src/archetypes/MasterDetailPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A list beside the selected item's detail (`design/archetypes/master-detail-page.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/master-detail-page.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport { computed, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue'\n\nimport { afterRender, masterDetailFocus, masterDetailHolds, useTrackedSlots } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/archetypes/master-detail-page.module.css'\nimport Button from '../controls/Button.vue'\nimport EmptyState, { type EmptyStateProps } from '../structure/EmptyState.vue'\nimport PageHeader from '../structure/PageHeader.vue'\nimport SplitPane from '../layout/SplitPane.vue'\n\nexport interface MasterDetailPageProps {\n /**\n * The way back to the list while the detail is drawn alone.\n */\n backLabel: string\n description?: string\n /**\n * The detail pane while nothing is selected, in the split. Required so the page always decides\n * it.\n */\n emptyState: EmptyStateProps\n /**\n * Names the list pane's region and the split's separator.\n */\n listLabel: string\n title: string\n}\n\ndefineOptions({ name: 'MasterDetailPage', inheritAttrs: false })\n\ndefineProps<MasterDetailPageProps>()\nconst emit = defineEmits<{ back: [] }>()\nconst callerSlots = defineSlots<{\n actions?: (props: Record<string, never>) => unknown\n detail?: (props: Record<string, never>) => unknown\n list: (props: Record<string, never>) => unknown\n}>()\nconst slots = useTrackedSlots(callerSlots)\nconst narrow = ref(false)\nconst held = ref(false)\nconst selected = ref(
|
|
1
|
+
{"version":3,"file":"MasterDetailPage.js","names":[],"sources":["../../src/archetypes/MasterDetailPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A list beside the selected item's detail (`design/archetypes/master-detail-page.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/master-detail-page.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport { computed, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue'\n\nimport { afterRender, masterDetailFocus, masterDetailHolds, useTrackedSlots } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/archetypes/master-detail-page.module.css'\nimport Button from '../controls/Button.vue'\nimport EmptyState, { type EmptyStateProps } from '../structure/EmptyState.vue'\nimport PageHeader from '../structure/PageHeader.vue'\nimport SplitPane from '../layout/SplitPane.vue'\n\nexport interface MasterDetailPageProps {\n /**\n * The way back to the list while the detail is drawn alone.\n */\n backLabel: string\n description?: string\n /**\n * The detail pane while nothing is selected, in the split. Required so the page always decides\n * it.\n */\n emptyState: EmptyStateProps\n /**\n * Names the list pane's region and the split's separator.\n */\n listLabel: string\n title: string\n}\n\ndefineOptions({ name: 'MasterDetailPage', inheritAttrs: false })\n\ndefineProps<MasterDetailPageProps>()\nconst emit = defineEmits<{ back: [] }>()\nconst callerSlots = defineSlots<{\n actions?: (props: Record<string, never>) => unknown\n detail?: (props: Record<string, never>) => unknown\n list: (props: Record<string, never>) => unknown\n}>()\nconst slots = useTrackedSlots(callerSlots)\nconst narrow = ref(false)\nconst held = ref(false)\nconst selected = ref(Boolean(slots.detail))\nconst body = useTemplateRef<HTMLElement>('body')\nconst root = useTemplateRef<HTMLElement>('root')\nconst measure = computed(() => () => {\n if (root.value === null) return\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16\n narrow.value = root.value.getBoundingClientRect().width < 48 * rem\n})\nlet release1: (() => void) | undefined\nconst effect1 = () => {\n release1?.()\n const run = () => {\n measure.value()\n }\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(run)\n for (const element of [root.value]) if (element) resize?.observe(element)\n release1 = () => {\n resize?.disconnect()\n }\n run()\n}\nonMounted(effect1)\nonBeforeUnmount(() => release1?.())\nconst effect2 = () => {\n selected.value = Boolean(slots.detail)\n}\nonMounted(effect2)\nwatch(() => Boolean(slots.detail), effect2, { flush: 'post' })\nlet release3: (() => void) | undefined\nconst effect3 = () => {\n release3?.()\n const listener = ($event: DocumentEventMap['focusin']) => {\n held.value = masterDetailHolds(body.value, $event)\n }\n document.addEventListener('focusin', listener)\n release3 = () => document.removeEventListener('focusin', listener)\n}\nonMounted(effect3)\nonBeforeUnmount(() => release3?.())\nconst effect4 = () => {\n afterRender(() => masterDetailFocus(body.value, held.value))\n}\nwatch(\n () =>\n narrow.value ? (selected.value ? 'detail' : 'list') : selected.value ? 'split-detail' : 'split',\n effect4,\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"styles.page\"\n :data-layout=\"narrow ? 'single' : 'split'\"\n :data-pane=\"narrow ? (selected ? 'detail' : 'list') : undefined\"\n data-member=\"master-detail-page\"\n >\n <PageHeader :title=\"title\" :description=\"description\">\n <template v-if=\"$slots.actions\" #actions>\n <slot name=\"actions\" />\n </template>\n </PageHeader>\n <!-- body -->\n <div ref=\"body\" :class=\"styles.body\">\n <template v-if=\"narrow\">\n <!-- list -->\n <section\n :class=\"styles.list\"\n :aria-label=\"listLabel\"\n tabindex=\"-1\"\n :hidden=\"selected\"\n data-master-detail-page-part=\"list\"\n >\n <slot name=\"list\" />\n </section>\n <!-- detail -->\n <div v-if=\"selected\" :class=\"styles.detail\" data-master-detail-page-part=\"detail\">\n <!-- back -->\n <div :class=\"styles.back\" data-master-detail-page-part=\"back\">\n <Button\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n icon=\"back\"\n :label=\"backLabel\"\n @click=\"emit('back')\"\n />\n </div>\n <!-- scroll -->\n <div :class=\"styles.scroll\">\n <slot name=\"detail\" />\n </div>\n </div>\n </template>\n <SplitPane v-else :label=\"listLabel\" :defaultRatio=\"0.32\" :startMin=\"240\" :endMin=\"420\">\n <template #start>\n <!-- list -->\n <section\n :class=\"styles.list\"\n :aria-label=\"listLabel\"\n tabindex=\"-1\"\n data-master-detail-page-part=\"list\"\n >\n <slot name=\"list\" />\n </section>\n </template>\n <template #end>\n <!-- detail -->\n <div :class=\"styles.detail\" data-master-detail-page-part=\"detail\">\n <!-- scroll -->\n <div v-if=\"selected\" :class=\"styles.scroll\">\n <slot name=\"detail\" />\n </div>\n <!-- empty -->\n <div v-else :class=\"styles.empty\">\n <EmptyState\n :icon=\"emptyState.icon\"\n :title=\"emptyState.title\"\n :description=\"emptyState.description\"\n >\n <template v-if=\"emptyState.action !== undefined\" #action>\n <component :is=\"emptyState.action\" />\n </template>\n <template v-if=\"emptyState.secondaryAction !== undefined\" #secondaryAction>\n <component :is=\"emptyState.secondaryAction\" />\n </template>\n </EmptyState>\n </div>\n </div>\n </template>\n </SplitPane>\n </div>\n </div>\n</template>\n"],"mappings":""}
|
|
@@ -19,7 +19,7 @@ var A = ["data-layout", "data-pane"], j = ["aria-label", "hidden"], M = ["aria-l
|
|
|
19
19
|
},
|
|
20
20
|
emits: ["back"],
|
|
21
21
|
setup(_, { emit: N }) {
|
|
22
|
-
let P = N, F = c(E()), I = S(!1), L = S(!1), R = S(
|
|
22
|
+
let P = N, F = c(E()), I = S(!1), L = S(!1), R = S(!!F.detail), z = D("body"), B = D("root"), V = u(() => () => {
|
|
23
23
|
if (B.value === null) return;
|
|
24
24
|
let e = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16;
|
|
25
25
|
I.value = B.value.getBoundingClientRect().width < 48 * e;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MasterDetailPage.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/archetypes/MasterDetailPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A list beside the selected item's detail (`design/archetypes/master-detail-page.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/master-detail-page.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport { computed, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue'\n\nimport { afterRender, masterDetailFocus, masterDetailHolds, useTrackedSlots } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/archetypes/master-detail-page.module.css'\nimport Button from '../controls/Button.vue'\nimport EmptyState, { type EmptyStateProps } from '../structure/EmptyState.vue'\nimport PageHeader from '../structure/PageHeader.vue'\nimport SplitPane from '../layout/SplitPane.vue'\n\nexport interface MasterDetailPageProps {\n /**\n * The way back to the list while the detail is drawn alone.\n */\n backLabel: string\n description?: string\n /**\n * The detail pane while nothing is selected, in the split. Required so the page always decides\n * it.\n */\n emptyState: EmptyStateProps\n /**\n * Names the list pane's region and the split's separator.\n */\n listLabel: string\n title: string\n}\n\ndefineOptions({ name: 'MasterDetailPage', inheritAttrs: false })\n\ndefineProps<MasterDetailPageProps>()\nconst emit = defineEmits<{ back: [] }>()\nconst callerSlots = defineSlots<{\n actions?: (props: Record<string, never>) => unknown\n detail?: (props: Record<string, never>) => unknown\n list: (props: Record<string, never>) => unknown\n}>()\nconst slots = useTrackedSlots(callerSlots)\nconst narrow = ref(false)\nconst held = ref(false)\nconst selected = ref(
|
|
1
|
+
{"version":3,"file":"MasterDetailPage.vue_vue_type_script_setup_true_lang.js","names":["$slots"],"sources":["../../src/archetypes/MasterDetailPage.vue"],"sourcesContent":["<script setup lang=\"ts\">\n/**\n * A list beside the selected item's detail (`design/archetypes/master-detail-page.md`).\n *\n * Generated by `pnpm shells` from `packages/shells/src/members/master-detail-page.ts`, the member's\n * framework-neutral description. Never edit it by hand: change the description and\n * run `pnpm shells`.\n */\nimport { computed, onBeforeUnmount, onMounted, ref, useTemplateRef, watch } from 'vue'\n\nimport { afterRender, masterDetailFocus, masterDetailHolds, useTrackedSlots } from '@polymorph/vue'\nimport styles from '@polymorph/recipes/archetypes/master-detail-page.module.css'\nimport Button from '../controls/Button.vue'\nimport EmptyState, { type EmptyStateProps } from '../structure/EmptyState.vue'\nimport PageHeader from '../structure/PageHeader.vue'\nimport SplitPane from '../layout/SplitPane.vue'\n\nexport interface MasterDetailPageProps {\n /**\n * The way back to the list while the detail is drawn alone.\n */\n backLabel: string\n description?: string\n /**\n * The detail pane while nothing is selected, in the split. Required so the page always decides\n * it.\n */\n emptyState: EmptyStateProps\n /**\n * Names the list pane's region and the split's separator.\n */\n listLabel: string\n title: string\n}\n\ndefineOptions({ name: 'MasterDetailPage', inheritAttrs: false })\n\ndefineProps<MasterDetailPageProps>()\nconst emit = defineEmits<{ back: [] }>()\nconst callerSlots = defineSlots<{\n actions?: (props: Record<string, never>) => unknown\n detail?: (props: Record<string, never>) => unknown\n list: (props: Record<string, never>) => unknown\n}>()\nconst slots = useTrackedSlots(callerSlots)\nconst narrow = ref(false)\nconst held = ref(false)\nconst selected = ref(Boolean(slots.detail))\nconst body = useTemplateRef<HTMLElement>('body')\nconst root = useTemplateRef<HTMLElement>('root')\nconst measure = computed(() => () => {\n if (root.value === null) return\n const rem = Number.parseFloat(getComputedStyle(document.documentElement).fontSize) || 16\n narrow.value = root.value.getBoundingClientRect().width < 48 * rem\n})\nlet release1: (() => void) | undefined\nconst effect1 = () => {\n release1?.()\n const run = () => {\n measure.value()\n }\n const resize = typeof ResizeObserver === 'undefined' ? undefined : new ResizeObserver(run)\n for (const element of [root.value]) if (element) resize?.observe(element)\n release1 = () => {\n resize?.disconnect()\n }\n run()\n}\nonMounted(effect1)\nonBeforeUnmount(() => release1?.())\nconst effect2 = () => {\n selected.value = Boolean(slots.detail)\n}\nonMounted(effect2)\nwatch(() => Boolean(slots.detail), effect2, { flush: 'post' })\nlet release3: (() => void) | undefined\nconst effect3 = () => {\n release3?.()\n const listener = ($event: DocumentEventMap['focusin']) => {\n held.value = masterDetailHolds(body.value, $event)\n }\n document.addEventListener('focusin', listener)\n release3 = () => document.removeEventListener('focusin', listener)\n}\nonMounted(effect3)\nonBeforeUnmount(() => release3?.())\nconst effect4 = () => {\n afterRender(() => masterDetailFocus(body.value, held.value))\n}\nwatch(\n () =>\n narrow.value ? (selected.value ? 'detail' : 'list') : selected.value ? 'split-detail' : 'split',\n effect4,\n { flush: 'post' },\n)\n</script>\n\n<template>\n <div\n ref=\"root\"\n :class=\"styles.page\"\n :data-layout=\"narrow ? 'single' : 'split'\"\n :data-pane=\"narrow ? (selected ? 'detail' : 'list') : undefined\"\n data-member=\"master-detail-page\"\n >\n <PageHeader :title=\"title\" :description=\"description\">\n <template v-if=\"$slots.actions\" #actions>\n <slot name=\"actions\" />\n </template>\n </PageHeader>\n <!-- body -->\n <div ref=\"body\" :class=\"styles.body\">\n <template v-if=\"narrow\">\n <!-- list -->\n <section\n :class=\"styles.list\"\n :aria-label=\"listLabel\"\n tabindex=\"-1\"\n :hidden=\"selected\"\n data-master-detail-page-part=\"list\"\n >\n <slot name=\"list\" />\n </section>\n <!-- detail -->\n <div v-if=\"selected\" :class=\"styles.detail\" data-master-detail-page-part=\"detail\">\n <!-- back -->\n <div :class=\"styles.back\" data-master-detail-page-part=\"back\">\n <Button\n variant=\"ghost\"\n tone=\"neutral\"\n size=\"sm\"\n icon=\"back\"\n :label=\"backLabel\"\n @click=\"emit('back')\"\n />\n </div>\n <!-- scroll -->\n <div :class=\"styles.scroll\">\n <slot name=\"detail\" />\n </div>\n </div>\n </template>\n <SplitPane v-else :label=\"listLabel\" :defaultRatio=\"0.32\" :startMin=\"240\" :endMin=\"420\">\n <template #start>\n <!-- list -->\n <section\n :class=\"styles.list\"\n :aria-label=\"listLabel\"\n tabindex=\"-1\"\n data-master-detail-page-part=\"list\"\n >\n <slot name=\"list\" />\n </section>\n </template>\n <template #end>\n <!-- detail -->\n <div :class=\"styles.detail\" data-master-detail-page-part=\"detail\">\n <!-- scroll -->\n <div v-if=\"selected\" :class=\"styles.scroll\">\n <slot name=\"detail\" />\n </div>\n <!-- empty -->\n <div v-else :class=\"styles.empty\">\n <EmptyState\n :icon=\"emptyState.icon\"\n :title=\"emptyState.title\"\n :description=\"emptyState.description\"\n >\n <template v-if=\"emptyState.action !== undefined\" #action>\n <component :is=\"emptyState.action\" />\n </template>\n <template v-if=\"emptyState.secondaryAction !== undefined\" #secondaryAction>\n <component :is=\"emptyState.secondaryAction\" />\n </template>\n </EmptyState>\n </div>\n </div>\n </template>\n </SplitPane>\n </div>\n </div>\n</template>\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;EAsCA,IAAM,IAAO,GAMP,IAAQ,EALM,EAKU,CAAW,GACnC,IAAS,EAAI,EAAK,GAClB,IAAO,EAAI,EAAK,GAChB,IAAW,EAAI,EAAQ,EAAM,MAAO,GACpC,IAAO,EAA4B,MAAM,GACzC,IAAO,EAA4B,MAAM,GACzC,IAAU,cAAqB;GACnC,IAAI,EAAK,UAAU,MAAM;GACzB,IAAM,IAAM,OAAO,WAAW,iBAAiB,SAAS,eAAe,CAAC,CAAC,QAAQ,KAAK;GACtF,EAAO,QAAQ,EAAK,MAAM,sBAAsB,CAAC,CAAC,QAAQ,KAAK;EACjE,CAAC,GACG;EAcJ,AADA,QAZsB;GACpB,IAAW;GACX,IAAM,UAAY;IAChB,EAAQ,MAAM;GAChB,GACM,IAAS,OAAO,iBAAmB,MAAc,KAAA,IAAY,IAAI,eAAe,CAAG;GACzF,KAAK,IAAM,KAAW,CAAC,EAAK,KAAK,GAAG,AAAI,KAAS,GAAQ,QAAQ,CAAO;GAIxE,AAHA,UAAiB;IACf,GAAQ,WAAW;GACrB,GACA,E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AA,WAAW,WAAW,KAAA,aAAA;UAAY;gBACX,EAAA,EAAA,GAArC,EAAqC,EAArB,EAAA,WAAW,MAAM,CAAA,EAAA,CAAA;;MAEnB,EAAA,WAAW,oBAAoB,KAAA,aAAA;UAAY;gBACX,EAAA,EAAA,GAA9C,EAA8C,EAA9B,EAAA,WAAW,eAAe,CAAA,EAAA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
._focusRing_1lfnc_15:focus-visible{outline:var(--pm-focus-width) solid var(--pm-border-focus);outline-offset:var(--pm-focus-offset);box-shadow:var(--pm-glow-focus)}._focusRing_1lfnc_15:has(>input:focus-visible){outline:var(--pm-focus-width) solid var(--pm-border-focus);outline-offset:var(--pm-focus-offset);box-shadow:var(--pm-glow-focus)}._focusRing_1lfnc_15:focus-visible:not([data-invalid],[aria-invalid=true],[data-selected],[data-range-start],[data-range-end]){border-color:var(--pm-border-focus-solid)}._focusRing_1lfnc_15:has(>input:focus-visible):not([data-invalid]){border-color:var(--pm-border-focus-solid)}@container style(--pm-focus-field:border){._focusRing_1lfnc_15:is(textarea,[role=combobox]):focus-visible:not([data-invalid],[aria-invalid=true]){outline-color:var(--pm-border-focus-solid);outline-offset:calc(var(--pm-focus-width) * -1);box-shadow:var(--pm-shadow-seat)}._focusRing_1lfnc_15:has(>input:focus-visible):not([data-invalid]){outline-color:var(--pm-border-focus-solid);outline-offset:calc(var(--pm-focus-width) * -1);box-shadow:var(--pm-shadow-seat)}}._stateFeedback_lkjqs_17{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard)}._pressable_lkjqs_38{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard), transform var(--pm-motion-duration-control) var(--pm-motion-easing-enter)}._pressable_lkjqs_38:active{transform:scale(var(--pm-motion-press-scale));transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard), transform calc(var(--pm-motion-duration-control) * .5) var(--pm-motion-easing-standard)}@keyframes _pm-spin_lkjqs_1{to{transform:rotate(360deg)}}@keyframes _pm-fade-in_lkjqs_1{0%{opacity:0}}@keyframes _pm-shimmer_lkjqs_1{0%{transform:translate(-100%)}to{transform:translate(100%)}}._spin_lkjqs_83{animation:_pm-spin_lkjqs_1 var(--pm-motion-ambient-spin) linear infinite}._fadeIn_lkjqs_92{animation:_pm-fade-in_lkjqs_1 var(--pm-motion-duration-control) var(--pm-motion-easing-enter) both}._shimmer_lkjqs_98{position:relative;overflow:hidden}._shimmer_lkjqs_98:after{content:"";background:linear-gradient(90deg, var(--pm-bg-subtle) 0%, var(--pm-bg-raised) 50%, var(--pm-bg-subtle) 100%);width:200%;animation:_pm-shimmer_lkjqs_1 var(--pm-motion-ambient-shimmer) linear infinite;position:absolute;inset:0}[data-motion=none] ._spin_lkjqs_83,[data-motion=none] ._fadeIn_lkjqs_92,[data-motion=none] ._shimmer_lkjqs_98:after{animation:none}@media (prefers-reduced-motion:reduce){._spin_lkjqs_83,._fadeIn_lkjqs_92,._shimmer_lkjqs_98:after{animation:none}._pressable_lkjqs_38,._pressable_lkjqs_38:active{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard);transform:none}}._shell_16r3p_13{--pm-shell-topbar-height:calc(var(--pm-space-7) + var(--pm-space-6));--pm-shell-sidebar-width:calc(var(--pm-space-10) * 2 + var(--pm-space-7));--pm-shell-sidebar-width-collapsed:calc(var(--pm-space-7) + var(--pm-space-5));grid-template:"banner banner" auto "sidebar topbar" minmax(var(--pm-shell-topbar-height), auto) "sidebar content" minmax(0, 1fr) / var(--pm-shell-sidebar-width) minmax(0, 1fr);background:var(--pm-texture-page) var(--pm-bg-app);block-size:100vh;inline-size:100%;min-inline-size:0;transition:grid-template-columns var(--pm-motion-duration-surface) var(--pm-motion-easing-standard);display:grid}@supports (height:1dvh){._shell_16r3p_13{block-size:100dvh}}._sidebar_16r3p_9{gap:var(--pm-space-2);min-block-size:0;min-inline-size:0;padding:var(--pm-space-4);background:var(--pm-shell-rail-bg);border-inline-end:1px solid var(--pm-shell-rail-border);flex-direction:column;grid-area:sidebar;display:flex;overflow:hidden}._railHead_16r3p_68{gap:var(--pm-space-2);min-block-size:var(--pm-shell-topbar-height);flex:none;align-items:center;display:flex}._brand_16r3p_76{min-inline-size:0;padding-inline:var(--pm-space-3);flex:1;align-items:center;display:flex}._nav_16r3p_84{gap:var(--pm-space-2);flex-direction:column;flex:1;min-block-size:0;display:flex;overflow-y:auto}._sidebarFooter_16r3p_93{flex:none}._navItem_16r3p_105{gap:var(--pm-space-3);inline-size:100%;block-size:var(--pm-control-height-md);padding-inline:var(--pm-space-3);font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-text-secondary);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:var(--pm-radius-md);background:0 0;border:1px solid #0000;justify-content:flex-start;align-items:center;text-decoration:none;display:flex;position:relative}._navGlyph_16r3p_134{color:var(--pm-text-muted);flex:none;align-items:center;display:inline-flex}._navLabel_16r3p_143{text-overflow:ellipsis;white-space:nowrap;flex:1;min-inline-size:0;overflow:hidden}._navEnd_16r3p_151{flex:none;align-items:center;display:inline-flex}._navGroup_16r3p_163{gap:var(--pm-space-2);flex-direction:column;display:flex}._navGroupLabel_16r3p_172{padding:var(--pm-space-4) var(--pm-space-3) var(--pm-space-1);font-family:var(--pm-text-xs-family);font-size:var(--pm-text-xs-size);font-weight:var(--pm-text-xs-weight);line-height:var(--pm-text-xs-line-height);letter-spacing:var(--pm-text-xs-tracking);color:var(--pm-text-muted);text-transform:uppercase}._navGroup_16r3p_163:first-child ._navGroupLabel_16r3p_172{padding-block-start:0}._userCard_16r3p_193{gap:var(--pm-space-3);min-inline-size:0;padding:var(--pm-space-2) var(--pm-space-3);border-radius:var(--pm-radius-md);align-items:center;display:flex}._userText_16r3p_204{flex-direction:column;flex:1;min-inline-size:0;display:flex}._userName_16r3p_211{font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-text-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._userDetail_16r3p_225{font-family:var(--pm-text-xs-family);font-size:var(--pm-text-xs-size);font-weight:var(--pm-text-xs-weight);line-height:var(--pm-text-xs-line-height);letter-spacing:var(--pm-text-xs-tracking);color:var(--pm-text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._userEnd_16r3p_237{flex:none;align-items:center;display:inline-flex}._navItem_16r3p_105[data-current]{color:var(--pm-selection-text);background:var(--pm-selection-bg)}._navItem_16r3p_105[data-current] ._navGlyph_16r3p_134{color:var(--pm-selection-text)}._navItem_16r3p_105:hover:not([data-current]){color:var(--pm-text-primary);background:var(--pm-bg-surface)}._navItem_16r3p_105:hover:not([data-current]) ._navGlyph_16r3p_134{color:var(--pm-text-secondary)}._toggle_16r3p_269{flex:none;display:flex}._banner_16r3p_276{grid-area:banner;min-inline-size:0}._topbar_16r3p_281{gap:var(--pm-space-4);min-inline-size:0;padding-block:var(--pm-space-2);padding-inline:var(--pm-space-6);background:var(--pm-shell-topbar-bg);border-block-end:1px solid var(--pm-shell-topbar-border);box-shadow:var(--pm-shadow-resting);flex-wrap:wrap;grid-area:topbar;justify-content:space-between;align-items:center;display:flex}._topbarSlot_16r3p_296{gap:var(--pm-space-3);flex-wrap:wrap;align-items:center;min-inline-size:0;display:flex}._content_16r3p_322{overflow-wrap:anywhere;background:var(--pm-texture-page) var(--pm-bg-app);grid-area:content;min-block-size:0;min-inline-size:0;overflow-y:auto;container-type:size}._page_16r3p_332{inline-size:100%;min-inline-size:0;max-inline-size:calc(var(--pm-space-10) * 16);padding:var(--pm-space-8);margin-inline:auto}@container (width<40rem){._page_16r3p_332{padding:var(--pm-space-6)}}._dock_16r3p_360{padding:0 var(--pm-space-6) var(--pm-space-5);pointer-events:none;z-index:var(--pm-z-raise);grid-area:content;justify-content:center;align-self:end;display:flex}._dock_16r3p_360>*{pointer-events:auto}._skip_16r3p_379{z-index:var(--pm-z-raise);padding:var(--pm-space-2) var(--pm-space-3);font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-accent-text);background:var(--pm-bg-surface);border-radius:var(--pm-radius-md);position:absolute;inset-block-start:var(--pm-space-3);inset-inline-start:var(--pm-space-3);transform:translateY(-200%)}._skip_16r3p_379:focus-visible{transform:translateY(0)}@media (width>=48rem){._shell_16r3p_13[data-collapsed]{grid-template-columns:var(--pm-shell-sidebar-width-collapsed) minmax(0, 1fr)}}@media (width<48rem){._shell_16r3p_13{grid-template:"banner" auto "topbar" minmax(var(--pm-shell-topbar-height), auto) "content" minmax(0, 1fr) / minmax(0, 1fr)}._sidebar_16r3p_9{z-index:var(--pm-z-shell);inline-size:var(--pm-shell-sidebar-width);visibility:hidden;box-shadow:var(--pm-shadow-transient);transition:transform var(--pm-motion-duration-surface) var(--pm-motion-easing-standard), visibility var(--pm-motion-duration-surface);position:fixed;inset-block:0;inset-inline-start:0;transform:translate(-100%)}._shell_16r3p_13[data-drawer] ._sidebar_16r3p_9{visibility:visible;transition-property:transform;transform:translate(0)}@media (prefers-reduced-motion:reduce){._sidebar_16r3p_9,._shell_16r3p_13[data-drawer] ._sidebar_16r3p_9{transition:none}}._toggle_16r3p_269{display:none}._scrim_16r3p_499{z-index:var(--pm-z-raise);background:var(--pm-bg-scrim);animation:_shell-scrim-enter_16r3p_1 var(--pm-motion-duration-surface) var(--pm-motion-easing-enter);border:0;position:fixed;inset:0}@keyframes _shell-scrim-enter_16r3p_1{0%{opacity:0}}}@media (width>=48rem){._drawerToggle_16r3p_517,._scrim_16r3p_499{display:none}._shell_16r3p_13[data-collapsed] ._sidebar_16r3p_9{padding-inline:var(--pm-space-2)}._shell_16r3p_13[data-collapsed] ._railHead_16r3p_68{flex-direction:column;min-block-size:auto}._shell_16r3p_13[data-collapsed] ._brand_16r3p_76{flex:none;justify-content:center;padding-inline:0}._shell_16r3p_13[data-collapsed] ._navItem_16r3p_105{justify-content:center;gap:0;padding-inline:0}._shell_16r3p_13[data-collapsed] ._navLabel_16r3p_143,._shell_16r3p_13[data-collapsed] ._navEnd_16r3p_151,._shell_16r3p_13[data-collapsed] ._userText_16r3p_204{white-space:nowrap;clip-path:inset(50%);border:0;block-size:1px;inline-size:1px;padding:0;position:absolute;overflow:hidden}._shell_16r3p_13[data-collapsed] ._navGroupLabel_16r3p_172,._shell_16r3p_13[data-collapsed] ._userEnd_16r3p_237{display:none}._shell_16r3p_13[data-collapsed] ._userCard_16r3p_193{justify-content:center;gap:0;padding-inline:0}._shell_16r3p_13[data-navigation=top]{grid-template:"banner banner" auto "sidebar topbar" minmax(var(--pm-shell-topbar-height), auto) "content content" minmax(0, 1fr) / auto minmax(min-content, 1fr)}._shell_16r3p_13[data-navigation=top] ._sidebar_16r3p_9{padding-block:var(--pm-space-2);padding-inline:var(--pm-space-4) 0;background:var(--pm-shell-topbar-bg);border-inline-end:0;border-block-end:1px solid var(--pm-shell-topbar-border);box-shadow:var(--pm-shadow-resting);flex-direction:row;align-items:center;overflow:visible}._shell_16r3p_13[data-navigation=top] ._railHead_16r3p_68{min-block-size:auto}:is(._shell_16r3p_13[data-navigation=top] ._railHead_16r3p_68:not(:has(._brand_16r3p_76)),._shell_16r3p_13[data-navigation=top] ._toggle_16r3p_269){display:none}._shell_16r3p_13[data-navigation=top] ._brand_16r3p_76{flex:none}._shell_16r3p_13[data-navigation=top] ._nav_16r3p_84{flex-flow:wrap;align-items:center;overflow:visible}._shell_16r3p_13[data-navigation=top] ._navItem_16r3p_105{inline-size:auto}._shell_16r3p_13[data-navigation=top] ._navItem_16r3p_105:hover:not([data-current]){background:var(--pm-bg-subtle)}._shell_16r3p_13[data-navigation=top] ._navGroup_16r3p_163{border-inline-start:1px solid var(--pm-border-subtle);flex-flow:wrap;align-items:center;padding-inline-start:var(--pm-space-2)}._shell_16r3p_13[data-navigation=top] ._navGroupLabel_16r3p_172{display:none}._shell_16r3p_13[data-navigation=top] ._nav_16r3p_84>._navGroup_16r3p_163:first-child,._shell_16r3p_13[data-navigation=top] ._nav_16r3p_84>:first-child>._navGroup_16r3p_163{border-inline-start:0;padding-inline-start:0}}
|
|
1
|
+
._focusRing_1lfnc_15:focus-visible{outline:var(--pm-focus-width) solid var(--pm-border-focus);outline-offset:var(--pm-focus-offset);box-shadow:var(--pm-glow-focus)}._focusRing_1lfnc_15:has(>input:focus-visible){outline:var(--pm-focus-width) solid var(--pm-border-focus);outline-offset:var(--pm-focus-offset);box-shadow:var(--pm-glow-focus)}._focusRing_1lfnc_15:focus-visible:not([data-invalid],[aria-invalid=true],[data-selected],[data-range-start],[data-range-end]){border-color:var(--pm-border-focus-solid)}._focusRing_1lfnc_15:has(>input:focus-visible):not([data-invalid]){border-color:var(--pm-border-focus-solid)}@container style(--pm-focus-field:border){._focusRing_1lfnc_15:is(textarea,[role=combobox]):focus-visible:not([data-invalid],[aria-invalid=true]){outline-color:var(--pm-border-focus-solid);outline-offset:calc(var(--pm-focus-width) * -1);box-shadow:var(--pm-shadow-seat)}._focusRing_1lfnc_15:has(>input:focus-visible):not([data-invalid]){outline-color:var(--pm-border-focus-solid);outline-offset:calc(var(--pm-focus-width) * -1);box-shadow:var(--pm-shadow-seat)}}._stateFeedback_lkjqs_17{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard)}._pressable_lkjqs_38{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard), transform var(--pm-motion-duration-control) var(--pm-motion-easing-enter)}._pressable_lkjqs_38:active{transform:scale(var(--pm-motion-press-scale));transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard), transform calc(var(--pm-motion-duration-control) * .5) var(--pm-motion-easing-standard)}@keyframes _pm-spin_lkjqs_1{to{transform:rotate(360deg)}}@keyframes _pm-fade-in_lkjqs_1{0%{opacity:0}}@keyframes _pm-shimmer_lkjqs_1{0%{transform:translate(-100%)}to{transform:translate(100%)}}._spin_lkjqs_83{animation:_pm-spin_lkjqs_1 var(--pm-motion-ambient-spin) linear infinite}._fadeIn_lkjqs_92{animation:_pm-fade-in_lkjqs_1 var(--pm-motion-duration-control) var(--pm-motion-easing-enter) both}._shimmer_lkjqs_98{position:relative;overflow:hidden}._shimmer_lkjqs_98:after{content:"";background:linear-gradient(90deg, var(--pm-bg-subtle) 0%, var(--pm-bg-raised) 50%, var(--pm-bg-subtle) 100%);width:200%;animation:_pm-shimmer_lkjqs_1 var(--pm-motion-ambient-shimmer) linear infinite;position:absolute;inset:0}[data-motion=none] ._spin_lkjqs_83,[data-motion=none] ._fadeIn_lkjqs_92,[data-motion=none] ._shimmer_lkjqs_98:after{animation:none}@media (prefers-reduced-motion:reduce){._spin_lkjqs_83,._fadeIn_lkjqs_92,._shimmer_lkjqs_98:after{animation:none}._pressable_lkjqs_38,._pressable_lkjqs_38:active{transition:background-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), border-color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), color var(--pm-motion-duration-control) var(--pm-motion-easing-standard), box-shadow var(--pm-motion-duration-control) var(--pm-motion-easing-standard);transform:none}}._shell_2zlpo_13{--pm-shell-topbar-height:calc(var(--pm-space-7) + var(--pm-space-6));--pm-shell-sidebar-width:calc(var(--pm-space-10) * 2 + var(--pm-space-7));--pm-shell-sidebar-width-collapsed:calc(var(--pm-space-7) + var(--pm-space-5));grid-template:"banner banner" auto "sidebar topbar" minmax(var(--pm-shell-topbar-height), auto) "sidebar content" minmax(0, 1fr) / var(--pm-shell-sidebar-width) minmax(0, 1fr);background:var(--pm-texture-page) var(--pm-bg-app);block-size:100vh;inline-size:100%;min-inline-size:0;transition:grid-template-columns var(--pm-motion-duration-surface) var(--pm-motion-easing-standard);display:grid}@supports (height:1dvh){._shell_2zlpo_13{block-size:100dvh}}._sidebar_2zlpo_9{gap:var(--pm-space-2);min-block-size:0;min-inline-size:0;padding:var(--pm-space-4);background:var(--pm-shell-rail-bg);border-inline-end:1px solid var(--pm-shell-rail-border);flex-direction:column;grid-area:sidebar;display:flex;overflow:hidden}._railHead_2zlpo_68{gap:var(--pm-space-2);min-block-size:var(--pm-shell-topbar-height);flex:none;align-items:center;display:flex}._brand_2zlpo_76{min-inline-size:0;padding-inline:var(--pm-space-3);flex:1;align-items:center;display:flex}._nav_2zlpo_84{gap:var(--pm-space-2);flex-direction:column;flex:1;min-block-size:0;display:flex;overflow-y:auto}._sidebarFooter_2zlpo_93{flex:none}._navItem_2zlpo_105{gap:var(--pm-space-3);inline-size:100%;block-size:var(--pm-control-height-md);padding-inline:var(--pm-space-3);font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-text-secondary);text-align:start;cursor:pointer;-webkit-user-select:none;user-select:none;border-radius:var(--pm-radius-md);background:0 0;border:1px solid #0000;justify-content:flex-start;align-items:center;text-decoration:none;display:flex;position:relative}._navGlyph_2zlpo_134{color:var(--pm-text-muted);flex:none;align-items:center;display:inline-flex}._navLabel_2zlpo_143{text-overflow:ellipsis;white-space:nowrap;flex:1;min-inline-size:0;overflow:hidden}._navEnd_2zlpo_151{flex:none;align-items:center;display:inline-flex}._navGroup_2zlpo_163{gap:var(--pm-space-2);flex-direction:column;display:flex}._navGroupLabel_2zlpo_172{padding:var(--pm-space-4) var(--pm-space-3) var(--pm-space-1);font-family:var(--pm-text-xs-family);font-size:var(--pm-text-xs-size);font-weight:var(--pm-text-xs-weight);line-height:var(--pm-text-xs-line-height);letter-spacing:var(--pm-text-xs-tracking);color:var(--pm-text-muted);text-transform:uppercase}._navGroup_2zlpo_163:first-child ._navGroupLabel_2zlpo_172{padding-block-start:0}._userCard_2zlpo_193{gap:var(--pm-space-3);min-inline-size:0;padding:var(--pm-space-2) var(--pm-space-3);border-radius:var(--pm-radius-md);align-items:center;display:flex}._userText_2zlpo_204{flex-direction:column;flex:1;min-inline-size:0;display:flex}._userName_2zlpo_211{font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-text-primary);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._userDetail_2zlpo_225{font-family:var(--pm-text-xs-family);font-size:var(--pm-text-xs-size);font-weight:var(--pm-text-xs-weight);line-height:var(--pm-text-xs-line-height);letter-spacing:var(--pm-text-xs-tracking);color:var(--pm-text-muted);text-overflow:ellipsis;white-space:nowrap;overflow:hidden}._userEnd_2zlpo_237{flex:none;align-items:center;display:inline-flex}._navItem_2zlpo_105[data-current]{color:var(--pm-selection-text);background:var(--pm-selection-bg)}._navItem_2zlpo_105[data-current] ._navGlyph_2zlpo_134{color:var(--pm-selection-text)}._navItem_2zlpo_105:hover:not([data-current]){color:var(--pm-text-primary);background:var(--pm-bg-surface)}._navItem_2zlpo_105:hover:not([data-current]) ._navGlyph_2zlpo_134{color:var(--pm-text-secondary)}._toggle_2zlpo_269{flex:none;display:flex}._banner_2zlpo_276{grid-area:banner;min-inline-size:0}._topbar_2zlpo_281{gap:var(--pm-space-4);min-inline-size:0;padding-block:var(--pm-space-2);padding-inline:var(--pm-space-6);background:var(--pm-shell-topbar-bg);border-block-end:1px solid var(--pm-shell-topbar-border);box-shadow:var(--pm-shadow-resting);flex-wrap:wrap;grid-area:topbar;justify-content:space-between;align-items:center;display:flex}._topbarSlot_2zlpo_296{gap:var(--pm-space-3);flex-wrap:wrap;align-items:center;min-inline-size:0;display:flex}._content_2zlpo_329{overflow-wrap:anywhere;background:var(--pm-texture-page) var(--pm-bg-app);grid-area:content;min-block-size:0;min-inline-size:0;position:relative;overflow-y:auto;container-type:size}._page_2zlpo_340{inline-size:100%;min-inline-size:0;max-inline-size:calc(var(--pm-space-10) * 16);padding:var(--pm-space-8);margin-inline:auto}@container (width<40rem){._page_2zlpo_340{padding:var(--pm-space-6)}}._dock_2zlpo_368{padding:0 var(--pm-space-6) var(--pm-space-5);pointer-events:none;z-index:var(--pm-z-raise);grid-area:content;justify-content:center;align-self:end;display:flex}._dock_2zlpo_368>*{pointer-events:auto}._skip_2zlpo_387{z-index:var(--pm-z-raise);padding:var(--pm-space-2) var(--pm-space-3);font-family:var(--pm-text-sm-family);font-size:var(--pm-text-sm-size);font-weight:var(--pm-text-sm-weight);line-height:var(--pm-text-sm-line-height);letter-spacing:var(--pm-text-sm-tracking);color:var(--pm-accent-text);background:var(--pm-bg-surface);border-radius:var(--pm-radius-md);position:absolute;inset-block-start:var(--pm-space-3);inset-inline-start:var(--pm-space-3);transform:translateY(-200%)}._skip_2zlpo_387:focus-visible{transform:translateY(0)}@media (width>=48rem){._shell_2zlpo_13[data-collapsed]{grid-template-columns:var(--pm-shell-sidebar-width-collapsed) minmax(0, 1fr)}}@media (width<48rem){._shell_2zlpo_13{grid-template:"banner" auto "topbar" minmax(var(--pm-shell-topbar-height), auto) "content" minmax(0, 1fr) / minmax(0, 1fr)}._sidebar_2zlpo_9{z-index:var(--pm-z-shell);inline-size:var(--pm-shell-sidebar-width);visibility:hidden;box-shadow:var(--pm-shadow-transient);transition:transform var(--pm-motion-duration-surface) var(--pm-motion-easing-standard), visibility var(--pm-motion-duration-surface);position:fixed;inset-block:0;inset-inline-start:0;transform:translate(-100%)}._shell_2zlpo_13[data-drawer] ._sidebar_2zlpo_9{visibility:visible;transition-property:transform;transform:translate(0)}@media (prefers-reduced-motion:reduce){._sidebar_2zlpo_9,._shell_2zlpo_13[data-drawer] ._sidebar_2zlpo_9{transition:none}}._toggle_2zlpo_269{display:none}._scrim_2zlpo_507{z-index:var(--pm-z-raise);background:var(--pm-bg-scrim);animation:_shell-scrim-enter_2zlpo_1 var(--pm-motion-duration-surface) var(--pm-motion-easing-enter);border:0;position:fixed;inset:0}@keyframes _shell-scrim-enter_2zlpo_1{0%{opacity:0}}}@media (width>=48rem){._drawerToggle_2zlpo_525,._scrim_2zlpo_507{display:none}._shell_2zlpo_13[data-collapsed] ._sidebar_2zlpo_9{padding-inline:var(--pm-space-2)}._shell_2zlpo_13[data-collapsed] ._railHead_2zlpo_68{flex-direction:column;min-block-size:auto}._shell_2zlpo_13[data-collapsed] ._brand_2zlpo_76{flex:none;justify-content:center;padding-inline:0}._shell_2zlpo_13[data-collapsed] ._navItem_2zlpo_105{justify-content:center;gap:0;padding-inline:0}._shell_2zlpo_13[data-collapsed] ._navLabel_2zlpo_143,._shell_2zlpo_13[data-collapsed] ._navEnd_2zlpo_151,._shell_2zlpo_13[data-collapsed] ._userText_2zlpo_204{white-space:nowrap;clip-path:inset(50%);border:0;block-size:1px;inline-size:1px;padding:0;position:absolute;overflow:hidden}._shell_2zlpo_13[data-collapsed] ._navGroupLabel_2zlpo_172,._shell_2zlpo_13[data-collapsed] ._userEnd_2zlpo_237{display:none}._shell_2zlpo_13[data-collapsed] ._userCard_2zlpo_193{justify-content:center;gap:0;padding-inline:0}._shell_2zlpo_13[data-navigation=top]{grid-template:"banner banner" auto "sidebar topbar" minmax(var(--pm-shell-topbar-height), auto) "content content" minmax(0, 1fr) / auto minmax(min-content, 1fr)}._shell_2zlpo_13[data-navigation=top] ._sidebar_2zlpo_9{padding-block:var(--pm-space-2);padding-inline:var(--pm-space-4) 0;background:var(--pm-shell-topbar-bg);border-inline-end:0;border-block-end:1px solid var(--pm-shell-topbar-border);box-shadow:var(--pm-shadow-resting);flex-direction:row;align-items:center;overflow:visible}._shell_2zlpo_13[data-navigation=top] ._railHead_2zlpo_68{min-block-size:auto}:is(._shell_2zlpo_13[data-navigation=top] ._railHead_2zlpo_68:not(:has(._brand_2zlpo_76)),._shell_2zlpo_13[data-navigation=top] ._toggle_2zlpo_269){display:none}._shell_2zlpo_13[data-navigation=top] ._brand_2zlpo_76{flex:none}._shell_2zlpo_13[data-navigation=top] ._nav_2zlpo_84{flex-flow:wrap;align-items:center;overflow:visible}._shell_2zlpo_13[data-navigation=top] ._navItem_2zlpo_105{inline-size:auto}._shell_2zlpo_13[data-navigation=top] ._navItem_2zlpo_105:hover:not([data-current]){background:var(--pm-bg-subtle)}._shell_2zlpo_13[data-navigation=top] ._navGroup_2zlpo_163{border-inline-start:1px solid var(--pm-border-subtle);flex-flow:wrap;align-items:center;padding-inline-start:var(--pm-space-2)}._shell_2zlpo_13[data-navigation=top] ._navGroupLabel_2zlpo_172{display:none}._shell_2zlpo_13[data-navigation=top] ._nav_2zlpo_84>._navGroup_2zlpo_163:first-child,._shell_2zlpo_13[data-navigation=top] ._nav_2zlpo_84>:first-child>._navGroup_2zlpo_163{border-inline-start:0;padding-inline-start:0}}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import './app-shell.css';
|
|
2
2
|
//#region ../recipes/src/archetypes/app-shell.module.css
|
|
3
|
-
var e = "
|
|
3
|
+
var e = "_shell_2zlpo_13", t = "_sidebar_2zlpo_9", n = "_railHead_2zlpo_68", r = "_brand_2zlpo_76", i = "_nav_2zlpo_84", a = "_sidebarFooter_2zlpo_93", o = "_navItem_2zlpo_105 _focusRing_1lfnc_15 _stateFeedback_lkjqs_17 _pressable_lkjqs_38", s = "_navGlyph_2zlpo_134 _stateFeedback_lkjqs_17", c = "_navLabel_2zlpo_143", l = "_navEnd_2zlpo_151", u = "_navGroup_2zlpo_163", d = "_navGroupLabel_2zlpo_172", f = "_userCard_2zlpo_193", p = "_userText_2zlpo_204", m = "_userName_2zlpo_211", h = "_userDetail_2zlpo_225", g = "_userEnd_2zlpo_237", _ = "_toggle_2zlpo_269", v = "_banner_2zlpo_276", y = "_topbar_2zlpo_281", b = "_topbarSlot_2zlpo_296", x = "_content_2zlpo_329", S = "_page_2zlpo_340", C = "_dock_2zlpo_368", w = "_skip_2zlpo_387 _focusRing_1lfnc_15", T = "_scrim_2zlpo_507", E = "_drawerToggle_2zlpo_525", D = {
|
|
4
4
|
shell: e,
|
|
5
5
|
sidebar: t,
|
|
6
6
|
railHead: n,
|
|
@@ -27,7 +27,7 @@ var e = "_shell_16r3p_13", t = "_sidebar_16r3p_9", n = "_railHead_16r3p_68", r =
|
|
|
27
27
|
dock: C,
|
|
28
28
|
skip: w,
|
|
29
29
|
scrim: T,
|
|
30
|
-
"shell-scrim-enter": "_shell-scrim-
|
|
30
|
+
"shell-scrim-enter": "_shell-scrim-enter_2zlpo_1",
|
|
31
31
|
drawerToggle: E
|
|
32
32
|
};
|
|
33
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"app-shell.module.js","names":[],"sources":["../../../recipes/src/archetypes/app-shell.module.css"],"sourcesContent":["/* AppShell — `design/archetypes/app-shell.md`.\n *\n * The `--pm-shell-*` scope is declared here and nowhere else. The values are\n * computed from space tokens, so a compact theme gets a tighter frame with no\n * extra declaration. Changing one of them is a one-line change that no screen\n * needs to know about (the churn test in `pages.test.tsx`).\n *\n * The sidebar collapse is the only animated structural change in the shell.\n * It uses the `appshell.sidebar` binding: `collapse` in persistent mode on the\n * inline axis. Law 2 lets a container animate only its size, and a grid track\n * counts as a container. */\n\n.shell {\n --pm-shell-topbar-height: calc(var(--pm-space-7) + var(--pm-space-6));\n --pm-shell-sidebar-width: calc(var(--pm-space-10) * 2 + var(--pm-space-7));\n --pm-shell-sidebar-width-collapsed: calc(var(--pm-space-7) + var(--pm-space-5));\n\n display: grid;\n grid-template:\n 'banner banner' auto\n 'sidebar topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'sidebar content' minmax(0, 1fr)\n / var(--pm-shell-sidebar-width) minmax(0, 1fr);\n min-inline-size: 0;\n inline-size: 100%;\n\n /* On phones `100vh` includes the collapsed browser chrome, so a `100vh`\n shell puts its bottom edge behind the URL bar (`docs/layout.md`). The\n fallback pattern (app-shell.md's root cell) puts the `vh` base here and\n the `dvh` override in the `@supports` block below. A deduplicating\n minifier would merge two declarations of one property in the same rule,\n and the built CSS would ship with only `dvh`. */\n block-size: 100vh;\n\n /* The texture sits on the page surface it decorates. It is `none` for themes\n whose ornament level disables it, and the colour underneath is exactly\n `bg.app`. */\n background: var(--pm-texture-page) var(--pm-bg-app);\n transition: grid-template-columns var(--pm-motion-duration-surface)\n var(--pm-motion-easing-standard);\n}\n\n@supports (height: 1dvh) {\n .shell {\n block-size: 100dvh;\n }\n}\n\n/* Region surfaces are theme data. The rail is one step off the page, and the\n region borders use the theme's emphasis (a flat system draws them at\n `border.default`, a shadowed one keeps them subtle). So a dark rail on a\n light app is a value a theme sets, not a separate recipe. */\n.sidebar {\n display: flex;\n flex-direction: column;\n grid-area: sidebar;\n gap: var(--pm-space-2);\n min-inline-size: 0;\n min-block-size: 0;\n padding: var(--pm-space-4);\n overflow: hidden;\n background: var(--pm-shell-rail-bg);\n border-inline-end: 1px solid var(--pm-shell-rail-border);\n}\n\n/* The head row: brand and the collapse toggle, at the topbar's height so the\n rail's first row and the frame's first row share a baseline. */\n.railHead {\n display: flex;\n flex: none;\n gap: var(--pm-space-2);\n align-items: center;\n min-block-size: var(--pm-shell-topbar-height);\n}\n\n.brand {\n display: flex;\n flex: 1;\n align-items: center;\n min-inline-size: 0;\n padding-inline: var(--pm-space-3);\n}\n\n.nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--pm-space-2);\n min-block-size: 0;\n overflow-y: auto;\n}\n\n.sidebarFooter {\n flex: none;\n}\n\n/* NavItem — `app-shell.md`'s NavItem recipe, cell by cell.\n *\n * It is start-aligned, which is why it exists instead of a stretched ghost\n * Button. The glyph sits at the same x on every row, so the rail reads as a\n * column instead of a stack of centred pills.\n *\n * Colour transitions come from `stateFeedback`. There is no entrance motion,\n * because rails do not animate their nav. */\n.navItem {\n composes: focusRing from '../conventions/focus.module.css';\n composes: stateFeedback pressable from '../conventions/motion.module.css';\n position: relative;\n display: flex;\n gap: var(--pm-space-3);\n align-items: center;\n justify-content: flex-start;\n inline-size: 100%;\n block-size: var(--pm-control-height-md);\n padding-inline: var(--pm-space-3);\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-text-secondary);\n text-align: start;\n\n /* The root swap (`href`) makes the row an <a>. The rail is navigation, not\n prose, so the user agent's link underline is removed. */\n text-decoration: none;\n cursor: pointer;\n user-select: none;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--pm-radius-md);\n}\n\n.navGlyph {\n composes: stateFeedback from '../conventions/motion.module.css';\n display: inline-flex;\n flex: none;\n align-items: center;\n color: var(--pm-text-muted);\n}\n\n/* When the rail is narrow, the text truncates, never the glyph or the count. */\n.navLabel {\n flex: 1;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.navEnd {\n display: inline-flex;\n flex: none;\n align-items: center;\n}\n\n/* NavGroup — `app-shell.md`'s NavGroup recipe, cell by cell.\n *\n * The label uses the system's only section-heading recipe (SettingsRow.Group's\n * overline, also used by Dashboard.Panel): `text.xs`, uppercase, muted. Many\n * sidebars use sentence case for group labels. This system styles every\n * section heading the same way, so the rail matches the settings screen. */\n.navGroup {\n display: flex;\n flex-direction: column;\n gap: var(--pm-space-2);\n}\n\n/* The top padding is the space between groups. It is on the label, not the\n group, because it is the space before a heading, and a group whose heading\n is hidden (collapsed) should not reserve it. */\n.navGroupLabel {\n padding: var(--pm-space-4) var(--pm-space-3) var(--pm-space-1);\n font-family: var(--pm-text-xs-family);\n font-size: var(--pm-text-xs-size);\n font-weight: var(--pm-text-xs-weight);\n line-height: var(--pm-text-xs-line-height);\n letter-spacing: var(--pm-text-xs-tracking);\n color: var(--pm-text-muted);\n text-transform: uppercase;\n}\n\n/* The rail's own padding is already above the first group. */\n.navGroup:first-child .navGroupLabel {\n padding-block-start: 0;\n}\n\n/* UserCard — the rail's foot.\n *\n * It is a row, not a control. The control is whatever is in `end`. Its height\n * is the avatar's plus the row's padding. It shares the left edge of every\n * NavItem above it, so it reads as the bottom of the same column. */\n.userCard {\n display: flex;\n gap: var(--pm-space-3);\n align-items: center;\n min-inline-size: 0;\n padding: var(--pm-space-2) var(--pm-space-3);\n border-radius: var(--pm-radius-md);\n}\n\n/* The text truncates, as NavItem's label does, for the same reason: an\n ellipsis shows that text is hidden, and a clipped glyph is a rendering bug. */\n.userText {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-inline-size: 0;\n}\n\n.userName {\n overflow: hidden;\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-text-primary);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* One step smaller and one tone lighter. A composition cannot reach this,\n because `Text` stops at `sm` and its lowest tone is `secondary`. */\n.userDetail {\n overflow: hidden;\n font-family: var(--pm-text-xs-family);\n font-size: var(--pm-text-xs-size);\n font-weight: var(--pm-text-xs-weight);\n line-height: var(--pm-text-xs-line-height);\n letter-spacing: var(--pm-text-xs-tracking);\n color: var(--pm-text-muted);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.userEnd {\n display: inline-flex;\n flex: none;\n align-items: center;\n}\n\n/* The current item uses the selection treatment (`design/components/README.md`),\n not a persistent hover. The selection colours sit one step below the hover\n wash and have their own text colour, so the current location reads as\n chosen, not hovered. */\n.navItem[data-current] {\n color: var(--pm-selection-text);\n background: var(--pm-selection-bg);\n}\n\n.navItem[data-current] .navGlyph {\n color: var(--pm-selection-text);\n}\n\n/* Selection takes precedence over hover, as in Table's law, for the same\n reason: if hover restyled the current row, the current location would\n flicker with the pointer. The hover uses `bg.surface` because the rail\n itself is `bg.subtle`. */\n.navItem:hover:not([data-current]) {\n color: var(--pm-text-primary);\n background: var(--pm-bg-surface);\n}\n\n.navItem:hover:not([data-current]) .navGlyph {\n color: var(--pm-text-secondary);\n}\n\n.toggle {\n display: flex;\n flex: none;\n}\n\n/* The banner's row. It is `auto`, so a shell without a banner gives it no\n height. The rail and the content region start under it. */\n.banner {\n grid-area: banner;\n min-inline-size: 0;\n}\n\n.topbar {\n display: flex;\n flex-wrap: wrap;\n grid-area: topbar;\n gap: var(--pm-space-4);\n align-items: center;\n justify-content: space-between;\n min-inline-size: 0;\n padding-block: var(--pm-space-2);\n padding-inline: var(--pm-space-6);\n background: var(--pm-shell-topbar-bg);\n border-block-end: 1px solid var(--pm-shell-topbar-border);\n box-shadow: var(--pm-shadow-resting);\n}\n\n.topbarSlot {\n display: flex;\n flex-wrap: wrap;\n gap: var(--pm-space-3);\n align-items: center;\n min-inline-size: 0;\n}\n\n/* The content region, and the container the page inside it measures.\n *\n * This is the boundary `docs/layout.md` names for the page archetypes. It must\n * be an ancestor of the page, not the page itself, because a container query\n * is answered by the nearest ancestor container. A page cannot query its own\n * width. The shell already knows how much room is left after the rail (the\n * whole window once the rail becomes a drawer), so the region that provides\n * the width declares the container.\n *\n * It contains both axes, so a page reads the region's visible height as\n * `100cqb`: DetailPage's aside that stays in view is never taller than the\n * region. The region's height is its grid row's, never its content's, so\n * containing its block size changes nothing it draws.\n *\n * It is the only scroll container. The frame stays in place and the page\n * inside it scrolls. The texture also stays in place, because the default\n * background attachment pins it to the region's box, so the page scrolls over\n * a still surface. */\n.content {\n container-type: size;\n grid-area: content;\n min-inline-size: 0;\n min-block-size: 0;\n overflow-wrap: anywhere;\n overflow-y: auto;\n background: var(--pm-texture-page) var(--pm-bg-app);\n}\n\n.page {\n min-inline-size: 0;\n inline-size: 100%;\n max-inline-size: calc(var(--pm-space-10) * 16);\n padding: var(--pm-space-8);\n margin-inline: auto;\n}\n\n@container (width < 40rem) {\n .page {\n padding: var(--pm-space-6);\n }\n}\n\n/* The dock: a floating layer over the content region.\n *\n * It uses the same grid cell as the content instead of a row below it.\n * `align-self: end` makes it float instead of acting as a footer, so the page\n * keeps its full height and the layer sits over its bottom edge. Sharing the\n * cell also keeps it centred when the rail collapses. The cell widens, so the\n * dock re-centres with the page without knowing the rail's width.\n *\n * It is not inside `.content`, because an absolutely positioned child of a\n * scroll container scrolls with it, and a prompt that scrolls away is not a\n * dock.\n *\n * `raise` is the same intra-member lift the skip link uses: above the page,\n * below the frame's own chrome and below every overlay. */\n.dock {\n display: flex;\n grid-area: content;\n align-self: end;\n justify-content: center;\n padding: 0 var(--pm-space-6) var(--pm-space-5);\n pointer-events: none;\n z-index: var(--pm-z-raise);\n}\n\n/* The layer ignores the pointer, so the space around the floating control\n still belongs to the page. The dock's children re-enable it. */\n.dock > * {\n pointer-events: auto;\n}\n\n/* Off-screen until it receives keyboard focus, then clearly visible. `raise` on\n the stacking scale is an intra-member lift over the shell's content, not\n chrome and not an overlay. */\n.skip {\n composes: focusRing from '../conventions/focus.module.css';\n position: absolute;\n inset-block-start: var(--pm-space-3);\n inset-inline-start: var(--pm-space-3);\n z-index: var(--pm-z-raise);\n padding: var(--pm-space-2) var(--pm-space-3);\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-accent-text);\n background: var(--pm-bg-surface);\n border-radius: var(--pm-radius-md);\n transform: translateY(-200%);\n}\n\n.skip:focus-visible {\n transform: translateY(0);\n}\n\n/* collapsed ----------------------------------------------------------------- */\n\n@media (width >= 48rem) {\n .shell[data-collapsed] {\n grid-template-columns: var(--pm-shell-sidebar-width-collapsed) minmax(0, 1fr);\n }\n}\n\n/* The small viewport ----------------------------------------------------------\n *\n * Below the reading width, two columns on a phone leave only a rail and a\n * narrow gutter. So the rail leaves the grid and becomes a drawer over the\n * content, and the topbar gets a `menu` button to open it.\n *\n * `48rem` is a literal, not a token, because a breakpoint belongs to the\n * viewport, not the theme. Scaling it with density would change the layout\n * for a reader who only changed control density. It is the only number in\n * this file that is deliberately not derived. */\n\n@media (width < 48rem) {\n .shell {\n grid-template:\n 'banner' auto\n 'topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'content' minmax(0, 1fr)\n / minmax(0, 1fr);\n }\n\n /* Off-canvas, and closed, not only out of view.\n *\n * `visibility: hidden` handles accessibility. A rail moved off-screen by a\n * transform keeps its tab order, so a keyboard user tabs into a nav they\n * cannot see and the focus ring goes off-screen. Hidden removes it from the\n * tab order and the accessibility tree together. That matches the state below\n * this breakpoint, where the navigation is behind a button.\n *\n * The transition list differs by direction on purpose. Closing transitions\n * `visibility`, which is discrete and changes at the end, so the rail stays\n * rendered while it slides away. Opening does not transition it, and this is\n * required. A transitioned property takes its new computed value only at the\n * style recalculation that starts the transition, which happens after the\n * effect that moves focus into the rail. Focusing a hidden element fails\n * silently, so the change must be immediate when opening. */\n .sidebar {\n position: fixed;\n inset-block: 0;\n inset-inline-start: 0;\n\n /* `shell` on the stacking scale. The drawer-mode rail is shell chrome,\n above the page and its lifts and below every portalled overlay\n (`--pm-z-overlay`). So a sheet's scrim covers the rail instead of the\n rail showing through it. */\n z-index: var(--pm-z-shell);\n inline-size: var(--pm-shell-sidebar-width);\n visibility: hidden;\n box-shadow: var(--pm-shadow-transient);\n transform: translateX(-100%);\n transition:\n transform var(--pm-motion-duration-surface) var(--pm-motion-easing-standard),\n visibility var(--pm-motion-duration-surface);\n }\n\n .shell[data-drawer] .sidebar {\n visibility: visible;\n transform: translateX(0);\n transition-property: transform;\n }\n\n /* Reduced motion (`docs/motion.md`). A slide normally becomes a fade, but a\n sheet held off-screen by a transform cannot fade in place: at opacity 0 it\n would already have to be in its final position. So it appears instantly.\n dialog.md gives the same rule for its scrim and panel. The drawer's scrim\n already complies as written, because its animation is opacity only.\n\n Both selectors are needed, because `.shell[data-drawer] .sidebar` has\n higher specificity than `.sidebar`. Overriding only the closed rule would\n leave the opening transition in place. */\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .shell[data-drawer] .sidebar {\n transition: none;\n }\n }\n\n /* No collapse toggle below the breakpoint. Here the rail is a sheet over the\n page, not a column of the frame, and a strip of glyphs floating over the\n content is not a useful state. */\n .toggle {\n display: none;\n }\n\n /* The scrim exists only while the drawer is open. A fixed transparent layer\n over a page with no drawer would capture every click.\n\n It uses `raise`, not `shell`, because of DOM order. The scrim renders after\n the sidebar, so at the same level it would paint over the rail it should\n sit under. One step lower keeps the order page, scrim, rail without\n changing the DOM. */\n .scrim {\n position: fixed;\n inset: 0;\n z-index: var(--pm-z-raise);\n background: var(--pm-bg-scrim);\n border: 0;\n animation: shell-scrim-enter var(--pm-motion-duration-surface) var(--pm-motion-easing-enter);\n }\n\n @keyframes shell-scrim-enter {\n from {\n opacity: 0;\n }\n }\n}\n\n/* At frame widths, the drawer's button and scrim are not used. */\n@media (width >= 48rem) {\n .drawerToggle,\n .scrim {\n display: none;\n }\n}\n\n/* When collapsed, the rail keeps a padding and the item drops its own, so the\n glyph centres in the remaining width instead of in a box offset by the\n sidebar's inset. */\n@media (width >= 48rem) {\n .shell[data-collapsed] .sidebar {\n padding-inline: var(--pm-space-2);\n }\n\n /* The head stacks when the rail narrows. A mark and a control do not fit side\n by side in 48px, and dropping either would lose the brand or the way to\n expand the rail. */\n .shell[data-collapsed] .railHead {\n flex-direction: column;\n min-block-size: auto;\n }\n\n .shell[data-collapsed] .brand {\n flex: none;\n justify-content: center;\n padding-inline: 0;\n }\n\n /* NavItem collapsed: no API, keyed off the shell.\n *\n * The item adapts to the narrow rail because the shell composed it. Everything\n * else in the rail is content the shell did not compose, and there\n * `overflow: hidden` clips what no longer fits instead of squashing it.\n * Adapting that content is the application's job. That division keeps this a\n * rail: the shell owns one item, not the whole nav. */\n .shell[data-collapsed] .navItem {\n gap: 0;\n justify-content: center;\n padding-inline: 0;\n }\n\n /* Visually hidden but still read aloud. The label is the accessible name in\n every mode, so it is clipped, not unmounted or `display: none`. UserCard's\n two lines are clipped too, because they are the card's accessible content,\n and clipping keeps a collapsed rail's foot available to screen readers. */\n .shell[data-collapsed] .navLabel,\n .shell[data-collapsed] .navEnd,\n .shell[data-collapsed] .userText {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n overflow: hidden;\n white-space: nowrap;\n border: 0;\n clip-path: inset(50%);\n }\n\n /* Removed, not clipped, for a different reason in each case.\n *\n * A group's title is a heading for a boundary that is no longer drawn. The\n * spec requires removing it, because clipping it would announce a section\n * nobody can see.\n *\n * UserCard's `end` is interactive. A menu trigger clipped to one pixel is a tab\n * stop nobody can find, with its focus ring off-screen. The drawer's\n * `visibility: hidden` follows the same reasoning. So `end` leaves the tab\n * order along with its space. */\n .shell[data-collapsed] .navGroupLabel,\n .shell[data-collapsed] .userEnd {\n display: none;\n }\n\n /* The avatar centres in the remaining width, in the same way as the nav glyph. */\n .shell[data-collapsed] .userCard {\n gap: 0;\n justify-content: center;\n padding-inline: 0;\n }\n}\n\n/* The navigation on top --------------------------------------------------------\n *\n * `navigation: 'top'` lays the rail along the frame's top row: the brand, then\n * the items in a row, and the topbar continues the row with its own slots. It\n * is the same `<nav>` in the same place in the document, before the topbar, so\n * the order a keyboard reaches the row in is the order it is drawn in. Every\n * rule is inside the frame-width query, so below the breakpoint the rail is\n * the drawer it is in the rail layout.\n *\n * The nav's column is as wide as its row needs, and the topbar keeps at least\n * the width its own content needs. When the row is wider than the frame, the\n * items wrap onto a further line, as SectionNav's do, so every destination\n * stays on screen and the frame never scrolls sideways. */\n@media (width >= 48rem) {\n .shell[data-navigation='top'] {\n grid-template:\n 'banner banner' auto\n 'sidebar topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'content content' minmax(0, 1fr)\n / auto minmax(min-content, 1fr);\n }\n\n /* The topbar's surface and lower edge, so the nav and the topbar read as one\n bar. `overflow` is visible because the row ends at the last item, and a\n clipped box would cut that item's focus ring. */\n .shell[data-navigation='top'] .sidebar {\n flex-direction: row;\n align-items: center;\n padding-block: var(--pm-space-2);\n padding-inline: var(--pm-space-4) 0;\n overflow: visible;\n background: var(--pm-shell-topbar-bg);\n border-inline-end: 0;\n border-block-end: 1px solid var(--pm-shell-topbar-border);\n box-shadow: var(--pm-shadow-resting);\n }\n\n /* The head keeps the brand and gives up the toggle: the collapse narrows a\n rail, and a row has no rail to narrow. A head with no brand takes no room. */\n .shell[data-navigation='top'] .railHead {\n min-block-size: auto;\n }\n\n .shell[data-navigation='top'] .railHead:not(:has(.brand)),\n .shell[data-navigation='top'] .toggle {\n display: none;\n }\n\n .shell[data-navigation='top'] .brand {\n flex: none;\n }\n\n /* The items in a row. It is not a scroll container, because a scroll\n container clips the focus ring of an item at its edge. */\n .shell[data-navigation='top'] .nav {\n flex-flow: row wrap;\n align-items: center;\n overflow: visible;\n }\n\n /* An item is as wide as its glyph, label and count. A label wider than the\n whole row still ends in an ellipsis. */\n .shell[data-navigation='top'] .navItem {\n inline-size: auto;\n }\n\n /* The bar is on `bg.surface`, which is the rail's hover fill, so hover steps\n to `bg.subtle` here, as SectionNav's does on its page. */\n .shell[data-navigation='top'] .navItem:hover:not([data-current]) {\n background: var(--pm-bg-subtle);\n }\n\n /* A group's items join the row. The overline is removed, as in the collapsed\n rail, and a rule before the group draws the boundary. The group keeps\n `role=\"group\"` and its name. */\n .shell[data-navigation='top'] .navGroup {\n flex-flow: row wrap;\n align-items: center;\n padding-inline-start: var(--pm-space-2);\n border-inline-start: 1px solid var(--pm-border-subtle);\n }\n\n .shell[data-navigation='top'] .navGroupLabel {\n display: none;\n }\n\n /* A group that starts the row has nothing before it to divide from. It is\n the nav slot's first child, or the first child of an element a renderer\n wraps each part in that draws no box of its own, so a sibling combinator\n between two groups would not reach them. */\n .shell[data-navigation='top'] .nav > .navGroup:first-child,\n .shell[data-navigation='top'] .nav > :first-child > .navGroup {\n padding-inline-start: 0;\n border-inline-start: 0;\n }\n}\n"],"mappings":""}
|
|
1
|
+
{"version":3,"file":"app-shell.module.js","names":[],"sources":["../../../recipes/src/archetypes/app-shell.module.css"],"sourcesContent":["/* AppShell — `design/archetypes/app-shell.md`.\n *\n * The `--pm-shell-*` scope is declared here and nowhere else. The values are\n * computed from space tokens, so a compact theme gets a tighter frame with no\n * extra declaration. Changing one of them is a one-line change that no screen\n * needs to know about (the churn test in `pages.test.tsx`).\n *\n * The sidebar collapse is the only animated structural change in the shell.\n * It uses the `appshell.sidebar` binding: `collapse` in persistent mode on the\n * inline axis. Law 2 lets a container animate only its size, and a grid track\n * counts as a container. */\n\n.shell {\n --pm-shell-topbar-height: calc(var(--pm-space-7) + var(--pm-space-6));\n --pm-shell-sidebar-width: calc(var(--pm-space-10) * 2 + var(--pm-space-7));\n --pm-shell-sidebar-width-collapsed: calc(var(--pm-space-7) + var(--pm-space-5));\n\n display: grid;\n grid-template:\n 'banner banner' auto\n 'sidebar topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'sidebar content' minmax(0, 1fr)\n / var(--pm-shell-sidebar-width) minmax(0, 1fr);\n min-inline-size: 0;\n inline-size: 100%;\n\n /* On phones `100vh` includes the collapsed browser chrome, so a `100vh`\n shell puts its bottom edge behind the URL bar (`docs/layout.md`). The\n fallback pattern (app-shell.md's root cell) puts the `vh` base here and\n the `dvh` override in the `@supports` block below. A deduplicating\n minifier would merge two declarations of one property in the same rule,\n and the built CSS would ship with only `dvh`. */\n block-size: 100vh;\n\n /* The texture sits on the page surface it decorates. It is `none` for themes\n whose ornament level disables it, and the colour underneath is exactly\n `bg.app`. */\n background: var(--pm-texture-page) var(--pm-bg-app);\n transition: grid-template-columns var(--pm-motion-duration-surface)\n var(--pm-motion-easing-standard);\n}\n\n@supports (height: 1dvh) {\n .shell {\n block-size: 100dvh;\n }\n}\n\n/* Region surfaces are theme data. The rail is one step off the page, and the\n region borders use the theme's emphasis (a flat system draws them at\n `border.default`, a shadowed one keeps them subtle). So a dark rail on a\n light app is a value a theme sets, not a separate recipe. */\n.sidebar {\n display: flex;\n flex-direction: column;\n grid-area: sidebar;\n gap: var(--pm-space-2);\n min-inline-size: 0;\n min-block-size: 0;\n padding: var(--pm-space-4);\n overflow: hidden;\n background: var(--pm-shell-rail-bg);\n border-inline-end: 1px solid var(--pm-shell-rail-border);\n}\n\n/* The head row: brand and the collapse toggle, at the topbar's height so the\n rail's first row and the frame's first row share a baseline. */\n.railHead {\n display: flex;\n flex: none;\n gap: var(--pm-space-2);\n align-items: center;\n min-block-size: var(--pm-shell-topbar-height);\n}\n\n.brand {\n display: flex;\n flex: 1;\n align-items: center;\n min-inline-size: 0;\n padding-inline: var(--pm-space-3);\n}\n\n.nav {\n display: flex;\n flex: 1;\n flex-direction: column;\n gap: var(--pm-space-2);\n min-block-size: 0;\n overflow-y: auto;\n}\n\n.sidebarFooter {\n flex: none;\n}\n\n/* NavItem — `app-shell.md`'s NavItem recipe, cell by cell.\n *\n * It is start-aligned, which is why it exists instead of a stretched ghost\n * Button. The glyph sits at the same x on every row, so the rail reads as a\n * column instead of a stack of centred pills.\n *\n * Colour transitions come from `stateFeedback`. There is no entrance motion,\n * because rails do not animate their nav. */\n.navItem {\n composes: focusRing from '../conventions/focus.module.css';\n composes: stateFeedback pressable from '../conventions/motion.module.css';\n position: relative;\n display: flex;\n gap: var(--pm-space-3);\n align-items: center;\n justify-content: flex-start;\n inline-size: 100%;\n block-size: var(--pm-control-height-md);\n padding-inline: var(--pm-space-3);\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-text-secondary);\n text-align: start;\n\n /* The root swap (`href`) makes the row an <a>. The rail is navigation, not\n prose, so the user agent's link underline is removed. */\n text-decoration: none;\n cursor: pointer;\n user-select: none;\n background: transparent;\n border: 1px solid transparent;\n border-radius: var(--pm-radius-md);\n}\n\n.navGlyph {\n composes: stateFeedback from '../conventions/motion.module.css';\n display: inline-flex;\n flex: none;\n align-items: center;\n color: var(--pm-text-muted);\n}\n\n/* When the rail is narrow, the text truncates, never the glyph or the count. */\n.navLabel {\n flex: 1;\n min-inline-size: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.navEnd {\n display: inline-flex;\n flex: none;\n align-items: center;\n}\n\n/* NavGroup — `app-shell.md`'s NavGroup recipe, cell by cell.\n *\n * The label uses the system's only section-heading recipe (SettingsRow.Group's\n * overline, also used by Dashboard.Panel): `text.xs`, uppercase, muted. Many\n * sidebars use sentence case for group labels. This system styles every\n * section heading the same way, so the rail matches the settings screen. */\n.navGroup {\n display: flex;\n flex-direction: column;\n gap: var(--pm-space-2);\n}\n\n/* The top padding is the space between groups. It is on the label, not the\n group, because it is the space before a heading, and a group whose heading\n is hidden (collapsed) should not reserve it. */\n.navGroupLabel {\n padding: var(--pm-space-4) var(--pm-space-3) var(--pm-space-1);\n font-family: var(--pm-text-xs-family);\n font-size: var(--pm-text-xs-size);\n font-weight: var(--pm-text-xs-weight);\n line-height: var(--pm-text-xs-line-height);\n letter-spacing: var(--pm-text-xs-tracking);\n color: var(--pm-text-muted);\n text-transform: uppercase;\n}\n\n/* The rail's own padding is already above the first group. */\n.navGroup:first-child .navGroupLabel {\n padding-block-start: 0;\n}\n\n/* UserCard — the rail's foot.\n *\n * It is a row, not a control. The control is whatever is in `end`. Its height\n * is the avatar's plus the row's padding. It shares the left edge of every\n * NavItem above it, so it reads as the bottom of the same column. */\n.userCard {\n display: flex;\n gap: var(--pm-space-3);\n align-items: center;\n min-inline-size: 0;\n padding: var(--pm-space-2) var(--pm-space-3);\n border-radius: var(--pm-radius-md);\n}\n\n/* The text truncates, as NavItem's label does, for the same reason: an\n ellipsis shows that text is hidden, and a clipped glyph is a rendering bug. */\n.userText {\n display: flex;\n flex: 1;\n flex-direction: column;\n min-inline-size: 0;\n}\n\n.userName {\n overflow: hidden;\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-text-primary);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* One step smaller and one tone lighter. A composition cannot reach this,\n because `Text` stops at `sm` and its lowest tone is `secondary`. */\n.userDetail {\n overflow: hidden;\n font-family: var(--pm-text-xs-family);\n font-size: var(--pm-text-xs-size);\n font-weight: var(--pm-text-xs-weight);\n line-height: var(--pm-text-xs-line-height);\n letter-spacing: var(--pm-text-xs-tracking);\n color: var(--pm-text-muted);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.userEnd {\n display: inline-flex;\n flex: none;\n align-items: center;\n}\n\n/* The current item uses the selection treatment (`design/components/README.md`),\n not a persistent hover. The selection colours sit one step below the hover\n wash and have their own text colour, so the current location reads as\n chosen, not hovered. */\n.navItem[data-current] {\n color: var(--pm-selection-text);\n background: var(--pm-selection-bg);\n}\n\n.navItem[data-current] .navGlyph {\n color: var(--pm-selection-text);\n}\n\n/* Selection takes precedence over hover, as in Table's law, for the same\n reason: if hover restyled the current row, the current location would\n flicker with the pointer. The hover uses `bg.surface` because the rail\n itself is `bg.subtle`. */\n.navItem:hover:not([data-current]) {\n color: var(--pm-text-primary);\n background: var(--pm-bg-surface);\n}\n\n.navItem:hover:not([data-current]) .navGlyph {\n color: var(--pm-text-secondary);\n}\n\n.toggle {\n display: flex;\n flex: none;\n}\n\n/* The banner's row. It is `auto`, so a shell without a banner gives it no\n height. The rail and the content region start under it. */\n.banner {\n grid-area: banner;\n min-inline-size: 0;\n}\n\n.topbar {\n display: flex;\n flex-wrap: wrap;\n grid-area: topbar;\n gap: var(--pm-space-4);\n align-items: center;\n justify-content: space-between;\n min-inline-size: 0;\n padding-block: var(--pm-space-2);\n padding-inline: var(--pm-space-6);\n background: var(--pm-shell-topbar-bg);\n border-block-end: 1px solid var(--pm-shell-topbar-border);\n box-shadow: var(--pm-shadow-resting);\n}\n\n.topbarSlot {\n display: flex;\n flex-wrap: wrap;\n gap: var(--pm-space-3);\n align-items: center;\n min-inline-size: 0;\n}\n\n/* The content region, and the container the page inside it measures.\n *\n * This is the boundary `docs/layout.md` names for the page archetypes. It must\n * be an ancestor of the page, not the page itself, because a container query\n * is answered by the nearest ancestor container. A page cannot query its own\n * width. The shell already knows how much room is left after the rail (the\n * whole window once the rail becomes a drawer), so the region that provides\n * the width declares the container.\n *\n * It contains both axes, so a page reads the region's visible height as\n * `100cqb`: DetailPage's aside that stays in view is never taller than the\n * region. The region's height is its grid row's, never its content's, so\n * containing its block size changes nothing it draws.\n *\n * It is the only scroll container. The frame stays in place and the page\n * inside it scrolls. The texture also stays in place, because the default\n * background attachment pins it to the region's box, so the page scrolls over\n * a still surface.\n *\n * It is positioned, so it is the containing block of everything it scrolls. A\n * member that hides text from the eye positions it absolutely\n * (`conventions/a11y.module.css`), and an absolutely positioned box belongs to\n * its containing block, not to the scroll container it sits in. Without a\n * positioned region, such a box far down a long page would be laid out against\n * the document and make the document itself scroll, under the frame. */\n.content {\n position: relative;\n container-type: size;\n grid-area: content;\n min-inline-size: 0;\n min-block-size: 0;\n overflow-wrap: anywhere;\n overflow-y: auto;\n background: var(--pm-texture-page) var(--pm-bg-app);\n}\n\n.page {\n min-inline-size: 0;\n inline-size: 100%;\n max-inline-size: calc(var(--pm-space-10) * 16);\n padding: var(--pm-space-8);\n margin-inline: auto;\n}\n\n@container (width < 40rem) {\n .page {\n padding: var(--pm-space-6);\n }\n}\n\n/* The dock: a floating layer over the content region.\n *\n * It uses the same grid cell as the content instead of a row below it.\n * `align-self: end` makes it float instead of acting as a footer, so the page\n * keeps its full height and the layer sits over its bottom edge. Sharing the\n * cell also keeps it centred when the rail collapses. The cell widens, so the\n * dock re-centres with the page without knowing the rail's width.\n *\n * It is not inside `.content`, because an absolutely positioned child of a\n * scroll container scrolls with it, and a prompt that scrolls away is not a\n * dock.\n *\n * `raise` is the same intra-member lift the skip link uses: above the page,\n * below the frame's own chrome and below every overlay. */\n.dock {\n display: flex;\n grid-area: content;\n align-self: end;\n justify-content: center;\n padding: 0 var(--pm-space-6) var(--pm-space-5);\n pointer-events: none;\n z-index: var(--pm-z-raise);\n}\n\n/* The layer ignores the pointer, so the space around the floating control\n still belongs to the page. The dock's children re-enable it. */\n.dock > * {\n pointer-events: auto;\n}\n\n/* Off-screen until it receives keyboard focus, then clearly visible. `raise` on\n the stacking scale is an intra-member lift over the shell's content, not\n chrome and not an overlay. */\n.skip {\n composes: focusRing from '../conventions/focus.module.css';\n position: absolute;\n inset-block-start: var(--pm-space-3);\n inset-inline-start: var(--pm-space-3);\n z-index: var(--pm-z-raise);\n padding: var(--pm-space-2) var(--pm-space-3);\n font-family: var(--pm-text-sm-family);\n font-size: var(--pm-text-sm-size);\n font-weight: var(--pm-text-sm-weight);\n line-height: var(--pm-text-sm-line-height);\n letter-spacing: var(--pm-text-sm-tracking);\n color: var(--pm-accent-text);\n background: var(--pm-bg-surface);\n border-radius: var(--pm-radius-md);\n transform: translateY(-200%);\n}\n\n.skip:focus-visible {\n transform: translateY(0);\n}\n\n/* collapsed ----------------------------------------------------------------- */\n\n@media (width >= 48rem) {\n .shell[data-collapsed] {\n grid-template-columns: var(--pm-shell-sidebar-width-collapsed) minmax(0, 1fr);\n }\n}\n\n/* The small viewport ----------------------------------------------------------\n *\n * Below the reading width, two columns on a phone leave only a rail and a\n * narrow gutter. So the rail leaves the grid and becomes a drawer over the\n * content, and the topbar gets a `menu` button to open it.\n *\n * `48rem` is a literal, not a token, because a breakpoint belongs to the\n * viewport, not the theme. Scaling it with density would change the layout\n * for a reader who only changed control density. It is the only number in\n * this file that is deliberately not derived. */\n\n@media (width < 48rem) {\n .shell {\n grid-template:\n 'banner' auto\n 'topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'content' minmax(0, 1fr)\n / minmax(0, 1fr);\n }\n\n /* Off-canvas, and closed, not only out of view.\n *\n * `visibility: hidden` handles accessibility. A rail moved off-screen by a\n * transform keeps its tab order, so a keyboard user tabs into a nav they\n * cannot see and the focus ring goes off-screen. Hidden removes it from the\n * tab order and the accessibility tree together. That matches the state below\n * this breakpoint, where the navigation is behind a button.\n *\n * The transition list differs by direction on purpose. Closing transitions\n * `visibility`, which is discrete and changes at the end, so the rail stays\n * rendered while it slides away. Opening does not transition it, and this is\n * required. A transitioned property takes its new computed value only at the\n * style recalculation that starts the transition, which happens after the\n * effect that moves focus into the rail. Focusing a hidden element fails\n * silently, so the change must be immediate when opening. */\n .sidebar {\n position: fixed;\n inset-block: 0;\n inset-inline-start: 0;\n\n /* `shell` on the stacking scale. The drawer-mode rail is shell chrome,\n above the page and its lifts and below every portalled overlay\n (`--pm-z-overlay`). So a sheet's scrim covers the rail instead of the\n rail showing through it. */\n z-index: var(--pm-z-shell);\n inline-size: var(--pm-shell-sidebar-width);\n visibility: hidden;\n box-shadow: var(--pm-shadow-transient);\n transform: translateX(-100%);\n transition:\n transform var(--pm-motion-duration-surface) var(--pm-motion-easing-standard),\n visibility var(--pm-motion-duration-surface);\n }\n\n .shell[data-drawer] .sidebar {\n visibility: visible;\n transform: translateX(0);\n transition-property: transform;\n }\n\n /* Reduced motion (`docs/motion.md`). A slide normally becomes a fade, but a\n sheet held off-screen by a transform cannot fade in place: at opacity 0 it\n would already have to be in its final position. So it appears instantly.\n dialog.md gives the same rule for its scrim and panel. The drawer's scrim\n already complies as written, because its animation is opacity only.\n\n Both selectors are needed, because `.shell[data-drawer] .sidebar` has\n higher specificity than `.sidebar`. Overriding only the closed rule would\n leave the opening transition in place. */\n @media (prefers-reduced-motion: reduce) {\n .sidebar,\n .shell[data-drawer] .sidebar {\n transition: none;\n }\n }\n\n /* No collapse toggle below the breakpoint. Here the rail is a sheet over the\n page, not a column of the frame, and a strip of glyphs floating over the\n content is not a useful state. */\n .toggle {\n display: none;\n }\n\n /* The scrim exists only while the drawer is open. A fixed transparent layer\n over a page with no drawer would capture every click.\n\n It uses `raise`, not `shell`, because of DOM order. The scrim renders after\n the sidebar, so at the same level it would paint over the rail it should\n sit under. One step lower keeps the order page, scrim, rail without\n changing the DOM. */\n .scrim {\n position: fixed;\n inset: 0;\n z-index: var(--pm-z-raise);\n background: var(--pm-bg-scrim);\n border: 0;\n animation: shell-scrim-enter var(--pm-motion-duration-surface) var(--pm-motion-easing-enter);\n }\n\n @keyframes shell-scrim-enter {\n from {\n opacity: 0;\n }\n }\n}\n\n/* At frame widths, the drawer's button and scrim are not used. */\n@media (width >= 48rem) {\n .drawerToggle,\n .scrim {\n display: none;\n }\n}\n\n/* When collapsed, the rail keeps a padding and the item drops its own, so the\n glyph centres in the remaining width instead of in a box offset by the\n sidebar's inset. */\n@media (width >= 48rem) {\n .shell[data-collapsed] .sidebar {\n padding-inline: var(--pm-space-2);\n }\n\n /* The head stacks when the rail narrows. A mark and a control do not fit side\n by side in 48px, and dropping either would lose the brand or the way to\n expand the rail. */\n .shell[data-collapsed] .railHead {\n flex-direction: column;\n min-block-size: auto;\n }\n\n .shell[data-collapsed] .brand {\n flex: none;\n justify-content: center;\n padding-inline: 0;\n }\n\n /* NavItem collapsed: no API, keyed off the shell.\n *\n * The item adapts to the narrow rail because the shell composed it. Everything\n * else in the rail is content the shell did not compose, and there\n * `overflow: hidden` clips what no longer fits instead of squashing it.\n * Adapting that content is the application's job. That division keeps this a\n * rail: the shell owns one item, not the whole nav. */\n .shell[data-collapsed] .navItem {\n gap: 0;\n justify-content: center;\n padding-inline: 0;\n }\n\n /* Visually hidden but still read aloud. The label is the accessible name in\n every mode, so it is clipped, not unmounted or `display: none`. UserCard's\n two lines are clipped too, because they are the card's accessible content,\n and clipping keeps a collapsed rail's foot available to screen readers. */\n .shell[data-collapsed] .navLabel,\n .shell[data-collapsed] .navEnd,\n .shell[data-collapsed] .userText {\n position: absolute;\n inline-size: 1px;\n block-size: 1px;\n padding: 0;\n overflow: hidden;\n white-space: nowrap;\n border: 0;\n clip-path: inset(50%);\n }\n\n /* Removed, not clipped, for a different reason in each case.\n *\n * A group's title is a heading for a boundary that is no longer drawn. The\n * spec requires removing it, because clipping it would announce a section\n * nobody can see.\n *\n * UserCard's `end` is interactive. A menu trigger clipped to one pixel is a tab\n * stop nobody can find, with its focus ring off-screen. The drawer's\n * `visibility: hidden` follows the same reasoning. So `end` leaves the tab\n * order along with its space. */\n .shell[data-collapsed] .navGroupLabel,\n .shell[data-collapsed] .userEnd {\n display: none;\n }\n\n /* The avatar centres in the remaining width, in the same way as the nav glyph. */\n .shell[data-collapsed] .userCard {\n gap: 0;\n justify-content: center;\n padding-inline: 0;\n }\n}\n\n/* The navigation on top --------------------------------------------------------\n *\n * `navigation: 'top'` lays the rail along the frame's top row: the brand, then\n * the items in a row, and the topbar continues the row with its own slots. It\n * is the same `<nav>` in the same place in the document, before the topbar, so\n * the order a keyboard reaches the row in is the order it is drawn in. Every\n * rule is inside the frame-width query, so below the breakpoint the rail is\n * the drawer it is in the rail layout.\n *\n * The nav's column is as wide as its row needs, and the topbar keeps at least\n * the width its own content needs. When the row is wider than the frame, the\n * items wrap onto a further line, as SectionNav's do, so every destination\n * stays on screen and the frame never scrolls sideways. */\n@media (width >= 48rem) {\n .shell[data-navigation='top'] {\n grid-template:\n 'banner banner' auto\n 'sidebar topbar' minmax(var(--pm-shell-topbar-height), auto)\n 'content content' minmax(0, 1fr)\n / auto minmax(min-content, 1fr);\n }\n\n /* The topbar's surface and lower edge, so the nav and the topbar read as one\n bar. `overflow` is visible because the row ends at the last item, and a\n clipped box would cut that item's focus ring. */\n .shell[data-navigation='top'] .sidebar {\n flex-direction: row;\n align-items: center;\n padding-block: var(--pm-space-2);\n padding-inline: var(--pm-space-4) 0;\n overflow: visible;\n background: var(--pm-shell-topbar-bg);\n border-inline-end: 0;\n border-block-end: 1px solid var(--pm-shell-topbar-border);\n box-shadow: var(--pm-shadow-resting);\n }\n\n /* The head keeps the brand and gives up the toggle: the collapse narrows a\n rail, and a row has no rail to narrow. A head with no brand takes no room. */\n .shell[data-navigation='top'] .railHead {\n min-block-size: auto;\n }\n\n .shell[data-navigation='top'] .railHead:not(:has(.brand)),\n .shell[data-navigation='top'] .toggle {\n display: none;\n }\n\n .shell[data-navigation='top'] .brand {\n flex: none;\n }\n\n /* The items in a row. It is not a scroll container, because a scroll\n container clips the focus ring of an item at its edge. */\n .shell[data-navigation='top'] .nav {\n flex-flow: row wrap;\n align-items: center;\n overflow: visible;\n }\n\n /* An item is as wide as its glyph, label and count. A label wider than the\n whole row still ends in an ellipsis. */\n .shell[data-navigation='top'] .navItem {\n inline-size: auto;\n }\n\n /* The bar is on `bg.surface`, which is the rail's hover fill, so hover steps\n to `bg.subtle` here, as SectionNav's does on its page. */\n .shell[data-navigation='top'] .navItem:hover:not([data-current]) {\n background: var(--pm-bg-subtle);\n }\n\n /* A group's items join the row. The overline is removed, as in the collapsed\n rail, and a rule before the group draws the boundary. The group keeps\n `role=\"group\"` and its name. */\n .shell[data-navigation='top'] .navGroup {\n flex-flow: row wrap;\n align-items: center;\n padding-inline-start: var(--pm-space-2);\n border-inline-start: 1px solid var(--pm-border-subtle);\n }\n\n .shell[data-navigation='top'] .navGroupLabel {\n display: none;\n }\n\n /* A group that starts the row has nothing before it to divide from. It is\n the nav slot's first child, or the first child of an element a renderer\n wraps each part in that draws no box of its own, so a sibling combinator\n between two groups would not reach them. */\n .shell[data-navigation='top'] .nav > .navGroup:first-child,\n .shell[data-navigation='top'] .nav > :first-child > .navGroup {\n padding-inline-start: 0;\n border-inline-start: 0;\n }\n}\n"],"mappings":""}
|