rift-ds 1.33.0 → 1.35.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 +11 -6
- package/behaviors/locale.d.ts +9 -0
- package/behaviors/locale.js +2 -0
- package/bin/templates/blocks/app/dashboard/page.tsx +1 -1
- package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -6
- package/chat/AssistantTurn.d.ts +2 -0
- package/chat/AssistantTurn.js +18 -7
- package/chat/ChatProvider.js +14 -0
- package/chat/ChatTabs.js +1 -1
- package/chat/ChatWidget.css +10 -0
- package/chat/ChatWidget.d.ts +9 -5
- package/chat/ChatWidget.js +7 -4
- package/chat/DemoWelcome.js +2 -2
- package/chat/FollowupSuggestions.js +1 -1
- package/chat/agentState.d.ts +2 -1
- package/chat/agentState.js +4 -1
- package/chat/awaiting.d.ts +19 -0
- package/chat/awaiting.js +21 -0
- package/chat/context.d.ts +4 -0
- package/chat/index.d.ts +1 -0
- package/chat/index.js +3 -1
- package/chat/server.d.ts +8 -3
- package/chat/server.js +1 -1
- package/components/ActionBar/ActionBar.css +78 -0
- package/components/ActionBar/ActionBar.d.ts +40 -0
- package/components/ActionBar/ActionBar.js +29 -0
- package/components/ActionCard/ActionCard.css +3 -3
- package/components/AgentStatus/AgentStatus.css +114 -22
- package/components/AgentStatus/AgentStatus.d.ts +10 -7
- package/components/AgentStatus/AgentStatus.js +10 -0
- package/components/AiButton/AiButton.d.ts +3 -3
- package/components/AiButton/AiButton.js +1 -1
- package/components/Alert/Alert.css +16 -0
- package/components/Alert/Alert.d.ts +2 -2
- package/components/Alert/Alert.js +3 -1
- package/components/AppSidebar/AppSidebar.css +140 -4
- package/components/AppSidebar/AppSidebar.d.ts +12 -0
- package/components/AppSidebar/AppSidebar.js +7 -3
- package/components/ChatThread/ChatThread.d.ts +5 -1
- package/components/ChatThread/ChatThread.js +1 -1
- package/components/Composer/Composer.css +14 -9
- package/components/Composer/Composer.d.ts +10 -8
- package/components/Composer/Composer.js +2 -1
- package/components/ContextMenu/ContextMenu.d.ts +5 -1
- package/components/ContextMenu/ContextMenu.js +2 -1
- package/components/ContributionGraph/ContributionGraph.d.ts +7 -1
- package/components/ContributionGraph/ContributionGraph.js +4 -18
- package/components/ContributionGraph/weeks.d.ts +8 -0
- package/components/ContributionGraph/weeks.js +25 -0
- package/components/DataTable/DataTable.js +1 -1
- package/components/DocumentChip/DocumentChip.js +1 -1
- package/components/EntitySwitcher/EntitySwitcher.css +11 -3
- package/components/EntitySwitcher/EntitySwitcher.js +1 -1
- package/components/EventCalendar/EventCalendar.css +152 -0
- package/components/EventCalendar/EventCalendar.d.ts +50 -4
- package/components/EventCalendar/EventCalendar.js +154 -23
- package/components/EventCalendar/eventTime.d.ts +31 -0
- package/components/EventCalendar/eventTime.js +42 -0
- package/components/FileInput/FileInput.d.ts +12 -4
- package/components/FileInput/FileInput.js +27 -4
- package/components/Input/Input.css +30 -0
- package/components/Input/Input.d.ts +8 -0
- package/components/Input/Input.js +3 -0
- package/components/MessageCard/MessageCard.css +1 -1
- package/components/Popover/Popover.d.ts +5 -1
- package/components/Popover/Popover.js +3 -1
- package/components/ProgressBar/ProgressBar.d.ts +5 -1
- package/components/ProgressBar/ProgressBar.js +1 -1
- package/components/PromptSuggestions/PromptSuggestions.d.ts +5 -1
- package/components/PromptSuggestions/PromptSuggestions.js +1 -1
- package/components/ResourceTimeline/ResourceTimeline.js +2 -2
- package/components/SegmentedControl/SegmentedControl.css +120 -3
- package/components/SegmentedControl/SegmentedControl.d.ts +9 -0
- package/components/SegmentedControl/SegmentedControl.js +11 -1
- package/components/ShaderScene/ShaderScene.d.ts +3 -3
- package/components/ShaderScene/scenes.d.ts +17 -0
- package/components/ShaderScene/scenes.js +175 -1
- package/components/SourceTrail/SourceTrail.css +1 -1
- package/components/Stat/Stat.css +12 -0
- package/components/Stat/Stat.d.ts +5 -0
- package/components/Stat/Stat.js +9 -3
- package/components/TableToolbar/TableToolbar.js +2 -2
- package/components/ThemeToggle/ThemeToggle.d.ts +1 -1
- package/components/ThreadTabs/ThreadTabs.d.ts +5 -1
- package/components/ThreadTabs/ThreadTabs.js +2 -1
- package/components/ToggleGroup/ToggleGroup.d.ts +5 -1
- package/components/ToolCall/ToolCall.css +2 -2
- package/components/UsageCard/UsageCard.css +4 -3
- package/components/registry.json +21 -4
- package/components/registry.json.d.ts +21 -4
- package/components/registry.json.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
ACTION BAR
|
|
3
|
+
A summary line and the primary actions, docked
|
|
4
|
+
to the bottom of a long list or form
|
|
5
|
+
============================================ */
|
|
6
|
+
|
|
7
|
+
/* Base */
|
|
8
|
+
.ds-action-bar {
|
|
9
|
+
/* The surface the bar reads as one with: the blur's tint with the blur
|
|
10
|
+
on, the fill with it off. An override hook: a bar over a container
|
|
11
|
+
points it at that container's fill. */
|
|
12
|
+
--ds-action-bar-surface: var(--color-bg-page-primary);
|
|
13
|
+
/* How far above the bar the blur reaches, so the content dissolves into
|
|
14
|
+
it rather than stopping at its edge. */
|
|
15
|
+
--ds-action-bar-blur-reach: var(--gap-1500);
|
|
16
|
+
position: relative;
|
|
17
|
+
/* Its own stacking context, so the blur's z-index of -1 paints behind
|
|
18
|
+
the summary and the actions but never behind the content it covers. */
|
|
19
|
+
isolation: isolate;
|
|
20
|
+
display: flex;
|
|
21
|
+
flex-wrap: wrap;
|
|
22
|
+
align-items: center;
|
|
23
|
+
gap: var(--gap-300) var(--gap-500);
|
|
24
|
+
box-sizing: border-box;
|
|
25
|
+
inline-size: 100%;
|
|
26
|
+
padding-block: var(--padding-400);
|
|
27
|
+
padding-inline: var(--padding-500);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/* Sticky: holds to the bottom edge of its scroll container. */
|
|
31
|
+
.ds-action-bar--sticky {
|
|
32
|
+
position: sticky;
|
|
33
|
+
inset-block-end: 0;
|
|
34
|
+
z-index: var(--layer-sticky);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/* Blur: the stack reaches above the bar, behind its content. The space
|
|
38
|
+
above the bar in flow is the same reach, so at the end of the scroll
|
|
39
|
+
the last row clears the blur instead of resting under it. */
|
|
40
|
+
.ds-action-bar--blur {
|
|
41
|
+
margin-block-start: var(--ds-action-bar-blur-reach);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.ds-action-bar__blur.ds-progressive-blur {
|
|
45
|
+
--ds-progressive-blur-tint: var(--ds-action-bar-surface);
|
|
46
|
+
inset-block-start: calc(var(--ds-action-bar-blur-reach) * -1);
|
|
47
|
+
z-index: -1;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
/* Solid: the bar's own surface, parted from the content by a hairline. */
|
|
51
|
+
.ds-action-bar--solid {
|
|
52
|
+
background-color: var(--ds-action-bar-surface);
|
|
53
|
+
border-block-start: var(--border-025) solid var(--color-divider);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/* Summary: takes the room at the start; a long line wraps rather than
|
|
57
|
+
pushing the actions off the bar. */
|
|
58
|
+
.ds-action-bar__summary {
|
|
59
|
+
flex: 1 1 auto;
|
|
60
|
+
min-inline-size: 0;
|
|
61
|
+
font-family: var(--font-paragraph-family);
|
|
62
|
+
font-size: var(--font-paragraph-size);
|
|
63
|
+
font-weight: var(--font-paragraph-weight);
|
|
64
|
+
line-height: var(--font-paragraph-line-height);
|
|
65
|
+
letter-spacing: var(--font-paragraph-letter-spacing);
|
|
66
|
+
color: var(--color-text-primary);
|
|
67
|
+
overflow-wrap: anywhere;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
/* Actions: hold the end edge, on the summary's row or wrapped below it. */
|
|
71
|
+
.ds-action-bar__actions {
|
|
72
|
+
display: flex;
|
|
73
|
+
flex-wrap: wrap;
|
|
74
|
+
align-items: center;
|
|
75
|
+
justify-content: flex-end;
|
|
76
|
+
gap: var(--gap-300);
|
|
77
|
+
margin-inline-start: auto;
|
|
78
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/** Props owned by ActionBar itself; everything else falls through to the root `<div>`. */
|
|
3
|
+
type ActionBarOwnProps = {
|
|
4
|
+
/**
|
|
5
|
+
* The summary line at the bar's start, such as "23 students still to
|
|
6
|
+
* mark". It is a polite live region, so a count that changes while the
|
|
7
|
+
* reader works is announced once it settles.
|
|
8
|
+
*/
|
|
9
|
+
summary?: React.ReactNode;
|
|
10
|
+
/**
|
|
11
|
+
* The actions at the bar's end, typically one or two Buttons with the
|
|
12
|
+
* primary action last. On a narrow bar they wrap below the summary and
|
|
13
|
+
* hold the end edge.
|
|
14
|
+
*/
|
|
15
|
+
actions?: React.ReactNode;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the bar holds to the bottom of its scroll container while the
|
|
18
|
+
* content scrolls under it. Off, it sits in flow after the content.
|
|
19
|
+
*/
|
|
20
|
+
sticky?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Whether the content fades under a progressive blur that reaches above
|
|
23
|
+
* the bar. Off, the bar is a solid surface with a hairline at its top
|
|
24
|
+
* edge.
|
|
25
|
+
*/
|
|
26
|
+
blur?: boolean;
|
|
27
|
+
/** Additional CSS classes on the root. */
|
|
28
|
+
className?: string;
|
|
29
|
+
};
|
|
30
|
+
export interface ActionBarProps extends ActionBarOwnProps, Omit<React.ComponentPropsWithRef<'div'>, keyof ActionBarOwnProps> {
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* A bar docked to the bottom of a long list or form, holding a summary
|
|
34
|
+
* line and the primary actions, with the content fading under a
|
|
35
|
+
* progressive blur rather than being cut off at the bar's edge. The
|
|
36
|
+
* forwarded ref and any unrecognised props target the root `<div>`, so a
|
|
37
|
+
* host that wants a landmark passes `role="region"` with an `aria-label`.
|
|
38
|
+
*/
|
|
39
|
+
export declare function ActionBar({ summary, actions, sticky, blur, className, ref, ...rest }: ActionBarProps): React.JSX.Element;
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import "react";
|
|
3
|
+
import { ProgressiveBlur } from "../ProgressiveBlur/ProgressiveBlur.js";
|
|
4
|
+
import "./ActionBar.css";
|
|
5
|
+
function ActionBar({
|
|
6
|
+
summary,
|
|
7
|
+
actions,
|
|
8
|
+
sticky = true,
|
|
9
|
+
blur = true,
|
|
10
|
+
className = "",
|
|
11
|
+
ref,
|
|
12
|
+
...rest
|
|
13
|
+
}) {
|
|
14
|
+
const baseClass = "ds-action-bar";
|
|
15
|
+
const classes = [
|
|
16
|
+
baseClass,
|
|
17
|
+
sticky && `${baseClass}--sticky`,
|
|
18
|
+
blur ? `${baseClass}--blur` : `${baseClass}--solid`,
|
|
19
|
+
className
|
|
20
|
+
].filter(Boolean).join(" ");
|
|
21
|
+
return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, children: [
|
|
22
|
+
blur && /* @__PURE__ */ jsx(ProgressiveBlur, { side: "bottom", tinted: true, className: `${baseClass}__blur` }),
|
|
23
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__summary`, "aria-live": "polite", "aria-atomic": "true", children: summary }),
|
|
24
|
+
actions != null && actions !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: actions })
|
|
25
|
+
] });
|
|
26
|
+
}
|
|
27
|
+
export {
|
|
28
|
+
ActionBar
|
|
29
|
+
};
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
|
|
8
8
|
A content card of the chat furniture: the
|
|
9
9
|
container fill behind its border, at the
|
|
10
|
-
ArtifactCard's radius, with
|
|
11
|
-
padding so its text
|
|
12
|
-
reply's own text does.
|
|
10
|
+
ArtifactCard's radius, with the recipe's
|
|
11
|
+
edge and inset as its padding so its text
|
|
12
|
+
starts where the reply's own text does.
|
|
13
13
|
============================================ */
|
|
14
14
|
|
|
15
15
|
.ds-action-card {
|
|
@@ -192,18 +192,7 @@
|
|
|
192
192
|
--ds-agent-label-color: var(--color-status-error-text);
|
|
193
193
|
}
|
|
194
194
|
|
|
195
|
-
/*
|
|
196
|
-
finished, and twinkle: one or two dots at a time dip and return, so the
|
|
197
|
-
finished mark stays alive without drawing the eye. The doubled class and
|
|
198
|
-
:nth-child(n) lift the rule over every pattern's dark-dot opt-outs, so
|
|
199
|
-
the whole matrix twinkles whatever the pattern. */
|
|
200
|
-
.ds-agent-status.ds-agent-status--done .ds-agent-status__dot:nth-child(n),
|
|
201
|
-
.ds-agent-status.ds-agent-status--error .ds-agent-status__dot:nth-child(n) {
|
|
202
|
-
opacity: 1;
|
|
203
|
-
transform: none;
|
|
204
|
-
animation: ds-agent-dot-twinkle var(--ds-agent-twinkle-cycle) var(--motion-ease-standard) infinite;
|
|
205
|
-
animation-delay: calc(var(--ds-agent-twinkle-step, 0) * var(--ds-agent-twinkle-slot));
|
|
206
|
-
}
|
|
195
|
+
/* What the matrix draws once a run ends or waits is in GLYPHS, below. */
|
|
207
196
|
|
|
208
197
|
/* ============================================
|
|
209
198
|
SIZES
|
|
@@ -574,7 +563,7 @@
|
|
|
574
563
|
animation-delay: calc(var(--ds-agent-twinkle-step, 0) * var(--ds-agent-twinkle-slot));
|
|
575
564
|
}
|
|
576
565
|
|
|
577
|
-
/* The twinkle's scatter
|
|
566
|
+
/* The twinkle pattern's scatter */
|
|
578
567
|
.ds-agent-status__dot:nth-child(1) { --ds-agent-twinkle-step: 7; }
|
|
579
568
|
.ds-agent-status__dot:nth-child(2) { --ds-agent-twinkle-step: 2; }
|
|
580
569
|
.ds-agent-status__dot:nth-child(3) { --ds-agent-twinkle-step: 10; }
|
|
@@ -653,15 +642,6 @@
|
|
|
653
642
|
--ds-agent-color: var(--color-status-error-icon);
|
|
654
643
|
}
|
|
655
644
|
|
|
656
|
-
/* Finished: solid and twinkling, as AgentStatus's matrix does. */
|
|
657
|
-
.ds-agent-status-mark.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(n),
|
|
658
|
-
.ds-agent-status-mark.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(n) {
|
|
659
|
-
opacity: 1;
|
|
660
|
-
transform: none;
|
|
661
|
-
animation: ds-agent-dot-twinkle var(--ds-agent-twinkle-cycle) var(--motion-ease-standard) infinite;
|
|
662
|
-
animation-delay: calc(var(--ds-agent-twinkle-step, 0) * var(--ds-agent-twinkle-slot));
|
|
663
|
-
}
|
|
664
|
-
|
|
665
645
|
.ds-agent-status-mark--animated .ds-agent-status-mark__dot {
|
|
666
646
|
animation: ds-agent-dot var(--ds-agent-cycle) var(--motion-ease-standard) infinite;
|
|
667
647
|
animation-delay: calc(var(--ds-agent-step, 0) * var(--ds-agent-slot));
|
|
@@ -1107,6 +1087,116 @@
|
|
|
1107
1087
|
}
|
|
1108
1088
|
}
|
|
1109
1089
|
|
|
1090
|
+
/* ============================================
|
|
1091
|
+
GLYPHS
|
|
1092
|
+
The three states that ask something of the
|
|
1093
|
+
reader each resolve the matrix into a mark of
|
|
1094
|
+
their own, so the shape says which one it is
|
|
1095
|
+
before the colour or the label does:
|
|
1096
|
+
|
|
1097
|
+
done error waiting
|
|
1098
|
+
. . . o o . . o o . . .
|
|
1099
|
+
o . o . . o o . . o . .
|
|
1100
|
+
. o . . o . . o o . o o
|
|
1101
|
+
|
|
1102
|
+
a tick, a cross, and a prompt whose cursor
|
|
1103
|
+
breathes. The mark's square grid draws the same
|
|
1104
|
+
three with a row to spare. Each is drawn in
|
|
1105
|
+
stroke order, one dot a slot, then holds. The
|
|
1106
|
+
doubled class and :nth-child(n) lift these
|
|
1107
|
+
rules over every pattern's own, so a finished
|
|
1108
|
+
matrix draws its glyph whatever pattern ran.
|
|
1109
|
+
Waiting draws the prompt on its default pattern
|
|
1110
|
+
only: a pattern asked for by name still runs.
|
|
1111
|
+
============================================ */
|
|
1112
|
+
|
|
1113
|
+
.ds-agent-status--waiting.ds-agent-status--breathe,
|
|
1114
|
+
.ds-agent-status-mark--waiting.ds-agent-status-mark--breathe {
|
|
1115
|
+
/* The glyph is the signal now, so the unlit dots fall back to the
|
|
1116
|
+
working floor and the prompt stands clear of them. */
|
|
1117
|
+
--ds-agent-dot-dim: 0.2;
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
.ds-agent-status.ds-agent-status--done .ds-agent-status__dot:nth-child(n),
|
|
1121
|
+
.ds-agent-status.ds-agent-status--error .ds-agent-status__dot:nth-child(n),
|
|
1122
|
+
.ds-agent-status.ds-agent-status--waiting.ds-agent-status--breathe .ds-agent-status__dot:nth-child(n),
|
|
1123
|
+
.ds-agent-status-mark.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(n),
|
|
1124
|
+
.ds-agent-status-mark.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(n),
|
|
1125
|
+
.ds-agent-status-mark.ds-agent-status-mark--waiting.ds-agent-status-mark--breathe .ds-agent-status-mark__dot:nth-child(n) {
|
|
1126
|
+
opacity: var(--ds-agent-dot-dim);
|
|
1127
|
+
transform: scale(var(--ds-agent-dot-rest));
|
|
1128
|
+
animation: none;
|
|
1129
|
+
}
|
|
1130
|
+
|
|
1131
|
+
.ds-agent-status.ds-agent-status--done .ds-agent-status__dot:is(:nth-child(4), :nth-child(5), :nth-child(7), :nth-child(10)),
|
|
1132
|
+
.ds-agent-status.ds-agent-status--error .ds-agent-status__dot:is(:nth-child(1), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(9), :nth-child(12)),
|
|
1133
|
+
.ds-agent-status.ds-agent-status--waiting.ds-agent-status--breathe .ds-agent-status__dot:is(:nth-child(1), :nth-child(6), :nth-child(9)),
|
|
1134
|
+
.ds-agent-status-mark.ds-agent-status-mark--done .ds-agent-status-mark__dot:is(:nth-child(8), :nth-child(9), :nth-child(11), :nth-child(14)),
|
|
1135
|
+
.ds-agent-status-mark.ds-agent-status-mark--error .ds-agent-status-mark__dot:is(:nth-child(1), :nth-child(4), :nth-child(6), :nth-child(7), :nth-child(10), :nth-child(11), :nth-child(13), :nth-child(16)),
|
|
1136
|
+
.ds-agent-status-mark.ds-agent-status-mark--waiting.ds-agent-status-mark--breathe .ds-agent-status-mark__dot:is(:nth-child(1), :nth-child(6), :nth-child(9)) {
|
|
1137
|
+
opacity: 1;
|
|
1138
|
+
transform: none;
|
|
1139
|
+
animation: var(--ds-agent-glyph-draw, none) var(--motion-duration-slow) var(--motion-ease-entrance) backwards;
|
|
1140
|
+
animation-delay: calc(var(--ds-agent-glyph-step, 0) * var(--ds-agent-slot));
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
/* The stroke-by-stroke draw runs only when the indicator reaches its state
|
|
1144
|
+
while on screen. One that mounts already there shows the glyph standing. */
|
|
1145
|
+
.ds-agent-status--arrived,
|
|
1146
|
+
.ds-agent-status-mark--arrived {
|
|
1147
|
+
--ds-agent-glyph-draw: ds-agent-dot-draw;
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
/* The prompt's cursor: the two dots after the chevron, breathing. */
|
|
1151
|
+
.ds-agent-status.ds-agent-status--waiting.ds-agent-status--breathe .ds-agent-status__dot:is(:nth-child(11), :nth-child(12)),
|
|
1152
|
+
.ds-agent-status-mark.ds-agent-status-mark--waiting.ds-agent-status-mark--breathe .ds-agent-status-mark__dot:is(:nth-child(15), :nth-child(16)) {
|
|
1153
|
+
animation: ds-agent-dot-breathe var(--ds-agent-cycle) var(--motion-ease-standard) infinite;
|
|
1154
|
+
}
|
|
1155
|
+
|
|
1156
|
+
/* Stroke order. The tick runs down its short arm and up its long one; the
|
|
1157
|
+
cross draws one stroke, then the other; the chevron runs top to bottom. */
|
|
1158
|
+
.ds-agent-status--done .ds-agent-status__dot:nth-child(5) { --ds-agent-glyph-step: 0; }
|
|
1159
|
+
.ds-agent-status--done .ds-agent-status__dot:nth-child(10) { --ds-agent-glyph-step: 1; }
|
|
1160
|
+
.ds-agent-status--done .ds-agent-status__dot:nth-child(7) { --ds-agent-glyph-step: 2; }
|
|
1161
|
+
.ds-agent-status--done .ds-agent-status__dot:nth-child(4) { --ds-agent-glyph-step: 3; }
|
|
1162
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(1) { --ds-agent-glyph-step: 0; }
|
|
1163
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(6) { --ds-agent-glyph-step: 1; }
|
|
1164
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(12) { --ds-agent-glyph-step: 2; }
|
|
1165
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(4) { --ds-agent-glyph-step: 3; }
|
|
1166
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(7) { --ds-agent-glyph-step: 4; }
|
|
1167
|
+
.ds-agent-status--error .ds-agent-status__dot:nth-child(9) { --ds-agent-glyph-step: 5; }
|
|
1168
|
+
.ds-agent-status--waiting .ds-agent-status__dot:nth-child(1) { --ds-agent-glyph-step: 0; }
|
|
1169
|
+
.ds-agent-status--waiting .ds-agent-status__dot:nth-child(6) { --ds-agent-glyph-step: 1; }
|
|
1170
|
+
.ds-agent-status--waiting .ds-agent-status__dot:nth-child(9) { --ds-agent-glyph-step: 2; }
|
|
1171
|
+
|
|
1172
|
+
.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(9) { --ds-agent-glyph-step: 0; }
|
|
1173
|
+
.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(14) { --ds-agent-glyph-step: 1; }
|
|
1174
|
+
.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(11) { --ds-agent-glyph-step: 2; }
|
|
1175
|
+
.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(8) { --ds-agent-glyph-step: 3; }
|
|
1176
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(1) { --ds-agent-glyph-step: 0; }
|
|
1177
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(6) { --ds-agent-glyph-step: 1; }
|
|
1178
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(11) { --ds-agent-glyph-step: 2; }
|
|
1179
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(16) { --ds-agent-glyph-step: 3; }
|
|
1180
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(4) { --ds-agent-glyph-step: 4; }
|
|
1181
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(7) { --ds-agent-glyph-step: 5; }
|
|
1182
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(10) { --ds-agent-glyph-step: 6; }
|
|
1183
|
+
.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(13) { --ds-agent-glyph-step: 7; }
|
|
1184
|
+
.ds-agent-status-mark--waiting .ds-agent-status-mark__dot:nth-child(1) { --ds-agent-glyph-step: 0; }
|
|
1185
|
+
.ds-agent-status-mark--waiting .ds-agent-status-mark__dot:nth-child(6) { --ds-agent-glyph-step: 1; }
|
|
1186
|
+
.ds-agent-status-mark--waiting .ds-agent-status-mark__dot:nth-child(9) { --ds-agent-glyph-step: 2; }
|
|
1187
|
+
|
|
1188
|
+
@keyframes ds-agent-dot-draw {
|
|
1189
|
+
from {
|
|
1190
|
+
opacity: var(--ds-agent-dot-dim);
|
|
1191
|
+
transform: scale(var(--ds-agent-dot-rest));
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
60% {
|
|
1195
|
+
opacity: 1;
|
|
1196
|
+
transform: scale(1.2);
|
|
1197
|
+
}
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1110
1200
|
/* ============================================
|
|
1111
1201
|
REDUCED MOTION
|
|
1112
1202
|
The global guard collapses every animation to
|
|
@@ -1121,6 +1211,8 @@
|
|
|
1121
1211
|
.ds-agent-status.ds-agent-status--error .ds-agent-status__dot:nth-child(n),
|
|
1122
1212
|
.ds-agent-status-mark.ds-agent-status-mark--done .ds-agent-status-mark__dot:nth-child(n),
|
|
1123
1213
|
.ds-agent-status-mark.ds-agent-status-mark--error .ds-agent-status-mark__dot:nth-child(n),
|
|
1214
|
+
.ds-agent-status.ds-agent-status--waiting.ds-agent-status--breathe .ds-agent-status__dot:nth-child(n),
|
|
1215
|
+
.ds-agent-status-mark.ds-agent-status-mark--waiting.ds-agent-status-mark--breathe .ds-agent-status-mark__dot:nth-child(n),
|
|
1124
1216
|
.ds-agent-status--animated.ds-agent-status--twinkle .ds-agent-status__dot:nth-child(n),
|
|
1125
1217
|
.ds-agent-status-mark--animated.ds-agent-status-mark--twinkle .ds-agent-status-mark__dot:nth-child(n) {
|
|
1126
1218
|
animation: none;
|
|
@@ -2,11 +2,11 @@ import { default as React } from 'react';
|
|
|
2
2
|
import { AgentStatusPattern, AgentStatusState } from './AgentStatusPatterns';
|
|
3
3
|
/** Props owned by AgentStatus itself — everything else falls through to the root element. */
|
|
4
4
|
type AgentStatusOwnProps = {
|
|
5
|
-
/** What the agent is doing. Drives the colour, the default label, and whether the matrix animates. */
|
|
5
|
+
/** What the agent is doing. Drives the colour, the default label, and whether the matrix animates. `waiting` takes the warning status colour, `done` the positive one (with a tick) and `error` the error one (with a cross); the other three stay monochrome. */
|
|
6
6
|
state?: AgentStatusState;
|
|
7
7
|
/** Status text. Falls back to a default for the state. Ignored when `children` are given. */
|
|
8
8
|
label?: string;
|
|
9
|
-
/** Which dot-matrix choreography to run. Defaults to `
|
|
9
|
+
/** Which dot-matrix choreography to run while the agent is active. Defaults to `orbit`. `waiting` with no pattern draws its glyph instead, a prompt whose cursor breathes (the same as AgentStatusMark); `done` and `error` draw a tick and a cross whatever the pattern. */
|
|
10
10
|
pattern?: AgentStatusPattern;
|
|
11
11
|
/**
|
|
12
12
|
* Sweep a highlight across the label while the agent is active. Defaults to
|
|
@@ -22,8 +22,9 @@ type AgentStatusOwnProps = {
|
|
|
22
22
|
/**
|
|
23
23
|
* `inline` sits in a line of content; `bar` is a full-width row for the
|
|
24
24
|
* top of a panel; `pill` is a glass pill for a status that floats over
|
|
25
|
-
* the page while a run goes on; once it ends the dots
|
|
26
|
-
* status colour, as in every variant. The pill does not
|
|
25
|
+
* the page while a run goes on; once it ends the dots draw a tick or a
|
|
26
|
+
* cross in the status colour, as in every variant. The pill does not
|
|
27
|
+
* position itself.
|
|
27
28
|
*/
|
|
28
29
|
variant?: 'inline' | 'bar' | 'pill';
|
|
29
30
|
/** A trailing control after the status text, such as a link that opens the run. Meant for the `pill` and `bar` variants. */
|
|
@@ -41,6 +42,8 @@ export interface AgentStatusProps extends AgentStatusOwnProps, Omit<React.Compon
|
|
|
41
42
|
*
|
|
42
43
|
* Colour carries meaning rather than decoration — the three working states are
|
|
43
44
|
* monochrome, and only `waiting`, `done` and `error` take a status colour.
|
|
45
|
+
* Those three also resolve the matrix into a glyph of their own (a prompt, a
|
|
46
|
+
* tick, a cross), so the shape says which it is before the colour does.
|
|
44
47
|
* The whole thing is one polite live region, so a screen reader hears the state
|
|
45
48
|
* change without the caller wiring anything up.
|
|
46
49
|
*/
|
|
@@ -49,7 +52,7 @@ export declare const AgentStatus: React.ForwardRefExoticComponent<AgentStatusPro
|
|
|
49
52
|
type AgentStatusMarkOwnProps = {
|
|
50
53
|
/** What the agent is doing. Drives the colour and whether the dots animate, as on AgentStatus. Defaults to `working`, unlike AgentStatus's `thinking`: the mark stands in for an icon on a control (AiButton's, a pill's), where the commonest moment it is drawn is a run under way, while the labelled AgentStatus most often opens a reply. */
|
|
51
54
|
state?: AgentStatusState;
|
|
52
|
-
/** Which choreography to run: every AgentStatus pattern, redrawn for the square grid. Defaults to `
|
|
55
|
+
/** Which choreography to run while the agent is active: every AgentStatus pattern, redrawn for the square grid. Defaults to `orbit`. `waiting` with no pattern draws its glyph instead, a prompt whose cursor breathes; `done` and `error` draw a tick and a cross whatever the pattern. */
|
|
53
56
|
pattern?: AgentStatusPattern;
|
|
54
57
|
/** Additional CSS classes */
|
|
55
58
|
className?: string;
|
|
@@ -61,8 +64,8 @@ export interface AgentStatusMarkProps extends AgentStatusMarkOwnProps, Omit<Reac
|
|
|
61
64
|
* by `--icon-size`, drawn inside a Material Symbol's live area, so it swaps
|
|
62
65
|
* with a glyph without moving or outgrowing it. Every AgentStatus pattern
|
|
63
66
|
* runs on it, redrawn for the square, in AgentStatus's cycle and colours;
|
|
64
|
-
* orbit is the default, and
|
|
65
|
-
* the first host.
|
|
67
|
+
* orbit is the default, and waiting, done and error draw AgentStatus's
|
|
68
|
+
* three glyphs. AiButton's status is the first host.
|
|
66
69
|
* Hidden from assistive technology; the host announces the state.
|
|
67
70
|
*/
|
|
68
71
|
export declare const AgentStatusMark: React.ForwardRefExoticComponent<AgentStatusMarkProps & React.RefAttributes<HTMLSpanElement>>;
|
|
@@ -11,6 +11,12 @@ const DEFAULT_LABELS = {
|
|
|
11
11
|
done: "Done",
|
|
12
12
|
error: "Failed"
|
|
13
13
|
};
|
|
14
|
+
function useArrived(state) {
|
|
15
|
+
const [initial] = useState(state);
|
|
16
|
+
const [arrived, setArrived] = useState(false);
|
|
17
|
+
if (!arrived && state !== initial) setArrived(true);
|
|
18
|
+
return arrived;
|
|
19
|
+
}
|
|
14
20
|
const ACTIVE_STATES = ["thinking", "working", "waiting"];
|
|
15
21
|
const AgentStatus = React.forwardRef(
|
|
16
22
|
({
|
|
@@ -26,6 +32,7 @@ const AgentStatus = React.forwardRef(
|
|
|
26
32
|
...rest
|
|
27
33
|
}, ref) => {
|
|
28
34
|
const baseClass = "ds-agent-status";
|
|
35
|
+
const arrived = useArrived(state);
|
|
29
36
|
const isActive = ACTIVE_STATES.includes(state);
|
|
30
37
|
const isShimmering = shimmer ?? isActive;
|
|
31
38
|
const resolvedSize = size === "sm" ? "compact" : size === "md" ? "default" : size;
|
|
@@ -47,6 +54,7 @@ const AgentStatus = React.forwardRef(
|
|
|
47
54
|
`${baseClass}--${resolvedSize}`,
|
|
48
55
|
`${baseClass}--${variant}`,
|
|
49
56
|
isActive ? `${baseClass}--animated` : "",
|
|
57
|
+
arrived ? `${baseClass}--arrived` : "",
|
|
50
58
|
className
|
|
51
59
|
].filter(Boolean).join(" ");
|
|
52
60
|
return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, role: "status", children: [
|
|
@@ -87,11 +95,13 @@ const MARK_DOT_COUNT = 16;
|
|
|
87
95
|
const AgentStatusMark = React.forwardRef(
|
|
88
96
|
({ state = "working", pattern, className = "", ...rest }, ref) => {
|
|
89
97
|
const baseClass = "ds-agent-status-mark";
|
|
98
|
+
const arrived = useArrived(state);
|
|
90
99
|
const classes = [
|
|
91
100
|
baseClass,
|
|
92
101
|
`${baseClass}--${state}`,
|
|
93
102
|
`${baseClass}--${pattern ?? (state === "waiting" ? "breathe" : "orbit")}`,
|
|
94
103
|
ACTIVE_STATES.includes(state) ? `${baseClass}--animated` : "",
|
|
104
|
+
arrived ? `${baseClass}--arrived` : "",
|
|
95
105
|
className
|
|
96
106
|
].filter(Boolean).join(" ");
|
|
97
107
|
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", ...rest, ref, className: classes, children: Array.from({ length: MARK_DOT_COUNT }, (_, i) => /* @__PURE__ */ jsx("span", { className: `${baseClass}__dot` }, i)) });
|
|
@@ -40,9 +40,9 @@ type AiButtonOwnProps = {
|
|
|
40
40
|
* What the agent behind the button is doing, in AgentStatus's vocabulary.
|
|
41
41
|
* The label never changes; the icon carries the state. `thinking` and
|
|
42
42
|
* `working` show AgentStatusMark and spin the ring faster, `waiting` shows
|
|
43
|
-
* the mark
|
|
44
|
-
* `error` turn the button to their status colours with the mark
|
|
45
|
-
*
|
|
43
|
+
* the mark's prompt glyph in the warning colour with the ring at rest, and `done` and
|
|
44
|
+
* `error` turn the button to their status colours with the mark drawing a
|
|
45
|
+
* tick or a cross in the status colour, then return to the resting look after a
|
|
46
46
|
* beat. The button stays clickable throughout, unlike Button's
|
|
47
47
|
* `loading`, so a click can open the conversation to watch the work.
|
|
48
48
|
*/
|
|
@@ -94,6 +94,22 @@
|
|
|
94
94
|
margin: 0;
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
+
/* Markup in the description: paragraphs and lists stack at the content's
|
|
98
|
+
own gap, with no browser margins, and a list keeps its markers inside the
|
|
99
|
+
content column. Links are the Link component's inline form, which already
|
|
100
|
+
takes the sentence's colour. */
|
|
101
|
+
.ds-alert__description > :where(p, ul, ol) {
|
|
102
|
+
margin: 0;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
.ds-alert__description > * + :where(p, ul, ol) {
|
|
106
|
+
margin-block-start: var(--gap-100); /* 4px */
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
.ds-alert__description :where(ul, ol) {
|
|
110
|
+
padding-inline-start: var(--padding-500); /* 20px */
|
|
111
|
+
}
|
|
112
|
+
|
|
97
113
|
/* ============================================
|
|
98
114
|
ACTIONS
|
|
99
115
|
============================================ */
|
|
@@ -6,8 +6,8 @@ type AlertOwnProps = {
|
|
|
6
6
|
* Note: this shadows the native `title` tooltip attribute, which Alert does not expose.
|
|
7
7
|
*/
|
|
8
8
|
title?: string;
|
|
9
|
-
/**
|
|
10
|
-
description?:
|
|
9
|
+
/** The body under the title. Plain text is the usual case; it also takes a short run of markup, such as a sentence with a Link in it or a list of two or three items. */
|
|
10
|
+
description?: React.ReactNode;
|
|
11
11
|
/** Alert variant determines colour and icon */
|
|
12
12
|
variant?: 'info' | 'positive' | 'warning' | 'error' | 'neutral';
|
|
13
13
|
/** Component size */
|
|
@@ -39,7 +39,9 @@ const Alert = React.forwardRef(
|
|
|
39
39
|
) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: iconValue }),
|
|
40
40
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__content`, children: [
|
|
41
41
|
title && /* @__PURE__ */ jsx("p", { className: `${baseClass}__title`, children: title }),
|
|
42
|
-
description &&
|
|
42
|
+
description != null && description !== false && description !== "" && // Text sits in a paragraph; markup gets a div, since a paragraph
|
|
43
|
+
// cannot hold another paragraph or a list.
|
|
44
|
+
(typeof description === "string" || typeof description === "number" ? /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, children: description }) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__description`, children: description })),
|
|
43
45
|
action != null && action !== false && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: action })
|
|
44
46
|
] }),
|
|
45
47
|
dismissible && /* @__PURE__ */ jsx(
|