rift-ds 1.23.0 → 1.24.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/behaviors/shell.css +119 -0
- package/bin/templates/blocks/components/blocks/AppShell.module.css +69 -15
- package/bin/templates/blocks/components/blocks/AppShell.tsx +45 -30
- package/bin/templates/blocks/registry.json +1 -1
- package/chat/ChatAgentPane.css +6 -6
- package/chat/ChatLauncher.d.ts +3 -3
- package/chat/ChatWidget.css +260 -8
- package/chat/ChatWidget.d.ts +37 -6
- package/chat/ChatWidget.js +37 -1
- package/chat/index.d.ts +1 -1
- package/chat/registry.json.d.ts +1 -1
- package/chat/registry.json.js +1 -1
- package/components/AppLayout/AppLayout.css +17 -4
- package/components/AppLayout/AppLayout.d.ts +8 -5
- package/components/AppLayout/AppLayout.js +2 -0
- package/components/AppSidebar/AppSidebar.css +108 -23
- package/components/AppSidebar/AppSidebar.d.ts +8 -5
- package/components/AppSidebar/AppSidebar.js +6 -3
- package/components/ThemePicker/ThemePicker.css +6 -0
- package/components/ThemePicker/ThemePicker.js +20 -11
- package/components/ThreadPanel/ThreadPanel.css +65 -36
- package/components/ThreadPanel/ThreadPanel.d.ts +5 -5
- package/components/ThreadPanel/ThreadPanel.js +1 -1
- package/components/registry.json +1 -1
- package/components/registry.json.d.ts +1 -1
- package/components/registry.json.js +1 -1
- package/package.json +1 -1
- package/tokens/presets/plum.css +234 -240
- package/tokens/tokens-dark.css +2 -2
- package/tokens/tokens-light.css +2 -2
- package/tokens/values.json.js +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
THE SHELL RECIPE
|
|
3
|
+
The one home of what each app shell mode is
|
|
4
|
+
made of, so every host draws the same three:
|
|
5
|
+
AppLayout and AppSidebar, ChatWidget when it
|
|
6
|
+
is the page, and the site's TemplateShell.
|
|
7
|
+
Each host imports this file, marks its root
|
|
8
|
+
with data-ds-shell (and, for a chat in
|
|
9
|
+
flush, data-ds-shell-backdrop), and reads
|
|
10
|
+
these properties
|
|
11
|
+
instead of restating a token.
|
|
12
|
+
|
|
13
|
+
A mode decides four things: the plane (what
|
|
14
|
+
the page is), the surface (what the content
|
|
15
|
+
sits on), the rail (how the navigation meets
|
|
16
|
+
the plane) and the edge. The edge belongs to
|
|
17
|
+
the mode, never a choice of its own:
|
|
18
|
+
|
|
19
|
+
- flush: no gap and nothing raised. The rail
|
|
20
|
+
sits on the shell plane behind a hairline
|
|
21
|
+
divider; the content is crisp on the app
|
|
22
|
+
surface. A chat seated as a page has one
|
|
23
|
+
lever more, the backdrop: solid, or blur
|
|
24
|
+
(the site chat's takeover: the glass token
|
|
25
|
+
and a 40px blur over whatever lies behind,
|
|
26
|
+
with the rail and the conversation clear
|
|
27
|
+
on it). Blur says the chat rests above
|
|
28
|
+
something, so it is the chat's alone: an
|
|
29
|
+
app layout or a template is always the
|
|
30
|
+
floor of its page and stays solid.
|
|
31
|
+
- floating: the rail is a glass card held off
|
|
32
|
+
the edges by the float gap, hairline and
|
|
33
|
+
floating shadow; the content sits on the
|
|
34
|
+
page.
|
|
35
|
+
- inset: the rail runs flush on the shell
|
|
36
|
+
plane and the content is a raised surface,
|
|
37
|
+
hairline and floating shadow, held off the
|
|
38
|
+
other edges by the inset gap.
|
|
39
|
+
|
|
40
|
+
Declared on the marked root, not on :root, so
|
|
41
|
+
a theme scoped to part of a page reaches it.
|
|
42
|
+
design.md's "App shells" section owns the
|
|
43
|
+
rules these encode.
|
|
44
|
+
============================================ */
|
|
45
|
+
|
|
46
|
+
:where([data-ds-shell]) {
|
|
47
|
+
/* The two gaps. The inset gap's value lives with AppSidebar's root rule
|
|
48
|
+
(--ds-shell-inset) and the float gap's with the floating rail
|
|
49
|
+
(--ds-sidebar-float-inset); both are read here. */
|
|
50
|
+
--ds-shell-gap: var(--ds-shell-inset, 10px);
|
|
51
|
+
--ds-shell-float-gap: var(--ds-sidebar-float-inset, 20px);
|
|
52
|
+
|
|
53
|
+
/* The raised edge and the glass card, shared by floating and inset. */
|
|
54
|
+
--ds-shell-radius: var(--radius-600);
|
|
55
|
+
--ds-shell-edge-border: var(--color-bg-container-border);
|
|
56
|
+
--ds-shell-edge-shadow: var(--shadow-floating);
|
|
57
|
+
--ds-shell-glass: var(--color-bg-glass);
|
|
58
|
+
--ds-shell-glass-blur: blur(24px);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
:where([data-ds-shell='flush']) {
|
|
62
|
+
--ds-shell-plane: var(--color-bg-app-shell);
|
|
63
|
+
--ds-shell-surface: var(--color-bg-app-surface);
|
|
64
|
+
--ds-shell-rail-bg: var(--color-bg-app-shell);
|
|
65
|
+
--ds-shell-rail-divider: var(--color-bg-container-border);
|
|
66
|
+
--ds-shell-surface-border: transparent;
|
|
67
|
+
--ds-shell-surface-shadow: none;
|
|
68
|
+
--ds-shell-surface-radius: 0;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/* Blur, a chat's alone: the plane is the glass over what lies behind, so
|
|
72
|
+
the rail and the conversation clear their own fills and the divider
|
|
73
|
+
stays. */
|
|
74
|
+
:where([data-ds-shell='flush'][data-ds-shell-backdrop='blur']) {
|
|
75
|
+
--ds-shell-plane: transparent;
|
|
76
|
+
--ds-shell-surface: transparent;
|
|
77
|
+
--ds-shell-rail-bg: transparent;
|
|
78
|
+
--ds-shell-backdrop-fill: var(--color-bg-glass);
|
|
79
|
+
--ds-shell-backdrop-filter: blur(40px);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
:where([data-ds-shell='floating']) {
|
|
83
|
+
--ds-shell-plane: var(--color-bg-page-primary);
|
|
84
|
+
--ds-shell-surface: var(--color-bg-page-primary);
|
|
85
|
+
--ds-shell-rail-bg: var(--ds-shell-glass);
|
|
86
|
+
--ds-shell-rail-divider: transparent;
|
|
87
|
+
--ds-shell-surface-border: transparent;
|
|
88
|
+
--ds-shell-surface-shadow: none;
|
|
89
|
+
--ds-shell-surface-radius: 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
:where([data-ds-shell='inset']) {
|
|
93
|
+
--ds-shell-plane: var(--color-bg-app-shell);
|
|
94
|
+
--ds-shell-surface: var(--color-bg-app-surface);
|
|
95
|
+
--ds-shell-rail-bg: var(--color-bg-app-shell);
|
|
96
|
+
--ds-shell-rail-divider: transparent;
|
|
97
|
+
--ds-shell-surface-border: var(--ds-shell-edge-border);
|
|
98
|
+
--ds-shell-surface-shadow: var(--ds-shell-edge-shadow);
|
|
99
|
+
--ds-shell-surface-radius: var(--ds-shell-radius);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/* The blur backdrop, drawn once for any host: a fixed layer behind the
|
|
103
|
+
host's content rather than a filter on the host itself, which would
|
|
104
|
+
become the containing block of every fixed descendant (AppSidebar, the
|
|
105
|
+
chat's sheets) and carry them off when the page scrolls. */
|
|
106
|
+
:where([data-ds-shell='flush'][data-ds-shell-backdrop='blur']) {
|
|
107
|
+
position: relative;
|
|
108
|
+
isolation: isolate;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
:where([data-ds-shell='flush'][data-ds-shell-backdrop='blur'])::before {
|
|
112
|
+
content: '';
|
|
113
|
+
position: fixed;
|
|
114
|
+
inset: 0;
|
|
115
|
+
z-index: -1;
|
|
116
|
+
pointer-events: none;
|
|
117
|
+
background-color: var(--ds-shell-backdrop-fill);
|
|
118
|
+
backdrop-filter: var(--ds-shell-backdrop-filter);
|
|
119
|
+
}
|
|
@@ -1,31 +1,72 @@
|
|
|
1
|
-
/* The app shell's layout
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/* The app shell's layout, in one of the three app shell modes (flush,
|
|
2
|
+
floating or inset; AppShell.tsx's SHELL_LAYOUT picks it). Every value is
|
|
3
|
+
a rift-ds token or a property of its shell recipe, except the sidebar's
|
|
4
|
+
own widths (64px collapsed, 280px expanded) and its mobile menu button
|
|
5
|
+
(40px), which are the AppSidebar component's geometry. */
|
|
4
6
|
|
|
5
7
|
.shell {
|
|
6
|
-
/* One inset for the floating sidebar and the gap it leaves
|
|
8
|
+
/* One inset for the floating sidebar and the gap it leaves, and the
|
|
9
|
+
content's top inset. */
|
|
7
10
|
--shell-inset: var(--padding-500);
|
|
8
11
|
--ds-sidebar-float-inset: var(--shell-inset);
|
|
12
|
+
/* The rail's width, which the main column clears. */
|
|
13
|
+
--shell-rail: 64px;
|
|
9
14
|
|
|
10
15
|
display: flex;
|
|
11
16
|
min-width: 0;
|
|
12
17
|
min-height: 100dvh;
|
|
13
|
-
|
|
18
|
+
/* The plane, from rift-ds's shell recipe: the root's data-ds-shell
|
|
19
|
+
marker (AppShell.tsx's SHELL_LAYOUT) picks the mode, and AppSidebar
|
|
20
|
+
brings the recipe's stylesheet with it. */
|
|
21
|
+
background-color: var(--ds-shell-plane);
|
|
14
22
|
}
|
|
15
23
|
|
|
16
|
-
|
|
17
|
-
|
|
24
|
+
.shell:has(:global(.ds-app-sidebar--expanded)) {
|
|
25
|
+
--shell-rail: 280px;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/* The sidebar is fixed, so the main column reserves its width: the rail,
|
|
29
|
+
plus the float gap either side of it in the floating layout. */
|
|
18
30
|
.main {
|
|
19
31
|
flex: 1;
|
|
20
32
|
min-width: 0;
|
|
21
33
|
display: flex;
|
|
22
34
|
justify-content: center;
|
|
23
|
-
padding-left:
|
|
24
|
-
transition: padding
|
|
35
|
+
padding-left: var(--shell-rail);
|
|
36
|
+
transition: padding var(--motion-duration-slow) var(--motion-ease-emphasized);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.shell[data-ds-shell='floating'] .main {
|
|
40
|
+
padding-left: calc(var(--shell-rail) + var(--shell-inset) * 2);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/* The content's ground: the crisp surface beside the flush rail, the page
|
|
44
|
+
itself when floating, and a raised surface
|
|
45
|
+
held off the edges in the inset layout, scrolling inside itself. */
|
|
46
|
+
.surface {
|
|
47
|
+
display: flex;
|
|
48
|
+
justify-content: center;
|
|
49
|
+
flex: 1;
|
|
50
|
+
min-width: 0;
|
|
51
|
+
background-color: var(--ds-shell-surface);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.shell[data-ds-shell='inset'] {
|
|
55
|
+
height: 100dvh;
|
|
56
|
+
min-height: 0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
.shell[data-ds-shell='inset'] .main {
|
|
60
|
+
min-height: 0;
|
|
61
|
+
padding: var(--ds-shell-gap);
|
|
62
|
+
padding-left: var(--shell-rail);
|
|
25
63
|
}
|
|
26
64
|
|
|
27
|
-
.
|
|
28
|
-
|
|
65
|
+
.shell[data-ds-shell='inset'] .surface {
|
|
66
|
+
overflow-y: auto;
|
|
67
|
+
border: var(--border-025) solid var(--ds-shell-surface-border);
|
|
68
|
+
border-radius: var(--ds-shell-surface-radius);
|
|
69
|
+
box-shadow: var(--ds-shell-surface-shadow);
|
|
29
70
|
}
|
|
30
71
|
|
|
31
72
|
.content {
|
|
@@ -65,7 +106,7 @@
|
|
|
65
106
|
bottom: 0;
|
|
66
107
|
inset-inline: calc(-1 * var(--padding-400));
|
|
67
108
|
z-index: -1;
|
|
68
|
-
background: linear-gradient(to bottom, var(--
|
|
109
|
+
background: linear-gradient(to bottom, var(--ds-shell-surface) var(--shell-inset), transparent);
|
|
69
110
|
pointer-events: none;
|
|
70
111
|
opacity: 0;
|
|
71
112
|
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
@@ -172,9 +213,22 @@
|
|
|
172
213
|
--shell-inset: var(--padding-400);
|
|
173
214
|
}
|
|
174
215
|
|
|
175
|
-
.main,
|
|
176
|
-
.
|
|
177
|
-
padding
|
|
216
|
+
.shell .main,
|
|
217
|
+
.shell[data-ds-shell] .main {
|
|
218
|
+
padding: 0;
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
/* The inset surface gives way: the page scrolls, edge to edge. */
|
|
222
|
+
.shell[data-ds-shell='inset'] {
|
|
223
|
+
height: auto;
|
|
224
|
+
min-height: 100dvh;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
.shell[data-ds-shell='inset'] .surface {
|
|
228
|
+
overflow: visible;
|
|
229
|
+
border: none;
|
|
230
|
+
border-radius: 0;
|
|
231
|
+
box-shadow: none;
|
|
178
232
|
}
|
|
179
233
|
|
|
180
234
|
.content {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
|
-
* The app shell every rift-ds block page sits in: the
|
|
5
|
-
* top bar (search, the AI entry and the colour mode), a page header
|
|
4
|
+
* The app shell every rift-ds block page sits in: the sidebar in one of
|
|
5
|
+
* rift-ds's three app shell modes (SHELL_LAYOUT below), a top bar (search, the AI entry and the colour mode), a page header
|
|
6
6
|
* (breadcrumb, title, actions) and the content column, with the spacing
|
|
7
7
|
* set. This file is yours: rename the product, change the navigation, and
|
|
8
8
|
* grow it with your app.
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
* it: bare while the page is at the top, then a fill above it and the
|
|
12
12
|
* library's ProgressiveBlur behind it fade in once the page scrolls.
|
|
13
13
|
*
|
|
14
|
-
* Responsive by construction: above 768px the sidebar
|
|
14
|
+
* Responsive by construction: above 768px the sidebar sits beside the
|
|
15
15
|
* page and the content moves over by its width; below it the sidebar
|
|
16
16
|
* becomes a drawer behind its own menu button, the search field folds to
|
|
17
17
|
* its icon, and the content runs edge to edge at a tighter gutter.
|
|
@@ -21,6 +21,7 @@ import { useEffect, useRef, useState, type ReactNode } from 'react';
|
|
|
21
21
|
import { AiButton } from 'rift-ds/components/AiButton/AiButton';
|
|
22
22
|
import {
|
|
23
23
|
AppSidebar,
|
|
24
|
+
type AppSidebarLayout,
|
|
24
25
|
type AppSidebarProfile,
|
|
25
26
|
type AppSidebarSection,
|
|
26
27
|
} from 'rift-ds/components/AppSidebar/AppSidebar';
|
|
@@ -30,6 +31,15 @@ import { ProgressiveBlur } from 'rift-ds/components/ProgressiveBlur/ProgressiveB
|
|
|
30
31
|
import { ThemeToggle } from 'rift-ds/components/ThemeToggle/ThemeToggle';
|
|
31
32
|
import styles from './AppShell.module.css';
|
|
32
33
|
|
|
34
|
+
/**
|
|
35
|
+
* How the sidebar and the content meet the page, one of the three app shell
|
|
36
|
+
* modes: `flush` runs the sidebar edge to edge on the shell colour behind a
|
|
37
|
+
* hairline, the content crisp beside it; `floating` lifts the sidebar into a
|
|
38
|
+
* glass card off the edges; `inset` runs it flush and sets the content in a
|
|
39
|
+
* raised surface held off the other edges, scrolling inside itself.
|
|
40
|
+
*/
|
|
41
|
+
const SHELL_LAYOUT: AppSidebarLayout = 'floating';
|
|
42
|
+
|
|
33
43
|
/** The product's name, shown beside the logo in the sidebar. */
|
|
34
44
|
const PRODUCT_NAME = 'Acme';
|
|
35
45
|
|
|
@@ -87,7 +97,10 @@ export function AppShell({ activeKey, breadcrumb, title, actions, children }: Ap
|
|
|
87
97
|
}, []);
|
|
88
98
|
|
|
89
99
|
return (
|
|
90
|
-
<div
|
|
100
|
+
<div
|
|
101
|
+
className={styles.shell}
|
|
102
|
+
data-ds-shell={SHELL_LAYOUT}
|
|
103
|
+
>
|
|
91
104
|
<AppSidebar
|
|
92
105
|
sections={NAV_SECTIONS}
|
|
93
106
|
profile={PROFILE}
|
|
@@ -95,36 +108,38 @@ export function AppShell({ activeKey, breadcrumb, title, actions, children }: Ap
|
|
|
95
108
|
expanded={expanded}
|
|
96
109
|
onExpandedChange={setExpanded}
|
|
97
110
|
logoText={PRODUCT_NAME}
|
|
98
|
-
layout=
|
|
111
|
+
layout={SHELL_LAYOUT}
|
|
99
112
|
/>
|
|
100
113
|
|
|
101
|
-
<div className={
|
|
102
|
-
<div className={styles.
|
|
103
|
-
<div
|
|
104
|
-
|
|
105
|
-
<
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
114
|
+
<div className={styles.main}>
|
|
115
|
+
<div className={styles.surface}>
|
|
116
|
+
<div className={styles.content}>
|
|
117
|
+
<div ref={markerRef} className={styles.topBarMarker} aria-hidden="true" />
|
|
118
|
+
<header className={styles.topBar} data-stuck={stuck ? '' : undefined}>
|
|
119
|
+
<ProgressiveBlur className={styles.topBarBlur} tinted={stuck} />
|
|
120
|
+
{/* Wire both to your command palette: CommandPalette from
|
|
121
|
+
rift-ds, opened from here and from Cmd+K. */}
|
|
122
|
+
<CommandPaletteTrigger className={styles.search} />
|
|
123
|
+
<div className={styles.topBarActions}>
|
|
124
|
+
<CommandPaletteTrigger iconOnly className={styles.searchIcon} />
|
|
125
|
+
{/* The AI entry. Point it at your chat: `npx rift-ds init chat`
|
|
126
|
+
scaffolds one, and ChatLauncher opens it. */}
|
|
127
|
+
<AiButton />
|
|
128
|
+
<ThemeToggle showLabels={false} />
|
|
129
|
+
</div>
|
|
130
|
+
</header>
|
|
117
131
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
132
|
+
<main className={styles.page}>
|
|
133
|
+
<div className={styles.pageHead}>
|
|
134
|
+
<div className={styles.pageHeadText}>
|
|
135
|
+
{breadcrumb && <Breadcrumb items={breadcrumb} />}
|
|
136
|
+
<h1 className={styles.title}>{title}</h1>
|
|
137
|
+
</div>
|
|
138
|
+
{actions && <div className={styles.pageActions}>{actions}</div>}
|
|
123
139
|
</div>
|
|
124
|
-
{
|
|
125
|
-
</
|
|
126
|
-
|
|
127
|
-
</main>
|
|
140
|
+
{children}
|
|
141
|
+
</main>
|
|
142
|
+
</div>
|
|
128
143
|
</div>
|
|
129
144
|
</div>
|
|
130
145
|
</div>
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"name": "app-shell",
|
|
6
6
|
"label": "App shell",
|
|
7
|
-
"description": "
|
|
7
|
+
"description": "A sidebar in your pick of the three shell modes, a top bar with search, AI and colour mode, a page header, and an empty page with the spacing set.",
|
|
8
8
|
"route": "/starter",
|
|
9
9
|
"files": [
|
|
10
10
|
"components/blocks/AppShell.tsx",
|
package/chat/ChatAgentPane.css
CHANGED
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
margin-top: var(--gap-400);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/* The rails' one group heading (design.md's App shells): paragraph small
|
|
23
|
+
in the tertiary text, mixed case, as the history rail beside it. */
|
|
22
24
|
.ds-chat-agent-pane__heading {
|
|
23
|
-
font-family: var(--font-
|
|
24
|
-
font-size: var(--font-
|
|
25
|
-
font-weight: var(--font-
|
|
26
|
-
line-height: var(--font-
|
|
27
|
-
letter-spacing: var(--font-overline-letter-spacing);
|
|
28
|
-
text-transform: uppercase;
|
|
25
|
+
font-family: var(--font-paragraph-sm-family);
|
|
26
|
+
font-size: var(--font-paragraph-sm-size);
|
|
27
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
28
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
29
29
|
color: var(--color-text-tertiary);
|
|
30
30
|
padding: var(--padding-100) var(--padding-200);
|
|
31
31
|
margin: 0;
|
package/chat/ChatLauncher.d.ts
CHANGED
|
@@ -47,9 +47,9 @@ export interface ChatLauncherProps {
|
|
|
47
47
|
/**
|
|
48
48
|
* How the docked panel sits on the page. `raised` (the default) is a glass
|
|
49
49
|
* card with the floating shadow, inset by `--ds-chat-inset`. `inset` is
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* AppLayout's `inset` content surface beside it, solid on the app surface
|
|
51
|
+
* colour with the same raised edge (the hairline and the floating
|
|
52
|
+
* shadow), no blur, and the `--ds-shell-inset` gap. The overlay below the dock threshold takes the same
|
|
53
53
|
* gap but keeps its shadow, since it still covers the page; the floating
|
|
54
54
|
* card and the takeover keep their own look.
|
|
55
55
|
*/
|