rift-ds 1.37.0 → 1.38.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 +1 -1
- package/behaviors/whenProgramLinked.d.ts +26 -0
- package/behaviors/whenProgramLinked.js +22 -0
- package/bin/templates/blocks/components/blocks/AppShell.module.css +6 -1
- package/bin/templates/blocks/components/blocks/AppShell.tsx +1 -0
- package/bin/templates/blocks/components/blocks/DocsShell.tsx +3 -3
- package/components/AppLayout/AppLayout.d.ts +9 -4
- package/components/AppLayout/AppLayout.js +1 -1
- package/components/AppSidebar/AppSidebar.css +197 -11
- package/components/AppSidebar/AppSidebar.d.ts +54 -11
- package/components/AppSidebar/AppSidebar.js +122 -42
- package/components/BottomNav/BottomNav.d.ts +2 -1
- package/components/DrillMenu/DrillMenu.css +302 -0
- package/components/DrillMenu/DrillMenu.d.ts +124 -0
- package/components/DrillMenu/DrillMenu.js +176 -0
- package/components/DrillMenu/path.d.ts +22 -0
- package/components/DrillMenu/path.js +27 -0
- package/components/IconButton/IconButton.css +35 -0
- package/components/IconButton/IconButton.d.ts +8 -0
- package/components/IconButton/IconButton.js +2 -0
- package/components/NavList/NavList.d.ts +30 -111
- package/components/NavList/NavList.js +4 -228
- package/components/ShaderField/useShaderField.js +63 -27
- package/components/ShaderScene/ShaderScene.js +135 -95
- package/components/ShaderScene/renderer.d.ts +15 -3
- package/components/ShaderScene/renderer.js +45 -14
- package/components/{NavList/NavList.css → SideNav/SideNav.css} +95 -85
- package/components/SideNav/SideNav.d.ts +118 -0
- package/components/SideNav/SideNav.js +233 -0
- package/components/SidebarPanel/SidebarPanel.d.ts +21 -54
- package/components/SidebarPanel/SidebarPanel.js +4 -168
- package/components/SiteHeader/SiteHeader.css +66 -30
- package/components/SiteHeader/SiteHeader.d.ts +45 -7
- package/components/SiteHeader/SiteHeader.js +51 -21
- package/components/SiteLayout/SiteLayout.css +7 -7
- package/components/SiteLayout/SiteLayout.d.ts +1 -1
- package/components/{SidebarPanel/SidebarPanel.css → SubNavPanel/SubNavPanel.css} +78 -38
- package/components/SubNavPanel/SubNavPanel.d.ts +63 -0
- package/components/SubNavPanel/SubNavPanel.js +182 -0
- package/components/ThreadPanel/ThreadPanel.css +1 -1
- package/components/registry.d.ts +2 -2
- package/components/registry.json +34 -26
- package/components/registry.json.d.ts +34 -26
- package/components/registry.json.js +1 -1
- package/index.d.ts +3 -1
- package/index.js +8 -2
- package/package.json +1 -1
- package/components/Nav/Nav.css +0 -57
- package/components/Nav/Nav.d.ts +0 -32
- package/components/Nav/Nav.js +0 -23
|
@@ -8,7 +8,9 @@ import { useScrollLock } from "../../behaviors/useScrollLock.js";
|
|
|
8
8
|
import { mediaAbove, mediaBelow, BREAKPOINT_MOBILE_PX, BREAKPOINT_TABLET_PX } from "../../tokens/breakpoints.js";
|
|
9
9
|
import { Avatar } from "../Avatar/Avatar.js";
|
|
10
10
|
import { PixelAvatar } from "../PixelAvatar/PixelAvatar.js";
|
|
11
|
-
import {
|
|
11
|
+
import { SubNavPanel } from "../SubNavPanel/SubNavPanel.js";
|
|
12
|
+
import { warnOnce } from "../../behaviors/devWarning.js";
|
|
13
|
+
import { DrillMenu } from "../DrillMenu/DrillMenu.js";
|
|
12
14
|
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
13
15
|
import "../../behaviors/shell.css";
|
|
14
16
|
import "./AppSidebar.css";
|
|
@@ -43,7 +45,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
43
45
|
activeKey,
|
|
44
46
|
activeSubKey,
|
|
45
47
|
activeTertiaryKey,
|
|
46
|
-
subNav = "
|
|
48
|
+
subNav = "panel",
|
|
47
49
|
defaultPanelOpen = true,
|
|
48
50
|
panelOpen: controlledPanelOpen,
|
|
49
51
|
onPanelOpenChange,
|
|
@@ -57,6 +59,9 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
57
59
|
topSlot,
|
|
58
60
|
persistentTopSlot = false,
|
|
59
61
|
footerSlot,
|
|
62
|
+
drawerTopEntries,
|
|
63
|
+
drawerBottomEntries,
|
|
64
|
+
footerAction,
|
|
60
65
|
collapsedFooterSlot,
|
|
61
66
|
className = "",
|
|
62
67
|
logo,
|
|
@@ -68,14 +73,19 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
68
73
|
collapseLabel = "Collapse sidebar",
|
|
69
74
|
profileMoreLabel = "Profile options",
|
|
70
75
|
menuLabel = "Menu",
|
|
76
|
+
drawerBackLabel = (title) => `Back to ${title}`,
|
|
77
|
+
drawerOverviewLabel = (label) => `${label} overview`,
|
|
71
78
|
linkComponent,
|
|
72
79
|
...rest
|
|
73
80
|
}, ref) {
|
|
74
81
|
const baseClass = "ds-app-sidebar";
|
|
75
|
-
const layout = layoutProp ?? (floatingProp ? "floating" : "
|
|
82
|
+
const layout = layoutProp ?? (floatingProp ? "floating" : "inset");
|
|
76
83
|
const floating = layout === "floating";
|
|
77
84
|
const contained = !fixed;
|
|
78
85
|
const Link = useLinkComponent(linkComponent);
|
|
86
|
+
if (sections.length > 1 && sections.some((section) => !section.category)) {
|
|
87
|
+
warnOnce("AppSidebar: with more than one section, give each a `category`, so every group the gaps set apart is named.");
|
|
88
|
+
}
|
|
79
89
|
const avatarSeed = (item) => typeof item.pixelAvatar === "string" ? item.pixelAvatar : item.label;
|
|
80
90
|
const avatarItems = sections.flatMap(
|
|
81
91
|
(section) => section.items.filter((item) => item.pixelAvatar)
|
|
@@ -110,6 +120,25 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
110
120
|
const [mobileOpen, setMobileOpen] = useState(false);
|
|
111
121
|
const toggleLabel = mobileOpen ? closeLabel : isExpanded ? collapseLabel : expandLabel;
|
|
112
122
|
const drawerRef = useRef(null);
|
|
123
|
+
const topRef = useRef(null);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
const top = topRef.current;
|
|
126
|
+
if (!top) return;
|
|
127
|
+
const edges = () => {
|
|
128
|
+
const max = top.scrollHeight - top.clientHeight;
|
|
129
|
+
top.toggleAttribute("data-fade-start", top.scrollTop > 1);
|
|
130
|
+
top.toggleAttribute("data-fade-end", top.scrollTop < max - 1);
|
|
131
|
+
};
|
|
132
|
+
edges();
|
|
133
|
+
top.addEventListener("scroll", edges, { passive: true });
|
|
134
|
+
const resize = new ResizeObserver(edges);
|
|
135
|
+
resize.observe(top);
|
|
136
|
+
for (const child of Array.from(top.children)) resize.observe(child);
|
|
137
|
+
return () => {
|
|
138
|
+
top.removeEventListener("scroll", edges);
|
|
139
|
+
resize.disconnect();
|
|
140
|
+
};
|
|
141
|
+
}, []);
|
|
113
142
|
const setDrawerRef = (node) => {
|
|
114
143
|
drawerRef.current = node;
|
|
115
144
|
if (typeof ref === "function") ref(node);
|
|
@@ -205,27 +234,9 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
205
234
|
);
|
|
206
235
|
const panelVisible = Boolean(panelSource) && isPanelOpen;
|
|
207
236
|
const panelId = useId();
|
|
208
|
-
const
|
|
209
|
-
const focusAfterDrill = useRef(null);
|
|
210
|
-
const openMobile = useCallback(() => {
|
|
211
|
-
setDrilled(Boolean(panelSource));
|
|
212
|
-
setMobileOpen(true);
|
|
213
|
-
}, [panelSource]);
|
|
214
|
-
useEffect(() => {
|
|
215
|
-
const target = focusAfterDrill.current;
|
|
216
|
-
focusAfterDrill.current = null;
|
|
217
|
-
if (!target || !drawerRef.current) return;
|
|
218
|
-
const selector = target === "in" ? ".ds-sidebar-panel__back" : '[data-panel-source="true"]';
|
|
219
|
-
drawerRef.current.querySelector(selector)?.focus();
|
|
220
|
-
}, [drilled]);
|
|
237
|
+
const openMobile = useCallback(() => setMobileOpen(true), []);
|
|
221
238
|
const selectPanelSource = useCallback(
|
|
222
239
|
(key) => {
|
|
223
|
-
if (mobileOpen) {
|
|
224
|
-
setPanelSourceKey(key);
|
|
225
|
-
focusAfterDrill.current = "in";
|
|
226
|
-
setDrilled(true);
|
|
227
|
-
return;
|
|
228
|
-
}
|
|
229
240
|
if (key === panelSourceKey && isPanelOpen) {
|
|
230
241
|
setPanelOpen(false);
|
|
231
242
|
} else {
|
|
@@ -233,8 +244,74 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
233
244
|
setPanelOpen(true);
|
|
234
245
|
}
|
|
235
246
|
},
|
|
236
|
-
[
|
|
247
|
+
[panelSourceKey, isPanelOpen, setPanelOpen]
|
|
237
248
|
);
|
|
249
|
+
const drawerClicks = /* @__PURE__ */ new Map();
|
|
250
|
+
const subEntries = (subs, deeper) => {
|
|
251
|
+
const entries = [];
|
|
252
|
+
for (const sub of subs) {
|
|
253
|
+
const row = subRow(sub, deeper);
|
|
254
|
+
const last = entries[entries.length - 1];
|
|
255
|
+
if (sub.group) {
|
|
256
|
+
if (last && "type" in last && last.label === sub.group) last.items.push(row);
|
|
257
|
+
else entries.push({ type: "section", id: `group-${sub.group}`, label: sub.group, items: [row] });
|
|
258
|
+
} else entries.push(row);
|
|
259
|
+
}
|
|
260
|
+
return entries;
|
|
261
|
+
};
|
|
262
|
+
const subRow = (sub, deeper) => {
|
|
263
|
+
drawerClicks.set(sub.key, sub.onClick);
|
|
264
|
+
return {
|
|
265
|
+
id: sub.key,
|
|
266
|
+
label: sub.label,
|
|
267
|
+
badge: sub.badge,
|
|
268
|
+
description: sub.description,
|
|
269
|
+
icon: sub.icon,
|
|
270
|
+
current: sub.key === activeSubKey || sub.key === activeTertiaryKey || void 0,
|
|
271
|
+
...deeper && sub.children?.length ? { items: subEntries(sub.children, false) } : sub.href ? { href: sub.href } : sub.selected !== void 0 ? (
|
|
272
|
+
// A choice: it applies where it is, and the drawer stays on its level.
|
|
273
|
+
{ selected: sub.selected, onClick: () => sub.onClick?.() }
|
|
274
|
+
) : { onClick: () => {
|
|
275
|
+
sub.onClick?.();
|
|
276
|
+
closeMobile();
|
|
277
|
+
} }
|
|
278
|
+
};
|
|
279
|
+
};
|
|
280
|
+
const itemRow = (item) => {
|
|
281
|
+
drawerClicks.set(item.key, item.onClick);
|
|
282
|
+
return {
|
|
283
|
+
id: item.key,
|
|
284
|
+
label: item.label,
|
|
285
|
+
badge: item.badge,
|
|
286
|
+
icon: item.pixelAvatar ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__drawer-avatar`, children: /* @__PURE__ */ jsx(PixelAvatar, { name: avatarSeed(item), ink: avatarInks.get(item.key) }) }) : item.icon,
|
|
287
|
+
value: item.value,
|
|
288
|
+
current: item.key === activeKey || void 0,
|
|
289
|
+
...item.children?.length ? { items: subEntries(item.children, true) } : item.href ? { href: item.href } : { onClick: () => {
|
|
290
|
+
item.onClick?.();
|
|
291
|
+
closeMobile();
|
|
292
|
+
} }
|
|
293
|
+
};
|
|
294
|
+
};
|
|
295
|
+
const drawerStack = mobileOpen ? [
|
|
296
|
+
...drawerTopEntries ?? [],
|
|
297
|
+
...sections.map((section, si) => ({
|
|
298
|
+
type: "section",
|
|
299
|
+
id: `section-${si}`,
|
|
300
|
+
label: section.category,
|
|
301
|
+
items: section.items.map(itemRow)
|
|
302
|
+
})),
|
|
303
|
+
...drawerBottomEntries ?? []
|
|
304
|
+
] : [];
|
|
305
|
+
let drawerPath = [];
|
|
306
|
+
for (const section of sections) {
|
|
307
|
+
for (const item of section.items) {
|
|
308
|
+
for (const sub of item.children ?? []) {
|
|
309
|
+
if (sub.key === activeSubKey) drawerPath = [item.key];
|
|
310
|
+
if (sub.children?.some((leaf) => leaf.key === activeTertiaryKey))
|
|
311
|
+
drawerPath = sub.children.length && !isPanelMode ? [item.key, sub.key] : [item.key];
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
}
|
|
238
315
|
const showExpanded = isExpanded || mobileOpen;
|
|
239
316
|
const expandOnClick = !showExpanded ? (event) => {
|
|
240
317
|
rest.onClick?.(event);
|
|
@@ -282,7 +359,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
282
359
|
className: classes,
|
|
283
360
|
onClick: expandOnClick ?? rest.onClick,
|
|
284
361
|
children: [
|
|
285
|
-
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__top`, children: [
|
|
362
|
+
/* @__PURE__ */ jsxs("div", { ref: topRef, className: `${baseClass}__top`, children: [
|
|
286
363
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__logo`, children: [
|
|
287
364
|
/* @__PURE__ */ jsxs(
|
|
288
365
|
"div",
|
|
@@ -315,7 +392,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
315
392
|
}
|
|
316
393
|
) })
|
|
317
394
|
] }),
|
|
318
|
-
topSlot && /* @__PURE__ */ jsx(
|
|
395
|
+
topSlot && !(mobileOpen && drawerTopEntries) && /* @__PURE__ */ jsx(
|
|
319
396
|
"div",
|
|
320
397
|
{
|
|
321
398
|
className: [
|
|
@@ -327,21 +404,22 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
327
404
|
children: topSlot
|
|
328
405
|
}
|
|
329
406
|
),
|
|
330
|
-
mobileOpen
|
|
331
|
-
|
|
407
|
+
mobileOpen ? /* @__PURE__ */ jsx(
|
|
408
|
+
DrillMenu,
|
|
332
409
|
{
|
|
410
|
+
className: `${baseClass}__drawer-stack`,
|
|
411
|
+
items: drawerStack,
|
|
412
|
+
defaultPath: drawerPath,
|
|
413
|
+
rootLabel: menuLabel,
|
|
414
|
+
backLabel: drawerBackLabel,
|
|
415
|
+
overviewLabel: drawerOverviewLabel,
|
|
416
|
+
navLabel: menuLabel,
|
|
333
417
|
linkComponent: Link,
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
focusAfterDrill.current = "out";
|
|
340
|
-
setDrilled(false);
|
|
341
|
-
},
|
|
342
|
-
backLabel: panelSource.parentLabel ?? menuLabel
|
|
343
|
-
},
|
|
344
|
-
panelSourceKey
|
|
418
|
+
onNavigate: (item) => {
|
|
419
|
+
if (item.id) drawerClicks.get(item.id)?.();
|
|
420
|
+
closeMobile();
|
|
421
|
+
}
|
|
422
|
+
}
|
|
345
423
|
) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__sections`, children: sections.map((section, si) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__nav`, children: [
|
|
346
424
|
section.category && /* @__PURE__ */ jsx("div", { className: `${baseClass}__category`, children: section.category }),
|
|
347
425
|
section.items.map((item) => {
|
|
@@ -367,7 +445,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
367
445
|
item.pixelAvatar ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-icon ${baseClass}__btn-icon--avatar`, children: /* @__PURE__ */ jsx(PixelAvatar, { name: avatarSeed(item), ink: avatarInks.get(item.key) }) }) : /* @__PURE__ */ jsx(
|
|
368
446
|
"span",
|
|
369
447
|
{
|
|
370
|
-
className: `${baseClass}__btn-icon${typeof item.icon === "string" ? ` material-symbols-rounded ${mirrorClass(item.icon)}` :
|
|
448
|
+
className: `${baseClass}__btn-icon${typeof item.icon === "string" ? ` material-symbols-rounded ${mirrorClass(item.icon)}` : ` ${baseClass}__btn-icon--node`}`,
|
|
371
449
|
children: item.icon
|
|
372
450
|
}
|
|
373
451
|
),
|
|
@@ -377,6 +455,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
377
455
|
] }),
|
|
378
456
|
isPanelMode && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-caption`, "aria-hidden": "true", children: item.label }),
|
|
379
457
|
item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-badge${isCount(item.badge) ? ` ${baseClass}__btn-badge--count` : ""}`, children: item.badge }),
|
|
458
|
+
item.value && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-value`, children: item.value }),
|
|
380
459
|
hasChildren && /* @__PURE__ */ jsx(
|
|
381
460
|
"span",
|
|
382
461
|
{
|
|
@@ -497,7 +576,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
497
576
|
] }, si)) })
|
|
498
577
|
] }),
|
|
499
578
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__bottom`, children: [
|
|
500
|
-
(footerSlot || collapsedFooterSlot) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__footer`, children: [
|
|
579
|
+
(footerSlot || collapsedFooterSlot) && !(mobileOpen && drawerBottomEntries) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__footer`, children: [
|
|
501
580
|
footerSlot && /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer-slot`, inert: !showExpanded, children: footerSlot }),
|
|
502
581
|
collapsedFooterSlot && /* @__PURE__ */ jsx(
|
|
503
582
|
"div",
|
|
@@ -533,13 +612,14 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
533
612
|
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: "more_horiz" })
|
|
534
613
|
}
|
|
535
614
|
)
|
|
536
|
-
] })
|
|
615
|
+
] }),
|
|
616
|
+
footerAction && /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer-action`, inert: !showExpanded, children: footerAction })
|
|
537
617
|
] })
|
|
538
618
|
]
|
|
539
619
|
}
|
|
540
620
|
),
|
|
541
621
|
panelSource && !mobileOpen && /* @__PURE__ */ jsx(
|
|
542
|
-
|
|
622
|
+
SubNavPanel,
|
|
543
623
|
{
|
|
544
624
|
linkComponent: Link,
|
|
545
625
|
id: panelId,
|
|
@@ -57,7 +57,8 @@ type BottomNavOwnProps = {
|
|
|
57
57
|
fixed?: boolean;
|
|
58
58
|
/**
|
|
59
59
|
* Accessible name of the navigation landmark. Defaults to "Tabs", distinct
|
|
60
|
-
* from
|
|
60
|
+
* from a site header's "Primary", so a screen carrying both announces two
|
|
61
|
+
* different navs
|
|
61
62
|
*/
|
|
62
63
|
'aria-label'?: string;
|
|
63
64
|
/**
|
|
@@ -0,0 +1,302 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
DRILL MENU COMPONENT
|
|
3
|
+
A drill-in menu for a phone: one level at a
|
|
4
|
+
time, touch-tall rows on one start line, a
|
|
5
|
+
back row naming where it returns to.
|
|
6
|
+
============================================ */
|
|
7
|
+
|
|
8
|
+
@layer rift.tokens, rift.preset, rift.components;
|
|
9
|
+
|
|
10
|
+
@layer rift.components {
|
|
11
|
+
|
|
12
|
+
.ds-drill-menu {
|
|
13
|
+
/* How far a row's content sits in from the row's own edge. A host that
|
|
14
|
+
lines the labels up with something above it (a header's brand) hangs
|
|
15
|
+
the menu out by this much, so the fills sit in the gutter and the
|
|
16
|
+
words sit on the line. */
|
|
17
|
+
--ds-drill-menu-inset: var(--padding-300);
|
|
18
|
+
/* Touch-tall rows: a control height and one step, so a thumb lands. */
|
|
19
|
+
--ds-drill-menu-row: calc(var(--control-height-default) + var(--padding-200));
|
|
20
|
+
--ds-drill-menu-row-prominent: calc(var(--control-height-default) + var(--padding-400));
|
|
21
|
+
display: block;
|
|
22
|
+
color: var(--color-text-primary);
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
.ds-drill-menu__level {
|
|
26
|
+
display: flex;
|
|
27
|
+
flex-direction: column;
|
|
28
|
+
gap: var(--gap-500);
|
|
29
|
+
scroll-margin-block-start: var(--gap-1000);
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/* A step slides the new level in along the reading direction: from the
|
|
33
|
+
end going in, from the start coming back. */
|
|
34
|
+
.ds-drill-menu__level--in {
|
|
35
|
+
animation: ds-drill-menu-in var(--motion-duration-base) var(--motion-ease-entrance);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.ds-drill-menu__level--out {
|
|
39
|
+
animation: ds-drill-menu-out var(--motion-duration-base) var(--motion-ease-entrance);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
@keyframes ds-drill-menu-in {
|
|
43
|
+
from {
|
|
44
|
+
opacity: 0;
|
|
45
|
+
transform: translateX(calc(var(--ds-inline-sign, 1) * var(--gap-500)));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@keyframes ds-drill-menu-out {
|
|
50
|
+
from {
|
|
51
|
+
opacity: 0;
|
|
52
|
+
transform: translateX(calc(var(--ds-inline-sign, 1) * -1 * var(--gap-500)));
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* ============================================
|
|
57
|
+
HEAD — back row and level title
|
|
58
|
+
============================================ */
|
|
59
|
+
|
|
60
|
+
.ds-drill-menu__head {
|
|
61
|
+
display: flex;
|
|
62
|
+
flex-direction: column;
|
|
63
|
+
align-items: flex-start;
|
|
64
|
+
gap: var(--gap-100);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.ds-drill-menu__back {
|
|
68
|
+
display: inline-flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
gap: var(--gap-050);
|
|
71
|
+
min-height: var(--ds-drill-menu-row);
|
|
72
|
+
/* The chevron's side takes one step less (the icon side of a box). */
|
|
73
|
+
padding-inline: var(--padding-100) var(--ds-drill-menu-inset);
|
|
74
|
+
border: none;
|
|
75
|
+
border-radius: var(--radius-pill);
|
|
76
|
+
background: transparent;
|
|
77
|
+
color: var(--color-text-secondary);
|
|
78
|
+
font-family: var(--font-paragraph-emphasis-family);
|
|
79
|
+
font-size: var(--font-paragraph-emphasis-size);
|
|
80
|
+
font-weight: var(--font-paragraph-emphasis-weight);
|
|
81
|
+
line-height: var(--font-paragraph-emphasis-line-height);
|
|
82
|
+
cursor: pointer;
|
|
83
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
@media (hover: hover) {
|
|
87
|
+
.ds-drill-menu:not([data-settling]) .ds-drill-menu__back:hover {
|
|
88
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.ds-drill-menu__back:focus-visible {
|
|
93
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
94
|
+
outline-offset: -2px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.ds-drill-menu__back-chevron {
|
|
98
|
+
--icon-size: var(--icon-size-600);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.ds-drill-menu__title {
|
|
102
|
+
margin: 0;
|
|
103
|
+
padding-inline: var(--ds-drill-menu-inset);
|
|
104
|
+
font-family: var(--font-heading-2-family);
|
|
105
|
+
font-size: var(--font-heading-2-size);
|
|
106
|
+
font-weight: var(--font-heading-2-weight);
|
|
107
|
+
line-height: var(--font-heading-2-line-height);
|
|
108
|
+
letter-spacing: var(--font-heading-2-letter-spacing);
|
|
109
|
+
color: var(--color-text-heading);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.ds-drill-menu__title:focus {
|
|
113
|
+
outline: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.ds-drill-menu__title:focus-visible {
|
|
117
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
118
|
+
outline-offset: 2px;
|
|
119
|
+
border-radius: var(--radius-100);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
.ds-drill-menu__header {
|
|
123
|
+
padding-inline: var(--ds-drill-menu-inset);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/* ============================================
|
|
127
|
+
SECTIONS AND ROWS
|
|
128
|
+
============================================ */
|
|
129
|
+
|
|
130
|
+
.ds-drill-menu__section {
|
|
131
|
+
display: flex;
|
|
132
|
+
flex-direction: column;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
.ds-drill-menu__section-label {
|
|
136
|
+
margin: 0;
|
|
137
|
+
padding: 0 var(--ds-drill-menu-inset) var(--gap-100);
|
|
138
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
139
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
140
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
141
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
142
|
+
color: var(--color-text-tertiary);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
.ds-drill-menu__list {
|
|
146
|
+
display: flex;
|
|
147
|
+
flex-direction: column;
|
|
148
|
+
margin: 0;
|
|
149
|
+
padding: 0;
|
|
150
|
+
list-style: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
.ds-drill-menu__item {
|
|
154
|
+
display: flex;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* One shape per row: the fill spans the row, the chevron sits inside it.
|
|
158
|
+
Hover applies only where the device hovers, so a tap leaves none
|
|
159
|
+
behind, and not while the menu settles after a step (`data-settling`,
|
|
160
|
+
until the pointer next moves), so the control that lands under a still
|
|
161
|
+
pointer does not light up. */
|
|
162
|
+
.ds-drill-menu__row {
|
|
163
|
+
display: flex;
|
|
164
|
+
align-items: center;
|
|
165
|
+
gap: var(--gap-300);
|
|
166
|
+
width: 100%;
|
|
167
|
+
min-height: var(--ds-drill-menu-row);
|
|
168
|
+
padding: var(--padding-100) var(--ds-drill-menu-inset);
|
|
169
|
+
border: none;
|
|
170
|
+
border-radius: var(--radius-300);
|
|
171
|
+
background: transparent;
|
|
172
|
+
color: var(--color-text-primary);
|
|
173
|
+
font-family: var(--font-paragraph-family);
|
|
174
|
+
font-size: var(--font-paragraph-size);
|
|
175
|
+
font-weight: var(--font-paragraph-weight);
|
|
176
|
+
line-height: var(--font-paragraph-line-height);
|
|
177
|
+
text-align: start;
|
|
178
|
+
text-decoration: none;
|
|
179
|
+
cursor: pointer;
|
|
180
|
+
-webkit-tap-highlight-color: transparent;
|
|
181
|
+
transition: background-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media (hover: hover) {
|
|
185
|
+
.ds-drill-menu:not([data-settling]) .ds-drill-menu__row:hover {
|
|
186
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
.ds-drill-menu__row:active {
|
|
191
|
+
background-color: var(--color-action-passive-bg-active);
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
.ds-drill-menu__row:focus-visible {
|
|
195
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
196
|
+
outline-offset: -2px;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/* Where the reader is: a quiet fill, never the action colour. */
|
|
200
|
+
.ds-drill-menu__row--current {
|
|
201
|
+
background-color: var(--color-action-passive-bg-hover);
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
.ds-drill-menu__row--prominent {
|
|
205
|
+
min-height: var(--ds-drill-menu-row-prominent);
|
|
206
|
+
font-family: var(--font-heading-3-family);
|
|
207
|
+
font-size: var(--font-heading-3-size);
|
|
208
|
+
font-weight: var(--font-heading-3-weight);
|
|
209
|
+
line-height: var(--font-heading-3-line-height);
|
|
210
|
+
letter-spacing: var(--font-heading-3-letter-spacing);
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/* A two-line row takes the taller row. */
|
|
214
|
+
.ds-drill-menu__row:has(.ds-drill-menu__description) {
|
|
215
|
+
min-height: var(--ds-drill-menu-row-prominent);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
.ds-drill-menu__icon {
|
|
219
|
+
display: grid;
|
|
220
|
+
place-items: center;
|
|
221
|
+
flex-shrink: 0;
|
|
222
|
+
width: var(--icon-size-600);
|
|
223
|
+
height: var(--icon-size-600);
|
|
224
|
+
color: var(--color-icon-primary);
|
|
225
|
+
--icon-size: var(--icon-size-600);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.ds-drill-menu__text {
|
|
229
|
+
display: flex;
|
|
230
|
+
flex-direction: column;
|
|
231
|
+
flex: 1;
|
|
232
|
+
min-width: 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
.ds-drill-menu__label,
|
|
236
|
+
.ds-drill-menu__description {
|
|
237
|
+
overflow: hidden;
|
|
238
|
+
text-overflow: ellipsis;
|
|
239
|
+
white-space: nowrap;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.ds-drill-menu__description {
|
|
243
|
+
font-family: var(--font-paragraph-sm-family);
|
|
244
|
+
font-size: var(--font-paragraph-sm-size);
|
|
245
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
246
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
247
|
+
color: var(--color-text-tertiary);
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
.ds-drill-menu__value {
|
|
251
|
+
flex-shrink: 1;
|
|
252
|
+
min-width: 0;
|
|
253
|
+
max-width: 50%;
|
|
254
|
+
overflow: hidden;
|
|
255
|
+
text-overflow: ellipsis;
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
font-family: var(--font-paragraph-sm-family);
|
|
258
|
+
font-size: var(--font-paragraph-sm-size);
|
|
259
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
260
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
261
|
+
color: var(--color-text-tertiary);
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
/* A count on the count badge pair, the "how many" mark AppSidebar,
|
|
265
|
+
BottomNav and TableToolbar share; a word on a quiet pill. */
|
|
266
|
+
.ds-drill-menu__badge {
|
|
267
|
+
flex-shrink: 0;
|
|
268
|
+
padding: var(--padding-050) var(--padding-200);
|
|
269
|
+
border-radius: var(--radius-pill);
|
|
270
|
+
background-color: var(--color-bg-container-tertiary);
|
|
271
|
+
color: var(--color-text-secondary);
|
|
272
|
+
font-family: var(--font-caption-family);
|
|
273
|
+
font-size: var(--font-caption-size);
|
|
274
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
275
|
+
line-height: var(--font-caption-line-height);
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.ds-drill-menu__badge--count {
|
|
279
|
+
background-color: var(--color-count-badge-bg);
|
|
280
|
+
color: var(--color-count-badge-text);
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
/* On a filled row the quiet pill steps back to the page ground. */
|
|
284
|
+
.ds-drill-menu:not([data-settling]) .ds-drill-menu__row:hover .ds-drill-menu__badge:not(.ds-drill-menu__badge--count),
|
|
285
|
+
.ds-drill-menu__row--current .ds-drill-menu__badge:not(.ds-drill-menu__badge--count) {
|
|
286
|
+
background-color: var(--color-bg-page-primary);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
.ds-drill-menu__trail {
|
|
290
|
+
display: grid;
|
|
291
|
+
place-items: center;
|
|
292
|
+
flex-shrink: 0;
|
|
293
|
+
min-width: var(--icon-size-600);
|
|
294
|
+
color: var(--color-icon-primary);
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
.ds-drill-menu__chevron,
|
|
298
|
+
.ds-drill-menu__external {
|
|
299
|
+
--icon-size: var(--icon-size-600);
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
} /* @layer rift.components */
|