rift-ds 1.37.1 → 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/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/{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 +51 -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
package/README.md
CHANGED
|
@@ -119,7 +119,7 @@ import 'rift-ds/tokens/presets/presets.css';
|
|
|
119
119
|
<summary>The full list</summary>
|
|
120
120
|
|
|
121
121
|
<!-- component-list:start -->
|
|
122
|
-
Accordion · Action bar · Action card · Action readout · Agent plan · Agent rail · Agent status · AI button · Alert · Alert dialog · Anchor nav · Animated number · App layout · App sidebar · Area chart · Artifact card · Artifact panel · Attachment drop zone · Attachment group · Attachment tile · Attachment viewer · Avatar · Avatar group · Back to top · Badge · Banner · Bar chart · Bento tile · Bento tile art · Bottom nav · Breadcrumb · Button · Button group · Card · Card stack · Carousel · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Checklist · Chip · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Copy button · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · Decision row · Description list · Dialog · Divider · Document chip · Document viewer · Drawer · Dropdown · Dropdown menu · Empty state · Entity card · Entity switcher · Error summary · Event calendar · Field · Figure · File input · File row · Filter bar · Form section · Funnel chart · Gantt chart · Gauge · Globe · Grid · Heading · Hover card · Icon · Icon button · Image compare · Input · Inspector colour picker · Inspector dropdown · Inspector input · Inspector section · Inspector segments · Inspector slider · Inspector toggle switch · Instructions · Interrupt card · Kbd · Legend tile · Lightbox · Line chart · Link · Link list · List · Map callout · Map legend · Masked input · Mega menu · Mention · Menu bar · Message actions · Message card · Meter · Model picker ·
|
|
122
|
+
Accordion · Action bar · Action card · Action readout · Agent plan · Agent rail · Agent status · AI button · Alert · Alert dialog · Anchor nav · Animated number · App layout · App sidebar · Area chart · Artifact card · Artifact panel · Attachment drop zone · Attachment group · Attachment tile · Attachment viewer · Avatar · Avatar group · Back to top · Badge · Banner · Bar chart · Bento tile · Bento tile art · Bottom nav · Breadcrumb · Button · Button group · Card · Card stack · Carousel · Chat header · Chat marker · Chat message · Chat thread · Checkbox · Checklist · Chip · Code block · Code diff · Colour picker · Combo chart · Combobox · Command palette · Command palette trigger · Composer · Contact card · Context menu · Contribution graph · Copy button · Currency input · Data table · Date input · Date picker · Date range picker · Deadline · Decision row · Description list · Dialog · Divider · Document chip · Document viewer · Drawer · Drill menu · Dropdown · Dropdown menu · Empty state · Entity card · Entity switcher · Error summary · Event calendar · Field · Figure · File input · File row · Filter bar · Form section · Funnel chart · Gantt chart · Gauge · Globe · Grid · Heading · Hover card · Icon · Icon button · Image compare · Input · Inspector colour picker · Inspector dropdown · Inspector input · Inspector section · Inspector segments · Inspector slider · Inspector toggle switch · Instructions · Interrupt card · Kbd · Legend tile · Lightbox · Line chart · Link · Link list · List · Map callout · Map legend · Masked input · Mega menu · Mention · Menu bar · Message actions · Message card · Meter · Model picker · Notification centre · Number input · Org chart · Page header · Pagination · Panel · Pie chart · Pin input · Pixel avatar · Popover · Progress bar · Progressive blur · Prompt suggestions · Prose · Question card · Quote · Radar chart · Radial chart · Radio button · Rating · Reasoning · Resource timeline · Rich dropdown · Scatter chart · Section title · Segmented control · Selection card · Shader field · Shader scene · Side nav · Signature pad · Site footer · Site header · Site layout · Skeleton · Slider · Source chip · Source trail · Sparkline · Spinner · Split button · Split pane · Stack · Stacked bar chart · Stat · Status dot · Stepper · Streaming text · Sub-nav panel · Swatch · Table · Table toolbar · Tabs · Tag input · Text · Textarea · Theme picker · Theme toggle · Thread panel · Thread tabs · Time picker · Timeline · Toast · Toggle group · Toggle switch · Tool call · Toolbar · Tooltip · Top app bar · Tree view · Treemap · Usage card · Waveform · Widget · Wizard · World map
|
|
123
123
|
<!-- component-list:end -->
|
|
124
124
|
|
|
125
125
|
</details>
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* The app shell's layout, in one of the three app shell modes (flush,
|
|
2
2
|
floating or inset; AppShell.tsx's SHELL_LAYOUT picks it). Every value is
|
|
3
3
|
a rift-ds token or a property of its shell recipe, except the sidebar's
|
|
4
|
-
own widths (
|
|
4
|
+
own widths (80px collapsed in panel mode, the default, or 64px in
|
|
5
|
+
accordion mode; 280px expanded) and its mobile menu button
|
|
5
6
|
(40px), which are the AppSidebar component's geometry. */
|
|
6
7
|
|
|
7
8
|
.shell {
|
|
@@ -24,6 +25,10 @@
|
|
|
24
25
|
background-color: var(--ds-shell-plane);
|
|
25
26
|
}
|
|
26
27
|
|
|
28
|
+
.shell:has(:global(.ds-app-sidebar--panel-mode:not(.ds-app-sidebar--expanded))) {
|
|
29
|
+
--shell-rail: 80px;
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
.shell:has(:global(.ds-app-sidebar--expanded)) {
|
|
28
33
|
--shell-rail: 280px;
|
|
29
34
|
}
|
|
@@ -54,6 +54,7 @@ const PRODUCT_NAME = 'Acme';
|
|
|
54
54
|
/** The sidebar's navigation. Give an item an `href` (`'/dashboard'`) to make it a link. */
|
|
55
55
|
const NAV_SECTIONS: AppSidebarSection[] = [
|
|
56
56
|
{
|
|
57
|
+
category: 'Main',
|
|
57
58
|
items: [
|
|
58
59
|
{ key: 'home', label: 'Home', icon: 'home' },
|
|
59
60
|
{ key: 'dashboard', label: 'Dashboard', icon: 'space_dashboard' },
|
|
@@ -24,7 +24,7 @@ import { AnchorNav } from 'rift-ds/components/AnchorNav/AnchorNav';
|
|
|
24
24
|
import { BackToTop } from 'rift-ds/components/BackToTop/BackToTop';
|
|
25
25
|
import { Breadcrumb, type BreadcrumbItem } from 'rift-ds/components/Breadcrumb/Breadcrumb';
|
|
26
26
|
import { CommandPaletteTrigger } from 'rift-ds/components/CommandPaletteTrigger/CommandPaletteTrigger';
|
|
27
|
-
import {
|
|
27
|
+
import { SideNav, type SideNavEntry } from 'rift-ds/components/SideNav/SideNav';
|
|
28
28
|
import { SiteFooter, type SiteFooterColumn } from 'rift-ds/components/SiteFooter/SiteFooter';
|
|
29
29
|
import { SiteHeader, type SiteHeaderSection } from 'rift-ds/components/SiteHeader/SiteHeader';
|
|
30
30
|
import { SiteLayout } from 'rift-ds/components/SiteLayout/SiteLayout';
|
|
@@ -47,7 +47,7 @@ const COMPONENT_PAGES = [
|
|
|
47
47
|
'Combobox', 'Dialog', 'Drawer', 'Dropdown menu', 'Field', 'Input', 'Menubar', 'Pagination', 'Popover', 'Select',
|
|
48
48
|
'Slider', 'Switch', 'Table', 'Tabs', 'Toast', 'Tooltip',
|
|
49
49
|
];
|
|
50
|
-
const NAV:
|
|
50
|
+
const NAV: SideNavEntry[] = [
|
|
51
51
|
{
|
|
52
52
|
type: 'section',
|
|
53
53
|
label: 'Getting started',
|
|
@@ -154,7 +154,7 @@ export function DocsShell({ currentHref, breadcrumb, children }: DocsShellProps)
|
|
|
154
154
|
/>
|
|
155
155
|
}
|
|
156
156
|
sidebar={
|
|
157
|
-
<
|
|
157
|
+
<SideNav
|
|
158
158
|
items={NAV}
|
|
159
159
|
size="compact"
|
|
160
160
|
scrollable
|
|
@@ -13,7 +13,11 @@ type AppLayoutOwnProps = {
|
|
|
13
13
|
activeSubKey?: string;
|
|
14
14
|
/** Active third-level item key, listed in the sidebar's side panel */
|
|
15
15
|
activeTertiaryKey?: string;
|
|
16
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Where sub-items show: straight into the sidebar's side panel, or its
|
|
18
|
+
* accordion (see AppSidebar).
|
|
19
|
+
* @default 'panel'
|
|
20
|
+
*/
|
|
17
21
|
subNav?: 'accordion' | 'panel';
|
|
18
22
|
/** Whether sidebar starts expanded */
|
|
19
23
|
defaultExpanded?: boolean;
|
|
@@ -25,13 +29,14 @@ type AppLayoutOwnProps = {
|
|
|
25
29
|
children: React.ReactNode;
|
|
26
30
|
/**
|
|
27
31
|
* How the rail and the content meet the page, one of the three app shell
|
|
28
|
-
* modes. `flush`
|
|
32
|
+
* modes. `flush` runs the rail edge to edge on the shell
|
|
29
33
|
* colour behind a hairline, the content centred beside it on the crisp
|
|
30
34
|
* app surface, nothing raised. `floating` floats the rail as a glass card,
|
|
31
35
|
* the content still centred. `inset` runs the rail flush on the shell
|
|
32
36
|
* colour and sets the content in a raised surface (hairline and floating
|
|
33
|
-
* shadow) inset from the other edges, which scrolls inside itself
|
|
34
|
-
* wide the content runs is `width`, apart from the mode.
|
|
37
|
+
* shadow) inset from the other edges, which scrolls inside itself, and is
|
|
38
|
+
* the default. How wide the content runs is `width`, apart from the mode.
|
|
39
|
+
* @default 'inset'
|
|
35
40
|
*/
|
|
36
41
|
layout?: AppSidebarLayout;
|
|
37
42
|
/**
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/* ============================================
|
|
2
2
|
APP SIDEBAR — collapsible navigation
|
|
3
|
-
Collapsed:
|
|
4
|
-
|
|
3
|
+
Collapsed: 80px labelled rail (panel mode, the
|
|
4
|
+
default) or 64px icon rail (accordion mode)
|
|
5
|
+
Expanded: 280px with labels, profile
|
|
5
6
|
============================================ */
|
|
6
7
|
|
|
7
8
|
@layer rift.tokens, rift.preset, rift.components;
|
|
@@ -102,19 +103,53 @@
|
|
|
102
103
|
TOP SECTION — logo + nav
|
|
103
104
|
============================================ */
|
|
104
105
|
.ds-app-sidebar__top {
|
|
106
|
+
/* How far the rows fade out at an end with more to scroll (AppSidebar.tsx
|
|
107
|
+
writes data-fade-start and data-fade-end). */
|
|
108
|
+
--ds-app-sidebar-fade: var(--gap-1000);
|
|
109
|
+
--ds-app-sidebar-fade-start: 0px;
|
|
110
|
+
--ds-app-sidebar-fade-end: 0px;
|
|
105
111
|
display: flex;
|
|
106
112
|
flex-direction: column;
|
|
107
113
|
gap: var(--gap-1000);
|
|
108
114
|
overflow-y: auto;
|
|
109
115
|
overflow-x: hidden;
|
|
116
|
+
overscroll-behavior: contain;
|
|
110
117
|
flex: 1;
|
|
111
118
|
min-height: 0;
|
|
119
|
+
/* ds-allow(color): mask alpha keywords (black/transparent), not palette colours */
|
|
120
|
+
-webkit-mask-image: linear-gradient(
|
|
121
|
+
to bottom,
|
|
122
|
+
transparent,
|
|
123
|
+
black var(--ds-app-sidebar-fade-start),
|
|
124
|
+
black calc(100% - var(--ds-app-sidebar-fade-end)),
|
|
125
|
+
transparent
|
|
126
|
+
);
|
|
127
|
+
/* ds-allow(color): mask alpha keywords (black/transparent), not palette colours */
|
|
128
|
+
mask-image: linear-gradient(
|
|
129
|
+
to bottom,
|
|
130
|
+
transparent,
|
|
131
|
+
black var(--ds-app-sidebar-fade-start),
|
|
132
|
+
black calc(100% - var(--ds-app-sidebar-fade-end)),
|
|
133
|
+
transparent
|
|
134
|
+
);
|
|
112
135
|
/* The scroller clips at its edge, and the logo row sits on it: the
|
|
113
136
|
collapse toggle's hover pill, a --gap-100 step out from the icon, lost
|
|
114
137
|
its top to it. A pill's worth of room inside the top edge, taken back
|
|
115
138
|
from the rail's padding, so nothing moves. */
|
|
116
139
|
padding-top: var(--gap-100);
|
|
117
140
|
margin-top: calc(-1 * var(--gap-100));
|
|
141
|
+
/* Scrolled to its end, the last row stops a step clear of the profile
|
|
142
|
+
rather than on it. Rows that fit never reach this: the block's spare
|
|
143
|
+
height already holds it. */
|
|
144
|
+
padding-bottom: var(--gap-500);
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-app-sidebar__top[data-fade-start] {
|
|
148
|
+
--ds-app-sidebar-fade-start: var(--ds-app-sidebar-fade);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ds-app-sidebar__top[data-fade-end] {
|
|
152
|
+
--ds-app-sidebar-fade-end: var(--ds-app-sidebar-fade);
|
|
118
153
|
}
|
|
119
154
|
|
|
120
155
|
/* ============================================
|
|
@@ -292,6 +327,16 @@
|
|
|
292
327
|
flex-shrink: 0;
|
|
293
328
|
}
|
|
294
329
|
|
|
330
|
+
/* A custom icon (a swatch, an inline mark) takes the glyph's box and
|
|
331
|
+
centres in it, so it sits where a glyph would rather than hugging the
|
|
332
|
+
start of the seat. */
|
|
333
|
+
.ds-app-sidebar__btn-icon--node {
|
|
334
|
+
display: inline-grid;
|
|
335
|
+
place-items: center;
|
|
336
|
+
inline-size: var(--icon-size);
|
|
337
|
+
block-size: var(--icon-size);
|
|
338
|
+
}
|
|
339
|
+
|
|
295
340
|
/* A generated avatar in the icon seat: a block-level sprite, so the seat
|
|
296
341
|
lays it out as a box rather than on the text baseline. */
|
|
297
342
|
.ds-app-sidebar__btn-icon--avatar {
|
|
@@ -350,6 +395,34 @@
|
|
|
350
395
|
background-color: var(--color-bg-page-primary);
|
|
351
396
|
}
|
|
352
397
|
|
|
398
|
+
/* A setting's current value, quiet at the row's end while expanded. */
|
|
399
|
+
.ds-app-sidebar__btn-value {
|
|
400
|
+
/* At the row's end, beside the chevron, as a settings list sets it. */
|
|
401
|
+
margin-inline-start: auto;
|
|
402
|
+
margin-inline-end: var(--padding-100);
|
|
403
|
+
flex-shrink: 1;
|
|
404
|
+
min-width: 0;
|
|
405
|
+
max-width: 45%;
|
|
406
|
+
overflow: hidden;
|
|
407
|
+
text-overflow: ellipsis;
|
|
408
|
+
white-space: nowrap;
|
|
409
|
+
font-family: var(--font-paragraph-sm-family);
|
|
410
|
+
font-size: var(--font-paragraph-sm-size);
|
|
411
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
412
|
+
/* Centred on the row with the label and the chevron, in panel mode too,
|
|
413
|
+
where the row aligns its children to the top for the caption below the
|
|
414
|
+
icon, at a line height of its own rather than a `normal` one. */
|
|
415
|
+
align-self: center;
|
|
416
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
417
|
+
color: var(--color-text-tertiary);
|
|
418
|
+
opacity: 0;
|
|
419
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
.ds-app-sidebar--expanded .ds-app-sidebar__btn-value {
|
|
423
|
+
opacity: 1;
|
|
424
|
+
}
|
|
425
|
+
|
|
353
426
|
/* A count: a solid pill on the count badge pair, the "how many" mark
|
|
354
427
|
BottomNav and TableToolbar share, which reads on any row fill. */
|
|
355
428
|
.ds-app-sidebar__btn-badge--count {
|
|
@@ -529,9 +602,40 @@
|
|
|
529
602
|
/* The nav sections share one wrapper so the drawer's drill-in can swap
|
|
530
603
|
them for the panel's level as a unit. */
|
|
531
604
|
.ds-app-sidebar__sections {
|
|
605
|
+
--ds-app-sidebar-section-gap: var(--gap-1000);
|
|
532
606
|
display: flex;
|
|
533
607
|
flex-direction: column;
|
|
534
|
-
gap: var(--gap
|
|
608
|
+
gap: var(--ds-app-sidebar-section-gap);
|
|
609
|
+
transition: gap var(--motion-duration-slow) var(--motion-ease-emphasized);
|
|
610
|
+
}
|
|
611
|
+
|
|
612
|
+
/* Collapsed, the headings that name the groups are gone, so the space
|
|
613
|
+
they sat in closes up and a short divider on the icons' axis marks
|
|
614
|
+
each break instead. The divider crossfades with the heading as the
|
|
615
|
+
rail expands, and the gap glides with the rail's own motion. */
|
|
616
|
+
.ds-app-sidebar:not(.ds-app-sidebar--expanded) .ds-app-sidebar__sections {
|
|
617
|
+
--ds-app-sidebar-section-gap: var(--gap-500);
|
|
618
|
+
}
|
|
619
|
+
|
|
620
|
+
.ds-app-sidebar__sections > .ds-app-sidebar__nav {
|
|
621
|
+
position: relative;
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
.ds-app-sidebar__sections > .ds-app-sidebar__nav + .ds-app-sidebar__nav::before {
|
|
625
|
+
content: '';
|
|
626
|
+
position: absolute;
|
|
627
|
+
inset-block-start: calc(var(--ds-app-sidebar-section-gap) / -2);
|
|
628
|
+
inset-inline: 0;
|
|
629
|
+
inline-size: var(--icon-size-600);
|
|
630
|
+
margin-inline: auto;
|
|
631
|
+
border-block-start: var(--border-025) solid var(--color-divider);
|
|
632
|
+
opacity: 1;
|
|
633
|
+
pointer-events: none;
|
|
634
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
.ds-app-sidebar--expanded .ds-app-sidebar__sections > .ds-app-sidebar__nav + .ds-app-sidebar__nav::before {
|
|
638
|
+
opacity: 0;
|
|
535
639
|
}
|
|
536
640
|
|
|
537
641
|
/* ============================================
|
|
@@ -707,7 +811,7 @@
|
|
|
707
811
|
}
|
|
708
812
|
|
|
709
813
|
/* ============================================
|
|
710
|
-
SIDE PANEL — the
|
|
814
|
+
SIDE PANEL — the SubNavPanel fixed beside the
|
|
711
815
|
rail. It tracks the rail's width through the
|
|
712
816
|
same slow emphasized glide, and slides a step
|
|
713
817
|
out from under it on open. Hidden, it stays
|
|
@@ -840,7 +944,7 @@
|
|
|
840
944
|
z-index: 2;
|
|
841
945
|
flex: none;
|
|
842
946
|
height: 100%;
|
|
843
|
-
margin-inline-end: calc(-1 * var(--ds-sidebar-panel-width, 240px));
|
|
947
|
+
margin-inline-end: calc(-1 * var(--ds-sub-nav-panel-width, var(--ds-sidebar-panel-width, 240px)));
|
|
844
948
|
transition:
|
|
845
949
|
margin var(--motion-duration-slow) var(--motion-ease-emphasized),
|
|
846
950
|
opacity var(--motion-duration-base) var(--motion-ease-standard),
|
|
@@ -863,7 +967,7 @@
|
|
|
863
967
|
height: calc(100% - var(--ds-sidebar-float-inset, 20px) * 2);
|
|
864
968
|
margin-block: var(--ds-sidebar-float-inset, 20px);
|
|
865
969
|
margin-inline-start: var(--gap-300);
|
|
866
|
-
margin-inline-end: calc(-1 * (var(--ds-sidebar-panel-width, 240px) + var(--gap-300)));
|
|
970
|
+
margin-inline-end: calc(-1 * (var(--ds-sub-nav-panel-width, var(--ds-sidebar-panel-width, 240px)) + var(--gap-300)));
|
|
867
971
|
}
|
|
868
972
|
|
|
869
973
|
.ds-app-sidebar__panel--contained.ds-app-sidebar__panel--floating.ds-app-sidebar__panel--visible {
|
|
@@ -889,6 +993,17 @@
|
|
|
889
993
|
width: 80px;
|
|
890
994
|
}
|
|
891
995
|
|
|
996
|
+
/* The seat assumes the rail's whole width: a classic scrollbar would take
|
|
997
|
+
a fifth of it and pull every row's pill off its icon. The fade at the
|
|
998
|
+
scrolling end is the rail's cue that there is more, so the bar goes. */
|
|
999
|
+
.ds-app-sidebar--panel-mode:not(.ds-app-sidebar--expanded) .ds-app-sidebar__top {
|
|
1000
|
+
scrollbar-width: none;
|
|
1001
|
+
}
|
|
1002
|
+
|
|
1003
|
+
.ds-app-sidebar--panel-mode:not(.ds-app-sidebar--expanded) .ds-app-sidebar__top::-webkit-scrollbar {
|
|
1004
|
+
display: none;
|
|
1005
|
+
}
|
|
1006
|
+
|
|
892
1007
|
/* The seat: 12px row margin + 16px row padding puts every 24px icon's
|
|
893
1008
|
centre on the 80px rail's centre line (28 + 12 = 40), and the logo,
|
|
894
1009
|
the category labels and the profile row share that leading edge. */
|
|
@@ -1116,13 +1231,15 @@
|
|
|
1116
1231
|
inset-inline-start: 0;
|
|
1117
1232
|
bottom: 0;
|
|
1118
1233
|
z-index: var(--layer-nav-rail);
|
|
1119
|
-
|
|
1234
|
+
/* The whole screen, as the site header's phone menu: a solid sheet
|
|
1235
|
+
whose levels drill in, clear of the notch and the home indicator. */
|
|
1236
|
+
width: 100%;
|
|
1120
1237
|
height: 100dvh;
|
|
1121
|
-
padding: var(--padding-500) 0;
|
|
1238
|
+
padding: max(var(--padding-500), env(safe-area-inset-top)) 0 max(var(--padding-500), env(safe-area-inset-bottom));
|
|
1122
1239
|
overflow-y: auto;
|
|
1123
1240
|
background: var(--color-bg-page-primary);
|
|
1124
|
-
border-inline-end:
|
|
1125
|
-
box-shadow:
|
|
1241
|
+
border-inline-end: none;
|
|
1242
|
+
box-shadow: none;
|
|
1126
1243
|
animation: ds-app-sidebar-slide-in var(--motion-duration-base) var(--motion-ease-standard);
|
|
1127
1244
|
}
|
|
1128
1245
|
}
|
|
@@ -1165,7 +1282,7 @@
|
|
|
1165
1282
|
z-index: 3;
|
|
1166
1283
|
height: 100%;
|
|
1167
1284
|
margin: 0;
|
|
1168
|
-
margin-inline-end: -
|
|
1285
|
+
margin-inline-end: -100%;
|
|
1169
1286
|
}
|
|
1170
1287
|
}
|
|
1171
1288
|
|
|
@@ -1242,4 +1359,73 @@
|
|
|
1242
1359
|
background-color: var(--color-action-passive-bg-active);
|
|
1243
1360
|
}
|
|
1244
1361
|
|
|
1362
|
+
/* ============================================
|
|
1363
|
+
PHONE DRAWER — the DrillMenu inside it
|
|
1364
|
+
============================================ */
|
|
1365
|
+
|
|
1366
|
+
/* The stack's rows sit a padding step in from the sheet's edge, so their
|
|
1367
|
+
labels land on the logo's start line. */
|
|
1368
|
+
.ds-app-sidebar__drawer-stack {
|
|
1369
|
+
padding-inline: var(--padding-400);
|
|
1370
|
+
padding-block-end: var(--padding-500);
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
/* The sheet's top keeps the logo row, the switcher and the stack a
|
|
1374
|
+
section step apart, not the rail's wider gap. */
|
|
1375
|
+
.ds-app-sidebar--mobile-open .ds-app-sidebar__top {
|
|
1376
|
+
gap: var(--gap-500);
|
|
1377
|
+
}
|
|
1378
|
+
|
|
1379
|
+
.ds-app-sidebar__drawer-avatar {
|
|
1380
|
+
display: grid;
|
|
1381
|
+
width: var(--icon-size-600);
|
|
1382
|
+
height: var(--icon-size-600);
|
|
1383
|
+
}
|
|
1384
|
+
|
|
1385
|
+
.ds-app-sidebar__drawer-avatar > * {
|
|
1386
|
+
width: 100%;
|
|
1387
|
+
height: 100%;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/* In the sheet the close and the profile's more button are thumb targets. */
|
|
1391
|
+
.ds-app-sidebar--mobile-open .ds-app-sidebar__toggle,
|
|
1392
|
+
.ds-app-sidebar--mobile-open .ds-app-sidebar__profile-more {
|
|
1393
|
+
width: calc(var(--control-height-default) + var(--padding-200));
|
|
1394
|
+
height: calc(var(--control-height-default) + var(--padding-200));
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/* The rail's one primary action below the profile, its button full
|
|
1398
|
+
width. It fades with the labels as the rail collapses, since a 64px
|
|
1399
|
+
rail has no room for it. */
|
|
1400
|
+
.ds-app-sidebar__footer-action {
|
|
1401
|
+
padding-inline: var(--padding-400);
|
|
1402
|
+
opacity: 0;
|
|
1403
|
+
pointer-events: none;
|
|
1404
|
+
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
.ds-app-sidebar--expanded .ds-app-sidebar__footer-action {
|
|
1408
|
+
opacity: 1;
|
|
1409
|
+
pointer-events: auto;
|
|
1410
|
+
}
|
|
1411
|
+
|
|
1412
|
+
.ds-app-sidebar__footer-action > * {
|
|
1413
|
+
width: 100%;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/* In the phone sheet it takes over the sheet's bottom padding, clear of
|
|
1417
|
+
the home indicator. */
|
|
1418
|
+
.ds-app-sidebar--mobile-open .ds-app-sidebar__footer-action {
|
|
1419
|
+
padding: 0 var(--padding-500) max(var(--padding-500), calc(env(safe-area-inset-bottom) + var(--padding-200)));
|
|
1420
|
+
margin-block-end: calc(-1 * max(var(--padding-500), env(safe-area-inset-bottom)));
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/* The sheet's foot (profile and action) is set off from the scrolling
|
|
1424
|
+
levels by a hairline and a step of room, so a row scrolling under it
|
|
1425
|
+
meets an edge, not the profile. */
|
|
1426
|
+
.ds-app-sidebar--mobile-open .ds-app-sidebar__bottom {
|
|
1427
|
+
padding-block-start: var(--padding-400);
|
|
1428
|
+
border-block-start: var(--border-025) solid var(--color-divider);
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1245
1431
|
} /* @layer rift.components */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
import { LinkComponent } from '../../behaviors/LinkProvider';
|
|
3
|
+
import { DrillMenuEntry } from '../DrillMenu/DrillMenu';
|
|
3
4
|
export interface AppSidebarSubItem {
|
|
4
5
|
/** Unique key for this sub-item */
|
|
5
6
|
key: string;
|
|
@@ -11,6 +12,12 @@ export interface AppSidebarSubItem {
|
|
|
11
12
|
href?: string;
|
|
12
13
|
/** Trailing pill, e.g. unread items. A count takes the count badge colours; a word stays a quiet pill */
|
|
13
14
|
badge?: string | number;
|
|
15
|
+
/** A second line under the label, shown where the sub-item is listed in the side panel and the phone drawer */
|
|
16
|
+
description?: string;
|
|
17
|
+
/** Icon before the label in the side panel and the phone drawer: a Material Symbol name or a custom element, such as a swatch */
|
|
18
|
+
icon?: string | React.ReactNode;
|
|
19
|
+
/** In a list of choices (a setting's options), whether this one is chosen: true carries the chosen mark in the side panel and the phone drawer. Picking a choice is an action, so the panel and the drawer stay open */
|
|
20
|
+
selected?: boolean;
|
|
14
21
|
/** Group heading this entry sits under when it is listed in the panel (see `subNav`); ignored in the accordion */
|
|
15
22
|
group?: string;
|
|
16
23
|
/**
|
|
@@ -44,11 +51,13 @@ export interface AppSidebarItem {
|
|
|
44
51
|
href?: string;
|
|
45
52
|
/** Trailing pill, e.g. unread items. A count takes the count badge colours and, while the rail is collapsed, rides the icon's corner; a word stays a quiet pill, hidden while collapsed */
|
|
46
53
|
badge?: string | number;
|
|
54
|
+
/** The setting's current value at the row's trailing end while expanded, such as "Dark" on a row whose sub-items are a setting's choices */
|
|
55
|
+
value?: string;
|
|
47
56
|
/** Sub-items: an accordion under the row, or the side panel's contents when `subNav="panel"` */
|
|
48
57
|
children?: AppSidebarSubItem[];
|
|
49
58
|
}
|
|
50
59
|
export interface AppSidebarSection {
|
|
51
|
-
/**
|
|
60
|
+
/** The heading above the group. Optional for a single section; with more than one, give each its heading, so every group the gaps set apart is named */
|
|
52
61
|
category?: string;
|
|
53
62
|
/** Nav items in this section */
|
|
54
63
|
items: AppSidebarItem[];
|
|
@@ -76,12 +85,13 @@ type AppSidebarOwnProps = {
|
|
|
76
85
|
/** Key of the currently active third-level item, listed in the side panel */
|
|
77
86
|
activeTertiaryKey?: string;
|
|
78
87
|
/**
|
|
79
|
-
* Where an item's sub-items show. `
|
|
80
|
-
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
88
|
+
* Where an item's sub-items show. `panel` (the default) opens a top-level
|
|
89
|
+
* item's sub-items straight into the side panel, with their children as
|
|
90
|
+
* the panel's accordion, and the collapsed rail shows each label under its
|
|
91
|
+
* icon. `accordion` opens them under the row instead, and a sub-item's own
|
|
92
|
+
* children open in a side panel as level 3. On small screens both modes
|
|
93
|
+
* drill in inside the drawer instead.
|
|
94
|
+
* @default 'panel'
|
|
85
95
|
*/
|
|
86
96
|
subNav?: 'accordion' | 'panel';
|
|
87
97
|
/** Whether the side panel starts open when there is one to show */
|
|
@@ -109,7 +119,8 @@ type AppSidebarOwnProps = {
|
|
|
109
119
|
* inset from the edges, as AppLayout's `inset` layout draws it. Inside a
|
|
110
120
|
* host that marks itself a shell (AppLayout, a chat or template page), the
|
|
111
121
|
* rail reads that host's mode from the shell recipe. Defaults to
|
|
112
|
-
* `
|
|
122
|
+
* `inset` (or `floating` while the deprecated `floating` is set).
|
|
123
|
+
* @default 'inset'
|
|
113
124
|
*/
|
|
114
125
|
layout?: AppSidebarLayout;
|
|
115
126
|
/**
|
|
@@ -135,6 +146,27 @@ type AppSidebarOwnProps = {
|
|
|
135
146
|
persistentTopSlot?: boolean;
|
|
136
147
|
/** Rendered above the profile block; fades out while collapsed */
|
|
137
148
|
footerSlot?: React.ReactNode;
|
|
149
|
+
/**
|
|
150
|
+
* Rows above the sections in the phone drawer, in DrillMenu's shape, such
|
|
151
|
+
* as a switcher that drills into its choices. When set, the drawer shows
|
|
152
|
+
* these in `topSlot`'s place, since a dropdown has no room to open on a
|
|
153
|
+
* full-screen menu.
|
|
154
|
+
*/
|
|
155
|
+
drawerTopEntries?: DrillMenuEntry[];
|
|
156
|
+
/**
|
|
157
|
+
* Rows after the sections in the phone drawer, in DrillMenu's shape, such
|
|
158
|
+
* as appearance settings that drill into their choices. When set, the
|
|
159
|
+
* drawer shows these in `footerSlot`'s place.
|
|
160
|
+
*/
|
|
161
|
+
drawerBottomEntries?: DrillMenuEntry[];
|
|
162
|
+
/**
|
|
163
|
+
* One primary action at the rail's foot, below the profile and full width,
|
|
164
|
+
* as the site header's drawer pins its call to action: in the expanded
|
|
165
|
+
* rail and the phone drawer alike, where it stays in view while the
|
|
166
|
+
* levels above it scroll. The collapsed rail has no room for it, so it
|
|
167
|
+
* fades out with the labels and is inert.
|
|
168
|
+
*/
|
|
169
|
+
footerAction?: React.ReactNode;
|
|
138
170
|
/** Rendered above the profile block while the rail is collapsed, in `footerSlot`'s place: the same controls at their smallest, such as a SegmentedControl's or ThemeToggle's `cycle` circle, stacked and centred on the rail's axis. The two forms share one cell and crossfade with the rail, and whichever is hidden is inert */
|
|
139
171
|
collapsedFooterSlot?: React.ReactNode;
|
|
140
172
|
/** Additional CSS classes */
|
|
@@ -166,10 +198,21 @@ type AppSidebarOwnProps = {
|
|
|
166
198
|
/** Accessible name of the profile block's more button */
|
|
167
199
|
profileMoreLabel?: string;
|
|
168
200
|
/**
|
|
169
|
-
*
|
|
170
|
-
*
|
|
201
|
+
* The phone drawer's menu: the accessible name of its navigation, and what
|
|
202
|
+
* the back row says on every second level
|
|
171
203
|
*/
|
|
172
204
|
menuLabel?: string;
|
|
205
|
+
/**
|
|
206
|
+
* The phone drawer's back row's accessible name, given the title of the level it
|
|
207
|
+
* returns to, for a site in another language. The drill menu's own default.
|
|
208
|
+
*/
|
|
209
|
+
drawerBackLabel?: (title: string) => string;
|
|
210
|
+
/**
|
|
211
|
+
* The text of the overview row a drilled level opens with when its row has
|
|
212
|
+
* a page of its own, given that row's label, for a site in another
|
|
213
|
+
* language. The drill menu's own default.
|
|
214
|
+
*/
|
|
215
|
+
drawerOverviewLabel?: (label: string) => string;
|
|
173
216
|
};
|
|
174
217
|
export interface AppSidebarProps extends AppSidebarOwnProps, Omit<React.ComponentPropsWithoutRef<'nav'>, keyof AppSidebarOwnProps | 'children'> {
|
|
175
218
|
}
|
|
@@ -179,7 +222,7 @@ export interface AppSidebarProps extends AppSidebarOwnProps, Omit<React.Componen
|
|
|
179
222
|
* **Collapsed** (64 px): icon-only buttons, logo mark, avatar.
|
|
180
223
|
* **Expanded** (280 px): labels, category headings, accordion
|
|
181
224
|
* sub-items with tree-line connectors, and a profile section.
|
|
182
|
-
* A third level opens in a `
|
|
225
|
+
* A third level opens in a `SubNavPanel` beside the rail (see `subNav`).
|
|
183
226
|
*
|
|
184
227
|
* The forwarded ref and any unrecognised props target the `<nav>` (the rail,
|
|
185
228
|
* and the drawer on small screens). The landmark is labelled "App
|