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
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useRef, useId, useEffect } from "react";
|
|
4
4
|
import { ChosenMark } from "../Dropdown/Dropdown.js";
|
|
5
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
5
6
|
import { useAnchoredPosition } from "../../behaviors/useAnchoredPosition.js";
|
|
6
7
|
import { useLayer } from "../../behaviors/useLayer.js";
|
|
7
8
|
import "./ThemePicker.css";
|
|
@@ -101,18 +102,26 @@ const ThemePicker = React.forwardRef(
|
|
|
101
102
|
className: [baseClass, `${baseClass}--${size}`, isOpen && `${baseClass}--open`, className].filter(Boolean).join(" "),
|
|
102
103
|
children: [
|
|
103
104
|
/* @__PURE__ */ jsx(
|
|
104
|
-
|
|
105
|
+
Tooltip,
|
|
105
106
|
{
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
className: `${baseClass}__trigger`,
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
107
|
+
content: active ? triggerLabel(active.label) : menuLabel,
|
|
108
|
+
position: placement,
|
|
109
|
+
className: `${baseClass}__trigger-tip`,
|
|
110
|
+
children: /* @__PURE__ */ jsx(
|
|
111
|
+
"button",
|
|
112
|
+
{
|
|
113
|
+
ref: triggerRef,
|
|
114
|
+
type: "button",
|
|
115
|
+
className: `${baseClass}__trigger`,
|
|
116
|
+
"aria-label": active ? triggerLabel(active.label) : menuLabel,
|
|
117
|
+
"aria-haspopup": "menu",
|
|
118
|
+
"aria-expanded": isOpen,
|
|
119
|
+
"aria-controls": isOpen ? menuId : void 0,
|
|
120
|
+
disabled,
|
|
121
|
+
onClick: () => setOpen(!isOpen),
|
|
122
|
+
children: swatch(active, "swatch")
|
|
123
|
+
}
|
|
124
|
+
)
|
|
116
125
|
}
|
|
117
126
|
),
|
|
118
127
|
isOpen && !disabled && /* @__PURE__ */ jsxs(
|
|
@@ -61,7 +61,9 @@
|
|
|
61
61
|
align-items: center;
|
|
62
62
|
flex: none;
|
|
63
63
|
min-width: 0;
|
|
64
|
-
|
|
64
|
+
/* The top inset seats the logo and the toggle 20px down, AppSidebar's
|
|
65
|
+
top line. */
|
|
66
|
+
padding: var(--padding-100) var(--padding-200) var(--padding-150);
|
|
65
67
|
margin-bottom: var(--gap-300);
|
|
66
68
|
}
|
|
67
69
|
|
|
@@ -190,12 +192,11 @@
|
|
|
190
192
|
display: none;
|
|
191
193
|
}
|
|
192
194
|
|
|
193
|
-
/* The
|
|
194
|
-
|
|
195
|
-
|
|
195
|
+
/* The toggle's box sits on the rail's trailing line, where AppSidebar's
|
|
196
|
+
does, 20px in; the rows' trailing items keep a step more room, inside
|
|
197
|
+
their pills. */
|
|
196
198
|
.ds-thread-panel--expanded .ds-thread-panel__toggle {
|
|
197
199
|
width: 24px;
|
|
198
|
-
margin-inline-end: calc(-1 * var(--gap-100));
|
|
199
200
|
opacity: 1;
|
|
200
201
|
}
|
|
201
202
|
|
|
@@ -346,7 +347,7 @@
|
|
|
346
347
|
}
|
|
347
348
|
|
|
348
349
|
/* ============================================
|
|
349
|
-
PROJECTS — standing rows under their own
|
|
350
|
+
PROJECTS — standing rows under their own group heading
|
|
350
351
|
Rows share the controls' anatomy (icon circles while collapsed, labels
|
|
351
352
|
fading with the sweep); the header carries the section's name and the
|
|
352
353
|
quiet new-project button, and fades out whole while collapsed — the
|
|
@@ -387,12 +388,10 @@
|
|
|
387
388
|
min-width: 0;
|
|
388
389
|
overflow: hidden;
|
|
389
390
|
white-space: nowrap;
|
|
390
|
-
font-family: var(--font-
|
|
391
|
-
font-size: var(--font-
|
|
392
|
-
font-weight: var(--font-
|
|
393
|
-
line-height: var(--font-
|
|
394
|
-
letter-spacing: var(--font-overline-letter-spacing);
|
|
395
|
-
text-transform: uppercase;
|
|
391
|
+
font-family: var(--font-paragraph-sm-family);
|
|
392
|
+
font-size: var(--font-paragraph-sm-size);
|
|
393
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
394
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
396
395
|
color: var(--color-text-tertiary);
|
|
397
396
|
}
|
|
398
397
|
|
|
@@ -509,23 +508,21 @@
|
|
|
509
508
|
gap: var(--gap-050);
|
|
510
509
|
}
|
|
511
510
|
|
|
512
|
-
/* The
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
511
|
+
/* The rails' one group heading, AppSidebar's category and SidebarPanel's
|
|
512
|
+
group label: paragraph small in the tertiary text, mixed case. Its
|
|
513
|
+
20px line is the overline's it replaced, so the rhythm below is
|
|
514
|
+
unchanged. On the rail's leading line, the logo's. The vertical padding
|
|
516
515
|
is the rows' own inset restated — as if the label sat inside a row —
|
|
517
|
-
so the
|
|
516
|
+
so the heading keeps the pills' rhythm instead of hugging the
|
|
518
517
|
new-thread row above and the first thread below. */
|
|
519
518
|
.ds-thread-panel__group-label {
|
|
520
519
|
padding: var(--padding-200);
|
|
521
520
|
overflow: hidden;
|
|
522
521
|
white-space: nowrap;
|
|
523
|
-
font-family: var(--font-
|
|
524
|
-
font-size: var(--font-
|
|
525
|
-
font-weight: var(--font-
|
|
526
|
-
line-height: var(--font-
|
|
527
|
-
letter-spacing: var(--font-overline-letter-spacing);
|
|
528
|
-
text-transform: uppercase;
|
|
522
|
+
font-family: var(--font-paragraph-sm-family);
|
|
523
|
+
font-size: var(--font-paragraph-sm-size);
|
|
524
|
+
font-weight: var(--font-paragraph-sm-weight);
|
|
525
|
+
line-height: var(--font-paragraph-sm-line-height);
|
|
529
526
|
color: var(--color-text-tertiary);
|
|
530
527
|
}
|
|
531
528
|
|
|
@@ -861,28 +858,45 @@
|
|
|
861
858
|
pointer-events: auto;
|
|
862
859
|
}
|
|
863
860
|
|
|
864
|
-
/*
|
|
865
|
-
|
|
866
|
-
|
|
861
|
+
/* The footer's controls start on the rail's leading line, over the avatar,
|
|
862
|
+
where AppSidebar's do. */
|
|
863
|
+
.ds-thread-panel__footer-slot {
|
|
864
|
+
padding-inline-start: var(--padding-200);
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
/* The rails' one profile block, AppSidebar's: a 40px avatar, the name over
|
|
868
|
+
the meta line in paragraph type, AppSidebar's avatar-to-name gap.
|
|
869
|
+
Collapsed, the avatar sits on the rail's axis (12 + 40 + 12 = 64);
|
|
870
|
+
expanded, it glides to the rail's leading line, 20px in, as AppSidebar's
|
|
871
|
+
does. Only the inline padding moves, so the row's height never snaps. */
|
|
867
872
|
.ds-thread-panel__profile {
|
|
868
|
-
display:
|
|
873
|
+
display: grid;
|
|
874
|
+
grid-template-columns: auto minmax(0, 1fr);
|
|
875
|
+
grid-template-areas: 'avatar name' 'avatar meta';
|
|
869
876
|
align-items: center;
|
|
870
|
-
gap:
|
|
877
|
+
column-gap: 10px; /* ds-allow(spacing): AppSidebar's avatar-to-name gap, between the 8px and 12px steps */
|
|
871
878
|
min-width: 0;
|
|
872
|
-
padding: var(--padding-
|
|
879
|
+
padding: var(--padding-200) 0 0;
|
|
873
880
|
transition: padding var(--motion-duration-slow) var(--motion-ease-emphasized);
|
|
874
881
|
}
|
|
875
882
|
|
|
876
883
|
.ds-thread-panel--expanded .ds-thread-panel__profile {
|
|
877
|
-
padding: var(--padding-
|
|
878
|
-
var(--padding-100);
|
|
884
|
+
padding: var(--padding-200) var(--padding-200) 0;
|
|
879
885
|
}
|
|
880
886
|
|
|
887
|
+
.ds-thread-panel__profile > :first-child {
|
|
888
|
+
grid-area: avatar;
|
|
889
|
+
}
|
|
890
|
+
|
|
891
|
+
/* The profile pairs its lines as EntitySwitcher does: the name in
|
|
892
|
+
paragraph-sm emphasis, the second line in caption, secondary. */
|
|
881
893
|
.ds-thread-panel__profile-name {
|
|
882
|
-
|
|
894
|
+
grid-area: name;
|
|
895
|
+
align-self: end;
|
|
883
896
|
min-width: 0;
|
|
884
897
|
overflow: hidden;
|
|
885
898
|
white-space: nowrap;
|
|
899
|
+
text-overflow: ellipsis;
|
|
886
900
|
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
887
901
|
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
888
902
|
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
@@ -897,14 +911,17 @@
|
|
|
897
911
|
}
|
|
898
912
|
|
|
899
913
|
.ds-thread-panel__profile-meta {
|
|
900
|
-
|
|
914
|
+
grid-area: meta;
|
|
915
|
+
align-self: start;
|
|
916
|
+
min-width: 0;
|
|
901
917
|
overflow: hidden;
|
|
902
918
|
white-space: nowrap;
|
|
919
|
+
text-overflow: ellipsis;
|
|
903
920
|
font-family: var(--font-caption-family);
|
|
904
921
|
font-size: var(--font-caption-size);
|
|
905
922
|
font-weight: var(--font-caption-weight);
|
|
906
923
|
line-height: var(--font-caption-line-height);
|
|
907
|
-
color: var(--color-text-
|
|
924
|
+
color: var(--color-text-secondary);
|
|
908
925
|
opacity: 0;
|
|
909
926
|
transition: opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
910
927
|
}
|
|
@@ -923,9 +940,21 @@
|
|
|
923
940
|
dots under the pen's visible edge while the glyph itself stays centred
|
|
924
941
|
under the logo. None of it shows collapsed, so nothing moves. */
|
|
925
942
|
.ds-thread-panel__thread,
|
|
926
|
-
.ds-thread-panel__group-label,
|
|
927
|
-
.ds-thread-panel__projects-header,
|
|
928
943
|
.ds-thread-panel__more,
|
|
929
944
|
.ds-thread-panel__rename {
|
|
930
945
|
padding-inline-start: var(--padding-300);
|
|
931
946
|
}
|
|
947
|
+
|
|
948
|
+
/* Group headings sit on the rail's leading line, the logo's and the row
|
|
949
|
+
icons', where AppSidebar's category does. */
|
|
950
|
+
.ds-thread-panel__group-label,
|
|
951
|
+
.ds-thread-panel__projects-header {
|
|
952
|
+
padding-inline-start: var(--padding-200);
|
|
953
|
+
}
|
|
954
|
+
|
|
955
|
+
/* A row's trailing item (the meta caption) keeps AppSidebar's badge room
|
|
956
|
+
from its pill's end, a step more than the pill's own inset. */
|
|
957
|
+
.ds-thread-panel__thread,
|
|
958
|
+
.ds-thread-panel__project {
|
|
959
|
+
padding-inline-end: var(--padding-300);
|
|
960
|
+
}
|
|
@@ -44,7 +44,7 @@ export interface ThreadPanelThread {
|
|
|
44
44
|
pinned?: boolean;
|
|
45
45
|
}
|
|
46
46
|
export interface ThreadPanelGroup {
|
|
47
|
-
/** Group heading in the
|
|
47
|
+
/** Group heading in the rails' shared mixed-case style, e.g. a project or repo name. Omit for an unlabelled run of threads. */
|
|
48
48
|
label?: string;
|
|
49
49
|
/** The group's threads, in display order. */
|
|
50
50
|
threads: ThreadPanelThread[];
|
|
@@ -76,9 +76,9 @@ export interface ThreadPanelProject {
|
|
|
76
76
|
export interface ThreadPanelProfile {
|
|
77
77
|
/** The signed-in person's display name; also seeds the Avatar's initials. */
|
|
78
78
|
name: string;
|
|
79
|
-
/**
|
|
79
|
+
/** The quiet second line under the name, e.g. the person's email, plan or workspace (AppSidebar's profile block carries the email there). */
|
|
80
80
|
meta?: string;
|
|
81
|
-
/** Replace the initials Avatar with a custom element, e.g. an `<Avatar src
|
|
81
|
+
/** Replace the initials Avatar with a custom element, e.g. an `<Avatar src>`; the row seats a 40px mark (Avatar at `md`). */
|
|
82
82
|
avatar?: React.ReactNode;
|
|
83
83
|
}
|
|
84
84
|
/** Props owned by ThreadPanel itself — everything else falls through to the root `<div>`. */
|
|
@@ -134,9 +134,9 @@ type ThreadPanelOwnProps = {
|
|
|
134
134
|
controls?: ThreadPanelControl[];
|
|
135
135
|
/** Fires with the clicked control's id. Rows with an `href` navigate as well. */
|
|
136
136
|
onControlSelect?: (id: string) => void;
|
|
137
|
-
/** Project rows between the standing controls and the history, under their own
|
|
137
|
+
/** Project rows between the standing controls and the history, under their own group heading. The section renders only when non-empty; collapsed, the rows fold to icon circles like the controls. */
|
|
138
138
|
projects?: ThreadPanelProject[];
|
|
139
|
-
/** The projects section's
|
|
139
|
+
/** The projects section's group heading text. */
|
|
140
140
|
projectsLabel?: string;
|
|
141
141
|
/** Id of the open project. Its row renders filled and carries `aria-current`. */
|
|
142
142
|
activeProjectId?: string;
|
|
@@ -515,7 +515,7 @@ const ThreadPanel = React.forwardRef(
|
|
|
515
515
|
className: `${baseClass}__profile`,
|
|
516
516
|
title: expanded ? void 0 : profile.name,
|
|
517
517
|
children: [
|
|
518
|
-
profile.avatar ?? /* @__PURE__ */ jsx(Avatar, { name: profile.name, size: "
|
|
518
|
+
profile.avatar ?? /* @__PURE__ */ jsx(Avatar, { name: profile.name, size: "md" }),
|
|
519
519
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-name`, children: profile.name }),
|
|
520
520
|
profile.meta && /* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-meta`, children: profile.meta })
|
|
521
521
|
]
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
display: flex;
|
|
23
23
|
flex-direction: column;
|
|
24
24
|
width: 100%;
|
|
25
|
-
background-color: var(--
|
|
26
|
-
border: var(--
|
|
25
|
+
background-color: var(--ds-chat-card-bg);
|
|
26
|
+
border: var(--ds-chat-card-border);
|
|
27
27
|
/* The chat furniture shares one 24px shell with MessageCard and the
|
|
28
28
|
bubbles; a closed row rounds to a capsule the way a one-line bubble
|
|
29
29
|
does, echoing the system's pill buttons. */
|
|
30
|
-
border-radius: var(--radius
|
|
30
|
+
border-radius: var(--ds-chat-card-radius);
|
|
31
31
|
overflow: hidden;
|
|
32
32
|
}
|
|
33
33
|
|
|
@@ -40,8 +40,11 @@
|
|
|
40
40
|
align-items: center;
|
|
41
41
|
gap: var(--gap-200);
|
|
42
42
|
width: 100%;
|
|
43
|
-
/*
|
|
44
|
-
|
|
43
|
+
/* The chat cards' one-row height: a compact control and 4px above and
|
|
44
|
+
below, so a label row and a row holding a button are the same height. */
|
|
45
|
+
box-sizing: border-box;
|
|
46
|
+
min-height: var(--ds-chat-card-row-height);
|
|
47
|
+
padding: var(--ds-chat-card-row-pad) var(--ds-chat-card-inset);
|
|
45
48
|
background: none;
|
|
46
49
|
border: none;
|
|
47
50
|
/* Buttons default to the UA's buttontext, not the inherited colour, so
|
|
@@ -75,26 +78,39 @@
|
|
|
75
78
|
align-items: center;
|
|
76
79
|
justify-content: center;
|
|
77
80
|
flex: none;
|
|
81
|
+
/* Fixed box: the running spinner (16px) is smaller than the status
|
|
82
|
+
icons (20px), so without it the text beside it shifts as the state
|
|
83
|
+
changes. AgentPlan's step indicator does the same. */
|
|
84
|
+
width: var(--icon-size-500);
|
|
85
|
+
height: var(--icon-size-500);
|
|
78
86
|
color: var(--ds-tool-call-icon-color);
|
|
87
|
+
/* The status glyph trails, beside the status word it stands for, so the
|
|
88
|
+
tool name starts on the card's inset edge like every chat card's text.
|
|
89
|
+
The auto margin pushes the status group right when no summary fills
|
|
90
|
+
the row. */
|
|
91
|
+
order: 1;
|
|
92
|
+
margin-inline-start: auto;
|
|
79
93
|
}
|
|
80
94
|
|
|
81
95
|
.ds-tool-call__indicator .material-symbols-rounded {
|
|
82
96
|
--icon-size: var(--icon-size-500);
|
|
83
97
|
}
|
|
84
98
|
|
|
85
|
-
/* The tool name is
|
|
86
|
-
the
|
|
87
|
-
when the row is short of room,
|
|
88
|
-
never pushes the status out
|
|
99
|
+
/* The tool name is the row's label, set like every chat card's one-row
|
|
100
|
+
label so the headers read as one set; the code stack stays for the
|
|
101
|
+
code inside. It yields to the status when the row is short of room,
|
|
102
|
+
ending in an ellipsis, so a long name never pushes the status out. */
|
|
89
103
|
.ds-tool-call__name {
|
|
90
104
|
flex: 0 1 auto;
|
|
91
105
|
min-width: 0;
|
|
92
106
|
overflow: hidden;
|
|
93
107
|
text-overflow: ellipsis;
|
|
94
108
|
white-space: nowrap;
|
|
95
|
-
font-family: var(--font-family
|
|
96
|
-
font-size: var(--font-paragraph-sm-size);
|
|
97
|
-
|
|
109
|
+
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
110
|
+
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
111
|
+
font-weight: var(--font-paragraph-sm-emphasis-weight);
|
|
112
|
+
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
113
|
+
letter-spacing: var(--font-paragraph-sm-emphasis-letter-spacing);
|
|
98
114
|
color: var(--color-text-primary);
|
|
99
115
|
}
|
|
100
116
|
|
|
@@ -115,8 +131,8 @@
|
|
|
115
131
|
}
|
|
116
132
|
|
|
117
133
|
.ds-tool-call__status {
|
|
134
|
+
order: 2;
|
|
118
135
|
flex: none;
|
|
119
|
-
margin-inline-start: auto;
|
|
120
136
|
color: var(--ds-tool-call-color);
|
|
121
137
|
font-family: var(--font-paragraph-sm-emphasis-family);
|
|
122
138
|
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
@@ -126,13 +142,9 @@
|
|
|
126
142
|
white-space: nowrap;
|
|
127
143
|
}
|
|
128
144
|
|
|
129
|
-
/* A summary already claims the free space; without one the status still
|
|
130
|
-
needs pushing to the right, which the auto margin above handles */
|
|
131
|
-
.ds-tool-call__summary ~ .ds-tool-call__status {
|
|
132
|
-
margin-inline-start: 0;
|
|
133
|
-
}
|
|
134
145
|
|
|
135
146
|
.ds-tool-call__duration {
|
|
147
|
+
order: 3;
|
|
136
148
|
flex: none;
|
|
137
149
|
color: var(--color-text-tertiary);
|
|
138
150
|
font-family: var(--font-paragraph-sm-family);
|
|
@@ -146,6 +158,7 @@
|
|
|
146
158
|
|
|
147
159
|
.ds-tool-call__chevron {
|
|
148
160
|
--icon-size: var(--icon-size-500);
|
|
161
|
+
order: 4;
|
|
149
162
|
|
|
150
163
|
flex: none;
|
|
151
164
|
color: var(--color-icon-secondary);
|
|
@@ -198,13 +211,17 @@
|
|
|
198
211
|
visibility: visible;
|
|
199
212
|
}
|
|
200
213
|
|
|
201
|
-
|
|
214
|
+
/* The grid row animates the clip, which has no box of its own, so it can
|
|
215
|
+
shrink to nothing. Padding and the divider live on the content inside it
|
|
216
|
+
in both states: toggled with the open class they would snap in on the
|
|
217
|
+
first frame and out before the row had closed. */
|
|
218
|
+
.ds-tool-call__clip {
|
|
202
219
|
overflow: hidden;
|
|
203
220
|
min-height: 0;
|
|
204
221
|
}
|
|
205
222
|
|
|
206
|
-
.ds-tool-
|
|
207
|
-
padding: var(--
|
|
223
|
+
.ds-tool-call__content {
|
|
224
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset);
|
|
208
225
|
border-top: var(--border-025) solid var(--color-divider);
|
|
209
226
|
}
|
|
210
227
|
|
|
@@ -227,7 +244,7 @@
|
|
|
227
244
|
align-items: center;
|
|
228
245
|
justify-content: flex-start;
|
|
229
246
|
gap: var(--gap-200);
|
|
230
|
-
padding: var(--padding-200) var(--
|
|
247
|
+
padding: var(--padding-200) var(--ds-chat-card-inset) var(--ds-chat-card-edge);
|
|
231
248
|
}
|
|
232
249
|
|
|
233
250
|
/* Icons take the colour of the text around them. Explicit, not just
|
|
@@ -240,3 +257,53 @@
|
|
|
240
257
|
.ds-tool-call .material-symbols-rounded:not(.ds-tool-call__chevron) {
|
|
241
258
|
color: inherit;
|
|
242
259
|
}
|
|
260
|
+
|
|
261
|
+
/* ============================================
|
|
262
|
+
NO CARD IN A CARD
|
|
263
|
+
A code block in the panel is the panel's
|
|
264
|
+
content, not a second card: it sheds its frame
|
|
265
|
+
and its header bar, the code sits on the card's
|
|
266
|
+
inset, and Copy moves to the footer's place at
|
|
267
|
+
the bottom left, drawn as the compact secondary
|
|
268
|
+
button the card's other actions are. A code
|
|
269
|
+
block standing on its own keeps its header.
|
|
270
|
+
============================================ */
|
|
271
|
+
|
|
272
|
+
.ds-tool-call__content > .ds-code-block {
|
|
273
|
+
border: none;
|
|
274
|
+
border-radius: 0;
|
|
275
|
+
background-color: transparent;
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
.ds-tool-call__content > .ds-code-block .ds-code-block__header {
|
|
279
|
+
order: 1;
|
|
280
|
+
justify-content: flex-start;
|
|
281
|
+
/* 16px off the code, the chat cards' block seam. */
|
|
282
|
+
margin-block-start: var(--gap-400);
|
|
283
|
+
padding: 0;
|
|
284
|
+
border-bottom: none;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
/* The language is the reader's to see in the code; the label goes. */
|
|
288
|
+
.ds-tool-call__content > .ds-code-block .ds-code-block__language {
|
|
289
|
+
display: none;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/* With the label gone the group around it has nothing to hold, so it
|
|
293
|
+
leaves the row rather than push Copy off the inset edge. */
|
|
294
|
+
.ds-tool-call__content > .ds-code-block .ds-code-block__meta {
|
|
295
|
+
display: contents;
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
.ds-tool-call__content > .ds-code-block .ds-code-block__copy {
|
|
299
|
+
box-sizing: border-box;
|
|
300
|
+
gap: var(--gap-200);
|
|
301
|
+
height: var(--control-height-compact);
|
|
302
|
+
padding: 0 var(--padding-300);
|
|
303
|
+
border: var(--border-025) solid var(--color-action-primary-border);
|
|
304
|
+
color: var(--color-text-primary);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.ds-tool-call__content > .ds-code-block .ds-code-block__pre {
|
|
308
|
+
padding: 0;
|
|
309
|
+
}
|
|
@@ -3,6 +3,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import React, { useId, useState, useCallback } from "react";
|
|
4
4
|
import { Spinner } from "../Spinner/Spinner.js";
|
|
5
5
|
import "./ToolCall.css";
|
|
6
|
+
import "../../behaviors/chat-card.css";
|
|
6
7
|
import "../../fonts/material-symbols.css";
|
|
7
8
|
const DEFAULT_STATUS_LABELS = {
|
|
8
9
|
pending: "Needs approval",
|
|
@@ -77,7 +78,7 @@ const ToolCall = React.forwardRef(
|
|
|
77
78
|
id: panelId,
|
|
78
79
|
role: "region",
|
|
79
80
|
"aria-labelledby": triggerId,
|
|
80
|
-
children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__content`, children })
|
|
81
|
+
children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__clip`, children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__content`, children }) })
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
84
|
actions && /* @__PURE__ */ jsx("div", { className: `${baseClass}__actions`, children: actions })
|
|
@@ -4,12 +4,39 @@
|
|
|
4
4
|
with reset captions, in the chart card chrome
|
|
5
5
|
============================================ */
|
|
6
6
|
|
|
7
|
-
/* Base — the card chrome itself comes from ds-chart
|
|
7
|
+
/* Base — the card chrome itself comes from ds-chart. In a chat it is one
|
|
8
|
+
of the chat cards, so it takes their padding, title and rhythm: 12px
|
|
9
|
+
above and below inside 20px sides, a title-body title with its subtitle
|
|
10
|
+
8px under it, and 16px between blocks. */
|
|
11
|
+
.ds-usage-card.ds-chart:not(.ds-chart--bare) {
|
|
12
|
+
padding: var(--ds-chat-card-edge) var(--ds-chat-card-inset);
|
|
13
|
+
border: var(--ds-chat-card-border);
|
|
14
|
+
border-radius: var(--ds-chat-card-radius);
|
|
15
|
+
background-color: var(--ds-chat-card-bg);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.ds-usage-card.ds-chart {
|
|
19
|
+
gap: var(--ds-chat-card-gap-block);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.ds-usage-card .ds-chart__header-text {
|
|
23
|
+
gap: var(--ds-chat-card-gap-subline);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.ds-usage-card .ds-chart__title {
|
|
27
|
+
font-family: var(--font-title-body-family);
|
|
28
|
+
font-size: var(--font-title-body-size);
|
|
29
|
+
font-weight: var(--font-title-body-weight);
|
|
30
|
+
line-height: var(--font-title-body-line-height);
|
|
31
|
+
letter-spacing: var(--font-title-body-letter-spacing);
|
|
32
|
+
color: var(--color-text-primary);
|
|
33
|
+
}
|
|
34
|
+
|
|
8
35
|
|
|
9
36
|
.ds-usage-card__items {
|
|
10
37
|
display: flex;
|
|
11
38
|
flex-direction: column;
|
|
12
|
-
gap: var(--gap-
|
|
39
|
+
gap: var(--gap-400);
|
|
13
40
|
}
|
|
14
41
|
|
|
15
42
|
.ds-usage-card__item {
|
|
@@ -3,6 +3,7 @@ import React from "react";
|
|
|
3
3
|
import { Meter } from "../Meter/Meter.js";
|
|
4
4
|
import "../Chart/Chart.css";
|
|
5
5
|
import "./UsageCard.css";
|
|
6
|
+
import "../../behaviors/chat-card.css";
|
|
6
7
|
import { DEFAULT_LOCALE } from "../../behaviors/locale.js";
|
|
7
8
|
const DEFAULT_THRESHOLDS = { warning: 0.8, error: 0.95 };
|
|
8
9
|
const UsageCard = React.forwardRef(
|
package/components/registry.json
CHANGED
|
@@ -71,6 +71,22 @@
|
|
|
71
71
|
"category": "data-display",
|
|
72
72
|
"client": true
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
"name": "ActionCard",
|
|
76
|
+
"label": "Action card",
|
|
77
|
+
"slug": "action-card",
|
|
78
|
+
"description": "A change an assistant proposes and the reader confirms, then the record of what happened, with Undo while it can be reversed.",
|
|
79
|
+
"category": "ai",
|
|
80
|
+
"client": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "ActionReadout",
|
|
84
|
+
"label": "Action readout",
|
|
85
|
+
"slug": "action-readout",
|
|
86
|
+
"description": "What a confirmed change did: a title over a list of facts, worked out from the records as they were just before it.",
|
|
87
|
+
"category": "ai",
|
|
88
|
+
"client": false
|
|
89
|
+
},
|
|
74
90
|
{
|
|
75
91
|
"name": "AgentPlan",
|
|
76
92
|
"label": "Agent plan",
|
|
@@ -139,7 +155,7 @@
|
|
|
139
155
|
"name": "AppLayout",
|
|
140
156
|
"label": "App layout",
|
|
141
157
|
"slug": "app-layout",
|
|
142
|
-
"description": "Full-page template pairing the collapsible App sidebar with a content area,
|
|
158
|
+
"description": "Full-page template pairing the collapsible App sidebar with a content area, in one of the three app shell modes: flush, floating or inset.",
|
|
143
159
|
"category": "layout",
|
|
144
160
|
"client": true
|
|
145
161
|
},
|
|
@@ -562,6 +578,14 @@
|
|
|
562
578
|
"category": "data-display",
|
|
563
579
|
"client": false
|
|
564
580
|
},
|
|
581
|
+
{
|
|
582
|
+
"name": "EntitySwitcher",
|
|
583
|
+
"label": "Entity switcher",
|
|
584
|
+
"slug": "entity-switcher",
|
|
585
|
+
"description": "Switcher for the company, team, or account a screen is scoped to, with a logo, icon, or initials mark and levels that drill in.",
|
|
586
|
+
"category": "navigation",
|
|
587
|
+
"client": true
|
|
588
|
+
},
|
|
565
589
|
{
|
|
566
590
|
"name": "EventCalendar",
|
|
567
591
|
"label": "Event calendar",
|
|
@@ -71,6 +71,22 @@ declare const _default: {
|
|
|
71
71
|
"category": "data-display",
|
|
72
72
|
"client": true
|
|
73
73
|
},
|
|
74
|
+
{
|
|
75
|
+
"name": "ActionCard",
|
|
76
|
+
"label": "Action card",
|
|
77
|
+
"slug": "action-card",
|
|
78
|
+
"description": "A change an assistant proposes and the reader confirms, then the record of what happened, with Undo while it can be reversed.",
|
|
79
|
+
"category": "ai",
|
|
80
|
+
"client": false
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"name": "ActionReadout",
|
|
84
|
+
"label": "Action readout",
|
|
85
|
+
"slug": "action-readout",
|
|
86
|
+
"description": "What a confirmed change did: a title over a list of facts, worked out from the records as they were just before it.",
|
|
87
|
+
"category": "ai",
|
|
88
|
+
"client": false
|
|
89
|
+
},
|
|
74
90
|
{
|
|
75
91
|
"name": "AgentPlan",
|
|
76
92
|
"label": "Agent plan",
|
|
@@ -139,7 +155,7 @@ declare const _default: {
|
|
|
139
155
|
"name": "AppLayout",
|
|
140
156
|
"label": "App layout",
|
|
141
157
|
"slug": "app-layout",
|
|
142
|
-
"description": "Full-page template pairing the collapsible App sidebar with a content area,
|
|
158
|
+
"description": "Full-page template pairing the collapsible App sidebar with a content area, in one of the three app shell modes: flush, floating or inset.",
|
|
143
159
|
"category": "layout",
|
|
144
160
|
"client": true
|
|
145
161
|
},
|
|
@@ -562,6 +578,14 @@ declare const _default: {
|
|
|
562
578
|
"category": "data-display",
|
|
563
579
|
"client": false
|
|
564
580
|
},
|
|
581
|
+
{
|
|
582
|
+
"name": "EntitySwitcher",
|
|
583
|
+
"label": "Entity switcher",
|
|
584
|
+
"slug": "entity-switcher",
|
|
585
|
+
"description": "Switcher for the company, team, or account a screen is scoped to, with a logo, icon, or initials mark and levels that drill in.",
|
|
586
|
+
"category": "navigation",
|
|
587
|
+
"client": true
|
|
588
|
+
},
|
|
565
589
|
{
|
|
566
590
|
"name": "EventCalendar",
|
|
567
591
|
"label": "Event calendar",
|