rift-ds 1.12.0 → 1.13.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 +8 -2
- package/behaviors/visually-hidden.css +24 -0
- package/bin/rift-ds.mjs +5 -2
- package/chat/ChatAgentPane.css +5 -1
- package/chat/ChatWidget.css +0 -36
- package/chat/ResponseActions.js +2 -1
- package/components/Accordion/Accordion.css +10 -3
- package/components/AgentPlan/AgentPlan.css +0 -12
- package/components/AgentPlan/AgentPlan.js +2 -1
- package/components/AgentStatus/AgentStatus.css +1 -1
- package/components/AnimatedNumber/AnimatedNumber.css +0 -12
- package/components/AnimatedNumber/AnimatedNumber.js +2 -1
- package/components/AppSidebar/AppSidebar.css +2 -2
- package/components/Attachment/Attachment.css +0 -17
- package/components/Attachment/AttachmentTile.js +3 -2
- package/components/BottomNav/BottomNav.css +0 -9
- package/components/BottomNav/BottomNav.js +2 -1
- package/components/CardStack/CardStack.css +0 -11
- package/components/CardStack/CardStack.js +2 -1
- package/components/ChatMessage/ChatMessage.css +0 -12
- package/components/ChatMessage/ChatMessage.js +2 -1
- package/components/Checkbox/Checkbox.css +34 -25
- package/components/Checkbox/Checkbox.d.ts +34 -0
- package/components/Checkbox/Checkbox.js +64 -36
- package/components/CodeDiff/CodeDiff.css +0 -11
- package/components/CodeDiff/CodeDiff.js +3 -2
- package/components/ColourSwatch/ColourSwatch.css +1 -0
- package/components/Combobox/Combobox.css +1 -8
- package/components/Combobox/Combobox.js +2 -1
- package/components/CommandPalette/CommandPalette.css +2 -25
- package/components/CommandPalette/CommandPalette.js +8 -5
- package/components/Composer/Composer.css +0 -12
- package/components/Composer/Composer.js +3 -2
- package/components/ContactCard/ContactCard.css +1 -1
- package/components/ContextMenu/ContextMenu.css +1 -9
- package/components/ContextMenu/ContextMenu.js +3 -2
- package/components/Dialog/Dialog.css +2 -26
- package/components/Dialog/Dialog.js +8 -12
- package/components/Drawer/Drawer.css +2 -26
- package/components/Drawer/Drawer.js +8 -12
- package/components/Dropdown/ChosenMark.css +19 -0
- package/components/Dropdown/Dropdown.css +0 -12
- package/components/Dropdown/Dropdown.d.ts +23 -0
- package/components/Dropdown/Dropdown.js +18 -17
- package/components/DropdownMenu/DropdownMenu.css +3 -9
- package/components/DropdownMenu/DropdownMenu.js +3 -2
- package/components/FilterBar/FilterBar.css +0 -8
- package/components/FilterBar/FilterBar.js +9 -6
- package/components/GanttChart/GanttChart.css +0 -13
- package/components/GanttChart/GanttChart.js +3 -2
- package/components/Inspector/InspectorToggleSwitch.js +5 -10
- package/components/InterruptCard/InterruptCard.css +0 -12
- package/components/InterruptCard/InterruptCard.js +2 -1
- package/components/ModelPicker/ModelPicker.css +4 -45
- package/components/ModelPicker/ModelPicker.js +13 -50
- package/components/MotionSwatch/MotionSwatch.css +1 -1
- package/components/NotificationCenter/NotificationCenter.css +1 -13
- package/components/NotificationCenter/NotificationCenter.js +2 -1
- package/components/PromptSuggestions/PromptSuggestions.css +0 -11
- package/components/PromptSuggestions/PromptSuggestions.js +3 -2
- package/components/QuestionCard/QuestionCard.css +13 -22
- package/components/QuestionCard/QuestionCard.js +8 -13
- package/components/RadioButton/RadioButton.css +27 -11
- package/components/RadioButton/RadioButton.d.ts +18 -0
- package/components/RadioButton/RadioButton.js +12 -2
- package/components/RichDropdown/RichDropdown.css +0 -9
- package/components/RichDropdown/RichDropdown.js +2 -8
- package/components/SegmentedControl/SegmentedControl.css +2 -14
- package/components/SegmentedControl/SegmentedControl.d.ts +7 -0
- package/components/SegmentedControl/SegmentedControl.js +4 -2
- package/components/SelectionCard/SelectionCard.css +29 -160
- package/components/SelectionCard/SelectionCard.js +5 -35
- package/components/SidebarPanel/SidebarPanel.css +1 -1
- package/components/SourceTrail/SourceTrail.css +0 -13
- package/components/SourceTrail/SourceTrail.js +2 -1
- package/components/SpacingSwatch/SpacingSwatch.css +1 -1
- package/components/Stepper/Stepper.css +0 -13
- package/components/Stepper/Stepper.js +2 -1
- package/components/Table/Table.css +0 -22
- package/components/Table/Table.js +3 -2
- package/components/ThreadPanel/ThreadPanel.css +2 -16
- package/components/ThreadPanel/ThreadPanel.js +3 -2
- package/components/ThreadTabs/ThreadTabs.css +1 -15
- package/components/ThreadTabs/ThreadTabs.js +2 -1
- package/components/TimePicker/TimePicker.css +0 -12
- package/components/TimePicker/TimePicker.js +2 -8
- package/components/ToggleGroup/ToggleGroup.css +9 -2
- package/components/ToggleSwitch/ToggleSwitch.css +33 -27
- package/components/ToggleSwitch/ToggleSwitch.d.ts +19 -0
- package/components/ToggleSwitch/ToggleSwitch.js +17 -10
- package/components/Tooltip/Tooltip.css +33 -36
- package/components/Tooltip/Tooltip.d.ts +10 -0
- package/components/Tooltip/Tooltip.js +72 -3
- package/components/Waveform/Waveform.css +0 -12
- package/components/Waveform/Waveform.js +2 -1
- package/index.js +10 -4
- package/package.json +1 -1
|
@@ -1,41 +1,8 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useId } from "react";
|
|
4
4
|
import { Field } from "../Field/Field.js";
|
|
5
5
|
import "./Checkbox.css";
|
|
6
|
-
const CheckIcon = () => /* @__PURE__ */ jsx(
|
|
7
|
-
"svg",
|
|
8
|
-
{
|
|
9
|
-
className: "ds-checkbox__icon",
|
|
10
|
-
width: "14",
|
|
11
|
-
height: "14",
|
|
12
|
-
viewBox: "0 0 14 14",
|
|
13
|
-
fill: "none",
|
|
14
|
-
"aria-hidden": "true",
|
|
15
|
-
children: /* @__PURE__ */ jsx(
|
|
16
|
-
"path",
|
|
17
|
-
{
|
|
18
|
-
d: "M2 7.5L5.5 11L12 3",
|
|
19
|
-
stroke: "currentColor",
|
|
20
|
-
strokeWidth: "2",
|
|
21
|
-
strokeLinecap: "round",
|
|
22
|
-
strokeLinejoin: "round"
|
|
23
|
-
}
|
|
24
|
-
)
|
|
25
|
-
}
|
|
26
|
-
);
|
|
27
|
-
const MinusIcon = () => /* @__PURE__ */ jsx(
|
|
28
|
-
"svg",
|
|
29
|
-
{
|
|
30
|
-
className: "ds-checkbox__icon",
|
|
31
|
-
width: "14",
|
|
32
|
-
height: "14",
|
|
33
|
-
viewBox: "0 0 14 14",
|
|
34
|
-
fill: "none",
|
|
35
|
-
"aria-hidden": "true",
|
|
36
|
-
children: /* @__PURE__ */ jsx("path", { d: "M2 7H12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
6
|
const Checkbox = React.forwardRef(
|
|
40
7
|
({
|
|
41
8
|
label,
|
|
@@ -64,6 +31,7 @@ const Checkbox = React.forwardRef(
|
|
|
64
31
|
const describedBy = helperId ?? rest["aria-describedby"];
|
|
65
32
|
const classes = [
|
|
66
33
|
baseClass,
|
|
34
|
+
"ds-control-host",
|
|
67
35
|
size === "compact" ? `${baseClass}--compact` : "",
|
|
68
36
|
checked ? `${baseClass}--checked` : "",
|
|
69
37
|
indeterminate && !checked ? `${baseClass}--indeterminate` : "",
|
|
@@ -105,7 +73,7 @@ const Checkbox = React.forwardRef(
|
|
|
105
73
|
"aria-invalid": error || void 0,
|
|
106
74
|
tabIndex: disabled ? -1 : 0,
|
|
107
75
|
children: [
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
76
|
+
/* @__PURE__ */ jsx(CheckboxIndicator, { checked, indeterminate, size }),
|
|
109
77
|
helperText ? /* @__PURE__ */ jsxs("span", { className: `${baseClass}__text`, children: [
|
|
110
78
|
label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
|
|
111
79
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__helper`, id: helperId, children: helperText })
|
|
@@ -180,7 +148,67 @@ const CheckboxGroup = React.forwardRef(
|
|
|
180
148
|
}
|
|
181
149
|
);
|
|
182
150
|
CheckboxGroup.displayName = "CheckboxGroup";
|
|
151
|
+
const CheckboxIndicator = React.forwardRef(
|
|
152
|
+
({ checked = false, indeterminate = false, size = "default", className = "", ...rest }, ref) => {
|
|
153
|
+
const base = "ds-checkbox__box";
|
|
154
|
+
const classes = [
|
|
155
|
+
base,
|
|
156
|
+
checked ? `${base}--checked` : "",
|
|
157
|
+
indeterminate && !checked ? `${base}--indeterminate` : "",
|
|
158
|
+
size === "compact" ? `${base}--compact` : "",
|
|
159
|
+
className
|
|
160
|
+
].filter(Boolean).join(" ");
|
|
161
|
+
return /* @__PURE__ */ jsx("span", { "aria-hidden": "true", ...rest, ref, className: classes, children: indeterminate && !checked ? /* @__PURE__ */ jsx(MinusIcon, {}) : /* @__PURE__ */ jsx(CheckIcon, {}) });
|
|
162
|
+
}
|
|
163
|
+
);
|
|
164
|
+
CheckboxIndicator.displayName = "CheckboxIndicator";
|
|
165
|
+
const CheckIcon = React.forwardRef(
|
|
166
|
+
({ className = "ds-checkbox__icon", ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
167
|
+
"svg",
|
|
168
|
+
{
|
|
169
|
+
width: "14",
|
|
170
|
+
height: "14",
|
|
171
|
+
viewBox: "0 0 14 14",
|
|
172
|
+
fill: "none",
|
|
173
|
+
"aria-hidden": "true",
|
|
174
|
+
...rest,
|
|
175
|
+
ref,
|
|
176
|
+
className,
|
|
177
|
+
children: /* @__PURE__ */ jsx(
|
|
178
|
+
"path",
|
|
179
|
+
{
|
|
180
|
+
d: "M2 7.5L5.5 11L12 3",
|
|
181
|
+
stroke: "currentColor",
|
|
182
|
+
strokeWidth: "2",
|
|
183
|
+
strokeLinecap: "round",
|
|
184
|
+
strokeLinejoin: "round"
|
|
185
|
+
}
|
|
186
|
+
)
|
|
187
|
+
}
|
|
188
|
+
)
|
|
189
|
+
);
|
|
190
|
+
CheckIcon.displayName = "CheckIcon";
|
|
191
|
+
const MinusIcon = React.forwardRef(
|
|
192
|
+
({ className = "ds-checkbox__icon", ...rest }, ref) => /* @__PURE__ */ jsx(
|
|
193
|
+
"svg",
|
|
194
|
+
{
|
|
195
|
+
width: "14",
|
|
196
|
+
height: "14",
|
|
197
|
+
viewBox: "0 0 14 14",
|
|
198
|
+
fill: "none",
|
|
199
|
+
"aria-hidden": "true",
|
|
200
|
+
...rest,
|
|
201
|
+
ref,
|
|
202
|
+
className,
|
|
203
|
+
children: /* @__PURE__ */ jsx("path", { d: "M2 7H12", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round" })
|
|
204
|
+
}
|
|
205
|
+
)
|
|
206
|
+
);
|
|
207
|
+
MinusIcon.displayName = "MinusIcon";
|
|
183
208
|
export {
|
|
209
|
+
CheckIcon,
|
|
184
210
|
Checkbox,
|
|
185
|
-
CheckboxGroup
|
|
211
|
+
CheckboxGroup,
|
|
212
|
+
CheckboxIndicator,
|
|
213
|
+
MinusIcon
|
|
186
214
|
};
|
|
@@ -162,14 +162,3 @@
|
|
|
162
162
|
itself is decorative (aria-hidden).
|
|
163
163
|
============================================ */
|
|
164
164
|
|
|
165
|
-
.ds-codediff__sr-only {
|
|
166
|
-
position: absolute;
|
|
167
|
-
width: 1px;
|
|
168
|
-
height: 1px;
|
|
169
|
-
padding: 0;
|
|
170
|
-
margin: -1px;
|
|
171
|
-
overflow: hidden;
|
|
172
|
-
clip: rect(0, 0, 0, 0);
|
|
173
|
-
white-space: nowrap;
|
|
174
|
-
border: 0;
|
|
175
|
-
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import "./CodeDiff.css";
|
|
4
|
+
import "../../behaviors/visually-hidden.css";
|
|
4
5
|
const HUNK_HEADER = /^@@\s+-(\d+)(?:,(\d+))?\s+\+(\d+)(?:,(\d+))?\s+@@/;
|
|
5
6
|
function parseUnifiedDiff(diff) {
|
|
6
7
|
const rawLines = diff.replace(/\n$/, "").split("\n");
|
|
@@ -109,7 +110,7 @@ const CodeDiff = React.forwardRef(
|
|
|
109
110
|
]
|
|
110
111
|
}
|
|
111
112
|
),
|
|
112
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
113
|
+
/* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", children: statsLabel(additions, deletions) })
|
|
113
114
|
] })
|
|
114
115
|
] }),
|
|
115
116
|
/* @__PURE__ */ jsx(
|
|
@@ -136,7 +137,7 @@ const CodeDiff = React.forwardRef(
|
|
|
136
137
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__gutter`, "aria-hidden": "true", children: line.newLine ?? "" })
|
|
137
138
|
] }),
|
|
138
139
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__marker`, "aria-hidden": "true", children: line.type === "add" ? "+" : line.type === "remove" ? "-" : "" }),
|
|
139
|
-
changeLabel && /* @__PURE__ */ jsxs("span", { className:
|
|
140
|
+
changeLabel && /* @__PURE__ */ jsxs("span", { className: "ds-visually-hidden", children: [
|
|
140
141
|
changeLabel,
|
|
141
142
|
" "
|
|
142
143
|
] }),
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
/* Appearance */
|
|
19
19
|
border: var(--border-025) solid var(--color-bg-container-border);
|
|
20
20
|
border-radius: var(--radius-600); /* 24px */
|
|
21
|
+
background-color: var(--color-bg-container-primary);
|
|
21
22
|
padding: var(--padding-500); /* 20px */
|
|
22
23
|
overflow: hidden;
|
|
23
24
|
position: relative;
|
|
@@ -260,12 +260,6 @@
|
|
|
260
260
|
color: var(--color-text-tertiary);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
-
.ds-combobox__check {
|
|
264
|
-
--icon-size: var(--icon-size-600);
|
|
265
|
-
color: var(--color-action-primary-bg);
|
|
266
|
-
flex-shrink: 0;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
263
|
/* ============================================
|
|
270
264
|
GROUPS
|
|
271
265
|
============================================ */
|
|
@@ -359,8 +353,7 @@
|
|
|
359
353
|
}
|
|
360
354
|
|
|
361
355
|
.ds-combobox--compact .ds-combobox__search-icon,
|
|
362
|
-
.ds-combobox--compact .ds-combobox__chevron
|
|
363
|
-
.ds-combobox--compact .ds-combobox__check {
|
|
356
|
+
.ds-combobox--compact .ds-combobox__chevron {
|
|
364
357
|
--icon-size: var(--icon-size-500);
|
|
365
358
|
}
|
|
366
359
|
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useRef, useId, useMemo, useCallback, useEffect } from "react";
|
|
4
|
+
import { ChosenMark } from "../Dropdown/Dropdown.js";
|
|
4
5
|
import { useLayer } from "../../behaviors/useLayer.js";
|
|
5
6
|
import { Field } from "../Field/Field.js";
|
|
6
7
|
import "./Combobox.css";
|
|
@@ -231,7 +232,7 @@ const Combobox = React.forwardRef(({
|
|
|
231
232
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__option-label`, children: option.label }),
|
|
232
233
|
option.description && /* @__PURE__ */ jsx("span", { className: `${baseClass}__option-description`, children: option.description })
|
|
233
234
|
] }),
|
|
234
|
-
isSelected && /* @__PURE__ */ jsx(
|
|
235
|
+
isSelected && /* @__PURE__ */ jsx(ChosenMark, {})
|
|
235
236
|
]
|
|
236
237
|
},
|
|
237
238
|
option.value
|
|
@@ -114,33 +114,10 @@
|
|
|
114
114
|
color: var(--color-input-text-placeholder);
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
/* The close is the library's CircularButton (tertiary, compact); the
|
|
118
|
+
header only seats it. */
|
|
117
119
|
.ds-command-palette__close {
|
|
118
|
-
display: inline-flex;
|
|
119
|
-
align-items: center;
|
|
120
|
-
justify-content: center;
|
|
121
|
-
width: 32px;
|
|
122
|
-
height: 32px;
|
|
123
|
-
padding: 0;
|
|
124
|
-
border: none;
|
|
125
|
-
border-radius: var(--radius-pill);
|
|
126
|
-
background-color: transparent;
|
|
127
|
-
color: var(--color-icon-primary);
|
|
128
|
-
cursor: pointer;
|
|
129
120
|
flex-shrink: 0;
|
|
130
|
-
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
.ds-command-palette__close:hover {
|
|
134
|
-
background-color: var(--color-action-passive-bg-hover);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ds-command-palette__close:focus-visible {
|
|
138
|
-
outline: 2px solid var(--color-action-primary-bg);
|
|
139
|
-
outline-offset: 2px;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
.ds-command-palette__close .material-symbols-rounded {
|
|
143
|
-
--icon-size: var(--icon-size-500);
|
|
144
121
|
}
|
|
145
122
|
|
|
146
123
|
/* ============================================
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useRef, useCallback, useId, useMemo, useEffect } from "react";
|
|
4
|
+
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
4
5
|
import ReactDOM from "react-dom";
|
|
5
6
|
import { Kbd } from "../Kbd/Kbd.js";
|
|
6
7
|
import "./CommandPalette.css";
|
|
@@ -182,13 +183,15 @@ const CommandPalette = React.forwardRef(({
|
|
|
182
183
|
}
|
|
183
184
|
),
|
|
184
185
|
/* @__PURE__ */ jsx(
|
|
185
|
-
|
|
186
|
+
CircularButton,
|
|
186
187
|
{
|
|
187
|
-
type: "button",
|
|
188
188
|
className: `${baseClass}__close`,
|
|
189
|
-
|
|
190
|
-
"
|
|
191
|
-
|
|
189
|
+
icon: "close",
|
|
190
|
+
variant: "tertiary",
|
|
191
|
+
size: "compact",
|
|
192
|
+
tooltip: false,
|
|
193
|
+
ariaLabel: closeLabel,
|
|
194
|
+
onClick: () => onOpenChange(false)
|
|
192
195
|
}
|
|
193
196
|
)
|
|
194
197
|
] }),
|
|
@@ -406,18 +406,6 @@
|
|
|
406
406
|
display: none;
|
|
407
407
|
}
|
|
408
408
|
|
|
409
|
-
.ds-composer__sr-only {
|
|
410
|
-
position: absolute;
|
|
411
|
-
width: 1px;
|
|
412
|
-
height: 1px;
|
|
413
|
-
padding: 0;
|
|
414
|
-
margin: -1px;
|
|
415
|
-
overflow: hidden;
|
|
416
|
-
clip: rect(0, 0, 0, 0);
|
|
417
|
-
white-space: nowrap;
|
|
418
|
-
border: 0;
|
|
419
|
-
}
|
|
420
|
-
|
|
421
409
|
/* ============================================
|
|
422
410
|
ATTACHMENTS ROW (legacy free-form slot)
|
|
423
411
|
============================================ */
|
|
@@ -7,6 +7,7 @@ import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
|
7
7
|
import { MentionText, MentionMenu } from "../Mention/Mention.js";
|
|
8
8
|
import "../../fonts/material-symbols.css";
|
|
9
9
|
import "./Composer.css";
|
|
10
|
+
import "../../behaviors/visually-hidden.css";
|
|
10
11
|
import { getMentionQuery, filterMentionItems, mentionOptionId, mentionListboxId, insertMention } from "../Mention/mentions.js";
|
|
11
12
|
const defaultFileAnnouncement = ({
|
|
12
13
|
type,
|
|
@@ -510,9 +511,9 @@ const Composer = React.forwardRef(
|
|
|
510
511
|
),
|
|
511
512
|
/* @__PURE__ */ jsx("div", { className: `${baseClass}__drop-hint`, "aria-hidden": "true", children: dropLabel })
|
|
512
513
|
] }),
|
|
513
|
-
(armed || hasFiles) && /* @__PURE__ */ jsx("span", { className:
|
|
514
|
+
(armed || hasFiles) && /* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", role: "status", children: announcement }),
|
|
514
515
|
mentionsArmed && /* The menu opens without moving focus, so its arrival is said here */
|
|
515
|
-
/* @__PURE__ */ jsx("span", { className:
|
|
516
|
+
/* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", role: "status", children: mentionOpen ? formatMentionAnnouncement(choosable.length) : "" })
|
|
516
517
|
]
|
|
517
518
|
}
|
|
518
519
|
);
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
align-items: center;
|
|
7
7
|
gap: var(--gap-500);
|
|
8
8
|
padding: var(--padding-500);
|
|
9
|
-
border:
|
|
9
|
+
border: var(--border-025) solid var(--color-bg-container-border);
|
|
10
10
|
border-radius: var(--radius-300);
|
|
11
11
|
background: var(--color-bg-container-primary-semi);
|
|
12
12
|
text-decoration: none;
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
justify-content: space-between;
|
|
94
94
|
gap: var(--gap-400);
|
|
95
95
|
padding: var(--padding-200) var(--padding-400);
|
|
96
|
-
border-radius: var(--radius-
|
|
96
|
+
border-radius: var(--radius-200); /* the inner step inside the --radius-300 panel, like every overlay row */
|
|
97
97
|
cursor: pointer;
|
|
98
98
|
position: relative;
|
|
99
99
|
white-space: nowrap;
|
|
@@ -131,14 +131,6 @@
|
|
|
131
131
|
color: var(--color-icon-primary);
|
|
132
132
|
}
|
|
133
133
|
|
|
134
|
-
.ds-context-menu__check {
|
|
135
|
-
--icon-size: var(--icon-size-500);
|
|
136
|
-
color: var(--color-icon-primary);
|
|
137
|
-
margin-left: auto;
|
|
138
|
-
flex-shrink: 0;
|
|
139
|
-
line-height: 1;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
134
|
/* States — disabled */
|
|
143
135
|
.ds-context-menu__item--disabled {
|
|
144
136
|
opacity: 0.4;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useRef, useId, useCallback, useEffect, useLayoutEffect } from "react";
|
|
4
|
+
import { ChosenMark } from "../Dropdown/Dropdown.js";
|
|
4
5
|
import { useLayer } from "../../behaviors/useLayer.js";
|
|
5
6
|
import { MOTION_HOVER_HIDE_DELAY_MS } from "../../tokens/motion.js";
|
|
6
7
|
import "./ContextMenu.css";
|
|
@@ -147,7 +148,7 @@ const SubEntry = ({
|
|
|
147
148
|
entry.label
|
|
148
149
|
] }),
|
|
149
150
|
entry.shortcut && /* @__PURE__ */ jsx("span", { className: `${baseClass}__shortcut`, children: entry.shortcut }),
|
|
150
|
-
entry.selected && /* @__PURE__ */ jsx(
|
|
151
|
+
entry.selected && /* @__PURE__ */ jsx(ChosenMark, {})
|
|
151
152
|
]
|
|
152
153
|
}
|
|
153
154
|
);
|
|
@@ -354,7 +355,7 @@ const ContextMenu = React.forwardRef(
|
|
|
354
355
|
entry.label
|
|
355
356
|
] }),
|
|
356
357
|
entry.shortcut && /* @__PURE__ */ jsx("span", { className: `${baseClass}__shortcut`, children: entry.shortcut }),
|
|
357
|
-
entry.selected && /* @__PURE__ */ jsx(
|
|
358
|
+
entry.selected && /* @__PURE__ */ jsx(ChosenMark, {})
|
|
358
359
|
]
|
|
359
360
|
},
|
|
360
361
|
`item-${index}`
|
|
@@ -110,34 +110,10 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/* Close button — ghost icon button */
|
|
113
|
+
/* The close is the library's CircularButton (tertiary, compact); the
|
|
114
|
+
header only seats it. */
|
|
113
115
|
.ds-dialog__close {
|
|
114
116
|
flex-shrink: 0;
|
|
115
|
-
display: inline-flex;
|
|
116
|
-
align-items: center;
|
|
117
|
-
justify-content: center;
|
|
118
|
-
width: 32px;
|
|
119
|
-
height: 32px;
|
|
120
|
-
padding: 0;
|
|
121
|
-
border: none;
|
|
122
|
-
border-radius: var(--radius-pill); /* pill */
|
|
123
|
-
background-color: transparent;
|
|
124
|
-
cursor: pointer;
|
|
125
|
-
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
.ds-dialog__close:hover {
|
|
129
|
-
background-color: var(--color-action-passive-bg-hover);
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
.ds-dialog__close:focus-visible {
|
|
133
|
-
outline: 2px solid var(--color-action-primary-bg);
|
|
134
|
-
outline-offset: 2px;
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
.ds-dialog__close-icon {
|
|
138
|
-
--icon-size: var(--icon-size-500);
|
|
139
|
-
line-height: 1;
|
|
140
|
-
color: var(--color-icon-primary);
|
|
141
117
|
}
|
|
142
118
|
|
|
143
119
|
/* ============================================
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useId } from "react";
|
|
4
|
+
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
4
5
|
import ReactDOM from "react-dom";
|
|
5
6
|
import "./Dialog.css";
|
|
6
7
|
import "../../fonts/material-symbols.css";
|
|
@@ -64,20 +65,15 @@ const Dialog = React.forwardRef(
|
|
|
64
65
|
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description })
|
|
65
66
|
] }),
|
|
66
67
|
dismissible && /* @__PURE__ */ jsx(
|
|
67
|
-
|
|
68
|
+
CircularButton,
|
|
68
69
|
{
|
|
69
|
-
type: "button",
|
|
70
70
|
className: `${baseClass}__close`,
|
|
71
|
-
|
|
72
|
-
"
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
"aria-hidden": "true",
|
|
78
|
-
children: "close"
|
|
79
|
-
}
|
|
80
|
-
)
|
|
71
|
+
icon: "close",
|
|
72
|
+
variant: "tertiary",
|
|
73
|
+
size: "compact",
|
|
74
|
+
tooltip: false,
|
|
75
|
+
ariaLabel: closeLabel,
|
|
76
|
+
onClick: () => onOpenChange(false)
|
|
81
77
|
}
|
|
82
78
|
)
|
|
83
79
|
] }),
|
|
@@ -179,34 +179,10 @@
|
|
|
179
179
|
}
|
|
180
180
|
|
|
181
181
|
/* Close button — ghost icon button */
|
|
182
|
+
/* The close is the library's CircularButton (tertiary, compact); the
|
|
183
|
+
header only seats it. */
|
|
182
184
|
.ds-drawer__close {
|
|
183
185
|
flex-shrink: 0;
|
|
184
|
-
display: inline-flex;
|
|
185
|
-
align-items: center;
|
|
186
|
-
justify-content: center;
|
|
187
|
-
width: 32px;
|
|
188
|
-
height: 32px;
|
|
189
|
-
padding: 0;
|
|
190
|
-
border: none;
|
|
191
|
-
border-radius: var(--radius-pill); /* pill */
|
|
192
|
-
background-color: transparent;
|
|
193
|
-
cursor: pointer;
|
|
194
|
-
transition: background-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
.ds-drawer__close:hover {
|
|
198
|
-
background-color: var(--color-action-passive-bg-hover);
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
.ds-drawer__close:focus-visible {
|
|
202
|
-
outline: 2px solid var(--color-action-primary-bg);
|
|
203
|
-
outline-offset: 2px;
|
|
204
|
-
}
|
|
205
|
-
|
|
206
|
-
.ds-drawer__close-icon {
|
|
207
|
-
--icon-size: var(--icon-size-500);
|
|
208
|
-
line-height: 1;
|
|
209
|
-
color: var(--color-icon-primary);
|
|
210
186
|
}
|
|
211
187
|
|
|
212
188
|
/* ============================================
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useId } from "react";
|
|
4
|
+
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
4
5
|
import ReactDOM from "react-dom";
|
|
5
6
|
import "./Drawer.css";
|
|
6
7
|
import "../../fonts/material-symbols.css";
|
|
@@ -66,20 +67,15 @@ const Drawer = React.forwardRef(
|
|
|
66
67
|
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description })
|
|
67
68
|
] }),
|
|
68
69
|
dismissible && /* @__PURE__ */ jsx(
|
|
69
|
-
|
|
70
|
+
CircularButton,
|
|
70
71
|
{
|
|
71
|
-
type: "button",
|
|
72
72
|
className: `${baseClass}__close`,
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"aria-hidden": "true",
|
|
80
|
-
children: "close"
|
|
81
|
-
}
|
|
82
|
-
)
|
|
73
|
+
icon: "close",
|
|
74
|
+
variant: "tertiary",
|
|
75
|
+
size: "compact",
|
|
76
|
+
tooltip: false,
|
|
77
|
+
ariaLabel: closeLabel,
|
|
78
|
+
onClick: () => onOpenChange(false)
|
|
83
79
|
}
|
|
84
80
|
)
|
|
85
81
|
] }),
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/* ============================================
|
|
2
|
+
CHOSEN MARK
|
|
3
|
+
The trailing check on a selected list or menu
|
|
4
|
+
row: one size and one colour across every
|
|
5
|
+
listbox and menu. The action colour, because
|
|
6
|
+
the mark names the selected item of a
|
|
7
|
+
mutually exclusive set, the role design.md
|
|
8
|
+
reserves it for. Rows at either density take
|
|
9
|
+
the compact icon step, since the mark is a
|
|
10
|
+
tick beside a label, not a leading icon.
|
|
11
|
+
============================================ */
|
|
12
|
+
|
|
13
|
+
.ds-chosen-mark {
|
|
14
|
+
--icon-size: var(--icon-size-500);
|
|
15
|
+
flex-shrink: 0;
|
|
16
|
+
margin-left: auto;
|
|
17
|
+
color: var(--color-action-primary-bg);
|
|
18
|
+
line-height: 1;
|
|
19
|
+
}
|
|
@@ -201,15 +201,6 @@
|
|
|
201
201
|
list-style: none;
|
|
202
202
|
}
|
|
203
203
|
|
|
204
|
-
/* ============================================
|
|
205
|
-
CHECK ICON
|
|
206
|
-
============================================ */
|
|
207
|
-
|
|
208
|
-
.ds-dropdown__check {
|
|
209
|
-
--icon-size: var(--icon-size-600);
|
|
210
|
-
color: var(--color-action-primary-bg);
|
|
211
|
-
}
|
|
212
|
-
|
|
213
204
|
/* The option row's icon-and-label cluster, so the selected check keeps its
|
|
214
205
|
own end of the space-between row. */
|
|
215
206
|
.ds-dropdown__option-content {
|
|
@@ -283,6 +274,3 @@
|
|
|
283
274
|
/* Compact group labels keep the base --font-paragraph-sm-* type — the
|
|
284
275
|
scale has no smaller step. */
|
|
285
276
|
|
|
286
|
-
.ds-dropdown--compact .ds-dropdown__check {
|
|
287
|
-
--icon-size: var(--icon-size-500);
|
|
288
|
-
}
|
|
@@ -89,4 +89,27 @@ export interface DropdownProps extends DropdownOwnProps, Omit<React.ComponentPro
|
|
|
89
89
|
* to the trigger, the element that carries the combobox role.
|
|
90
90
|
*/
|
|
91
91
|
export declare const Dropdown: React.ForwardRefExoticComponent<DropdownProps & React.RefAttributes<HTMLDivElement>>;
|
|
92
|
+
/** Props owned by ChosenMark itself — everything else falls through to the <span>. */
|
|
93
|
+
type ChosenMarkOwnProps = {
|
|
94
|
+
/** Additional CSS classes */
|
|
95
|
+
className?: string;
|
|
96
|
+
};
|
|
97
|
+
export interface ChosenMarkProps extends ChosenMarkOwnProps, Omit<React.ComponentPropsWithoutRef<'span'>, keyof ChosenMarkOwnProps | 'children'> {
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* The chosen mark: the trailing check a list or menu row shows on the item
|
|
101
|
+
* that is currently selected. One glyph, one colour and one size for every
|
|
102
|
+
* listbox and menu in the library (Dropdown, Combobox, RichDropdown,
|
|
103
|
+
* TimePicker, ModelPicker, DropdownMenu, ContextMenu, FilterBar's
|
|
104
|
+
* single-select), so a chosen row reads the same wherever it appears. The
|
|
105
|
+
* row renders it only when its item is selected; the row's `aria-selected`
|
|
106
|
+
* or `aria-checked` carries the state, so the mark itself is hidden from
|
|
107
|
+
* assistive technology.
|
|
108
|
+
*
|
|
109
|
+
* It is a mark, not a control: a row whose items are picked independently
|
|
110
|
+
* (a multi-select) shows a CheckboxIndicator instead, and a row that is a
|
|
111
|
+
* control in its own right (SelectionCard, QuestionCard) carries the real
|
|
112
|
+
* indicator.
|
|
113
|
+
*/
|
|
114
|
+
export declare const ChosenMark: React.ForwardRefExoticComponent<ChosenMarkProps & React.RefAttributes<HTMLSpanElement>>;
|
|
92
115
|
export {};
|