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
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
display: flex;
|
|
18
18
|
flex-direction: column;
|
|
19
19
|
width: 100%;
|
|
20
|
-
background-color: var(--
|
|
21
|
-
border: var(--
|
|
20
|
+
background-color: var(--ds-chat-card-bg);
|
|
21
|
+
border: var(--ds-chat-card-border);
|
|
22
22
|
/* The chat furniture's shared 24px shell — see ToolCall. */
|
|
23
|
-
border-radius: var(--radius
|
|
23
|
+
border-radius: var(--ds-chat-card-radius);
|
|
24
24
|
overflow: hidden;
|
|
25
25
|
}
|
|
26
26
|
|
|
@@ -40,15 +40,27 @@
|
|
|
40
40
|
display: flex;
|
|
41
41
|
align-items: flex-start;
|
|
42
42
|
gap: var(--gap-200);
|
|
43
|
-
|
|
43
|
+
/* 8px under the text: with the next section's 8px above, every seam in
|
|
44
|
+
the card is 16px, MessageCard's body-to-actions distance; 12px at
|
|
45
|
+
the card's top and bottom edges, every chat card's. */
|
|
46
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset) var(--padding-200);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/* A section that closes the card takes the full bottom padding back. */
|
|
50
|
+
.ds-interrupt-card__header:last-child,
|
|
51
|
+
.ds-interrupt-card__detail:last-child {
|
|
52
|
+
padding-bottom: var(--ds-chat-card-edge);
|
|
44
53
|
}
|
|
45
54
|
|
|
46
55
|
.ds-interrupt-card__icon {
|
|
47
56
|
display: inline-flex;
|
|
48
57
|
align-items: center;
|
|
49
58
|
flex: none;
|
|
59
|
+
/* A title's icon trails it, so the card's text starts on its inset edge. */
|
|
60
|
+
order: 1;
|
|
61
|
+
margin-inline-start: auto;
|
|
50
62
|
/* Centre the icon on the title's first line. */
|
|
51
|
-
margin-top: calc((var(--font-
|
|
63
|
+
margin-top: calc((var(--font-title-body-line-height) - var(--icon-size-500)) / 2);
|
|
52
64
|
color: var(--ds-interrupt-card-color);
|
|
53
65
|
}
|
|
54
66
|
|
|
@@ -59,19 +71,20 @@
|
|
|
59
71
|
.ds-interrupt-card__heading {
|
|
60
72
|
display: flex;
|
|
61
73
|
flex-direction: column;
|
|
62
|
-
|
|
74
|
+
/* The description is the title's subline, set straight under it. */
|
|
75
|
+
gap: var(--ds-chat-card-gap-subline);
|
|
63
76
|
min-width: 0;
|
|
64
77
|
}
|
|
65
78
|
|
|
66
|
-
/* The
|
|
67
|
-
|
|
79
|
+
/* The chat cards share one title tier, the scale's card-title role:
|
|
80
|
+
a heading tier inside a reply would outrank the reply's own text. */
|
|
68
81
|
.ds-interrupt-card__title {
|
|
69
|
-
font-family: var(--font-
|
|
70
|
-
font-size: var(--font-
|
|
71
|
-
font-weight: var(--font-
|
|
72
|
-
line-height: var(--font-
|
|
73
|
-
letter-spacing: var(--font-
|
|
74
|
-
color: var(--color-text-
|
|
82
|
+
font-family: var(--font-title-body-family);
|
|
83
|
+
font-size: var(--font-title-body-size);
|
|
84
|
+
font-weight: var(--font-title-body-weight);
|
|
85
|
+
line-height: var(--font-title-body-line-height);
|
|
86
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
87
|
+
color: var(--color-text-primary);
|
|
75
88
|
}
|
|
76
89
|
|
|
77
90
|
.ds-interrupt-card__description {
|
|
@@ -91,7 +104,9 @@
|
|
|
91
104
|
============================================ */
|
|
92
105
|
|
|
93
106
|
.ds-interrupt-card__detail {
|
|
94
|
-
|
|
107
|
+
/* Under the heading's 8px, so what the question covers sits 8px under
|
|
108
|
+
it like the description does; 8px below meets the footer's 8px. */
|
|
109
|
+
padding: 0 var(--ds-chat-card-inset) var(--padding-200);
|
|
95
110
|
}
|
|
96
111
|
|
|
97
112
|
.ds-interrupt-card__detail > :first-child {
|
|
@@ -102,6 +117,66 @@
|
|
|
102
117
|
margin-bottom: 0;
|
|
103
118
|
}
|
|
104
119
|
|
|
120
|
+
/* No card in a card: the ToolCall the question covers sheds its shell and
|
|
121
|
+
its rows sit on this card's inset, so the call reads as a line of the
|
|
122
|
+
question rather than a card inside it. */
|
|
123
|
+
.ds-interrupt-card__detail > .ds-tool-call {
|
|
124
|
+
border: none;
|
|
125
|
+
border-radius: 0;
|
|
126
|
+
background-color: transparent;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content,
|
|
130
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__actions {
|
|
131
|
+
padding-inline: 0;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* The call is a line of the question here, not a row of its own. */
|
|
135
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__header {
|
|
136
|
+
min-height: 0;
|
|
137
|
+
padding: 0;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__header:hover {
|
|
141
|
+
background-color: transparent;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* The call's details, opened. A card has one footer and the decision owns
|
|
145
|
+
it, so the code does not bring a footer of its own: it sits in a quiet
|
|
146
|
+
well (the fill one step in from the card's, at MessageCard's media-slot
|
|
147
|
+
corner, no border, so a slot rather than a card) with Copy in the well's
|
|
148
|
+
corner, and the panel drops its divider, the card's only rule. */
|
|
149
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content {
|
|
150
|
+
padding-block: var(--ds-chat-card-gap-text) 0;
|
|
151
|
+
border-top: none;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content > .ds-code-block {
|
|
155
|
+
position: relative;
|
|
156
|
+
border-radius: var(--ds-chat-card-radius-edge);
|
|
157
|
+
background-color: var(--color-bg-container-secondary);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content > .ds-code-block .ds-code-block__header {
|
|
161
|
+
position: absolute;
|
|
162
|
+
inset-block-start: var(--padding-200);
|
|
163
|
+
inset-inline-end: var(--padding-200);
|
|
164
|
+
margin: 0;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
/* CodeBlock's own quiet copy, not the footer button a lone ToolCall
|
|
168
|
+
draws, since the well is not a footer. */
|
|
169
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content > .ds-code-block .ds-code-block__copy {
|
|
170
|
+
height: auto;
|
|
171
|
+
padding: var(--padding-050) var(--padding-200);
|
|
172
|
+
border: none;
|
|
173
|
+
color: var(--color-text-secondary);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.ds-interrupt-card__detail > .ds-tool-call .ds-tool-call__content > .ds-code-block .ds-code-block__pre {
|
|
177
|
+
padding: var(--ds-chat-card-edge);
|
|
178
|
+
}
|
|
179
|
+
|
|
105
180
|
/* ============================================
|
|
106
181
|
OPTIONS
|
|
107
182
|
Mirrors ToolCall's actions footer exactly, so
|
|
@@ -114,34 +189,21 @@
|
|
|
114
189
|
align-items: center;
|
|
115
190
|
justify-content: flex-start;
|
|
116
191
|
gap: var(--gap-200);
|
|
117
|
-
padding: var(--padding-200) var(--
|
|
192
|
+
padding: var(--padding-200) var(--ds-chat-card-inset) var(--ds-chat-card-edge);
|
|
118
193
|
}
|
|
119
194
|
|
|
120
195
|
/* ============================================
|
|
121
|
-
ANSWERED
|
|
122
|
-
Same footer geometry,
|
|
123
|
-
buttons were.
|
|
196
|
+
ANSWERED
|
|
197
|
+
Same footer geometry, a status badge where
|
|
198
|
+
the buttons were.
|
|
124
199
|
============================================ */
|
|
125
200
|
|
|
126
201
|
.ds-interrupt-card__answer {
|
|
127
202
|
display: flex;
|
|
128
203
|
align-items: center;
|
|
129
204
|
justify-content: flex-start;
|
|
130
|
-
|
|
131
|
-
padding: var(--padding-200) var(--
|
|
132
|
-
font-family: var(--font-paragraph-sm-family);
|
|
133
|
-
font-size: var(--font-paragraph-sm-size);
|
|
134
|
-
font-weight: var(--font-paragraph-sm-weight);
|
|
135
|
-
line-height: var(--font-paragraph-sm-line-height);
|
|
136
|
-
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
137
|
-
color: var(--color-text-secondary);
|
|
138
|
-
}
|
|
139
|
-
|
|
140
|
-
.ds-interrupt-card__answer-icon {
|
|
141
|
-
--icon-size: var(--icon-size-500);
|
|
142
|
-
|
|
143
|
-
flex: none;
|
|
144
|
-
color: var(--ds-interrupt-card-color);
|
|
205
|
+
/* The footer's geometry, with the badge where the buttons were. */
|
|
206
|
+
padding: var(--padding-200) var(--ds-chat-card-inset) var(--ds-chat-card-edge);
|
|
145
207
|
}
|
|
146
208
|
|
|
147
209
|
/* ============================================
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/** The status an answered card records: an approval, a refusal, or neither. */
|
|
3
|
+
export type InterruptCardAnsweredVariant = 'positive' | 'error' | 'neutral';
|
|
2
4
|
/** One choice the card offers, rendered as a Button in the options footer. */
|
|
3
5
|
export interface InterruptCardOption {
|
|
4
6
|
/** Value passed to `onValueChange` when this option is chosen. */
|
|
@@ -13,6 +15,18 @@ export interface InterruptCardOption {
|
|
|
13
15
|
variant?: 'primary' | 'secondary' | 'danger';
|
|
14
16
|
/** Colour, passed to the option's Button: `destructive` for dangerous approvals. */
|
|
15
17
|
tone?: 'default' | 'destructive';
|
|
18
|
+
/**
|
|
19
|
+
* The status the answered card's read-out takes once this option is chosen.
|
|
20
|
+
* Defaults to `positive` for a `primary` option, `error` for a destructive
|
|
21
|
+
* one and `neutral` for the rest; set `error` on a refusal such as "Deny".
|
|
22
|
+
*/
|
|
23
|
+
answeredVariant?: InterruptCardAnsweredVariant;
|
|
24
|
+
/**
|
|
25
|
+
* What the answered card's read-out says once this option is chosen,
|
|
26
|
+
* written as the decision made rather than the button pressed, e.g.
|
|
27
|
+
* "Denied" for "Deny". Defaults to `label`.
|
|
28
|
+
*/
|
|
29
|
+
answeredLabel?: string;
|
|
16
30
|
}
|
|
17
31
|
/** Props owned by InterruptCard itself — everything else falls through to the root element. */
|
|
18
32
|
type InterruptCardOwnProps = {
|
|
@@ -31,10 +45,11 @@ type InterruptCardOwnProps = {
|
|
|
31
45
|
onValueChange?: (value: string) => void;
|
|
32
46
|
/**
|
|
33
47
|
* The already-chosen value. When set, the card renders its answered state:
|
|
34
|
-
* the options
|
|
48
|
+
* the options give way to the chosen one's read-out, worded as the
|
|
49
|
+
* decision made, in the status that choice records.
|
|
35
50
|
*/
|
|
36
51
|
value?: string;
|
|
37
|
-
/** Override the
|
|
52
|
+
/** Override the answered read-out's text (default: the chosen option's `answeredLabel`, then its label). */
|
|
38
53
|
answeredLabel?: string;
|
|
39
54
|
/** Visually hidden status announced while the card waits for a decision. Defaults to "Waiting for your decision". */
|
|
40
55
|
waitingLabel?: string;
|
|
@@ -57,7 +72,9 @@ export interface InterruptCardProps extends InterruptCardOwnProps, Omit<React.Co
|
|
|
57
72
|
*
|
|
58
73
|
* The card stays quiet in both states: one tone, the standard container
|
|
59
74
|
* border, options in a footer outside the content. Once `value` is set the
|
|
60
|
-
* decision is made
|
|
75
|
+
* decision is made: the buttons give way to the chosen one's read-out, a
|
|
76
|
+
* compact button's size and shape in the status the option records
|
|
77
|
+
* (`answeredVariant`); a visually hidden
|
|
61
78
|
* status announcement carries the waiting state for screen readers.
|
|
62
79
|
*
|
|
63
80
|
* Fully controlled: the card never stores the answer itself — `onValueChange`
|
|
@@ -2,14 +2,23 @@ import { jsxs, jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Button } from "../Button/Button.js";
|
|
4
4
|
import "./InterruptCard.css";
|
|
5
|
+
import "../../behaviors/chat-card.css";
|
|
5
6
|
import "../../behaviors/visually-hidden.css";
|
|
6
7
|
import "../../fonts/material-symbols.css";
|
|
7
8
|
import { mirrorClass } from "../../behaviors/direction.js";
|
|
8
|
-
function
|
|
9
|
+
function answeredVariantOf(option) {
|
|
10
|
+
if (!option) return "neutral";
|
|
11
|
+
if (option.answeredVariant) return option.answeredVariant;
|
|
12
|
+
if (option.variant === "danger" || option.tone === "destructive") return "error";
|
|
13
|
+
return option.variant === "primary" ? "positive" : "neutral";
|
|
14
|
+
}
|
|
15
|
+
function optionButtonProps(option, wayOut = false) {
|
|
9
16
|
if (option.variant === "danger") {
|
|
10
17
|
return { variant: "secondary", tone: option.tone ?? "destructive" };
|
|
11
18
|
}
|
|
12
|
-
|
|
19
|
+
const variant = option.variant ?? "secondary";
|
|
20
|
+
const tone = option.tone ?? (wayOut && variant === "secondary" ? "neutral" : "default");
|
|
21
|
+
return { variant, tone };
|
|
13
22
|
}
|
|
14
23
|
const InterruptCard = React.forwardRef(
|
|
15
24
|
({
|
|
@@ -34,7 +43,8 @@ const InterruptCard = React.forwardRef(
|
|
|
34
43
|
bare ? `${baseClass}--bare` : "",
|
|
35
44
|
className
|
|
36
45
|
].filter(Boolean).join(" ");
|
|
37
|
-
const
|
|
46
|
+
const chosen = answered ? options?.find((option) => option.value === value) : void 0;
|
|
47
|
+
const echoedLabel = answeredLabel ?? chosen?.answeredLabel ?? chosen?.label ?? value;
|
|
38
48
|
return /* @__PURE__ */ jsxs("div", { ...rest, ref, role: "group", "aria-label": title, className: classes, children: [
|
|
39
49
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__header`, children: [
|
|
40
50
|
icon && /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: typeof icon === "string" ? /* @__PURE__ */ jsx("span", { className: `material-symbols-rounded ${mirrorClass(icon)}`, children: icon }) : icon }),
|
|
@@ -45,13 +55,18 @@ const InterruptCard = React.forwardRef(
|
|
|
45
55
|
!answered && /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", role: "status", children: waitingLabel })
|
|
46
56
|
] }),
|
|
47
57
|
children && /* @__PURE__ */ jsx("div", { className: `${baseClass}__detail`, children }),
|
|
48
|
-
answered ?
|
|
49
|
-
/*
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
answered ? (
|
|
59
|
+
/* The decision is made: the buttons give way to the chosen one's
|
|
60
|
+
read-out, a compact button's size and shape in the status that
|
|
61
|
+
choice records, behind a check (a cross for a refusal). */
|
|
62
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__answer`, children: /* @__PURE__ */ jsxs("span", { className: `ds-chat-card-readout ds-chat-card-readout--${answeredVariantOf(chosen)} ${baseClass}__readout ${baseClass}__readout--${answeredVariantOf(chosen)}`, children: [
|
|
63
|
+
/* @__PURE__ */ jsx("span", { className: `ds-chat-card-readout__icon ${baseClass}__readout-icon material-symbols-rounded`, "aria-hidden": "true", children: answeredVariantOf(chosen) === "error" ? "close" : "check" }),
|
|
64
|
+
echoedLabel
|
|
65
|
+
] }) })
|
|
66
|
+
) : options && options.length > 0 && /* @__PURE__ */ jsx("div", { className: `${baseClass}__options`, children: options.map((option, index) => /* @__PURE__ */ jsx(
|
|
52
67
|
Button,
|
|
53
68
|
{
|
|
54
|
-
...optionButtonProps(option),
|
|
69
|
+
...optionButtonProps(option, index === options.length - 1 && options.length >= 3),
|
|
55
70
|
size: "compact",
|
|
56
71
|
label: option.label,
|
|
57
72
|
onClick: () => onValueChange?.(option.value)
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
flex-direction: column;
|
|
17
17
|
width: 100%;
|
|
18
18
|
max-width: var(--ds-message-card-max-width, 100%);
|
|
19
|
-
background-color: var(--
|
|
20
|
-
border: var(--
|
|
21
|
-
border-radius: var(--radius
|
|
19
|
+
background-color: var(--ds-chat-card-bg);
|
|
20
|
+
border: var(--ds-chat-card-border);
|
|
21
|
+
border-radius: var(--ds-chat-card-radius);
|
|
22
22
|
overflow: hidden;
|
|
23
23
|
}
|
|
24
24
|
|
|
@@ -37,10 +37,9 @@
|
|
|
37
37
|
border-radius: var(--radius-300);
|
|
38
38
|
overflow: hidden;
|
|
39
39
|
/* The slot carries its own surface, so drawn media — a chart, an SVG —
|
|
40
|
-
reads as the same image-shaped panel a photo would
|
|
41
|
-
the
|
|
42
|
-
|
|
43
|
-
background-color: var(--color-bg-page-primary);
|
|
40
|
+
reads as the same image-shaped panel a photo would: one step in from
|
|
41
|
+
the card's crisp fill, so it shows as a slot in both themes. */
|
|
42
|
+
background-color: var(--color-bg-container-secondary);
|
|
44
43
|
}
|
|
45
44
|
|
|
46
45
|
.ds-message-card__media img {
|
|
@@ -71,14 +70,20 @@
|
|
|
71
70
|
.ds-message-card__body {
|
|
72
71
|
display: flex;
|
|
73
72
|
flex-direction: column;
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
/* Header, description and children are the card's body. */
|
|
74
|
+
gap: var(--ds-chat-card-gap-text);
|
|
75
|
+
padding: var(--padding-400) var(--ds-chat-card-inset) var(--padding-200);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
/* Without media the body opens the card, at the chat cards' 12px edge. */
|
|
79
|
+
.ds-message-card__body:first-child {
|
|
80
|
+
padding-top: var(--ds-chat-card-edge);
|
|
76
81
|
}
|
|
77
82
|
|
|
78
83
|
/* Without an actions footer the body closes the card, so it takes the full
|
|
79
84
|
bottom padding back. */
|
|
80
85
|
.ds-message-card__body:last-child {
|
|
81
|
-
padding-bottom: var(--
|
|
86
|
+
padding-bottom: var(--ds-chat-card-edge);
|
|
82
87
|
}
|
|
83
88
|
|
|
84
89
|
/* Title and meta form one unit, tucked closer together than the body's
|
|
@@ -86,7 +91,8 @@
|
|
|
86
91
|
.ds-message-card__header {
|
|
87
92
|
display: flex;
|
|
88
93
|
flex-direction: column;
|
|
89
|
-
|
|
94
|
+
/* The meta line is the title's subline, set straight under it. */
|
|
95
|
+
gap: var(--ds-chat-card-gap-subline);
|
|
90
96
|
min-width: 0;
|
|
91
97
|
}
|
|
92
98
|
|
|
@@ -101,6 +107,9 @@
|
|
|
101
107
|
display: inline-flex;
|
|
102
108
|
align-items: center;
|
|
103
109
|
flex: none;
|
|
110
|
+
/* A title's icon trails it, so the card's text starts on its inset edge. */
|
|
111
|
+
order: 1;
|
|
112
|
+
margin-inline-start: auto;
|
|
104
113
|
color: var(--color-icon-primary);
|
|
105
114
|
}
|
|
106
115
|
|
|
@@ -110,12 +119,12 @@
|
|
|
110
119
|
|
|
111
120
|
.ds-message-card__title {
|
|
112
121
|
min-width: 0;
|
|
113
|
-
font-family: var(--font-
|
|
114
|
-
font-size: var(--font-
|
|
115
|
-
font-weight: var(--font-
|
|
116
|
-
line-height: var(--font-
|
|
117
|
-
letter-spacing: var(--font-
|
|
118
|
-
color: var(--color-text-
|
|
122
|
+
font-family: var(--font-title-body-family);
|
|
123
|
+
font-size: var(--font-title-body-size);
|
|
124
|
+
font-weight: var(--font-title-body-weight);
|
|
125
|
+
line-height: var(--font-title-body-line-height);
|
|
126
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
127
|
+
color: var(--color-text-primary);
|
|
119
128
|
}
|
|
120
129
|
|
|
121
130
|
.ds-message-card__meta {
|
|
@@ -150,7 +159,7 @@
|
|
|
150
159
|
align-items: center;
|
|
151
160
|
justify-content: flex-start;
|
|
152
161
|
gap: var(--gap-200);
|
|
153
|
-
padding: var(--padding-200) var(--
|
|
162
|
+
padding: var(--padding-200) var(--ds-chat-card-inset) var(--ds-chat-card-edge);
|
|
154
163
|
}
|
|
155
164
|
|
|
156
165
|
/* Icons take the colour of the text around them. Explicit, not just
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import "./MessageCard.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 MessageCard = React.forwardRef(
|
|
@@ -302,6 +302,9 @@
|
|
|
302
302
|
.ds-prompt-suggestions__item {
|
|
303
303
|
display: flex;
|
|
304
304
|
flex-shrink: 0;
|
|
305
|
+
/* Never wider than the list, so a chip's own max-width has an edge to stop
|
|
306
|
+
at and a label too long for the room ends in an ellipsis (Chip.css). */
|
|
307
|
+
max-width: 100%;
|
|
305
308
|
/* Pills pop in one after another — a small rise-and-settle with the
|
|
306
309
|
spring's overshoot, quiet enough to read as arrival rather than
|
|
307
310
|
performance. `backwards` keeps a delayed pill invisible until its
|
|
@@ -146,6 +146,7 @@
|
|
|
146
146
|
|
|
147
147
|
.ds-prose code {
|
|
148
148
|
font-family: var(--font-family-code);
|
|
149
|
+
font-size-adjust: var(--font-code-aspect);
|
|
149
150
|
font-size: var(--font-paragraph-sm-size);
|
|
150
151
|
background-color: var(--color-bg-container-secondary);
|
|
151
152
|
border-radius: var(--radius-050);
|
|
@@ -160,6 +161,7 @@
|
|
|
160
161
|
|
|
161
162
|
.ds-prose pre {
|
|
162
163
|
font-family: var(--font-family-code);
|
|
164
|
+
font-size-adjust: var(--font-code-aspect);
|
|
163
165
|
font-size: var(--font-paragraph-sm-size);
|
|
164
166
|
line-height: var(--font-paragraph-sm-line-height);
|
|
165
167
|
background-color: var(--color-bg-container-primary);
|
|
@@ -128,7 +128,9 @@
|
|
|
128
128
|
width: 100%;
|
|
129
129
|
min-width: 0;
|
|
130
130
|
margin: 0;
|
|
131
|
-
|
|
131
|
+
/* 20px sides, the chat cards' text inset, so a row's label lines up
|
|
132
|
+
with the cards stacked around it. */
|
|
133
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset);
|
|
132
134
|
border: var(--border-025) dashed var(--color-bg-container-border);
|
|
133
135
|
border-radius: var(--radius-300);
|
|
134
136
|
background-color: var(--color-input-bg-primary);
|
|
@@ -305,10 +307,12 @@ button.ds-question-card__option--chosen:hover {
|
|
|
305
307
|
}
|
|
306
308
|
|
|
307
309
|
.ds-question-summary--card {
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
310
|
+
/* A record in the thread, so it is one of the chat cards: their fill,
|
|
311
|
+
radius and padding. */
|
|
312
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset);
|
|
313
|
+
border: var(--ds-chat-card-border);
|
|
314
|
+
border-radius: var(--ds-chat-card-radius);
|
|
315
|
+
background-color: var(--ds-chat-card-bg);
|
|
312
316
|
color: var(--color-text-primary);
|
|
313
317
|
}
|
|
314
318
|
|
|
@@ -6,6 +6,7 @@ import { CheckboxIndicator } from "../Checkbox/Checkbox.js";
|
|
|
6
6
|
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
7
7
|
import { RadioIndicator } from "../RadioButton/RadioButton.js";
|
|
8
8
|
import "./QuestionCard.css";
|
|
9
|
+
import "../../behaviors/chat-card.css";
|
|
9
10
|
import "../../behaviors/visually-hidden.css";
|
|
10
11
|
import "../../fonts/material-symbols.css";
|
|
11
12
|
const EMPTY_DRAFT = { values: [], other: "", otherOpen: false };
|
|
@@ -13,9 +13,9 @@
|
|
|
13
13
|
display: flex;
|
|
14
14
|
flex-direction: column;
|
|
15
15
|
width: 100%;
|
|
16
|
-
background-color: var(--
|
|
17
|
-
border: var(--
|
|
18
|
-
border-radius: var(--radius
|
|
16
|
+
background-color: var(--ds-chat-card-bg);
|
|
17
|
+
border: var(--ds-chat-card-border);
|
|
18
|
+
border-radius: var(--ds-chat-card-radius);
|
|
19
19
|
overflow: hidden;
|
|
20
20
|
}
|
|
21
21
|
|
|
@@ -28,7 +28,11 @@
|
|
|
28
28
|
align-items: center;
|
|
29
29
|
gap: var(--gap-200);
|
|
30
30
|
width: 100%;
|
|
31
|
-
|
|
31
|
+
/* The chat cards' one-row height: a compact control and 4px above and
|
|
32
|
+
below, so a label row and a row holding a button are the same height. */
|
|
33
|
+
box-sizing: border-box;
|
|
34
|
+
min-height: var(--ds-chat-card-row-height);
|
|
35
|
+
padding: var(--ds-chat-card-row-pad) var(--ds-chat-card-inset);
|
|
32
36
|
background: none;
|
|
33
37
|
border: none;
|
|
34
38
|
/* Buttons default to the UA's buttontext, not the inherited colour, so
|
|
@@ -49,10 +53,18 @@
|
|
|
49
53
|
}
|
|
50
54
|
|
|
51
55
|
.ds-source-trail__indicator {
|
|
56
|
+
/* The header's glyph trails, before the chevron, so the count starts on
|
|
57
|
+
the card's inset edge; the rows' markers stay in front, on that edge. */
|
|
58
|
+
order: 1;
|
|
52
59
|
display: inline-flex;
|
|
53
60
|
align-items: center;
|
|
54
61
|
justify-content: center;
|
|
55
62
|
flex: none;
|
|
63
|
+
/* Fixed box: the running spinner (16px) is smaller than the status
|
|
64
|
+
icons (20px), so without it the text beside it shifts as the state
|
|
65
|
+
changes. AgentPlan's step indicator does the same. */
|
|
66
|
+
width: var(--icon-size-500);
|
|
67
|
+
height: var(--icon-size-500);
|
|
56
68
|
color: var(--color-text-secondary);
|
|
57
69
|
}
|
|
58
70
|
|
|
@@ -76,6 +88,7 @@
|
|
|
76
88
|
|
|
77
89
|
.ds-source-trail__chevron {
|
|
78
90
|
--icon-size: var(--icon-size-500);
|
|
91
|
+
order: 2;
|
|
79
92
|
|
|
80
93
|
flex: none;
|
|
81
94
|
color: var(--color-icon-secondary);
|
|
@@ -104,19 +117,21 @@
|
|
|
104
117
|
visibility: visible;
|
|
105
118
|
}
|
|
106
119
|
|
|
107
|
-
|
|
120
|
+
/* The grid row animates the clip (see ToolCall's): the list keeps its
|
|
121
|
+
padding, divider and gap in both states, so only the height moves. */
|
|
122
|
+
.ds-source-trail__clip {
|
|
108
123
|
overflow: hidden;
|
|
109
124
|
min-height: 0;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
.ds-source-trail__list {
|
|
110
128
|
margin: 0;
|
|
111
|
-
|
|
129
|
+
/* 12px above and below, every chat card's edge inset. */
|
|
130
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset);
|
|
131
|
+
border-top: var(--border-025) solid var(--color-divider);
|
|
112
132
|
list-style: none;
|
|
113
133
|
display: flex;
|
|
114
134
|
flex-direction: column;
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
.ds-source-trail--open .ds-source-trail__list {
|
|
118
|
-
padding: var(--padding-200) var(--padding-500) var(--padding-400);
|
|
119
|
-
border-top: var(--border-025) solid var(--color-divider);
|
|
120
135
|
gap: var(--gap-200);
|
|
121
136
|
}
|
|
122
137
|
|
|
@@ -149,6 +164,13 @@
|
|
|
149
164
|
align-items: center;
|
|
150
165
|
justify-content: center;
|
|
151
166
|
flex: none;
|
|
167
|
+
/* Fixed box: the running spinner (16px) is smaller than the status
|
|
168
|
+
icons (20px), so without it the text beside it shifts as the state
|
|
169
|
+
changes. AgentPlan's step indicator does the same. */
|
|
170
|
+
width: var(--icon-size-500);
|
|
171
|
+
height: var(--icon-size-500);
|
|
172
|
+
/* Optical: see AgentPlan's step indicator. */
|
|
173
|
+
margin-inline-start: calc(-1 * var(--padding-050));
|
|
152
174
|
color: var(--color-text-secondary);
|
|
153
175
|
}
|
|
154
176
|
|
|
@@ -4,6 +4,7 @@ import React, { useId, useState, useCallback } from "react";
|
|
|
4
4
|
import { SourceChip } from "../SourceChip/SourceChip.js";
|
|
5
5
|
import { Spinner } from "../Spinner/Spinner.js";
|
|
6
6
|
import "./SourceTrail.css";
|
|
7
|
+
import "../../behaviors/chat-card.css";
|
|
7
8
|
import "../../behaviors/visually-hidden.css";
|
|
8
9
|
import "../../fonts/material-symbols.css";
|
|
9
10
|
const STATUS_ICONS = {
|
|
@@ -80,7 +81,7 @@ const SourceTrail = React.forwardRef(
|
|
|
80
81
|
id: panelId,
|
|
81
82
|
role: "region",
|
|
82
83
|
"aria-labelledby": triggerId,
|
|
83
|
-
children: /* @__PURE__ */ jsx("ol", { className: `${baseClass}__list`, children: items.map((item, index) => {
|
|
84
|
+
children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__clip`, children: /* @__PURE__ */ jsx("ol", { className: `${baseClass}__list`, children: items.map((item, index) => {
|
|
84
85
|
const status = item.status ?? "done";
|
|
85
86
|
return /* @__PURE__ */ jsxs(
|
|
86
87
|
"li",
|
|
@@ -105,7 +106,7 @@ const SourceTrail = React.forwardRef(
|
|
|
105
106
|
},
|
|
106
107
|
`${item.title}-${index}`
|
|
107
108
|
);
|
|
108
|
-
}) })
|
|
109
|
+
}) }) })
|
|
109
110
|
}
|
|
110
111
|
)
|
|
111
112
|
] });
|
|
@@ -517,7 +517,10 @@
|
|
|
517
517
|
would follow off screen. */
|
|
518
518
|
inset-block-start: 100dvh;
|
|
519
519
|
inset-block-end: auto;
|
|
520
|
-
|
|
520
|
+
/* --ds-table-toolbar-floating-offset is the host's hook: an app with its
|
|
521
|
+
own bar at the foot of the screen (a bottom tab bar) sets it to that
|
|
522
|
+
bar's height, so the bulk bar floats above it rather than over it. */
|
|
523
|
+
translate: 0 calc(-100% - var(--padding-300) - var(--ds-table-toolbar-floating-offset, 0px) - env(safe-area-inset-bottom, 0px));
|
|
521
524
|
z-index: var(--layer-sticky);
|
|
522
525
|
padding: var(--padding-200);
|
|
523
526
|
border-radius: var(--radius-600);
|
|
@@ -199,7 +199,7 @@ function CommandRow({ command, table, labels, size, open, onClose, state, onStat
|
|
|
199
199
|
variant: "secondary",
|
|
200
200
|
tone: "neutral",
|
|
201
201
|
size: "compact",
|
|
202
|
-
iconLeft: "
|
|
202
|
+
iconLeft: "undo",
|
|
203
203
|
label: labels.commandUndo,
|
|
204
204
|
onClick: () => {
|
|
205
205
|
latestTable.current.applyView(before);
|
|
@@ -187,3 +187,9 @@
|
|
|
187
187
|
animation: none;
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
|
|
191
|
+
/* The trigger's tooltip names the swatch; with the menu open the menu says
|
|
192
|
+
it all, and the bubble would sit on the side the menu takes. */
|
|
193
|
+
.ds-theme-picker--open .ds-theme-picker__trigger-tip .ds-tooltip__panel {
|
|
194
|
+
display: none;
|
|
195
|
+
}
|