rift-ds 1.22.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/README.md +3 -3
- package/behaviors/chat-card.css +135 -0
- 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/AssistantTurn.js +9 -3
- package/chat/ChatAgentPane.css +6 -6
- package/chat/ChatLauncher.d.ts +3 -3
- package/chat/ChatLauncher.js +3 -5
- package/chat/ChatProvider.d.ts +10 -1
- package/chat/ChatProvider.js +3 -2
- package/chat/ChatWidget.css +272 -8
- package/chat/ChatWidget.d.ts +63 -9
- package/chat/ChatWidget.js +110 -38
- package/chat/DemoWelcome.js +2 -2
- package/chat/actions.d.ts +105 -0
- package/chat/actions.js +47 -0
- package/chat/demo-card-components.d.ts +3 -4
- package/chat/demo-script.js +15 -15
- package/chat/generatedStarters.d.ts +19 -0
- package/chat/generatedStarters.js +49 -0
- package/chat/index.d.ts +7 -3
- package/chat/index.js +25 -2
- package/chat/placement.d.ts +9 -0
- package/chat/placement.js +7 -0
- package/chat/queries.d.ts +6 -0
- package/chat/queries.js +25 -0
- package/chat/questions.d.ts +1 -1
- package/chat/questions.js +1 -1
- package/chat/registry.json.d.ts +5 -3
- package/chat/registry.json.js +1 -1
- package/chat/selection.css +8 -0
- package/chat/selection.d.ts +40 -0
- package/chat/selection.js +140 -0
- package/chat/selectionContext.d.ts +70 -0
- package/chat/selectionContext.js +60 -0
- package/chat/server.d.ts +54 -1
- package/chat/server.js +101 -5
- package/chat/suggestions.d.ts +12 -8
- package/chat/suggestions.js +1 -1
- package/chat/types.d.ts +2 -0
- package/chat/useChat.js +5 -3
- package/components/ActionCard/ActionCard.css +147 -0
- package/components/ActionCard/ActionCard.d.ts +54 -0
- package/components/ActionCard/ActionCard.js +75 -0
- package/components/ActionReadout/ActionReadout.css +47 -0
- package/components/ActionReadout/ActionReadout.d.ts +29 -0
- package/components/ActionReadout/ActionReadout.js +22 -0
- package/components/AgentPlan/AgentPlan.css +18 -8
- package/components/AgentPlan/AgentPlan.js +1 -0
- 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 +119 -28
- package/components/AppSidebar/AppSidebar.d.ts +10 -5
- package/components/AppSidebar/AppSidebar.js +19 -4
- package/components/ArtifactCard/ArtifactCard.css +11 -10
- package/components/ArtifactCard/ArtifactCard.js +3 -1
- package/components/ChatThread/ChatThread.css +6 -3
- package/components/Chip/Chip.css +9 -1
- package/components/CodeBlock/CodeBlock.css +2 -0
- package/components/CodeDiff/CodeDiff.css +18 -8
- package/components/CodeDiff/CodeDiff.js +1 -0
- package/components/Composer/Composer.css +52 -13
- package/components/Composer/Composer.d.ts +9 -1
- package/components/Composer/Composer.js +19 -1
- package/components/DataTable/FilterEditor.js +4 -2
- package/components/DataTable/filterModel.d.ts +8 -0
- package/components/DataTable/filterModel.js +4 -0
- package/components/DataTable/views.js +2 -2
- package/components/DocumentChip/DocumentChip.css +27 -3
- package/components/EntitySwitcher/EntitySwitcher.css +333 -0
- package/components/EntitySwitcher/EntitySwitcher.d.ts +74 -0
- package/components/EntitySwitcher/EntitySwitcher.js +291 -0
- package/components/InterruptCard/InterruptCard.css +96 -34
- package/components/InterruptCard/InterruptCard.d.ts +20 -3
- package/components/InterruptCard/InterruptCard.js +23 -8
- package/components/MessageCard/MessageCard.css +27 -18
- package/components/MessageCard/MessageCard.js +1 -0
- package/components/PromptSuggestions/PromptSuggestions.css +3 -0
- package/components/Prose/Prose.css +2 -0
- package/components/QuestionCard/QuestionCard.css +9 -5
- package/components/QuestionCard/QuestionCard.js +1 -0
- package/components/SourceTrail/SourceTrail.css +33 -11
- package/components/SourceTrail/SourceTrail.js +3 -2
- package/components/TableToolbar/TableToolbar.css +4 -1
- package/components/TableToolbar/TableToolbar.js +1 -1
- 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/ToolCall/ToolCall.css +89 -22
- package/components/ToolCall/ToolCall.js +2 -1
- package/components/UsageCard/UsageCard.css +29 -2
- package/components/UsageCard/UsageCard.js +1 -0
- package/components/registry.json +25 -1
- package/components/registry.json.d.ts +25 -1
- package/components/registry.json.js +1 -1
- package/fonts/presets/bricolage-grotesque-300-800-latin-ext.woff2 +0 -0
- package/fonts/presets/bricolage-grotesque-300-800-latin.woff2 +0 -0
- package/fonts/presets/figtree-300-800-latin-ext.woff2 +0 -0
- package/fonts/presets/figtree-300-800-latin.woff2 +0 -0
- package/index.d.ts +3 -0
- package/index.js +6 -0
- package/package.json +5 -1
- package/tokens/motion.d.ts +2 -0
- package/tokens/motion.js +2 -0
- package/tokens/presets/plum.css +413 -0
- package/tokens/presets/presets.css +1 -0
- package/tokens/registry.json +2 -0
- package/tokens/registry.json.d.ts +2 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +6 -2
- package/tokens/tokens-light.css +6 -2
- package/tokens/tokens-typography.css +8 -2
- package/tokens/values.json.js +1 -1
|
@@ -9,6 +9,8 @@ import { mediaAbove, mediaBelow, BREAKPOINT_TABLET_PX, BREAKPOINT_MOBILE_PX } fr
|
|
|
9
9
|
import { Avatar } from "../Avatar/Avatar.js";
|
|
10
10
|
import { PixelAvatar } from "../PixelAvatar/PixelAvatar.js";
|
|
11
11
|
import { SidebarPanel } from "../SidebarPanel/SidebarPanel.js";
|
|
12
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
13
|
+
import "../../behaviors/shell.css";
|
|
12
14
|
import "./AppSidebar.css";
|
|
13
15
|
import "../../behaviors/direction.css";
|
|
14
16
|
import "../../fonts/material-symbols.css";
|
|
@@ -52,6 +54,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
52
54
|
layout: layoutProp,
|
|
53
55
|
floating: floatingProp = false,
|
|
54
56
|
topSlot,
|
|
57
|
+
persistentTopSlot = false,
|
|
55
58
|
footerSlot,
|
|
56
59
|
collapsedFooterSlot,
|
|
57
60
|
className = "",
|
|
@@ -103,6 +106,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
103
106
|
return () => band.removeEventListener("change", onChange);
|
|
104
107
|
}, []);
|
|
105
108
|
const [mobileOpen, setMobileOpen] = useState(false);
|
|
109
|
+
const toggleLabel = mobileOpen ? closeLabel : isExpanded ? collapseLabel : expandLabel;
|
|
106
110
|
const drawerRef = useRef(null);
|
|
107
111
|
const setDrawerRef = (node) => {
|
|
108
112
|
drawerRef.current = node;
|
|
@@ -298,17 +302,28 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
298
302
|
]
|
|
299
303
|
}
|
|
300
304
|
),
|
|
301
|
-
/* @__PURE__ */ jsx(
|
|
305
|
+
/* @__PURE__ */ jsx(Tooltip, { content: toggleLabel, position: "start", className: `${baseClass}__toggle-tip`, children: /* @__PURE__ */ jsx(
|
|
302
306
|
"button",
|
|
303
307
|
{
|
|
304
308
|
className: `${baseClass}__toggle`,
|
|
305
309
|
onClick: mobileOpen ? closeMobile : toggleExpanded,
|
|
306
|
-
"aria-label":
|
|
310
|
+
"aria-label": toggleLabel,
|
|
307
311
|
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded ds-mirror-rtl", children: mobileOpen ? "close" : isExpanded ? "left_panel_close" : "left_panel_open" })
|
|
308
312
|
}
|
|
309
|
-
)
|
|
313
|
+
) })
|
|
310
314
|
] }),
|
|
311
|
-
topSlot && /* @__PURE__ */ jsx(
|
|
315
|
+
topSlot && /* @__PURE__ */ jsx(
|
|
316
|
+
"div",
|
|
317
|
+
{
|
|
318
|
+
className: [
|
|
319
|
+
`${baseClass}__top-slot`,
|
|
320
|
+
persistentTopSlot ? `${baseClass}__top-slot--persistent` : ""
|
|
321
|
+
].filter(Boolean).join(" "),
|
|
322
|
+
"data-expanded": showExpanded,
|
|
323
|
+
inert: !showExpanded && !persistentTopSlot,
|
|
324
|
+
children: topSlot
|
|
325
|
+
}
|
|
326
|
+
),
|
|
312
327
|
mobileOpen && drilled && panelSource ? /* @__PURE__ */ jsx(
|
|
313
328
|
SidebarPanel,
|
|
314
329
|
{
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
display: flex;
|
|
13
13
|
align-items: center;
|
|
14
14
|
gap: var(--gap-300);
|
|
15
|
+
/* The column's full width, like every chat card. */
|
|
15
16
|
width: 100%;
|
|
16
|
-
max-width: 360px;
|
|
17
17
|
padding: var(--padding-300);
|
|
18
|
-
border: var(--
|
|
19
|
-
border-radius: var(--radius
|
|
20
|
-
background-color: var(--
|
|
18
|
+
border: var(--ds-chat-card-border);
|
|
19
|
+
border-radius: var(--ds-chat-card-radius);
|
|
20
|
+
background-color: var(--ds-chat-card-bg);
|
|
21
21
|
cursor: pointer;
|
|
22
22
|
text-align: start;
|
|
23
23
|
transition:
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
on-stage one, so it stays a tile on the card instead of dissolving into
|
|
47
47
|
a fill of nearly its own value. */
|
|
48
48
|
.ds-artifact-card--open .ds-artifact-card__mark {
|
|
49
|
-
background-color: var(--
|
|
49
|
+
background-color: var(--ds-chat-card-bg);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
.ds-artifact-card__mark {
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
/* Concentric with the card: its radius less the padding between them,
|
|
61
61
|
computed from the live tokens so the corner holds under any theme's
|
|
62
62
|
radius scale, and squares off with a squared theme. */
|
|
63
|
-
border-radius: max(0px, calc(var(--radius
|
|
63
|
+
border-radius: max(0px, calc(var(--ds-chat-card-radius) - var(--padding-300)));
|
|
64
64
|
background-color: var(--color-bg-container-secondary);
|
|
65
65
|
color: var(--color-icon-primary);
|
|
66
66
|
}
|
|
@@ -76,10 +76,11 @@
|
|
|
76
76
|
overflow: hidden;
|
|
77
77
|
text-overflow: ellipsis;
|
|
78
78
|
white-space: nowrap;
|
|
79
|
-
font-family: var(--font-
|
|
80
|
-
font-size: var(--font-
|
|
81
|
-
font-weight: var(--font-
|
|
82
|
-
line-height: var(--font-
|
|
79
|
+
font-family: var(--font-title-body-family);
|
|
80
|
+
font-size: var(--font-title-body-size);
|
|
81
|
+
font-weight: var(--font-title-body-weight);
|
|
82
|
+
line-height: var(--font-title-body-line-height);
|
|
83
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
83
84
|
color: var(--color-text-primary);
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import "./ArtifactCard.css";
|
|
4
|
+
import "../../behaviors/chat-card.css";
|
|
4
5
|
import "../../fonts/material-symbols.css";
|
|
5
6
|
import { mirrorClass } from "../../behaviors/direction.js";
|
|
6
7
|
const baseClass = "ds-artifact-card";
|
|
8
|
+
const cueIcon = (open) => open ? "right_panel_close" : "right_panel_open";
|
|
7
9
|
const ArtifactCard = React.forwardRef(
|
|
8
10
|
({ title, meta, icon = "draft", open = false, className = "", ...rest }, ref) => /* @__PURE__ */ jsxs(
|
|
9
11
|
"button",
|
|
@@ -19,7 +21,7 @@ const ArtifactCard = React.forwardRef(
|
|
|
19
21
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__title`, children: title }),
|
|
20
22
|
meta && /* @__PURE__ */ jsx("span", { className: `${baseClass}__meta`, children: meta })
|
|
21
23
|
] }),
|
|
22
|
-
/* @__PURE__ */ jsx("span", { className: `${baseClass}__cue material-symbols-rounded`, "aria-hidden": "true", children: open
|
|
24
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__cue material-symbols-rounded ${mirrorClass(cueIcon(open))}`, "aria-hidden": "true", children: cueIcon(open) })
|
|
23
25
|
]
|
|
24
26
|
}
|
|
25
27
|
)
|
|
@@ -114,8 +114,11 @@
|
|
|
114
114
|
}
|
|
115
115
|
|
|
116
116
|
/* The passive ramp is a ghost family meant to paint over a surface, so
|
|
117
|
-
the floating pill supplies its own:
|
|
118
|
-
|
|
117
|
+
the floating pill supplies its own: the app surface + border below, the
|
|
118
|
+
passive layer above stepping through rest, hover, and active. Opaque, so
|
|
119
|
+
the text scrolling under it never shows through (the container surface
|
|
120
|
+
is translucent in dark mode), and never frosted: the thread's edge-fade
|
|
121
|
+
mask stops a backdrop blur inside the scroller from seeing that text. */
|
|
119
122
|
.ds-chat-thread__jump {
|
|
120
123
|
display: flex;
|
|
121
124
|
align-items: center;
|
|
@@ -127,7 +130,7 @@
|
|
|
127
130
|
padding: 0;
|
|
128
131
|
border: var(--border-025) solid var(--color-bg-container-border);
|
|
129
132
|
border-radius: var(--radius-pill);
|
|
130
|
-
background-color: var(--color-bg-
|
|
133
|
+
background-color: var(--color-bg-app-surface);
|
|
131
134
|
background-image: linear-gradient(
|
|
132
135
|
var(--color-action-passive-bg),
|
|
133
136
|
var(--color-action-passive-bg)
|
package/components/Chip/Chip.css
CHANGED
|
@@ -27,6 +27,11 @@
|
|
|
27
27
|
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
28
28
|
color: var(--color-text-secondary);
|
|
29
29
|
white-space: nowrap;
|
|
30
|
+
/* Never wider than its container: a label too long for the room ends in an
|
|
31
|
+
ellipsis rather than running past the edge. Suggestion copy is held to a
|
|
32
|
+
budget that fits a phone (SUGGESTION_MAX_CHARS), so this is the net, not
|
|
33
|
+
the plan. */
|
|
34
|
+
max-width: 100%;
|
|
30
35
|
|
|
31
36
|
transition: background-color var(--motion-duration-base) var(--motion-ease-standard), border-color var(--motion-duration-base) var(--motion-ease-standard),
|
|
32
37
|
color var(--motion-duration-base) var(--motion-ease-standard), opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
@@ -99,7 +104,10 @@
|
|
|
99
104
|
============================================ */
|
|
100
105
|
|
|
101
106
|
.ds-chip__label {
|
|
102
|
-
|
|
107
|
+
/* The label gives way before the icon or the remove button does. */
|
|
108
|
+
min-width: 0;
|
|
109
|
+
overflow: hidden;
|
|
110
|
+
text-overflow: ellipsis;
|
|
103
111
|
}
|
|
104
112
|
|
|
105
113
|
/* ============================================
|
|
@@ -81,6 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
.ds-code-block__filename {
|
|
83
83
|
font-family: var(--font-family-code);
|
|
84
|
+
font-size-adjust: var(--font-code-aspect);
|
|
84
85
|
font-size: var(--font-paragraph-sm-size);
|
|
85
86
|
line-height: var(--font-paragraph-sm-line-height);
|
|
86
87
|
color: var(--color-text-secondary);
|
|
@@ -173,6 +174,7 @@
|
|
|
173
174
|
|
|
174
175
|
.ds-code-block__code {
|
|
175
176
|
font-family: var(--font-family-code);
|
|
177
|
+
font-size-adjust: var(--font-code-aspect);
|
|
176
178
|
font-size: var(--font-paragraph-sm-size);
|
|
177
179
|
line-height: var(--font-paragraph-sm-line-height);
|
|
178
180
|
color: var(--color-text-primary);
|
|
@@ -10,9 +10,12 @@
|
|
|
10
10
|
display: flex;
|
|
11
11
|
flex-direction: column;
|
|
12
12
|
width: 100%;
|
|
13
|
-
border: var(--
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
border: var(--ds-chat-card-border);
|
|
14
|
+
/* A diff a reply carries is one of the chat cards, on their fill, but its
|
|
15
|
+
rows run to its edges, so it keeps the code family's 12px corner: a
|
|
16
|
+
24px curve would cut into the tinted lines and crowd the file row. */
|
|
17
|
+
border-radius: var(--ds-chat-card-radius-edge);
|
|
18
|
+
background-color: var(--ds-chat-card-bg);
|
|
16
19
|
overflow: hidden;
|
|
17
20
|
}
|
|
18
21
|
|
|
@@ -25,16 +28,22 @@
|
|
|
25
28
|
align-items: center;
|
|
26
29
|
justify-content: space-between;
|
|
27
30
|
gap: var(--gap-200);
|
|
28
|
-
|
|
31
|
+
/* One row at the chat cards' one-row height, on their 20px inset. */
|
|
32
|
+
box-sizing: border-box;
|
|
33
|
+
min-height: var(--ds-chat-card-row-height);
|
|
34
|
+
padding: var(--ds-chat-card-row-pad) var(--ds-chat-card-inset);
|
|
29
35
|
border-bottom: var(--border-025) solid var(--color-bg-container-border);
|
|
30
36
|
flex-shrink: 0;
|
|
31
37
|
}
|
|
32
38
|
|
|
33
39
|
.ds-codediff__filename {
|
|
34
|
-
|
|
35
|
-
font-
|
|
36
|
-
|
|
37
|
-
|
|
40
|
+
/* The file row's label, set like every chat card's one-row label. */
|
|
41
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
42
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
43
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
44
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
45
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
46
|
+
color: var(--color-text-primary);
|
|
38
47
|
overflow: hidden;
|
|
39
48
|
text-overflow: ellipsis;
|
|
40
49
|
white-space: nowrap;
|
|
@@ -89,6 +98,7 @@
|
|
|
89
98
|
width: max-content;
|
|
90
99
|
min-width: 100%;
|
|
91
100
|
font-family: var(--font-family-code);
|
|
101
|
+
font-size-adjust: var(--font-code-aspect);
|
|
92
102
|
font-size: var(--font-paragraph-sm-size);
|
|
93
103
|
line-height: var(--font-paragraph-sm-line-height);
|
|
94
104
|
color: var(--color-text-primary);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import "./CodeDiff.css";
|
|
4
|
+
import "../../behaviors/chat-card.css";
|
|
4
5
|
import "../../behaviors/visually-hidden.css";
|
|
5
6
|
const HUNK_HEADER = /^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?\s+@@/;
|
|
6
7
|
function parseUnifiedDiff(diff) {
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
border: var(--border-025) solid var(--color-input-border-primary);
|
|
43
43
|
border-radius: var(--ds-composer-radius);
|
|
44
44
|
/* Where the typed text starts and ends. One value, because the mention
|
|
45
|
-
overlay has to sit on exactly the rail the textarea does.
|
|
45
|
+
overlay has to sit on exactly the rail the textarea does. The mini
|
|
46
|
+
composer keeps this; the two-row composer and the chat row set the
|
|
47
|
+
optical rail below. */
|
|
46
48
|
--ds-composer-text-inset: var(--padding-500);
|
|
47
49
|
box-shadow: var(--shadow-floating);
|
|
48
50
|
transition: border-color var(--motion-duration-fast) var(--motion-ease-standard);
|
|
@@ -226,6 +228,13 @@
|
|
|
226
228
|
}
|
|
227
229
|
}
|
|
228
230
|
|
|
231
|
+
/* The two-row composer's optical rail: the footer's --padding-200 ring plus
|
|
232
|
+
the --padding-400 pill inset, where a ModelPicker trigger's label and the
|
|
233
|
+
context chip's icon ink also start, so the three read as one column. */
|
|
234
|
+
.ds-composer:not(.ds-composer--inline) {
|
|
235
|
+
--ds-composer-text-inset: calc(var(--padding-200) + var(--padding-400));
|
|
236
|
+
}
|
|
237
|
+
|
|
229
238
|
/* ============================================
|
|
230
239
|
CONTEXT CHIP
|
|
231
240
|
A full-width, non-interactive note — what the model is currently looking
|
|
@@ -241,6 +250,9 @@
|
|
|
241
250
|
gap: var(--gap-100);
|
|
242
251
|
/* The action bar's tight --padding-200 ring, open toward the text below */
|
|
243
252
|
margin: var(--padding-200) var(--padding-200) 0;
|
|
253
|
+
/* A flex item in the one-row composer: without this, a long note widens
|
|
254
|
+
the chip to its text instead of ellipsizing inside the shell */
|
|
255
|
+
min-width: 0;
|
|
244
256
|
/* ModelPicker's trigger geometry — the send button's height with the same
|
|
245
257
|
0/padding-md inset — so the chip and the bar's pills read as one family */
|
|
246
258
|
height: var(--ds-composer-send-size);
|
|
@@ -277,8 +289,8 @@
|
|
|
277
289
|
of the shell's top edge, and the layout aligns on one optical rail: the
|
|
278
290
|
bar's --padding-200 ring plus the --padding-400 pill inset (24px). The
|
|
279
291
|
typed text, the attachments, the chip's icon ink and a ModelPicker
|
|
280
|
-
trigger's label all start on it
|
|
281
|
-
|
|
292
|
+
trigger's label all start on it, the same rail the inside placement
|
|
293
|
+
keeps. */
|
|
282
294
|
|
|
283
295
|
/* The bar and the shell travel as one block, so a host's gap never lands
|
|
284
296
|
between them */
|
|
@@ -299,19 +311,15 @@
|
|
|
299
311
|
calc(var(--padding-200) + var(--padding-400) + var(--border-025));
|
|
300
312
|
}
|
|
301
313
|
|
|
302
|
-
/* Optical alignment: a glyph's ink starts inside its
|
|
303
|
-
pulled back by that side bearing to land the ink on
|
|
304
|
-
default fits the portrait document glyphs a context
|
|
305
|
-
carries (ink starts 4/24 into the box); the fallback is a
|
|
306
|
-
for a glyph with a different bearing. */
|
|
307
|
-
.ds-composer__context
|
|
314
|
+
/* Optical alignment, in either placement: a glyph's ink starts inside its
|
|
315
|
+
box, so the box is pulled back by that side bearing to land the ink on
|
|
316
|
+
the text rail. The default fits the portrait document glyphs a context
|
|
317
|
+
note usually carries (ink starts 4/24 into the box); the fallback is a
|
|
318
|
+
consumer hook for a glyph with a different bearing. */
|
|
319
|
+
.ds-composer__context-icon {
|
|
308
320
|
margin-inline-start: calc(-1 * var(--ds-composer-context-icon-bearing, var(--icon-size-500) * 4 / 24));
|
|
309
321
|
}
|
|
310
322
|
|
|
311
|
-
.ds-composer--context-above {
|
|
312
|
-
--ds-composer-text-inset: calc(var(--padding-200) + var(--padding-400));
|
|
313
|
-
}
|
|
314
|
-
|
|
315
323
|
.ds-composer--context-above .ds-composer__attachments {
|
|
316
324
|
padding-inline: var(--ds-composer-text-inset);
|
|
317
325
|
}
|
|
@@ -325,6 +333,18 @@
|
|
|
325
333
|
white-space: nowrap;
|
|
326
334
|
}
|
|
327
335
|
|
|
336
|
+
/* The clear button ends the chip, pulled into the pill's end padding so its
|
|
337
|
+
circle sits concentric with the pill's end cap. */
|
|
338
|
+
.ds-composer__context-clear {
|
|
339
|
+
flex-shrink: 0;
|
|
340
|
+
margin-inline-start: auto;
|
|
341
|
+
margin-inline-end: calc(var(--padding-400) * -1 + (var(--ds-composer-send-size) - var(--control-height-compact)) / 2);
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
.ds-composer__context--above .ds-composer__context-clear {
|
|
345
|
+
margin-inline-end: calc(var(--padding-400) * -1 + (var(--control-height-default) - var(--control-height-compact)) / 2);
|
|
346
|
+
}
|
|
347
|
+
|
|
328
348
|
/* ============================================
|
|
329
349
|
FILE TRAY
|
|
330
350
|
The queued files: one row of square tiles that scrolls sideways rather
|
|
@@ -748,3 +768,22 @@
|
|
|
748
768
|
.ds-composer--inline-chat .ds-composer__footer {
|
|
749
769
|
padding: var(--ds-composer-ring);
|
|
750
770
|
}
|
|
771
|
+
|
|
772
|
+
/* The chat row's rail: its own ring plus the chip's pill inset, so the
|
|
773
|
+
typed text and the chip's icon ink start together here too. */
|
|
774
|
+
.ds-composer--inline-chat {
|
|
775
|
+
--ds-composer-text-inset: calc(var(--ds-composer-ring) + var(--padding-400));
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
/* A context note inside the chat row takes a line of its own over the text
|
|
779
|
+
and the send button, so a note alone never brings the footer's empty
|
|
780
|
+
row. The chip sits on the row's ring, and since it is the send button's
|
|
781
|
+
height the shell's corner stays concentric with both. */
|
|
782
|
+
.ds-composer--inline-chat {
|
|
783
|
+
flex-wrap: wrap;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
.ds-composer--inline-chat .ds-composer__context {
|
|
787
|
+
flex-basis: 100%;
|
|
788
|
+
margin: var(--ds-composer-ring) var(--ds-composer-ring) 0;
|
|
789
|
+
}
|
|
@@ -34,7 +34,7 @@ type ComposerOwnProps = {
|
|
|
34
34
|
onStop?: () => void;
|
|
35
35
|
/** The mini composer's density (`inline` as `true`), matching a table's or a bar's: `compact` takes the smaller text, height and button. Every other composer has the one size, so it ignores this. */
|
|
36
36
|
size?: 'default' | 'compact';
|
|
37
|
-
/** One row with the send button on the text's line. `true` makes the shell exactly `size`'s control height, so it lines up with an Input or a table's toolbar: the mini composer, for AI input inside other content such as a table, never for a chat. `chat` gives the button a full-size control and room around it: for a chat with nothing to seat in a footer. Above one row (`maxRows`), typing grows the shell with the send button held in the bottom corner. A placeholder stays on one line and ends in an ellipsis. */
|
|
37
|
+
/** One row with the send button on the text's line. `true` makes the shell exactly `size`'s control height, so it lines up with an Input or a table's toolbar: the mini composer, for AI input inside other content such as a table, never for a chat. `chat` gives the button a full-size control and room around it: for a chat with nothing to seat in a footer, where a `context` note inside takes a line of its own over the row. Above one row (`maxRows`), typing grows the shell with the send button held in the bottom corner. A placeholder stays on one line and ends in an ellipsis. */
|
|
38
38
|
inline?: boolean | 'chat';
|
|
39
39
|
/** Growth cap in text rows before the textarea scrolls internally. Defaults to 12 in a chat composer, or 3 in the mini composer. */
|
|
40
40
|
maxRows?: number;
|
|
@@ -71,6 +71,14 @@ type ComposerOwnProps = {
|
|
|
71
71
|
* convention.
|
|
72
72
|
*/
|
|
73
73
|
contextIcon?: string | React.ReactNode;
|
|
74
|
+
/**
|
|
75
|
+
* Called by the context chip's clear button, which appears only when this
|
|
76
|
+
* is set: for a host whose note follows something the reader focused (a
|
|
77
|
+
* selection, a highlighted passage) and can go back to the page as a whole.
|
|
78
|
+
*/
|
|
79
|
+
onContextClear?: () => void;
|
|
80
|
+
/** The accessible name of the context chip's clear button. Defaults to "Clear context". */
|
|
81
|
+
contextClearLabel?: string;
|
|
74
82
|
/**
|
|
75
83
|
* The files queued on this message, drawn as a scrolling row of square
|
|
76
84
|
* tiles above the textarea. Controlled by the caller: Composer draws the
|
|
@@ -41,6 +41,8 @@ const Composer = React.forwardRef(
|
|
|
41
41
|
context,
|
|
42
42
|
contextIcon,
|
|
43
43
|
contextPlacement = "inside",
|
|
44
|
+
onContextClear,
|
|
45
|
+
contextClearLabel = "Clear context",
|
|
44
46
|
files,
|
|
45
47
|
onFilesSelected,
|
|
46
48
|
onFileRemove,
|
|
@@ -385,7 +387,23 @@ const Composer = React.forwardRef(
|
|
|
385
387
|
onClick: contextAbove ? handleShellClick : void 0,
|
|
386
388
|
children: [
|
|
387
389
|
contextIcon && /* @__PURE__ */ jsx("span", { className: `${baseClass}__context-icon`, "aria-hidden": "true", children: typeof contextIcon === "string" ? /* @__PURE__ */ jsx("span", { className: `material-symbols-rounded ${mirrorClass(contextIcon)}`, children: contextIcon }) : contextIcon }),
|
|
388
|
-
/* @__PURE__ */ jsx("span", { className: `${baseClass}__context-text`, children: context })
|
|
390
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__context-text`, children: context }),
|
|
391
|
+
onContextClear && /* @__PURE__ */ jsx(
|
|
392
|
+
CircularButton,
|
|
393
|
+
{
|
|
394
|
+
icon: "close",
|
|
395
|
+
variant: "tertiary",
|
|
396
|
+
tone: "neutral",
|
|
397
|
+
size: "compact",
|
|
398
|
+
ariaLabel: contextClearLabel,
|
|
399
|
+
tooltip: false,
|
|
400
|
+
className: `${baseClass}__context-clear`,
|
|
401
|
+
onClick: (event) => {
|
|
402
|
+
event.stopPropagation();
|
|
403
|
+
onContextClear();
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
)
|
|
389
407
|
]
|
|
390
408
|
}
|
|
391
409
|
) : null;
|
|
@@ -28,7 +28,9 @@ function FilterEditor({
|
|
|
28
28
|
size = "compact",
|
|
29
29
|
onChange
|
|
30
30
|
}) {
|
|
31
|
-
const operators = OPERATORS[column.kind];
|
|
31
|
+
const operators = OPERATORS[column.kind].includes(filter.operator) || VALUELESS.has(filter.operator) ? OPERATORS[column.kind] : [...OPERATORS[column.kind], filter.operator];
|
|
32
|
+
const [held] = useState(() => Array.isArray(filter.value) ? filter.value.map((value2) => ({ value: value2, label: value2 })) : []);
|
|
33
|
+
const choices = column.options?.length ? column.options : held;
|
|
32
34
|
const setValue = (value2) => onChange({ ...filter, value: value2 });
|
|
33
35
|
const pair = Array.isArray(filter.value) && filter.operator === "between" ? filter.value : [null, null];
|
|
34
36
|
const valueName = labels.valueField(column.label);
|
|
@@ -38,7 +40,7 @@ function FilterEditor({
|
|
|
38
40
|
return /* @__PURE__ */ jsx(
|
|
39
41
|
ChoiceList,
|
|
40
42
|
{
|
|
41
|
-
options:
|
|
43
|
+
options: choices,
|
|
42
44
|
value: Array.isArray(filter.value) ? filter.value : [],
|
|
43
45
|
onChange: setValue,
|
|
44
46
|
size,
|
|
@@ -30,6 +30,14 @@ export interface Filter {
|
|
|
30
30
|
}
|
|
31
31
|
/** Each kind's operators, in menu order; the first is the one a new filter starts with. */
|
|
32
32
|
export declare const OPERATORS: Record<FilterKind, FilterOperator[]>;
|
|
33
|
+
/**
|
|
34
|
+
* Operators a view may set on a column that its menu does not offer. A list on
|
|
35
|
+
* a text column is how a host shows these rows (an id isAnyOf the ones a reader
|
|
36
|
+
* ticked or changed) or turns a top-N into a filter; nobody types a list into a
|
|
37
|
+
* text field, so the menu leaves it out, and the editor lists the values the
|
|
38
|
+
* filter holds so each can be unticked.
|
|
39
|
+
*/
|
|
40
|
+
export declare const VIEW_OPERATORS: Partial<Record<FilterKind, readonly FilterOperator[]>>;
|
|
33
41
|
/** Operators that take no value. */
|
|
34
42
|
export declare const VALUELESS: ReadonlySet<FilterOperator>;
|
|
35
43
|
/** Every word a filter shows or announces, each defaulting to English. */
|
|
@@ -8,6 +8,9 @@ const OPERATORS = {
|
|
|
8
8
|
tags: ["hasAnyOf", "hasAllOf", "hasNoneOf"],
|
|
9
9
|
boolean: ["isChecked", "isNotChecked"]
|
|
10
10
|
};
|
|
11
|
+
const VIEW_OPERATORS = {
|
|
12
|
+
text: ["isAnyOf", "isNoneOf"]
|
|
13
|
+
};
|
|
11
14
|
const VALUELESS = /* @__PURE__ */ new Set(["isEmpty", "isNotEmpty", "isChecked", "isNotChecked"]);
|
|
12
15
|
const DEFAULT_FILTER_LABELS = {
|
|
13
16
|
operators: {
|
|
@@ -152,6 +155,7 @@ export {
|
|
|
152
155
|
DEFAULT_FILTER_LABELS,
|
|
153
156
|
OPERATORS,
|
|
154
157
|
VALUELESS,
|
|
158
|
+
VIEW_OPERATORS,
|
|
155
159
|
isComplete,
|
|
156
160
|
kindOf,
|
|
157
161
|
matches,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OPERATORS, VALUELESS } from "./filterModel.js";
|
|
1
|
+
import { OPERATORS, VALUELESS, VIEW_OPERATORS } from "./filterModel.js";
|
|
2
2
|
function slotStartingView(toolbar) {
|
|
3
3
|
if (!toolbar || typeof toolbar !== "object" || !("props" in toolbar)) return void 0;
|
|
4
4
|
const props = toolbar.props;
|
|
@@ -17,7 +17,7 @@ function reconcileView(view, columns) {
|
|
|
17
17
|
const col = byKey.get(filter.column);
|
|
18
18
|
if (!col) return false;
|
|
19
19
|
if (!col.filterKind) return true;
|
|
20
|
-
return OPERATORS[col.filterKind].includes(filter.operator) || VALUELESS.has(filter.operator);
|
|
20
|
+
return OPERATORS[col.filterKind].includes(filter.operator) || VALUELESS.has(filter.operator) || Boolean(VIEW_OPERATORS[col.filterKind]?.includes(filter.operator)) && Array.isArray(filter.value);
|
|
21
21
|
});
|
|
22
22
|
if (view.search !== void 0) next.search = view.search;
|
|
23
23
|
if (view.hiddenColumns) next.hiddenColumns = view.hiddenColumns.filter(known);
|
|
@@ -19,7 +19,9 @@
|
|
|
19
19
|
border-radius: var(--radius-300);
|
|
20
20
|
background-color: var(--color-bg-container-primary);
|
|
21
21
|
|
|
22
|
-
transition:
|
|
22
|
+
transition:
|
|
23
|
+
border-color var(--motion-duration-base) var(--motion-ease-standard),
|
|
24
|
+
background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
23
25
|
}
|
|
24
26
|
|
|
25
27
|
/* ============================================
|
|
@@ -60,7 +62,25 @@
|
|
|
60
62
|
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
61
63
|
}
|
|
62
64
|
|
|
63
|
-
|
|
65
|
+
/* A clickable chip is one target: the body button's hit area stretches over
|
|
66
|
+
the whole tile, and the tile itself takes the hover fill and the focus
|
|
67
|
+
ring. The remove button sits above the stretch, a target of its own. */
|
|
68
|
+
.ds-document-chip--clickable {
|
|
69
|
+
position: relative;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.ds-document-chip--clickable .ds-document-chip__main::after {
|
|
73
|
+
content: '';
|
|
74
|
+
position: absolute;
|
|
75
|
+
inset: 0;
|
|
76
|
+
border-radius: var(--radius-300);
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
.ds-document-chip--clickable .ds-document-chip__remove {
|
|
80
|
+
position: relative;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.ds-document-chip--clickable:has(.ds-document-chip__main:hover) {
|
|
64
84
|
background-color: var(--color-bg-container-secondary);
|
|
65
85
|
}
|
|
66
86
|
|
|
@@ -174,7 +194,11 @@
|
|
|
174
194
|
FOCUS
|
|
175
195
|
============================================ */
|
|
176
196
|
|
|
177
|
-
.ds-document-chip__main:focus-visible
|
|
197
|
+
.ds-document-chip__main:focus-visible {
|
|
198
|
+
outline: none;
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
.ds-document-chip--clickable:has(.ds-document-chip__main:focus-visible),
|
|
178
202
|
.ds-document-chip__remove:focus-visible {
|
|
179
203
|
outline: 2px solid var(--color-action-primary-bg);
|
|
180
204
|
outline-offset: -2px;
|