rift-ds 1.40.0 → 1.41.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 +6 -2
- package/behaviors/shell.css +9 -11
- package/bin/templates/blocks/components/blocks/AppShell.tsx +2 -1
- package/chat/ChatLauncher.d.ts +2 -2
- package/chat/ChatWidget.css +7 -7
- package/chat/ChatWidget.d.ts +1 -1
- package/components/AppLayout/AppLayout.css +1 -1
- package/components/AppLayout/AppLayout.d.ts +2 -2
- package/components/AppSidebar/AppSidebar.css +12 -15
- package/components/AppSidebar/AppSidebar.d.ts +4 -4
- package/components/AppSidebar/AppSidebar.js +9 -5
- package/components/Avatar/Avatar.css +18 -5
- package/components/Avatar/Avatar.d.ts +2 -0
- package/components/Avatar/Avatar.js +2 -1
- package/components/AvatarGroup/AvatarGroup.css +8 -1
- package/components/AvatarGroup/AvatarGroup.d.ts +6 -0
- package/components/AvatarGroup/AvatarGroup.js +2 -2
- package/components/DataTable/DataTable.css +63 -0
- package/components/DataTable/DataTable.d.ts +26 -2
- package/components/DataTable/DataTable.js +116 -90
- package/components/DrillMenu/DrillMenu.d.ts +2 -1
- package/components/DrillMenu/DrillMenu.js +14 -3
- package/components/EntitySwitcher/EntitySwitcher.css +2 -1
- package/components/Icon/Icon.css +6 -1
- package/components/Icon/Icon.d.ts +3 -1
- package/components/Icon/Icon.js +2 -0
- package/components/PixelAvatar/PixelAvatar.css +7 -1
- package/components/PixelAvatar/PixelAvatar.d.ts +2 -0
- package/components/PixelAvatar/PixelAvatar.js +2 -1
- package/components/ShaderField/useShaderField.js +2 -2
- package/components/ShaderScene/ShaderScene.js +2 -2
- package/components/SiteHeader/SiteHeader.css +0 -9
- package/components/SourceChip/SourceChip.css +2 -1
- package/components/SubNavPanel/SubNavPanel.css +10 -9
- package/components/Table/Table.css +310 -0
- package/components/Table/Table.d.ts +28 -2
- package/components/Table/Table.js +26 -9
- package/components/registry.json +1 -1
- package/components/registry.json.d.ts +1 -1
- package/components/registry.json.js +1 -1
- package/package.json +3 -2
- package/tokens/motion.d.ts +2 -0
- package/tokens/motion.js +2 -0
- package/tokens/presets/contrast.css +34 -1
- package/tokens/presets/coral.css +38 -1
- package/tokens/presets/forest.css +41 -1
- package/tokens/presets/gold.css +35 -1
- package/tokens/presets/marquee.css +40 -1
- package/tokens/presets/mono.css +79 -1
- package/tokens/presets/pink.css +38 -1
- package/tokens/presets/plum.css +41 -1
- package/tokens/presets/terminal.css +36 -1
- package/tokens/presets/violet.css +41 -1
- package/tokens/presets/warm.css +33 -1
- package/tokens/presets/zest.css +45 -1
- package/tokens/registry.json +1 -0
- package/tokens/registry.json.d.ts +1 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +1 -0
- package/tokens/tokens-light.css +5 -0
- package/tokens/values.json.js +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<!-- banner:start -->
|
|
2
|
-
<a href="https://rift-ds.com"><img src="https://raw.githubusercontent.com/robritacca-dotcom/rift-ds/main/.github/readme-banner.jpg" alt="Rift DS, the AI-
|
|
2
|
+
<a href="https://rift-ds.com"><img src="https://raw.githubusercontent.com/robritacca-dotcom/rift-ds/main/.github/readme-banner.jpg" alt="Rift DS, the open-source, AI-native design system" width="100%"></a>
|
|
3
3
|
<!-- banner:end -->
|
|
4
4
|
|
|
5
5
|
# Rift DS
|
|
@@ -153,4 +153,8 @@ Designed and built by [Robert Ritacca](https://robertritacca.com).
|
|
|
153
153
|
|
|
154
154
|
## License
|
|
155
155
|
|
|
156
|
-
|
|
156
|
+
The package is MIT: the components, the tokens, the chat widget, the command-line tool and everything else published to npm as `rift-ds`, with the scripts that build them. Use it in anything. See [`LICENSE`](LICENSE) for the full terms.
|
|
157
|
+
|
|
158
|
+
The website is not. Its code, pages, writing and design are all rights reserved, apart from the files it publishes for use with the package, which are MIT too. See [`website/LICENSE`](website/LICENSE).
|
|
159
|
+
|
|
160
|
+
The Rift DS name, the logo, the mark and the brand's other assets are not licensed under either. A fork or a product built on the package needs its own name and logo. See [`TRADEMARKS.md`](TRADEMARKS.md).
|
package/behaviors/shell.css
CHANGED
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
something, so it is the chat's alone: an
|
|
29
29
|
app layout or a template is always the
|
|
30
30
|
floor of its page and stays solid.
|
|
31
|
-
- floating: the rail is a
|
|
32
|
-
the edges by the float gap,
|
|
33
|
-
floating shadow; the content
|
|
34
|
-
|
|
31
|
+
- floating: the rail is a card on the shell
|
|
32
|
+
colour held off the edges by the float gap,
|
|
33
|
+
hairline and floating shadow; the content
|
|
34
|
+
is crisp on the app surface around it.
|
|
35
35
|
- inset: the rail runs flush on the shell
|
|
36
36
|
plane and the content is a raised surface,
|
|
37
37
|
hairline and floating shadow, held off the
|
|
@@ -58,12 +58,10 @@
|
|
|
58
58
|
--ds-shell-gap: var(--ds-shell-inset, 10px);
|
|
59
59
|
--ds-shell-float-gap: var(--ds-sidebar-float-inset, 20px);
|
|
60
60
|
|
|
61
|
-
/* The raised edge
|
|
61
|
+
/* The raised edge, shared by floating and inset. */
|
|
62
62
|
--ds-shell-radius: var(--radius-600);
|
|
63
|
-
--ds-shell-edge-border: var(--color-bg-
|
|
63
|
+
--ds-shell-edge-border: var(--color-bg-app-shell-border);
|
|
64
64
|
--ds-shell-edge-shadow: var(--shadow-floating);
|
|
65
|
-
--ds-shell-glass: var(--color-bg-glass);
|
|
66
|
-
--ds-shell-glass-blur: blur(24px);
|
|
67
65
|
}
|
|
68
66
|
|
|
69
67
|
:where([data-ds-shell='flush']) {
|
|
@@ -88,9 +86,9 @@
|
|
|
88
86
|
}
|
|
89
87
|
|
|
90
88
|
:where([data-ds-shell='floating']) {
|
|
91
|
-
--ds-shell-plane: var(--color-bg-
|
|
92
|
-
--ds-shell-surface: var(--color-bg-
|
|
93
|
-
--ds-shell-rail-bg: var(--
|
|
89
|
+
--ds-shell-plane: var(--color-bg-app-surface);
|
|
90
|
+
--ds-shell-surface: var(--color-bg-app-surface);
|
|
91
|
+
--ds-shell-rail-bg: var(--color-bg-app-shell);
|
|
94
92
|
--ds-shell-rail-divider: transparent;
|
|
95
93
|
--ds-shell-surface-border: transparent;
|
|
96
94
|
--ds-shell-surface-shadow: none;
|
|
@@ -36,7 +36,8 @@ import styles from './AppShell.module.css';
|
|
|
36
36
|
* How the sidebar and the content meet the page, one of the three app shell
|
|
37
37
|
* modes: `flush` runs the sidebar edge to edge on the shell colour behind a
|
|
38
38
|
* hairline, the content crisp beside it; `floating` lifts the sidebar into a
|
|
39
|
-
*
|
|
39
|
+
* card on the shell colour off the edges, the content crisp on the app
|
|
40
|
+
* surface; `inset` runs it flush and sets the content in a
|
|
40
41
|
* raised surface held off the other edges, scrolling inside itself.
|
|
41
42
|
*/
|
|
42
43
|
const SHELL_LAYOUT: AppSidebarLayout = 'floating';
|
package/chat/ChatLauncher.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ export declare const CHAT_PANEL_ID = "ds-chat-panel";
|
|
|
6
6
|
export interface ChatLauncherProps {
|
|
7
7
|
/** The floating button's text. */
|
|
8
8
|
label?: string;
|
|
9
|
-
/** The button's icon. */
|
|
10
|
-
icon?: string;
|
|
9
|
+
/** The button's icon: a Material Symbol name, or a custom element (a brand mark) drawn in the icon slot. */
|
|
10
|
+
icon?: string | ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* A TLDR panel the button summons on hover: a pre-written summary and
|
|
13
13
|
* prompt chips. A tapped chip opens the chat and sends the chip's
|
package/chat/ChatWidget.css
CHANGED
|
@@ -792,7 +792,7 @@
|
|
|
792
792
|
width: 100%;
|
|
793
793
|
min-width: 0;
|
|
794
794
|
min-height: 0;
|
|
795
|
-
border: var(--border-025) solid var(--color-bg-
|
|
795
|
+
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-app-shell-border));
|
|
796
796
|
border-radius: var(--radius-600);
|
|
797
797
|
background-color: var(--color-bg-page-primary);
|
|
798
798
|
overflow: hidden;
|
|
@@ -857,7 +857,7 @@
|
|
|
857
857
|
flex: 1;
|
|
858
858
|
min-width: 0;
|
|
859
859
|
min-height: 0;
|
|
860
|
-
border: var(--border-025) solid var(--color-bg-
|
|
860
|
+
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-app-shell-border));
|
|
861
861
|
border-radius: var(--radius-600);
|
|
862
862
|
/* Solid, the agent pane's ground: see the aside rail's card. */
|
|
863
863
|
background-color: var(--color-bg-page-primary);
|
|
@@ -1160,7 +1160,7 @@ html[data-chat-resizing] .ds-chat-launcher__panel {
|
|
|
1160
1160
|
|
|
1161
1161
|
.ds-chat-launcher__panel--flat {
|
|
1162
1162
|
background: var(--color-bg-app-surface);
|
|
1163
|
-
border-color: var(--color-bg-
|
|
1163
|
+
border-color: var(--ds-shell-edge-border, var(--color-bg-app-shell-border));
|
|
1164
1164
|
box-shadow: var(--shadow-floating);
|
|
1165
1165
|
backdrop-filter: none;
|
|
1166
1166
|
}
|
|
@@ -1527,17 +1527,17 @@ html[data-chat-resizing] .ds-chat-launcher__panel--floating .ds-chat-header {
|
|
|
1527
1527
|
border-inline-end-color: var(--ds-shell-rail-divider);
|
|
1528
1528
|
}
|
|
1529
1529
|
|
|
1530
|
-
/* Floating: the history rail lifts off the plane as a
|
|
1531
|
-
floating rail's; the trailing panels wear the same raised
|
|
1530
|
+
/* Floating: the history rail lifts off the plane as a card on the shell
|
|
1531
|
+
colour, the floating rail's; the trailing panels wear the same raised
|
|
1532
|
+
edge. */
|
|
1532
1533
|
.ds-chat-widget__rails[data-ds-shell='floating'] > .ds-chat-widget__threads-rail {
|
|
1533
1534
|
margin: var(--ds-shell-float-gap);
|
|
1534
1535
|
margin-inline-end: 0;
|
|
1535
1536
|
overflow: hidden;
|
|
1536
|
-
background-color: var(--ds-shell-
|
|
1537
|
+
background-color: var(--ds-shell-rail-bg);
|
|
1537
1538
|
border: var(--border-025) solid var(--ds-shell-edge-border);
|
|
1538
1539
|
border-radius: var(--ds-shell-radius);
|
|
1539
1540
|
box-shadow: var(--ds-shell-edge-shadow);
|
|
1540
|
-
backdrop-filter: var(--ds-shell-glass-blur);
|
|
1541
1541
|
}
|
|
1542
1542
|
|
|
1543
1543
|
/* Raised trailing panels (floating and inset): the card keeps its
|
package/chat/ChatWidget.d.ts
CHANGED
|
@@ -66,7 +66,7 @@ export interface ChatWidgetProps {
|
|
|
66
66
|
* Seat the widget as a page in one of AppLayout's three shell modes, for a
|
|
67
67
|
* host where the chat is the page (a chat home), not a panel over one.
|
|
68
68
|
* `flush` runs the history rail on the shell colour behind a hairline
|
|
69
|
-
* beside the conversation; `floating` lifts the rail into a
|
|
69
|
+
* beside the conversation; `floating` lifts the rail into a card on the shell colour;
|
|
70
70
|
* `inset` runs the rail flush and seats the conversation
|
|
71
71
|
* and each trailing panel in raised surfaces. Left out, the widget draws
|
|
72
72
|
* no shell and takes its host's ground, as a docked or floating panel
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
/* ============================================
|
|
114
|
-
FLOATING LAYOUT — the rail floats as a
|
|
114
|
+
FLOATING LAYOUT — the rail floats as a
|
|
115
115
|
card, so the main column clears its inset on
|
|
116
116
|
both sides of it
|
|
117
117
|
============================================ */
|
|
@@ -39,8 +39,8 @@ type AppLayoutOwnProps = {
|
|
|
39
39
|
* How the rail and the content meet the page, one of the three app shell
|
|
40
40
|
* modes. `flush` runs the rail edge to edge on the shell
|
|
41
41
|
* colour behind a hairline, the content centred beside it on the crisp
|
|
42
|
-
* app surface, nothing raised. `floating` floats the rail as a
|
|
43
|
-
* the content
|
|
42
|
+
* app surface, nothing raised. `floating` floats the rail as a card on the
|
|
43
|
+
* shell colour, the content centred on the crisp app surface. `inset` runs the rail flush on the shell
|
|
44
44
|
* colour and sets the content in a raised surface (hairline and floating
|
|
45
45
|
* shadow) inset from the other edges, which scrolls inside itself, and is
|
|
46
46
|
* the default. How wide the content runs is `width`, apart from the mode.
|
|
@@ -50,23 +50,20 @@
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/* ============================================
|
|
53
|
-
FLOATING VARIANT — the rail as a
|
|
54
|
-
inset from the viewport edges
|
|
55
|
-
recipe as the site chat panel)
|
|
53
|
+
FLOATING VARIANT — the rail as a card on the
|
|
54
|
+
shell colour, inset from the viewport edges
|
|
56
55
|
============================================ */
|
|
57
56
|
.ds-app-sidebar--floating {
|
|
58
57
|
top: var(--ds-sidebar-float-inset, 20px);
|
|
59
58
|
inset-inline-start: var(--ds-sidebar-float-inset, 20px);
|
|
60
59
|
height: calc(100dvh - var(--ds-sidebar-float-inset, 20px) * 2);
|
|
61
|
-
/* The shell recipe's
|
|
60
|
+
/* The shell recipe's floating card (src/behaviors/shell.css): the shell
|
|
61
|
+
colour, a step off the crisp surface around it, with the recipe's
|
|
62
62
|
values as fallbacks for a rail standing outside a shell host. */
|
|
63
|
-
background-color: var(--ds-shell-
|
|
64
|
-
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-
|
|
63
|
+
background-color: var(--ds-shell-rail-bg, var(--color-bg-app-shell));
|
|
64
|
+
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-app-shell-border));
|
|
65
65
|
border-radius: var(--ds-shell-radius, var(--radius-600));
|
|
66
66
|
box-shadow: var(--ds-shell-edge-shadow, var(--shadow-floating));
|
|
67
|
-
/* The glass token is deliberately translucent; this blur is what keeps
|
|
68
|
-
content behind the rail readable through it. */
|
|
69
|
-
backdrop-filter: var(--ds-shell-glass-blur, blur(24px));
|
|
70
67
|
}
|
|
71
68
|
|
|
72
69
|
/* The inset layout's gap: between the content surface and the viewport
|
|
@@ -1139,18 +1136,18 @@
|
|
|
1139
1136
|
inset-inline-start: 280px;
|
|
1140
1137
|
}
|
|
1141
1138
|
|
|
1142
|
-
/* Floating: a second
|
|
1139
|
+
/* Floating: a second card beside the first, one gap along. */
|
|
1143
1140
|
.ds-app-sidebar__panel--floating {
|
|
1144
1141
|
top: var(--ds-sidebar-float-inset, 20px);
|
|
1145
1142
|
inset-inline-start: calc(var(--ds-sidebar-float-inset, 20px) + 64px + var(--gap-300));
|
|
1146
1143
|
height: calc(100dvh - var(--ds-sidebar-float-inset, 20px) * 2);
|
|
1147
|
-
/* The shell recipe's
|
|
1144
|
+
/* The shell recipe's floating card (src/behaviors/shell.css): the shell
|
|
1145
|
+
colour, a step off the crisp surface around it, with the recipe's
|
|
1148
1146
|
values as fallbacks for a rail standing outside a shell host. */
|
|
1149
|
-
background-color: var(--ds-shell-
|
|
1150
|
-
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-
|
|
1147
|
+
background-color: var(--ds-shell-rail-bg, var(--color-bg-app-shell));
|
|
1148
|
+
border: var(--border-025) solid var(--ds-shell-edge-border, var(--color-bg-app-shell-border));
|
|
1151
1149
|
border-radius: var(--ds-shell-radius, var(--radius-600));
|
|
1152
1150
|
box-shadow: var(--ds-shell-edge-shadow, var(--shadow-floating));
|
|
1153
|
-
backdrop-filter: var(--ds-shell-glass-blur, blur(24px));
|
|
1154
1151
|
}
|
|
1155
1152
|
|
|
1156
1153
|
.ds-app-sidebar__panel--floating.ds-app-sidebar__panel--panel-mode {
|
|
@@ -1465,7 +1462,7 @@
|
|
|
1465
1462
|
width: 0;
|
|
1466
1463
|
padding: 0;
|
|
1467
1464
|
overflow: hidden;
|
|
1468
|
-
/* Zero width still paints borders and the floating variant's
|
|
1465
|
+
/* Zero width still paints borders and the floating variant's raised
|
|
1469
1466
|
edge — a hairline sliver standing where the rail was. Visibility
|
|
1470
1467
|
hides every painted box in one property, whatever the variant;
|
|
1471
1468
|
the open drawer below restores it. */
|
|
@@ -199,9 +199,9 @@ type AppSidebarOwnProps = {
|
|
|
199
199
|
/**
|
|
200
200
|
* How the rail meets the page, one of the three app shell modes. `flush`
|
|
201
201
|
* runs it edge to edge on the shell colour behind a hairline divider,
|
|
202
|
-
* nothing raised. `floating` floats it off the viewport edges as a
|
|
203
|
-
*
|
|
204
|
-
*
|
|
202
|
+
* nothing raised. `floating` floats it off the viewport edges as a card on
|
|
203
|
+
* the shell colour beside the crisp app surface: inset with rounded
|
|
204
|
+
* corners, a hairline and the floating shadow (the inset defaults to 20px and is
|
|
205
205
|
* overridable via the --ds-sidebar-float-inset custom property). `inset`
|
|
206
206
|
* runs it flush on the app shell colour, beside a raised content surface
|
|
207
207
|
* inset from the edges, as AppLayout's `inset` layout draws it. Inside a
|
|
@@ -212,7 +212,7 @@ type AppSidebarOwnProps = {
|
|
|
212
212
|
*/
|
|
213
213
|
layout?: AppSidebarLayout;
|
|
214
214
|
/**
|
|
215
|
-
* Floats the rail as a
|
|
215
|
+
* Floats the rail as a card, the same as `layout="floating"`.
|
|
216
216
|
* @deprecated Use `layout="floating"`.
|
|
217
217
|
*/
|
|
218
218
|
floating?: boolean;
|
|
@@ -31,14 +31,18 @@ function DefaultLogo() {
|
|
|
31
31
|
{
|
|
32
32
|
width: "24",
|
|
33
33
|
height: "24",
|
|
34
|
-
viewBox: "
|
|
35
|
-
fill: "none",
|
|
34
|
+
viewBox: "-4 -4 104 104",
|
|
36
35
|
xmlns: "http://www.w3.org/2000/svg",
|
|
37
36
|
"aria-hidden": "true",
|
|
38
37
|
children: [
|
|
39
|
-
/* @__PURE__ */ jsx(
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
"path",
|
|
40
|
+
{
|
|
41
|
+
d: "M20.5 31L31.5 25L31.5 50.28L17.78 64L2.22 64L20.5 45.72ZM64.5 31L75.5 25L75.5 45.72L93.78 64L78.22 64L64.5 50.28Z",
|
|
42
|
+
fill: "currentColor"
|
|
43
|
+
}
|
|
44
|
+
),
|
|
45
|
+
/* @__PURE__ */ jsx("path", { d: "M42 11L54 5L54 85L42 91Z", fill: "currentColor" })
|
|
42
46
|
]
|
|
43
47
|
}
|
|
44
48
|
);
|
|
@@ -12,7 +12,9 @@
|
|
|
12
12
|
display: inline-flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
justify-content: center;
|
|
15
|
-
|
|
15
|
+
/* --ds-mark-radius is the shared mark hook: `round`, or a container's
|
|
16
|
+
`roundMarks`, sets it to a circle; unset, the avatar keeps its token. */
|
|
17
|
+
border-radius: var(--ds-mark-radius, var(--radius-pill)); /* 999px */
|
|
16
18
|
background-color: var(--color-bg-container-secondary);
|
|
17
19
|
flex-shrink: 0;
|
|
18
20
|
}
|
|
@@ -41,9 +43,8 @@
|
|
|
41
43
|
A logo is fitted whole, never cropped to the box.
|
|
42
44
|
============================================ */
|
|
43
45
|
|
|
44
|
-
.ds-avatar--square
|
|
45
|
-
|
|
46
|
-
border-radius: var(--radius-300);
|
|
46
|
+
.ds-avatar--square {
|
|
47
|
+
border-radius: var(--ds-mark-radius, var(--radius-300));
|
|
47
48
|
}
|
|
48
49
|
|
|
49
50
|
.ds-avatar--square .ds-avatar__image {
|
|
@@ -59,7 +60,19 @@
|
|
|
59
60
|
height: 100%;
|
|
60
61
|
object-fit: cover;
|
|
61
62
|
display: block;
|
|
62
|
-
border-radius:
|
|
63
|
+
border-radius: inherit;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/* ============================================
|
|
67
|
+
ROUND
|
|
68
|
+
A true circle whatever the theme's radius, on either shape: a theme may
|
|
69
|
+
square the pill off, and a circle is geometry, not a step on the radius
|
|
70
|
+
scale. It sets the shared mark hook, so a container's `roundMarks` and
|
|
71
|
+
an avatar's own `round` are the same rule.
|
|
72
|
+
============================================ */
|
|
73
|
+
|
|
74
|
+
.ds-avatar--round {
|
|
75
|
+
--ds-mark-radius: 50%;
|
|
63
76
|
}
|
|
64
77
|
|
|
65
78
|
/* ============================================
|
|
@@ -12,6 +12,8 @@ type AvatarOwnProps = {
|
|
|
12
12
|
size?: 'sm' | 'md' | 'lg';
|
|
13
13
|
/** `circle` for a person; `square` for an organisation (a company, a bank, a vendor, an integration): rounded corners on the radius scale, a logo fitted whole rather than cropped, and a building glyph when there is no image or name. */
|
|
14
14
|
shape?: 'circle' | 'square';
|
|
15
|
+
/** Draw a true circle whatever the theme's radius, for either shape. Without it a `circle` follows the theme's pill radius, which a theme may square off, and a `square` keeps its rounded corners. A container's `roundMarks` (Table, DataTable) does the same for every avatar inside it. */
|
|
16
|
+
round?: boolean;
|
|
15
17
|
/**
|
|
16
18
|
* Which of the six fills the initials sit on. Picked from the name when
|
|
17
19
|
* unset, so a person keeps one colour everywhere; `neutral` keeps the
|
|
@@ -11,6 +11,7 @@ const Avatar = React.forwardRef(
|
|
|
11
11
|
name,
|
|
12
12
|
size = "md",
|
|
13
13
|
shape = "circle",
|
|
14
|
+
round = false,
|
|
14
15
|
fill,
|
|
15
16
|
status,
|
|
16
17
|
statusLabel,
|
|
@@ -22,7 +23,7 @@ const Avatar = React.forwardRef(
|
|
|
22
23
|
const sizeClass = `${baseClass}--${size}`;
|
|
23
24
|
const fillIndex = name?.trim() && fill !== "neutral" ? fill ?? avatarFill(name.trim()) : null;
|
|
24
25
|
const fillClass = fillIndex ? `${baseClass}--fill-${fillIndex}` : "";
|
|
25
|
-
const classes = [baseClass, sizeClass, shape === "square" ? `${baseClass}--square` : "", fillClass, className].filter(Boolean).join(" ");
|
|
26
|
+
const classes = [baseClass, sizeClass, shape === "square" ? `${baseClass}--square` : "", round ? `${baseClass}--round` : "", fillClass, className].filter(Boolean).join(" ");
|
|
26
27
|
const getInitials = (fullName) => {
|
|
27
28
|
const parts = fullName.trim().split(/\s+/);
|
|
28
29
|
if (parts.length === 1) return parts[0][0].toUpperCase();
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
.ds-avatar-group__item {
|
|
23
23
|
position: relative;
|
|
24
24
|
display: inline-flex;
|
|
25
|
-
border-radius: var(--radius-pill);
|
|
25
|
+
border-radius: var(--ds-mark-radius, var(--radius-pill));
|
|
26
26
|
box-shadow: 0 0 0 var(--border-050) var(--color-bg-page-primary);
|
|
27
27
|
}
|
|
28
28
|
|
|
@@ -30,6 +30,13 @@
|
|
|
30
30
|
margin-inline-start: calc(var(--gap-200) * -1);
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
+
/* Round: sets the shared mark hook, so the avatars, their rings and the
|
|
34
|
+
counter all draw a true circle whatever the theme's radius. */
|
|
35
|
+
|
|
36
|
+
.ds-avatar-group--round {
|
|
37
|
+
--ds-mark-radius: 50%;
|
|
38
|
+
}
|
|
39
|
+
|
|
33
40
|
/* Overflow counter */
|
|
34
41
|
|
|
35
42
|
.ds-avatar-group__overflow {
|
|
@@ -10,6 +10,12 @@ type AvatarGroupOwnProps = {
|
|
|
10
10
|
* Cloned onto the children so the group cannot render mixed sizes.
|
|
11
11
|
*/
|
|
12
12
|
size?: 'sm' | 'md' | 'lg';
|
|
13
|
+
/**
|
|
14
|
+
* Draw every avatar in the stack, its ring and the overflow counter as a
|
|
15
|
+
* true circle whatever the theme's radius, through the shared mark hook
|
|
16
|
+
* (`--ds-mark-radius`) the avatars read.
|
|
17
|
+
*/
|
|
18
|
+
round?: boolean;
|
|
13
19
|
/**
|
|
14
20
|
* Accessible label for the overflow counter. Defaults to "N more" (for
|
|
15
21
|
* example "4 more"), with N the number of hidden avatars. Pass a function
|
|
@@ -4,9 +4,9 @@ import "./AvatarGroup.css";
|
|
|
4
4
|
import { avatarFill } from "../Avatar/avatarFill.js";
|
|
5
5
|
import { spreadInks } from "../PixelAvatar/pixelInks.js";
|
|
6
6
|
const AvatarGroup = React.forwardRef(
|
|
7
|
-
({ children, max = 5, size = "md", overflowLabel, className = "", ...rest }, ref) => {
|
|
7
|
+
({ children, max = 5, size = "md", round = false, overflowLabel, className = "", ...rest }, ref) => {
|
|
8
8
|
const baseClass = "ds-avatar-group";
|
|
9
|
-
const classes = [baseClass, `${baseClass}--${size}`, className].filter(Boolean).join(" ");
|
|
9
|
+
const classes = [baseClass, `${baseClass}--${size}`, round ? `${baseClass}--round` : "", className].filter(Boolean).join(" ");
|
|
10
10
|
const flatten = (nodes) => React.Children.toArray(nodes).flatMap(
|
|
11
11
|
(node) => React.isValidElement(node) && node.type === React.Fragment ? flatten(node.props.children) : [node]
|
|
12
12
|
);
|
|
@@ -9,6 +9,17 @@
|
|
|
9
9
|
|
|
10
10
|
@layer rift.tokens, rift.preset, rift.components;
|
|
11
11
|
|
|
12
|
+
/* A pinned cell paints its row tint through this property, inside a
|
|
13
|
+
gradient over its opaque body. Registered as a colour so it can fade:
|
|
14
|
+
unregistered, it switched at once while the rest of the row faded its
|
|
15
|
+
background, so the pinned cell lit up a beat before the row caught up.
|
|
16
|
+
Browsers without @property switch it at once, as before. */
|
|
17
|
+
@property --ds-dt-tint {
|
|
18
|
+
syntax: '<color>';
|
|
19
|
+
initial-value: transparent;
|
|
20
|
+
inherits: false;
|
|
21
|
+
}
|
|
22
|
+
|
|
12
23
|
@layer rift.components {
|
|
13
24
|
|
|
14
25
|
.ds-data-table {
|
|
@@ -18,6 +29,13 @@
|
|
|
18
29
|
width: 100%;
|
|
19
30
|
}
|
|
20
31
|
|
|
32
|
+
/* Round marks: the shared mark hook at a true circle, so every Avatar,
|
|
33
|
+
Icon tile, PixelAvatar tile and logo in the table draws round whatever
|
|
34
|
+
the theme's radius. */
|
|
35
|
+
.ds-data-table--round-marks {
|
|
36
|
+
--ds-mark-radius: 50%;
|
|
37
|
+
}
|
|
38
|
+
|
|
21
39
|
/* ============================================
|
|
22
40
|
TOOLBAR
|
|
23
41
|
============================================ */
|
|
@@ -180,6 +198,9 @@
|
|
|
180
198
|
z-index: 1;
|
|
181
199
|
background-color: var(--color-table-body-bg);
|
|
182
200
|
background-image: linear-gradient(var(--ds-dt-tint), var(--ds-dt-tint));
|
|
201
|
+
/* The row's own fade (.ds-table__row in Table.css), so the pinned
|
|
202
|
+
cells and the rest of the row change together. */
|
|
203
|
+
transition: --ds-dt-tint var(--motion-duration-base) var(--motion-ease-standard);
|
|
183
204
|
}
|
|
184
205
|
|
|
185
206
|
/* Body rows only: the header row is a row too, and never takes a hover tint. */
|
|
@@ -1366,4 +1387,46 @@
|
|
|
1366
1387
|
border-radius: var(--radius-300);
|
|
1367
1388
|
}
|
|
1368
1389
|
|
|
1390
|
+
/* ============================================
|
|
1391
|
+
FRAMELESS (`frameless`, `outerControl`)
|
|
1392
|
+
Table.css draws the frameless table and its outer control on the
|
|
1393
|
+
classes this table shares; this only fits DataTable's own frame and its
|
|
1394
|
+
sticky cells to it. The frame drops its outline and surface and reaches
|
|
1395
|
+
past its column by the tile's bleed, or by the outer control's 40px on
|
|
1396
|
+
the start side. A sticky cell (a pinned column, a sticky header) keeps
|
|
1397
|
+
an opaque base, the surface the table sits on rather than the bordered
|
|
1398
|
+
table's body (an app shell's surface inside one, else the page), and paints the frameless line and tile over it instead of
|
|
1399
|
+
its own tint.
|
|
1400
|
+
============================================ */
|
|
1401
|
+
|
|
1402
|
+
.ds-table__wrapper.ds-data-table__frame--frameless {
|
|
1403
|
+
margin-inline: calc(-1 * var(--padding-400));
|
|
1404
|
+
border: 0;
|
|
1405
|
+
border-radius: 0;
|
|
1406
|
+
background: transparent;
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
.ds-table__wrapper.ds-data-table__frame--outer-control {
|
|
1410
|
+
margin-inline-start: -40px; /* ds-allow(spacing): the outer control column, UTILITY_COLUMN_WIDTH */
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
.ds-table.ds-table--frameless .ds-data-table__cell--pinned,
|
|
1414
|
+
.ds-table.ds-table--frameless.ds-data-table__grid--sticky .ds-table__head .ds-table__header-cell {
|
|
1415
|
+
--ds-table-base: var(--ds-table-surface, var(--ds-shell-surface, var(--color-bg-page-primary)));
|
|
1416
|
+
|
|
1417
|
+
background-color: var(--ds-table-base);
|
|
1418
|
+
background-image:
|
|
1419
|
+
linear-gradient(var(--ds-table-line), var(--ds-table-line)),
|
|
1420
|
+
linear-gradient(var(--ds-table-fill), var(--ds-table-fill));
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/* The first row's tile draws its top edge on the header's line, one pixel
|
|
1424
|
+
above the row, where an opaque pinned header cell stacks over it. So
|
|
1425
|
+
while that row is lifted, a pinned header cell at either end runs its
|
|
1426
|
+
own line on to where the tile's corner starts, and the edge reads
|
|
1427
|
+
unbroken across the pinned column. */
|
|
1428
|
+
.ds-table.ds-table--frameless:has(.ds-table__body .ds-table__row:first-child:is(:hover, :has(:focus-visible))) .ds-table__head .ds-table__row > :is(:first-child, :last-child).ds-data-table__cell--pinned {
|
|
1429
|
+
--ds-table-line-size: calc(100% - var(--ds-table-radius));
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1369
1432
|
} /* @layer rift.components */
|
|
@@ -566,8 +566,32 @@ type DataTableOwnProps<R extends DataTableRow = DataTableRow> = {
|
|
|
566
566
|
onRowOrderChange?: (order: string[]) => void;
|
|
567
567
|
/** The column and row controls' words, merged over their English defaults. */
|
|
568
568
|
columnLabels?: Partial<DataTableColumnLabels>;
|
|
569
|
-
/** Draws a vertical line between columns, as well as the lines between rows. */
|
|
569
|
+
/** Draws a vertical line between columns, as well as the lines between rows. A frameless table draws none. */
|
|
570
570
|
columnDividers?: boolean;
|
|
571
|
+
/**
|
|
572
|
+
* Draws the table with no frame, as Table's `frameless` does: no outline,
|
|
573
|
+
* no header band and no column dividers, the first and last columns'
|
|
574
|
+
* content flush with the page, and a hovered row lifted into a raised
|
|
575
|
+
* tile that reaches past the columns. The page needs room for that reach
|
|
576
|
+
* on both sides (`--padding-400`). Narrower than a phone (the table's own
|
|
577
|
+
* width, under `BREAKPOINT_PHONE_PX`) it keeps its usual look.
|
|
578
|
+
*/
|
|
579
|
+
frameless?: boolean;
|
|
580
|
+
/**
|
|
581
|
+
* Draws every mark in the table (an Avatar, an AvatarGroup, an Icon tile,
|
|
582
|
+
* a PixelAvatar tile, a logo) as a true circle whatever the theme's radius,
|
|
583
|
+
* through the shared mark hook, `--ds-mark-radius`, as Table's `roundMarks`
|
|
584
|
+
* does. A wide picture is not a mark and keeps its corners.
|
|
585
|
+
*/
|
|
586
|
+
roundMarks?: boolean;
|
|
587
|
+
/**
|
|
588
|
+
* With `frameless`, hangs the first utility column (the row grip of
|
|
589
|
+
* `reorderableRows`, else the checkbox of `selectable`) as the row's outer
|
|
590
|
+
* control: inside the tile's start, showing on hover, on keyboard focus,
|
|
591
|
+
* when checked, or while any row is selected. The page needs 40px of room
|
|
592
|
+
* on the table's start side for it.
|
|
593
|
+
*/
|
|
594
|
+
outerControl?: boolean;
|
|
571
595
|
/** How every cell's text fits unless its column says otherwise: `wrap` (the default), `nowrap`, `truncate` or `lines-2`. */
|
|
572
596
|
cellText?: DataTableCellText;
|
|
573
597
|
/** The actions a row offers, in an actions column that sticks to the end edge: inline ones as icon buttons, the rest in a More menu. */
|
|
@@ -618,7 +642,7 @@ type DataTableOwnProps<R extends DataTableRow = DataTableRow> = {
|
|
|
618
642
|
};
|
|
619
643
|
export interface DataTableProps<R extends DataTableRow = DataTableRow> extends DataTableOwnProps<R>, Omit<React.ComponentPropsWithRef<'div'>, keyof DataTableOwnProps<R>> {
|
|
620
644
|
}
|
|
621
|
-
export declare function DataTable<R extends DataTableRow = DataTableRow>({ columns: columnsProp, rows: rowsProp, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, pageSizeLabel, phoneLayout, selectable, selectedIds, defaultSelectedIds, onSelectionChange, sort, defaultSort, onSortChange, sorts: sortsProp, defaultSorts, onSortsChange, multiSort, onViewChange, view: viewProp, defaultView, virtualize, onLoadMore, hasMore, renderDetail, expandedIds: expandedProp, defaultExpandedIds, onExpandedIdsChange, expandMode, grouping: groupingProp, defaultGrouping, onGroupingChange, totalsRow, totals: totalsProp, defaultTotals, onTotalsChange, linkComponent, rowHref, onRowClick, searchable, searchPlaceholder, toolbar, size: sizeProp, defaultSize, onSizeChange, filters: filtersProp, defaultFilters, onFiltersChange, search: searchProp, defaultSearch, onSearchChange, filterLabels: filterLabelsProp, striped, caption, emptyState, selectAllLabel, selectRowLabel, sortLabel, sortRankLabel, sortAnnouncement, pageAnnouncement, resultsLabel, selectedLabel, paginationLabels, emptyStateLabels, resizableColumns, reorderableColumns, columnMenu, reorderableRows, stickyHeader, maxHeight, navigation, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnOrder, defaultColumnOrder, onColumnOrderChange, columnPinning, defaultColumnPinning, onColumnPinningChange, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rowOrder, defaultRowOrder, onRowOrderChange, columnLabels, columnDividers, cellText, rowActions, rowActionsVisibility, editMode, onCellEdit, onRowEdit, manual, rowCount: rowCountProp, loading, error, onRetry, loadLabels, locale: localeProp, className, ref, ...rest }: DataTableProps<R>): React.JSX.Element;
|
|
645
|
+
export declare function DataTable<R extends DataTableRow = DataTableRow>({ columns: columnsProp, rows: rowsProp, pageSize: pageSizeProp, defaultPageSize, onPageSizeChange, pageSizeOptions, page: pageProp, defaultPage, onPageChange, pageSizeLabel, phoneLayout, selectable, selectedIds, defaultSelectedIds, onSelectionChange, sort, defaultSort, onSortChange, sorts: sortsProp, defaultSorts, onSortsChange, multiSort, onViewChange, view: viewProp, defaultView, virtualize, onLoadMore, hasMore, renderDetail, expandedIds: expandedProp, defaultExpandedIds, onExpandedIdsChange, expandMode, grouping: groupingProp, defaultGrouping, onGroupingChange, totalsRow, totals: totalsProp, defaultTotals, onTotalsChange, linkComponent, rowHref, onRowClick, searchable, searchPlaceholder, toolbar, size: sizeProp, defaultSize, onSizeChange, filters: filtersProp, defaultFilters, onFiltersChange, search: searchProp, defaultSearch, onSearchChange, filterLabels: filterLabelsProp, striped, caption, emptyState, selectAllLabel, selectRowLabel, sortLabel, sortRankLabel, sortAnnouncement, pageAnnouncement, resultsLabel, selectedLabel, paginationLabels, emptyStateLabels, resizableColumns, reorderableColumns, columnMenu, reorderableRows, stickyHeader, maxHeight, navigation, columnWidths, defaultColumnWidths, onColumnWidthsChange, columnOrder, defaultColumnOrder, onColumnOrderChange, columnPinning, defaultColumnPinning, onColumnPinningChange, hiddenColumns, defaultHiddenColumns, onHiddenColumnsChange, rowOrder, defaultRowOrder, onRowOrderChange, columnLabels, columnDividers, frameless: framelessProp, roundMarks, outerControl, cellText, rowActions, rowActionsVisibility, editMode, onCellEdit, onRowEdit, manual, rowCount: rowCountProp, loading, error, onRetry, loadLabels, locale: localeProp, className, ref, ...rest }: DataTableProps<R>): React.JSX.Element;
|
|
622
646
|
/**
|
|
623
647
|
* A stored view made safe for a table's columns as they are now: columns
|
|
624
648
|
* that no longer exist drop out of every part of it, a filter whose
|