rift-ds 1.32.0 → 1.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -4
- package/behaviors/clipboard.d.ts +7 -0
- package/behaviors/clipboard.js +35 -0
- package/behaviors/headingSlug.d.ts +8 -0
- package/behaviors/headingSlug.js +4 -0
- package/behaviors/shell.css +64 -0
- package/behaviors/syncedChoice.d.ts +2 -0
- package/behaviors/syncedChoice.js +48 -0
- package/behaviors/useLayer.d.ts +15 -2
- package/behaviors/useLayer.js +3 -2
- package/bin/templates/blocks/app/guide/PageFeedback.tsx +55 -0
- package/bin/templates/blocks/app/guide/page.module.css +94 -0
- package/bin/templates/blocks/app/guide/page.tsx +168 -0
- package/bin/templates/blocks/components/blocks/AppShell.module.css +3 -1
- package/bin/templates/blocks/components/blocks/AppShell.tsx +8 -0
- package/bin/templates/blocks/components/blocks/DocsShell.module.css +18 -0
- package/bin/templates/blocks/components/blocks/DocsShell.tsx +179 -0
- package/bin/templates/blocks/registry.json +13 -0
- package/code/highlight.d.ts +4 -0
- package/code/highlight.js +34 -0
- package/code/index.d.ts +16 -0
- package/code/index.js +23 -0
- package/components/AnchorNav/AnchorNav.d.ts +29 -3
- package/components/AnchorNav/AnchorNav.js +69 -5
- package/components/AppLayout/AppLayout.css +8 -4
- package/components/AppLayout/AppLayout.d.ts +13 -3
- package/components/AppLayout/AppLayout.js +2 -0
- package/components/ArtifactPanel/ArtifactPanel.css +46 -0
- package/components/ArtifactPanel/ArtifactPanel.d.ts +14 -4
- package/components/ArtifactPanel/ArtifactPanel.js +8 -5
- package/components/BackToTop/BackToTop.css +28 -0
- package/components/BackToTop/BackToTop.d.ts +28 -0
- package/components/BackToTop/BackToTop.js +47 -0
- package/components/BentoTile/BentoTile.css +3 -0
- package/components/CodeBlock/CodeBlock.css +63 -24
- package/components/CodeBlock/CodeBlock.d.ts +62 -6
- package/components/CodeBlock/CodeBlock.js +90 -48
- package/components/CopyButton/CopyButton.d.ts +42 -0
- package/components/CopyButton/CopyButton.js +72 -0
- package/components/DescriptionList/DescriptionListCopy.d.ts +2 -2
- package/components/DescriptionList/DescriptionListCopy.js +7 -35
- package/components/Figure/Figure.css +26 -0
- package/components/Figure/Figure.d.ts +10 -1
- package/components/Figure/Figure.js +15 -3
- package/components/Heading/Heading.css +43 -0
- package/components/Heading/Heading.d.ts +14 -3
- package/components/Heading/Heading.js +22 -4
- package/components/HoverCard/HoverCard.js +1 -0
- package/components/Link/Link.css +38 -0
- package/components/Link/Link.d.ts +3 -3
- package/components/Link/Link.js +1 -1
- package/components/Menubar/Menubar.css +82 -0
- package/components/Menubar/Menubar.d.ts +40 -0
- package/components/Menubar/Menubar.js +97 -0
- package/components/NavList/NavList.css +197 -0
- package/components/NavList/NavList.d.ts +54 -6
- package/components/NavList/NavList.js +136 -8
- package/components/Pagination/Pagination.css +80 -0
- package/components/Pagination/Pagination.d.ts +29 -3
- package/components/Pagination/Pagination.js +49 -5
- package/components/Rating/Rating.css +26 -0
- package/components/Rating/Rating.d.ts +18 -5
- package/components/Rating/Rating.js +16 -7
- package/components/SectionTitle/SectionTitle.css +36 -0
- package/components/SectionTitle/SectionTitle.d.ts +10 -1
- package/components/SectionTitle/SectionTitle.js +7 -2
- package/components/ShaderScene/ShaderScene.d.ts +2 -1
- package/components/ShaderScene/ShaderScene.js +20 -2
- package/components/SiteFooter/SiteFooter.css +157 -0
- package/components/SiteFooter/SiteFooter.d.ts +53 -0
- package/components/SiteFooter/SiteFooter.js +61 -0
- package/components/SiteHeader/SiteHeader.css +106 -4
- package/components/SiteHeader/SiteHeader.d.ts +25 -2
- package/components/SiteHeader/SiteHeader.js +46 -8
- package/components/SiteLayout/SiteLayout.css +361 -0
- package/components/SiteLayout/SiteLayout.d.ts +103 -0
- package/components/SiteLayout/SiteLayout.js +68 -0
- package/components/Table/Table.css +14 -0
- package/components/Table/Table.d.ts +2 -0
- package/components/Table/Table.js +1 -1
- package/components/Tooltip/Tooltip.js +1 -0
- package/components/keyboard-patterns.json.d.ts +57 -0
- package/components/keyboard-patterns.json.js +1 -1
- package/components/registry.json +89 -19
- package/components/registry.json.d.ts +89 -19
- package/components/registry.json.js +1 -1
- package/index.d.ts +5 -0
- package/index.js +14 -1
- package/package.json +14 -2
- package/tokens/breakpoints.js +3 -3
- package/tokens/registry.json +5 -0
- package/tokens/registry.json.d.ts +5 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +12 -0
- package/tokens/tokens-light.css +12 -0
- package/tokens/values.json.js +1 -1
|
@@ -0,0 +1,361 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
SITE LAYOUT COMPONENT
|
|
3
|
+
The frame of a documentation or marketing site:
|
|
4
|
+
header, sidebar, main, aside and footer, laid out
|
|
5
|
+
by two independent choices, the page's width
|
|
6
|
+
(the shell recipe's width axis) and where the
|
|
7
|
+
sidebar docks. No surface of its own, not even
|
|
8
|
+
the page colour: what lies behind shows through.
|
|
9
|
+
============================================ */
|
|
10
|
+
|
|
11
|
+
.ds-site-layout {
|
|
12
|
+
/* The header's height, so the sticky columns start below it: SiteHeader's
|
|
13
|
+
own --ds-site-header-height when the host sets it on the layout (one
|
|
14
|
+
value then sizes both), else the same calc SiteHeader uses for its bar.
|
|
15
|
+
An override hook for another header. */
|
|
16
|
+
--ds-site-layout-header-height: var(--ds-site-header-height, calc(var(--control-height-default) + var(--padding-1000)));
|
|
17
|
+
/* The window's height, an override hook for a host that pins it (a page
|
|
18
|
+
drawn in a scaled preview frame sets its own). */
|
|
19
|
+
--ds-site-layout-viewport-height: 100vh;
|
|
20
|
+
/* Column widths: room for a page title or a section name on one line. */
|
|
21
|
+
--ds-site-layout-sidebar-width: calc(6.5 * var(--control-height-default));
|
|
22
|
+
--ds-site-layout-aside-width: calc(5 * var(--control-height-default));
|
|
23
|
+
/* The reading width of `readingWidth`: about 75 characters of body text. */
|
|
24
|
+
--ds-site-layout-reading-width: calc(19 * var(--control-height-default));
|
|
25
|
+
/* --ds-site-layout-reserve-end, the room the page gives up at its end
|
|
26
|
+
edge for a panel the host docks there (a chat), is read with a 0
|
|
27
|
+
fallback and never declared here, so a host can set it on the layout
|
|
28
|
+
or any ancestor: the whole frame, header included, steps in by it, and
|
|
29
|
+
an edge-pinned aside moves in with it. */
|
|
30
|
+
/* The room between the header and the page, the site's own page rhythm:
|
|
31
|
+
the sidebar, the main column and the aside all start this far down. */
|
|
32
|
+
--ds-site-layout-top-gap: var(--gap-1500);
|
|
33
|
+
/* A heading jump lands clear of the sticky header and of the blur that
|
|
34
|
+
fades out below its bar (SiteHeader's --ds-site-header-blur-reach,
|
|
35
|
+
--gap-1500), with a beat to spare, so the heading is never cut off. */
|
|
36
|
+
--ds-heading-scroll-margin: calc(
|
|
37
|
+
var(--ds-site-layout-header-height) + var(--ds-site-header-blur-reach, var(--gap-1500)) + var(--gap-200)
|
|
38
|
+
);
|
|
39
|
+
display: flex;
|
|
40
|
+
flex-direction: column;
|
|
41
|
+
/* The whole width of whatever holds it, a flex parent that centres its
|
|
42
|
+
children included: the frame is the page, never a column in one. */
|
|
43
|
+
align-self: stretch;
|
|
44
|
+
width: 100%;
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
min-height: var(--ds-site-layout-viewport-height);
|
|
47
|
+
padding-inline-end: var(--ds-site-layout-reserve-end, 0px);
|
|
48
|
+
transition: padding-inline-end var(--motion-duration-slow) var(--motion-ease-emphasized);
|
|
49
|
+
/* No background: the page behind is the floor, so an ambient field or a
|
|
50
|
+
shader the host paints there shows through the frame. */
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
/* A frame that reaches the window's edges (docked to the edge, or a full
|
|
54
|
+
page) keeps a wider gutter from the tablet step up, so the brand and the
|
|
55
|
+
sidebar's words sit well in from the edge and a row's hanging fill keeps
|
|
56
|
+
room before it. The header's slot and the footer's row inherit it, so all
|
|
57
|
+
three still share one line. --ds-site-layout-edge-gutter overrides it. */
|
|
58
|
+
@media (min-width: 960px) {
|
|
59
|
+
.ds-site-layout--dock-edge,
|
|
60
|
+
.ds-site-layout[data-ds-width='full'] {
|
|
61
|
+
--ds-shell-gutter: var(--ds-site-layout-edge-gutter, calc(var(--padding-500) + var(--padding-300)));
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/* ============================================
|
|
66
|
+
HEADER
|
|
67
|
+
The header's slot draws no box, so a sticky
|
|
68
|
+
header sticks to the whole page; it carries the
|
|
69
|
+
header's width axis, which a SiteHeader with no
|
|
70
|
+
width of its own reads.
|
|
71
|
+
============================================ */
|
|
72
|
+
|
|
73
|
+
.ds-site-layout__header {
|
|
74
|
+
display: contents;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.ds-site-layout__header > .ds-site-header:not(.ds-site-header--width) .ds-site-header__bar {
|
|
78
|
+
max-width: var(--ds-shell-content-max, var(--ds-shell-contained-width));
|
|
79
|
+
margin-inline: auto;
|
|
80
|
+
padding-inline: var(--ds-shell-gutter); /* SiteHeader's own name for its bar's side padding, which its menu
|
|
81
|
+
panel lines up with. */
|
|
82
|
+
--_bar-inset: var(--ds-shell-gutter);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* ============================================
|
|
86
|
+
BODY AND ROW
|
|
87
|
+
The row is the width axis: contained, it centres
|
|
88
|
+
at the contained width; full, it runs edge to
|
|
89
|
+
edge. Docked to the content, the sidebar is the
|
|
90
|
+
row's first column; docked to the edge, it sits
|
|
91
|
+
before the row and the row takes the room after.
|
|
92
|
+
============================================ */
|
|
93
|
+
|
|
94
|
+
.ds-site-layout__body {
|
|
95
|
+
display: flex;
|
|
96
|
+
flex: 1 0 auto;
|
|
97
|
+
width: 100%;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ds-site-layout__row {
|
|
102
|
+
display: grid;
|
|
103
|
+
grid-template-columns: minmax(0, 1fr);
|
|
104
|
+
/* The site's column gap, the room between a page's columns. */
|
|
105
|
+
gap: var(--gap-1500);
|
|
106
|
+
flex: 1 1 auto;
|
|
107
|
+
min-width: 0;
|
|
108
|
+
max-width: var(--ds-shell-content-max, var(--ds-shell-contained-width));
|
|
109
|
+
margin-inline: auto;
|
|
110
|
+
padding-inline: var(--ds-shell-gutter);
|
|
111
|
+
box-sizing: border-box;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.ds-site-layout--dock-content.ds-site-layout--with-sidebar .ds-site-layout__row {
|
|
115
|
+
grid-template-columns: var(--ds-site-layout-sidebar-width) minmax(0, 1fr);
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.ds-site-layout--with-aside .ds-site-layout__row {
|
|
119
|
+
grid-template-columns: minmax(0, 1fr) var(--ds-site-layout-aside-width);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ds-site-layout--dock-content.ds-site-layout--with-sidebar.ds-site-layout--with-aside .ds-site-layout__row {
|
|
123
|
+
grid-template-columns: var(--ds-site-layout-sidebar-width) minmax(0, 1fr) var(--ds-site-layout-aside-width);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ============================================
|
|
127
|
+
SIDEBAR
|
|
128
|
+
Sticks below the header and holds the window's
|
|
129
|
+
height, so a scrollable NavList inside scrolls on
|
|
130
|
+
its own. Docked to the edge it carries the gutter
|
|
131
|
+
on its start side and a hairline on its end.
|
|
132
|
+
============================================ */
|
|
133
|
+
|
|
134
|
+
.ds-site-layout__sidebar {
|
|
135
|
+
position: sticky;
|
|
136
|
+
top: var(--ds-site-layout-header-height);
|
|
137
|
+
display: flex;
|
|
138
|
+
flex-direction: column;
|
|
139
|
+
align-self: start;
|
|
140
|
+
height: calc(var(--ds-site-layout-viewport-height) - var(--ds-site-layout-header-height));
|
|
141
|
+
min-height: 0;
|
|
142
|
+
/* Its list starts the top gap down, and scrolls up through it. */
|
|
143
|
+
padding-block-start: var(--ds-site-layout-top-gap);
|
|
144
|
+
box-sizing: border-box;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-site-layout--dock-edge .ds-site-layout__sidebar {
|
|
148
|
+
position: sticky;
|
|
149
|
+
flex: none;
|
|
150
|
+
width: calc(var(--ds-site-layout-sidebar-width) + var(--ds-shell-gutter));
|
|
151
|
+
padding-inline: var(--ds-shell-gutter) var(--padding-300);
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
/* Optical alignment: a NavList's words line up with the header's brand,
|
|
155
|
+
not its row fills, so the list hangs out by its own text inset and the
|
|
156
|
+
fills sit in the gutter. A host's own list sets the same hook to join in. */
|
|
157
|
+
.ds-site-layout__sidebar > .ds-nav-list,
|
|
158
|
+
.ds-site-layout__sidebar > [data-ds-sidebar-hang] {
|
|
159
|
+
width: calc(100% + var(--ds-nav-list-text-inset, 0px));
|
|
160
|
+
margin-inline-start: calc(-1 * var(--ds-nav-list-text-inset, 0px));
|
|
161
|
+
/* The same optical rule on the block axis: a scrollable list keeps room
|
|
162
|
+
at its top for its fade (--ds-nav-list-block-inset); pulling the list
|
|
163
|
+
up by it starts the first row level with the page's first line, the
|
|
164
|
+
breadcrumb or the title. */
|
|
165
|
+
margin-block-start: calc(-1 * var(--ds-nav-list-block-inset, 0px));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/* Docked to the edge, the content sits the column gap off the divider,
|
|
169
|
+
not the gutter, so it never crowds the sidebar, and takes the same gap
|
|
170
|
+
at the window's end, so it centres between the two edges (an edge-pinned
|
|
171
|
+
aside sits in that end margin). */
|
|
172
|
+
.ds-site-layout--dock-edge.ds-site-layout--with-sidebar .ds-site-layout__row {
|
|
173
|
+
padding-inline: var(--gap-1500);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/* An edge-pinned aside floats over the window's end margin, so the row
|
|
177
|
+
keeps room for it: the gutter it sits in, the rail itself (about a
|
|
178
|
+
control's height wide) and a beat. A contained row takes only the part
|
|
179
|
+
of that room its own margin does not already give (100% is the body's
|
|
180
|
+
width; docked to the edge, the sidebar's column comes off it first; a
|
|
181
|
+
window narrower than the contained width leaves no margin), so a
|
|
182
|
+
wide window keeps the full contained width; a full row takes all of it. */
|
|
183
|
+
.ds-site-layout {
|
|
184
|
+
--ds-site-layout-rail-room: calc(var(--ds-shell-gutter) + var(--control-height-default) + var(--gap-500));
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
.ds-site-layout.ds-site-layout--aside-edge[data-ds-width='contained'] .ds-site-layout__row {
|
|
188
|
+
padding-inline-end: max(
|
|
189
|
+
var(--ds-shell-gutter),
|
|
190
|
+
calc(var(--ds-site-layout-rail-room) - max(0px, (100% - var(--ds-shell-contained-width)) / 2))
|
|
191
|
+
);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.ds-site-layout.ds-site-layout--aside-edge.ds-site-layout--dock-edge[data-ds-width='contained'] .ds-site-layout__row {
|
|
195
|
+
padding-inline-end: max(
|
|
196
|
+
var(--gap-1500),
|
|
197
|
+
calc(
|
|
198
|
+
var(--ds-site-layout-rail-room) -
|
|
199
|
+
max(
|
|
200
|
+
0px,
|
|
201
|
+
(100% - var(--ds-site-layout-sidebar-width) - var(--ds-shell-gutter) - var(--ds-shell-contained-width)) / 2
|
|
202
|
+
)
|
|
203
|
+
)
|
|
204
|
+
);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
.ds-site-layout.ds-site-layout--aside-edge[data-ds-width='full'] .ds-site-layout__row {
|
|
208
|
+
padding-inline-end: max(var(--gap-1500), var(--ds-site-layout-rail-room));
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* The edge-docked sidebar's divider: a hairline that fades out at both
|
|
212
|
+
ends, so it reads as a seam between the sidebar and the page rather than
|
|
213
|
+
a box drawn around the list. */
|
|
214
|
+
.ds-site-layout--dock-edge .ds-site-layout__sidebar::after {
|
|
215
|
+
content: '';
|
|
216
|
+
position: absolute;
|
|
217
|
+
/* From where the list starts, not from the header's edge. */
|
|
218
|
+
inset-block: var(--ds-site-layout-top-gap) 0;
|
|
219
|
+
inset-inline-end: 0;
|
|
220
|
+
width: var(--border-025);
|
|
221
|
+
background: linear-gradient(
|
|
222
|
+
to bottom,
|
|
223
|
+
transparent,
|
|
224
|
+
var(--color-divider) var(--gap-1000),
|
|
225
|
+
var(--color-divider) calc(100% - var(--gap-1000)),
|
|
226
|
+
transparent
|
|
227
|
+
);
|
|
228
|
+
pointer-events: none;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
/* ============================================
|
|
232
|
+
MAIN AND ASIDE
|
|
233
|
+
============================================ */
|
|
234
|
+
|
|
235
|
+
.ds-site-layout__main {
|
|
236
|
+
display: flex;
|
|
237
|
+
flex-direction: column;
|
|
238
|
+
gap: var(--gap-500);
|
|
239
|
+
min-width: 0;
|
|
240
|
+
padding-block: var(--ds-site-layout-top-gap) var(--padding-1500);
|
|
241
|
+
outline: none;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
/* readingWidth: the main column holds the measure, centred in its grid
|
|
245
|
+
cell, while the page is contained; full sets the shell maximum to none.
|
|
246
|
+
The main element itself narrows, never its children, so a fixed control
|
|
247
|
+
inside it (BackToTop, a docked panel) keeps its own placement. */
|
|
248
|
+
.ds-site-layout--reading .ds-site-layout__main {
|
|
249
|
+
width: 100%;
|
|
250
|
+
max-width: var(--ds-shell-content-max, var(--ds-site-layout-reading-width));
|
|
251
|
+
justify-self: center;
|
|
252
|
+
box-sizing: border-box;
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
.ds-site-layout__aside {
|
|
256
|
+
position: sticky;
|
|
257
|
+
top: var(--ds-site-layout-header-height);
|
|
258
|
+
align-self: start;
|
|
259
|
+
padding-block-start: var(--ds-site-layout-top-gap);
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/* Pinned to the window's end edge (asidePlacement="edge"): out of the
|
|
263
|
+
grid, centred on the height, a gutter in from the edge, so the content
|
|
264
|
+
keeps the room a column would take. It moves in with the end reserve. */
|
|
265
|
+
.ds-site-layout--aside-edge .ds-site-layout__aside {
|
|
266
|
+
position: fixed;
|
|
267
|
+
inset-block-start: 50%;
|
|
268
|
+
/* Fixed to the window, so it follows the end reserve, not the frame's
|
|
269
|
+
box. A host that narrows the page itself rather than through the
|
|
270
|
+
reserve (padding on the body for a docked chat) moves it with
|
|
271
|
+
--ds-site-layout-aside-inset instead. */
|
|
272
|
+
inset-inline-end: var(
|
|
273
|
+
--ds-site-layout-aside-inset,
|
|
274
|
+
calc(var(--ds-site-layout-reserve-end, 0px) + var(--ds-shell-gutter))
|
|
275
|
+
);
|
|
276
|
+
padding-block-start: 0;
|
|
277
|
+
transform: translateY(-50%);
|
|
278
|
+
/* Above the page's content, below the sticky header and its menus. */
|
|
279
|
+
z-index: 5;
|
|
280
|
+
transition: inset-inline-end var(--motion-duration-slow) var(--motion-ease-emphasized);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* ============================================
|
|
284
|
+
FOOTER
|
|
285
|
+
A fading hairline above, the width axis inside.
|
|
286
|
+
============================================ */
|
|
287
|
+
|
|
288
|
+
.ds-site-layout__footer {
|
|
289
|
+
position: relative;
|
|
290
|
+
/* Room between the page and the footer, so the body (the sidebar's last
|
|
291
|
+
rows included) ends well clear of the line above it. */
|
|
292
|
+
margin-block-start: var(--gap-2000);
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* The line above the footer fades out at both ends, the sidebar divider's
|
|
296
|
+
treatment turned on its side. */
|
|
297
|
+
.ds-site-layout__footer::before {
|
|
298
|
+
content: '';
|
|
299
|
+
position: absolute;
|
|
300
|
+
inset-block-start: 0;
|
|
301
|
+
inset-inline: 0;
|
|
302
|
+
height: var(--border-025);
|
|
303
|
+
background: linear-gradient(
|
|
304
|
+
to right, /* ds-allow(physical): a symmetric fade, the same at both ends in either reading direction */
|
|
305
|
+
transparent,
|
|
306
|
+
var(--color-divider) var(--gap-1500),
|
|
307
|
+
var(--color-divider) calc(100% - var(--gap-1500)),
|
|
308
|
+
transparent
|
|
309
|
+
);
|
|
310
|
+
pointer-events: none;
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
.ds-site-layout__footer-row {
|
|
314
|
+
max-width: var(--ds-shell-content-max, var(--ds-shell-contained-width));
|
|
315
|
+
margin-inline: auto;
|
|
316
|
+
padding-inline: var(--ds-shell-gutter);
|
|
317
|
+
box-sizing: border-box;
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
/* ============================================
|
|
321
|
+
RESPONSIVE
|
|
322
|
+
Below 1152px a column aside gives way; below
|
|
323
|
+
960px the sidebar and an edge aside leave the
|
|
324
|
+
page, and the header's menu carries the pages.
|
|
325
|
+
============================================ */
|
|
326
|
+
|
|
327
|
+
@media (max-width: 1151px) {
|
|
328
|
+
/* The column aside only: an edge-pinned one takes no column, so it stays
|
|
329
|
+
until the sidebar goes. */
|
|
330
|
+
.ds-site-layout--with-aside .ds-site-layout__aside {
|
|
331
|
+
display: none;
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ds-site-layout--with-aside .ds-site-layout__row {
|
|
335
|
+
grid-template-columns: minmax(0, 1fr);
|
|
336
|
+
}
|
|
337
|
+
|
|
338
|
+
.ds-site-layout--dock-content.ds-site-layout--with-sidebar.ds-site-layout--with-aside .ds-site-layout__row {
|
|
339
|
+
grid-template-columns: var(--ds-site-layout-sidebar-width) minmax(0, 1fr);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
@media (max-width: 959px) {
|
|
344
|
+
.ds-site-layout__sidebar,
|
|
345
|
+
.ds-site-layout--aside-edge .ds-site-layout__aside {
|
|
346
|
+
display: none;
|
|
347
|
+
}
|
|
348
|
+
|
|
349
|
+
/* The sidebar's room and gap go with it: the content takes the header's
|
|
350
|
+
gutter, so it lines up with the brand above it. */
|
|
351
|
+
.ds-site-layout.ds-site-layout .ds-site-layout__row {
|
|
352
|
+
grid-template-columns: minmax(0, 1fr);
|
|
353
|
+
padding-inline: var(--ds-shell-gutter);
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
/* The edge aside is gone too, and its room with it. */
|
|
357
|
+
.ds-site-layout.ds-site-layout--aside-edge[data-ds-width] .ds-site-layout__row,
|
|
358
|
+
.ds-site-layout.ds-site-layout--aside-edge.ds-site-layout--dock-edge[data-ds-width] .ds-site-layout__row {
|
|
359
|
+
padding-inline-end: var(--ds-shell-gutter);
|
|
360
|
+
}
|
|
361
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Props owned by SiteLayout itself. */
|
|
3
|
+
type SiteLayoutOwnProps = {
|
|
4
|
+
/** The page's main content: the article, the page. */
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* The top bar, usually a SiteHeader. A SiteHeader given no `width` of its
|
|
8
|
+
* own follows `headerWidth`, so the bar lines up with the page below it.
|
|
9
|
+
*/
|
|
10
|
+
header?: React.ReactNode;
|
|
11
|
+
/**
|
|
12
|
+
* The navigation column, usually a scrollable NavList: the wide-screen
|
|
13
|
+
* form of the site's sub-navigation. Sticks below the header; below
|
|
14
|
+
* 960px it leaves the page, and the header's own menu carries the same
|
|
15
|
+
* pages (give each SiteHeader section its `drawerItems`, and set the
|
|
16
|
+
* header's `foldBelow="tablet"` so it folds at the same step), so a
|
|
17
|
+
* reader has one menu, never two.
|
|
18
|
+
*/
|
|
19
|
+
sidebar?: React.ReactNode;
|
|
20
|
+
/** The column after the content, usually an AnchorNav reading the page's headings. Gives way below 1152px in the `column` placement. */
|
|
21
|
+
aside?: React.ReactNode;
|
|
22
|
+
/**
|
|
23
|
+
* Where the aside sits. `column` gives it a column of its own after the
|
|
24
|
+
* content. `edge` pins it to the window's end edge, centred on the
|
|
25
|
+
* height, and gives the content the room: the place for AnchorNav's
|
|
26
|
+
* `floating` variant, a minimap that opens on hover or focus. Hidden
|
|
27
|
+
* below 960px in either.
|
|
28
|
+
*/
|
|
29
|
+
asidePlacement?: 'column' | 'edge';
|
|
30
|
+
/** The bottom of the site, usually a SiteFooter. */
|
|
31
|
+
footer?: React.ReactNode;
|
|
32
|
+
/**
|
|
33
|
+
* How wide the page runs, the shell recipe's width axis. `contained`
|
|
34
|
+
* centres the columns at the contained width (1440px, or the nearest
|
|
35
|
+
* `--ds-shell-contained-width`); `full` runs them edge to edge, the side
|
|
36
|
+
* gutter aside.
|
|
37
|
+
*/
|
|
38
|
+
width?: 'contained' | 'full';
|
|
39
|
+
/**
|
|
40
|
+
* The contained width's step, for a page a level narrower or wider than
|
|
41
|
+
* the default: `narrow` (1200px, a 1080px article beside an edge-docked sidebar), `default` (1440px) or `wide` (1680px).
|
|
42
|
+
* The header and the footer follow it when contained. With the sidebar
|
|
43
|
+
* docked to the edge, the step caps the room after the sidebar; docked to
|
|
44
|
+
* the content, it caps the sidebar and the content together.
|
|
45
|
+
* @default 'default'
|
|
46
|
+
*/
|
|
47
|
+
containedWidth?: 'narrow' | 'default' | 'wide';
|
|
48
|
+
/**
|
|
49
|
+
* How wide the header's bar runs, for a SiteHeader that sets no `width`
|
|
50
|
+
* of its own. It moves with the sidebar's dock: `full` when the sidebar
|
|
51
|
+
* docks to the window's edge (so the brand sits over the sidebar, flush
|
|
52
|
+
* with the same edge), the page's `width` when it docks beside the
|
|
53
|
+
* content. Set it only to break that pairing.
|
|
54
|
+
* @default sidebarDock === 'edge' ? 'full' : width
|
|
55
|
+
*/
|
|
56
|
+
headerWidth?: 'contained' | 'full';
|
|
57
|
+
/**
|
|
58
|
+
* How wide the footer's row runs. It moves with the header: `full` when
|
|
59
|
+
* the sidebar docks to the window's edge, the page's `width` when it
|
|
60
|
+
* docks beside the content, so the top and the bottom of the site always
|
|
61
|
+
* agree. Set it only to break that pairing.
|
|
62
|
+
* @default sidebarDock === 'edge' ? 'full' : width
|
|
63
|
+
*/
|
|
64
|
+
footerWidth?: 'contained' | 'full';
|
|
65
|
+
/**
|
|
66
|
+
* Where the sidebar sits. `content` keeps it in the page's row, beside the
|
|
67
|
+
* content, so a contained page centres all three columns together. `edge`
|
|
68
|
+
* docks it to the window's start edge behind a hairline, and the content
|
|
69
|
+
* and aside are laid out (and contained) in the room after it.
|
|
70
|
+
*/
|
|
71
|
+
sidebarDock?: 'content' | 'edge';
|
|
72
|
+
/**
|
|
73
|
+
* Hold the main column to a reading width (about 75 characters of body
|
|
74
|
+
* text, centred in its column) while the page is contained. A full-width page lets the content run the whole column.
|
|
75
|
+
* `--ds-site-layout-reading-width` sets the measure.
|
|
76
|
+
*/
|
|
77
|
+
readingWidth?: boolean;
|
|
78
|
+
/** The id of the main region, the skip link's target. */
|
|
79
|
+
mainId?: string;
|
|
80
|
+
/** The skip link's text, the page's first stop. Pass an empty string for none. */
|
|
81
|
+
skipLinkLabel?: string;
|
|
82
|
+
/** Accessible name of the sidebar's navigation landmark. */
|
|
83
|
+
sidebarLabel?: string;
|
|
84
|
+
/** Accessible name of the aside's complementary landmark. */
|
|
85
|
+
asideLabel?: string;
|
|
86
|
+
/** Additional CSS classes */
|
|
87
|
+
className?: string;
|
|
88
|
+
};
|
|
89
|
+
export interface SiteLayoutProps extends SiteLayoutOwnProps, Omit<React.ComponentPropsWithRef<'div'>, keyof SiteLayoutOwnProps> {
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* SiteLayout: the frame of a documentation or marketing site. A header, a
|
|
93
|
+
* navigation sidebar, the main content, an aside and a footer, laid out by
|
|
94
|
+
* props: how wide the page runs (`width`, stepped by `containedWidth`),
|
|
95
|
+
* where the sidebar docks (`sidebarDock`; the header and the footer move
|
|
96
|
+
* with it unless `headerWidth` or `footerWidth` breaks the pairing), where
|
|
97
|
+
* the aside sits (`asidePlacement`) and the reading width; any combination
|
|
98
|
+
* holds. The sidebar sticks below the header and scrolls on its own; below
|
|
99
|
+
* 1152px a column aside gives way, and below 960px the sidebar and an edge
|
|
100
|
+
* aside leave the page to the header's own menu. A skip link comes first.
|
|
101
|
+
*/
|
|
102
|
+
export declare function SiteLayout({ children, header, sidebar, aside, footer, width, containedWidth, headerWidth, footerWidth, readingWidth, sidebarDock, asidePlacement, mainId, skipLinkLabel, sidebarLabel, asideLabel, className, ref, ...rest }: SiteLayoutProps): React.JSX.Element;
|
|
103
|
+
export {};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { Link } from "../Link/Link.js";
|
|
4
|
+
import "../../behaviors/shell.css";
|
|
5
|
+
import "./SiteLayout.css";
|
|
6
|
+
function SiteLayout({
|
|
7
|
+
children,
|
|
8
|
+
header,
|
|
9
|
+
sidebar,
|
|
10
|
+
aside,
|
|
11
|
+
footer,
|
|
12
|
+
width = "contained",
|
|
13
|
+
containedWidth = "default",
|
|
14
|
+
headerWidth,
|
|
15
|
+
footerWidth,
|
|
16
|
+
readingWidth = false,
|
|
17
|
+
sidebarDock = "content",
|
|
18
|
+
asidePlacement = "column",
|
|
19
|
+
mainId = "main",
|
|
20
|
+
skipLinkLabel = "Skip to content",
|
|
21
|
+
sidebarLabel = "Pages",
|
|
22
|
+
asideLabel = "On this page",
|
|
23
|
+
className = "",
|
|
24
|
+
ref,
|
|
25
|
+
...rest
|
|
26
|
+
}) {
|
|
27
|
+
const baseClass = "ds-site-layout";
|
|
28
|
+
const frameWidth = sidebarDock === "edge" ? "full" : width;
|
|
29
|
+
const classes = [
|
|
30
|
+
baseClass,
|
|
31
|
+
`${baseClass}--dock-${sidebarDock}`,
|
|
32
|
+
sidebar ? `${baseClass}--with-sidebar` : "",
|
|
33
|
+
aside && asidePlacement === "column" ? `${baseClass}--with-aside` : "",
|
|
34
|
+
aside && asidePlacement === "edge" ? `${baseClass}--aside-edge` : "",
|
|
35
|
+
readingWidth ? `${baseClass}--reading` : "",
|
|
36
|
+
className
|
|
37
|
+
].filter(Boolean).join(" ");
|
|
38
|
+
const content = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
39
|
+
/* @__PURE__ */ jsx("main", { id: mainId, className: `${baseClass}__main`, tabIndex: -1, children }),
|
|
40
|
+
aside && /* @__PURE__ */ jsx("aside", { className: `${baseClass}__aside`, "aria-label": asideLabel, children: aside })
|
|
41
|
+
] });
|
|
42
|
+
const sidebarColumn = sidebar && /* @__PURE__ */ jsx("nav", { className: `${baseClass}__sidebar`, "aria-label": sidebarLabel, children: sidebar });
|
|
43
|
+
return /* @__PURE__ */ jsxs(
|
|
44
|
+
"div",
|
|
45
|
+
{
|
|
46
|
+
...rest,
|
|
47
|
+
ref,
|
|
48
|
+
className: classes,
|
|
49
|
+
"data-ds-width": width,
|
|
50
|
+
"data-ds-contained": containedWidth === "default" ? void 0 : containedWidth,
|
|
51
|
+
children: [
|
|
52
|
+
skipLinkLabel && /* @__PURE__ */ jsx(Link, { variant: "skip", href: `#${mainId}`, children: skipLinkLabel }),
|
|
53
|
+
header && /* @__PURE__ */ jsx("div", { className: `${baseClass}__header`, "data-ds-width": headerWidth ?? frameWidth, children: header }),
|
|
54
|
+
sidebarDock === "edge" ? /* @__PURE__ */ jsxs("div", { className: `${baseClass}__body`, children: [
|
|
55
|
+
sidebarColumn,
|
|
56
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__row`, children: content })
|
|
57
|
+
] }) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__body`, children: /* @__PURE__ */ jsxs("div", { className: `${baseClass}__row`, children: [
|
|
58
|
+
sidebarColumn,
|
|
59
|
+
content
|
|
60
|
+
] }) }),
|
|
61
|
+
footer && /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer`, "data-ds-width": footerWidth ?? frameWidth, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer-row`, children: footer }) })
|
|
62
|
+
]
|
|
63
|
+
}
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
export {
|
|
67
|
+
SiteLayout
|
|
68
|
+
};
|
|
@@ -259,3 +259,17 @@
|
|
|
259
259
|
.ds-table--column-dividers .ds-table__cell:not(:last-child) {
|
|
260
260
|
border-inline-end: var(--border-025) solid var(--color-table-divider);
|
|
261
261
|
}
|
|
262
|
+
|
|
263
|
+
/* ============================================
|
|
264
|
+
CODE COLUMN (column `mono`)
|
|
265
|
+
A reference table's code cells: the code face at the
|
|
266
|
+
cell's size, broken anywhere so a long type wraps inside
|
|
267
|
+
its column rather than widening the table.
|
|
268
|
+
============================================ */
|
|
269
|
+
|
|
270
|
+
.ds-table__cell-content--mono {
|
|
271
|
+
font-family: var(--font-family-code);
|
|
272
|
+
font-size-adjust: var(--font-code-aspect);
|
|
273
|
+
overflow-wrap: anywhere;
|
|
274
|
+
word-break: break-word;
|
|
275
|
+
}
|
|
@@ -12,6 +12,8 @@ export interface TableColumn {
|
|
|
12
12
|
sort?: 'asc' | 'desc';
|
|
13
13
|
/** Whether this column names each row. Its cells render as row headers (`<th scope="row">`), so moving along a row announces which record it is. */
|
|
14
14
|
rowHeader?: boolean;
|
|
15
|
+
/** Set the column's cells in the code face, wrapping long values at any character: for prop names, types, defaults, tokens and other code a reference table lists. */
|
|
16
|
+
mono?: boolean;
|
|
15
17
|
}
|
|
16
18
|
export interface TableRow {
|
|
17
19
|
/** Unique row identifier */
|
|
@@ -60,7 +60,7 @@ const Table = React.forwardRef(
|
|
|
60
60
|
const content = /* @__PURE__ */ jsx(
|
|
61
61
|
"div",
|
|
62
62
|
{
|
|
63
|
-
className: `${baseClass}__cell-content`,
|
|
63
|
+
className: `${baseClass}__cell-content${col.mono ? ` ${baseClass}__cell-content--mono` : ""}`,
|
|
64
64
|
style: {
|
|
65
65
|
// flex-start and flex-end follow the reading direction;
|
|
66
66
|
// left and right stay on their screen side.
|
|
@@ -176,6 +176,63 @@ declare const _default: {
|
|
|
176
176
|
}
|
|
177
177
|
]
|
|
178
178
|
},
|
|
179
|
+
"menubar": {
|
|
180
|
+
"label": "Menu bar",
|
|
181
|
+
"apg": "https://www.w3.org/WAI/ARIA/apg/patterns/menubar/",
|
|
182
|
+
"rows": [
|
|
183
|
+
{
|
|
184
|
+
"id": "tab-stop",
|
|
185
|
+
"keys": [
|
|
186
|
+
"Tab"
|
|
187
|
+
],
|
|
188
|
+
"text": "Moves focus into the bar at the last menu it was on, and out of the bar on the next press."
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "next",
|
|
192
|
+
"keys": [
|
|
193
|
+
"ArrowRight"
|
|
194
|
+
],
|
|
195
|
+
"inline": true,
|
|
196
|
+
"text": "Moves to the next menu, opening it if a menu is open."
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"id": "previous",
|
|
200
|
+
"keys": [
|
|
201
|
+
"ArrowLeft"
|
|
202
|
+
],
|
|
203
|
+
"inline": true,
|
|
204
|
+
"text": "Moves to the previous menu, opening it if a menu is open."
|
|
205
|
+
},
|
|
206
|
+
{
|
|
207
|
+
"id": "last",
|
|
208
|
+
"keys": [
|
|
209
|
+
"End"
|
|
210
|
+
],
|
|
211
|
+
"text": "Moves to the last menu."
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
"id": "first",
|
|
215
|
+
"keys": [
|
|
216
|
+
"Home"
|
|
217
|
+
],
|
|
218
|
+
"text": "Moves to the first menu."
|
|
219
|
+
},
|
|
220
|
+
{
|
|
221
|
+
"id": "open",
|
|
222
|
+
"keys": [
|
|
223
|
+
"ArrowDown"
|
|
224
|
+
],
|
|
225
|
+
"text": "Opens the menu and moves into it; the menu's own keys then apply."
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"id": "dismiss",
|
|
229
|
+
"keys": [
|
|
230
|
+
"Escape"
|
|
231
|
+
],
|
|
232
|
+
"text": "Closes the open menu and returns focus to its name in the bar."
|
|
233
|
+
}
|
|
234
|
+
]
|
|
235
|
+
},
|
|
179
236
|
"combobox": {
|
|
180
237
|
"label": "Combobox",
|
|
181
238
|
"apg": "https://www.w3.org/WAI/ARIA/apg/patterns/combobox/",
|