rift-ds 1.19.0 → 1.20.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/components/AgentStatus/AgentStatus.css +8 -0
- package/components/AppSidebar/AppSidebar.css +37 -0
- package/components/AppSidebar/AppSidebar.d.ts +2 -0
- package/components/AppSidebar/AppSidebar.js +248 -215
- package/components/Attachment/AttachmentViewer.js +2 -0
- package/components/BentoTile/BentoTile.js +2 -0
- package/components/Checkbox/Checkbox.css +4 -1
- package/components/Checkbox/Checkbox.d.ts +12 -5
- package/components/Checkbox/Checkbox.js +7 -2
- package/components/ColorPicker/ColorPicker.js +3 -1
- package/components/Combobox/Combobox.d.ts +1 -1
- package/components/Composer/Composer.css +42 -2
- package/components/Composer/Composer.d.ts +1 -1
- package/components/Composer/Composer.js +1 -0
- package/components/Dropdown/Dropdown.d.ts +4 -4
- package/components/Dropdown/Dropdown.js +1 -0
- package/components/EventCalendar/EventCalendar.css +3 -1
- package/components/LegendTile/LegendTile.css +10 -3
- package/components/LegendTile/LegendTile.d.ts +1 -1
- package/components/LegendTile/LegendTile.js +1 -1
- package/components/PinInput/PinInput.d.ts +6 -0
- package/components/PinInput/PinInput.js +38 -34
- package/components/RadioButton/RadioButton.css +4 -1
- package/components/RadioButton/RadioButton.d.ts +10 -12
- package/components/RadioButton/RadioButton.js +8 -6
- package/components/Reasoning/Reasoning.css +14 -0
- package/components/RichDropdown/RichDropdown.d.ts +4 -5
- package/components/RichDropdown/RichDropdown.js +1 -0
- package/components/SegmentedControl/SegmentedControl.css +43 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +16 -2
- package/components/SegmentedControl/SegmentedControl.js +41 -4
- package/components/SelectionCard/SelectionCard.d.ts +7 -1
- package/components/SelectionCard/SelectionCard.js +2 -1
- package/components/Stat/Stat.css +2 -2
- package/components/TableToolbar/TableToolbar.css +15 -4
- package/components/TableToolbar/TableToolbar.d.ts +1 -0
- package/components/TableToolbar/TableToolbar.js +18 -9
- package/components/Tabs/Tabs.d.ts +2 -0
- package/components/Tabs/Tabs.js +1 -0
- package/components/TagInput/TagInput.d.ts +7 -0
- package/components/TagInput/TagInput.js +5 -3
- package/components/ThemeToggle/ThemeToggle.css +3 -25
- package/components/ThemeToggle/ThemeToggle.js +8 -20
- package/components/TimePicker/TimePicker.d.ts +6 -0
- package/components/TimePicker/TimePicker.js +4 -0
- package/components/Timeline/Timeline.css +7 -2
- package/components/Timeline/Timeline.d.ts +4 -4
- package/components/ToggleSwitch/ToggleSwitch.d.ts +8 -0
- package/components/ToggleSwitch/ToggleSwitch.js +6 -1
- package/components/ToolCall/ToolCall.css +11 -3
- package/components/TypographySwatch/TypographySwatch.css +3 -1
- package/components/WorldMap/WorldMap.d.ts +1 -1
- package/components/WorldMap/WorldMap.js +1 -1
- package/components/registry.json +1 -1
- package/components/registry.json.d.ts +1 -1
- package/components/registry.json.js +1 -1
- package/package.json +5 -1
- package/tokens/presets/contrast.css +8 -8
- package/tokens/presets/forest.css +10 -8
- package/tokens/presets/gold.css +12 -10
- package/tokens/presets/marquee.css +9 -9
- package/tokens/presets/mono.css +14 -0
- package/tokens/presets/pink.css +8 -8
- package/tokens/presets/terminal.css +8 -8
- package/tokens/presets/violet.css +8 -8
- package/tokens/presets/warm.css +8 -8
- package/tokens/presets/zest.css +10 -8
- 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 +5 -1
- package/tokens/tokens-light.css +23 -18
- package/tokens/values.d.ts +34 -0
- package/tokens/values.js +11 -0
- package/tokens/values.json.js +8 -0
|
@@ -8,6 +8,8 @@ export interface Segment {
|
|
|
8
8
|
icon?: string | React.ReactNode;
|
|
9
9
|
/** Whether disabled */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** The id of the `role="tabpanel"` element this segment shows, written as its `aria-controls`. The consumer renders the panels. */
|
|
12
|
+
panelId?: string;
|
|
11
13
|
}
|
|
12
14
|
/** Props owned by SegmentedControl itself — everything else falls through to the strip. */
|
|
13
15
|
type SegmentedControlOwnProps = {
|
|
@@ -77,6 +79,17 @@ type SegmentedControlOwnProps = {
|
|
|
77
79
|
* @deprecated Pass the native `aria-label` attribute instead.
|
|
78
80
|
*/
|
|
79
81
|
ariaLabel?: string;
|
|
82
|
+
/**
|
|
83
|
+
* Draw one circle in place of the strip, for a seat with room for a single
|
|
84
|
+
* control (a collapsed rail's foot, a condensed header's actions): it shows
|
|
85
|
+
* the current segment's glyph (a segment without an icon shows its label's
|
|
86
|
+
* first character), each press steps to the next enabled segment, round
|
|
87
|
+
* again, and the current label is its tooltip. Its accessible name comes
|
|
88
|
+
* from `cycleLabel`. ThemeToggle's `cycle` is this form.
|
|
89
|
+
*/
|
|
90
|
+
cycle?: boolean;
|
|
91
|
+
/** The cycle circle's accessible name, from the current segment's label and the next one's. Default: the control's `aria-label`, then both, as in "View: List. Switch to Grid". */
|
|
92
|
+
cycleLabel?: (current: string, next: string) => string;
|
|
80
93
|
/** Additional CSS classes */
|
|
81
94
|
className?: string;
|
|
82
95
|
};
|
|
@@ -87,8 +100,9 @@ export interface SegmentedControlProps extends SegmentedControlOwnProps, Omit<Re
|
|
|
87
100
|
* A horizontal set of mutually exclusive options with a
|
|
88
101
|
* pill-shaped active indicator. Supports icons and keyboard navigation.
|
|
89
102
|
*
|
|
90
|
-
* Forwards a ref to the `role="tablist"` strip, the component's only wrapper
|
|
91
|
-
* and spreads unrecognised props
|
|
103
|
+
* Forwards a ref to the `role="tablist"` strip, the component's only wrapper
|
|
104
|
+
* (in the `cycle` form, the circle's wrapper), and spreads unrecognised props
|
|
105
|
+
* onto it.
|
|
92
106
|
*/
|
|
93
107
|
export declare const SegmentedControl: React.ForwardRefExoticComponent<SegmentedControlProps & React.RefAttributes<HTMLDivElement>>;
|
|
94
108
|
export {};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
2
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { useState, useRef, useCallback, useLayoutEffect } from "react";
|
|
4
4
|
import "./SegmentedControl.css";
|
|
5
5
|
import "../../behaviors/visually-hidden.css";
|
|
@@ -7,6 +7,7 @@ import "../../fonts/material-symbols.css";
|
|
|
7
7
|
import { mirrorClass, logicalArrowKey } from "../../behaviors/direction.js";
|
|
8
8
|
import { useAnchoredPosition } from "../../behaviors/useAnchoredPosition.js";
|
|
9
9
|
import { useTopLayer } from "../../behaviors/useTopLayer.js";
|
|
10
|
+
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
10
11
|
const SegmentedControl = React.forwardRef(
|
|
11
12
|
({
|
|
12
13
|
segments,
|
|
@@ -22,9 +23,13 @@ const SegmentedControl = React.forwardRef(
|
|
|
22
23
|
collapse = false,
|
|
23
24
|
showLabels = true,
|
|
24
25
|
ariaLabel,
|
|
26
|
+
cycle = false,
|
|
27
|
+
cycleLabel,
|
|
25
28
|
className = "",
|
|
29
|
+
"aria-label": nativeAriaLabel,
|
|
26
30
|
...rest
|
|
27
31
|
}, ref) => {
|
|
32
|
+
const name = nativeAriaLabel ?? ariaLabel;
|
|
28
33
|
const controlledValue = value ?? legacyActiveSegment;
|
|
29
34
|
const isControlled = controlledValue !== void 0;
|
|
30
35
|
const [internalValue, setInternalValue] = useState(
|
|
@@ -153,8 +158,9 @@ const SegmentedControl = React.forwardRef(
|
|
|
153
158
|
}
|
|
154
159
|
const metrics = metricsRef.current;
|
|
155
160
|
if (!metrics) return;
|
|
156
|
-
const
|
|
157
|
-
|
|
161
|
+
const hostStyle = getComputedStyle(host);
|
|
162
|
+
const available = host.clientWidth - parseFloat(hostStyle.paddingInlineStart) - parseFloat(hostStyle.paddingInlineEnd);
|
|
163
|
+
if (host.clientWidth === 0) return;
|
|
158
164
|
const next = available >= metrics.full ? "full" : available >= metrics.labels || !everySegmentHasIcon ? "labels" : "icons";
|
|
159
165
|
setCollapseState(
|
|
160
166
|
(current) => current.key === collapseKey && current.mode === next ? current : { key: collapseKey, mode: next }
|
|
@@ -239,10 +245,40 @@ const SegmentedControl = React.forwardRef(
|
|
|
239
245
|
});
|
|
240
246
|
}
|
|
241
247
|
};
|
|
248
|
+
if (cycle) {
|
|
249
|
+
const enabled = segments.filter((segment) => !segment.disabled);
|
|
250
|
+
const current = segments.find((segment) => segment.value === activeSegment) ?? enabled[0] ?? segments[0];
|
|
251
|
+
const currentIndex = segments.indexOf(current);
|
|
252
|
+
const next = [...segments.slice(currentIndex + 1), ...segments.slice(0, currentIndex + 1)].find(
|
|
253
|
+
(segment) => !segment.disabled
|
|
254
|
+
) ?? current;
|
|
255
|
+
const label = current && (cycleLabel ? cycleLabel(current.label, next.label) : `${name ? `${name}: ` : ""}${current.label}. Switch to ${next.label}`);
|
|
256
|
+
return /* @__PURE__ */ jsx(
|
|
257
|
+
"div",
|
|
258
|
+
{
|
|
259
|
+
...rest,
|
|
260
|
+
ref: setRef,
|
|
261
|
+
className: [baseClass, sizeClass, variantClass, `${baseClass}--cycle`, className].filter(Boolean).join(" "),
|
|
262
|
+
children: current && /* @__PURE__ */ jsx(
|
|
263
|
+
CircularButton,
|
|
264
|
+
{
|
|
265
|
+
icon: current.icon ?? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: current.label.charAt(0) }),
|
|
266
|
+
size,
|
|
267
|
+
variant: "secondary",
|
|
268
|
+
tone: "neutral",
|
|
269
|
+
ariaLabel: label,
|
|
270
|
+
tooltip: current.label,
|
|
271
|
+
disabled: next === current,
|
|
272
|
+
onClick: () => select(next.value)
|
|
273
|
+
}
|
|
274
|
+
)
|
|
275
|
+
}
|
|
276
|
+
);
|
|
277
|
+
}
|
|
242
278
|
return /* @__PURE__ */ jsxs(
|
|
243
279
|
"div",
|
|
244
280
|
{
|
|
245
|
-
"aria-label":
|
|
281
|
+
"aria-label": name,
|
|
246
282
|
...rest,
|
|
247
283
|
ref: setRef,
|
|
248
284
|
className: classes,
|
|
@@ -272,6 +308,7 @@ const SegmentedControl = React.forwardRef(
|
|
|
272
308
|
className: btnClasses,
|
|
273
309
|
"aria-selected": isActive,
|
|
274
310
|
"aria-disabled": segment.disabled || void 0,
|
|
311
|
+
"aria-controls": segment.panelId,
|
|
275
312
|
disabled: segment.disabled,
|
|
276
313
|
tabIndex: isActive ? 0 : -1,
|
|
277
314
|
"data-segment-value": segment.value,
|
|
@@ -25,7 +25,13 @@ type SelectionCardOwnProps = {
|
|
|
25
25
|
defaultValue?: string | string[];
|
|
26
26
|
/** Called with the next selection — a string in radio mode, an array otherwise */
|
|
27
27
|
onValueChange?: (value: string | string[]) => void;
|
|
28
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Form field name, also the group's aria-label when none is given. When set,
|
|
30
|
+
* each selected option's `value` submits with an enclosing form through a
|
|
31
|
+
* hidden input, repeated in checkbox and toggle modes as a set of native
|
|
32
|
+
* checkboxes does; a disabled option submits nothing. In a form, name the group
|
|
33
|
+
* with `aria-label` too, so a field key is never what a screen reader announces.
|
|
34
|
+
*/
|
|
29
35
|
name?: string;
|
|
30
36
|
/** Additional CSS classes */
|
|
31
37
|
className?: string;
|
|
@@ -70,7 +70,8 @@ const SelectionCard = React.forwardRef(
|
|
|
70
70
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: option.label }),
|
|
71
71
|
option.description && /* @__PURE__ */ jsx("span", { className: `${baseClass}__description`, children: option.description })
|
|
72
72
|
] }),
|
|
73
|
-
/* @__PURE__ */ jsx("div", { className: `${baseClass}__indicator`, children: mode === "radio" ? /* @__PURE__ */ jsx(RadioIndicator, { checked: selected }) : mode === "toggle" ? /* @__PURE__ */ jsx(SwitchIndicator, { checked: selected }) : /* @__PURE__ */ jsx(CheckboxIndicator, { checked: selected }) })
|
|
73
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__indicator`, children: mode === "radio" ? /* @__PURE__ */ jsx(RadioIndicator, { checked: selected }) : mode === "toggle" ? /* @__PURE__ */ jsx(SwitchIndicator, { checked: selected }) : /* @__PURE__ */ jsx(CheckboxIndicator, { checked: selected }) }),
|
|
74
|
+
name && selected && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: option.value, disabled: option.disabled })
|
|
74
75
|
]
|
|
75
76
|
},
|
|
76
77
|
option.value
|
package/components/Stat/Stat.css
CHANGED
|
@@ -66,8 +66,8 @@
|
|
|
66
66
|
line-height: 1;
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
/* The trend tokens are theme-split for contrast:
|
|
70
|
-
|
|
69
|
+
/* The trend tokens are theme-split for contrast: the brightest ramp steps
|
|
70
|
+
that hold AA on the primary container, the mint/coral accents on dark ones. */
|
|
71
71
|
.ds-stat__delta--up {
|
|
72
72
|
color: var(--color-trend-up);
|
|
73
73
|
}
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
TABLE TOOLBAR
|
|
3
3
|
The control bar over a table: search, filter chips, the More panel's columns,
|
|
4
4
|
the density switch, the count, the actions and the AI command, in one line.
|
|
5
|
+
A long AI command grows its own row.
|
|
5
6
|
============================================ */
|
|
6
7
|
|
|
7
8
|
.ds-table-toolbar {
|
|
@@ -120,6 +121,7 @@
|
|
|
120
121
|
chip's editor) holds its pressed fill until the panel closes, so the
|
|
121
122
|
bar says which control the open panel belongs to. */
|
|
122
123
|
.ds-table-toolbar .ds-circular-button--tertiary[aria-expanded='true'],
|
|
124
|
+
.ds-table-toolbar .ds-circular-button--secondary-neutral[aria-expanded='true'],
|
|
123
125
|
.ds-table-toolbar .ds-chip[aria-expanded='true'],
|
|
124
126
|
.ds-table-toolbar .ds-button[aria-expanded='true'] {
|
|
125
127
|
background-color: var(--color-action-passive-bg-active);
|
|
@@ -302,7 +304,7 @@
|
|
|
302
304
|
|
|
303
305
|
/* A count on an icon's top-end corner, drawn as BottomNav's count badge:
|
|
304
306
|
a solid pill on the count badge pair, so it reads at a glance on the
|
|
305
|
-
|
|
307
|
+
outlined icon buttons in both modes. */
|
|
306
308
|
.ds-table-toolbar__badge {
|
|
307
309
|
position: absolute;
|
|
308
310
|
inset-block-start: calc(-1 * var(--padding-100));
|
|
@@ -379,12 +381,18 @@
|
|
|
379
381
|
it stays in view). */
|
|
380
382
|
.ds-table-toolbar__row {
|
|
381
383
|
position: relative;
|
|
384
|
+
display: grid;
|
|
385
|
+
grid-template-columns: minmax(0, 1fr);
|
|
382
386
|
min-width: 0;
|
|
383
387
|
}
|
|
384
388
|
|
|
389
|
+
.ds-table-toolbar__row > .ds-table-toolbar__main {
|
|
390
|
+
grid-area: 1 / 1;
|
|
391
|
+
}
|
|
392
|
+
|
|
385
393
|
/* A row that takes over the bar: the bar's controls fade out, then the row
|
|
386
|
-
comes in. Coming back is the reverse. The bar stays laid out throughout, so
|
|
387
|
-
|
|
394
|
+
comes in. Coming back is the reverse. The bar stays laid out throughout, so taking
|
|
395
|
+
over never changes the row's height; only a long AI command grows it (below). */
|
|
388
396
|
.ds-table-toolbar__start > *,
|
|
389
397
|
.ds-table-toolbar__end {
|
|
390
398
|
transition: opacity var(--motion-duration-fast) var(--motion-ease-standard) var(--motion-duration-fast);
|
|
@@ -579,14 +587,17 @@
|
|
|
579
587
|
inset: 0;
|
|
580
588
|
z-index: 1;
|
|
581
589
|
display: flex;
|
|
582
|
-
align-items:
|
|
590
|
+
align-items: flex-end;
|
|
583
591
|
gap: var(--gap-200);
|
|
584
592
|
visibility: hidden;
|
|
585
593
|
pointer-events: none;
|
|
586
594
|
transition: visibility 0s linear var(--motion-duration-fast);
|
|
587
595
|
}
|
|
588
596
|
|
|
597
|
+
/* Open, it shares the bar's grid cell in flow, so a long request grows the row and pushes the table down. */
|
|
589
598
|
.ds-table-toolbar__command-row[data-open] {
|
|
599
|
+
position: relative;
|
|
600
|
+
grid-area: 1 / 1;
|
|
590
601
|
visibility: visible;
|
|
591
602
|
pointer-events: auto;
|
|
592
603
|
transition: visibility 0s;
|
|
@@ -284,6 +284,7 @@ type TableToolbarOwnProps = {
|
|
|
284
284
|
* text your handler turns into a whole table setup. It reaches everything a
|
|
285
285
|
* view holds (filters, sorts, search, columns, pinning, grouping, density),
|
|
286
286
|
* so it can do in a sentence what the bar's other controls do one at a time.
|
|
287
|
+
* A long request grows the composer to three rows, pushing the table down.
|
|
287
288
|
* The library calls no model; your handler does. A change or an error lands in
|
|
288
289
|
* a toast, in the surrounding ToastProvider's stack if there is one, else in the
|
|
289
290
|
* bar's own at the bottom-right. Shows only inside a DataTable.
|
|
@@ -140,6 +140,7 @@ function ToolbarPanel({
|
|
|
140
140
|
)
|
|
141
141
|
] });
|
|
142
142
|
}
|
|
143
|
+
const COMMAND_MAX_ROWS = 3;
|
|
143
144
|
function CommandRow({ command, table, labels, size, open, onClose, state, onStateChange }) {
|
|
144
145
|
const { toast, dismiss } = useToast();
|
|
145
146
|
const [text, setText] = useState("");
|
|
@@ -250,6 +251,7 @@ function CommandRow({ command, table, labels, size, open, onClose, state, onStat
|
|
|
250
251
|
Composer,
|
|
251
252
|
{
|
|
252
253
|
inline: true,
|
|
254
|
+
maxRows: COMMAND_MAX_ROWS,
|
|
253
255
|
size,
|
|
254
256
|
value: text,
|
|
255
257
|
onValueChange: setText,
|
|
@@ -509,12 +511,14 @@ const TableToolbar = React.forwardRef(
|
|
|
509
511
|
const rootRef = useRef(null);
|
|
510
512
|
const [narrow, setNarrow] = useState(false);
|
|
511
513
|
const [crowded, setCrowded] = useState(false);
|
|
514
|
+
const foldedAt = useRef(0);
|
|
512
515
|
useEffect(() => {
|
|
513
516
|
const node = rootRef.current;
|
|
514
517
|
if (!node) return;
|
|
515
518
|
const observer = new ResizeObserver(([entry]) => {
|
|
516
|
-
|
|
517
|
-
|
|
519
|
+
const width = entry.contentRect.width;
|
|
520
|
+
setNarrow(width < BREAKPOINT_PHONE_PX || width <= foldedAt.current);
|
|
521
|
+
setCrowded(width < BREAKPOINT_SHEET_PX);
|
|
518
522
|
});
|
|
519
523
|
observer.observe(node);
|
|
520
524
|
return () => observer.disconnect();
|
|
@@ -537,6 +541,11 @@ const TableToolbar = React.forwardRef(
|
|
|
537
541
|
used += width + gap;
|
|
538
542
|
}
|
|
539
543
|
const moreWidth = (more?.getBoundingClientRect().width ?? 0) + gap;
|
|
544
|
+
if (used - gap + (chipEls.length ? moreWidth : 0) > start.clientWidth + 1) {
|
|
545
|
+
foldedAt.current = rootRef.current?.getBoundingClientRect().width ?? 0;
|
|
546
|
+
setNarrow(true);
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
540
549
|
let n = 0;
|
|
541
550
|
for (let i = 0; i < chipEls.length; i += 1) {
|
|
542
551
|
const width = chipEls[i].getBoundingClientRect().width + gap;
|
|
@@ -794,7 +803,7 @@ const TableToolbar = React.forwardRef(
|
|
|
794
803
|
CircularButton,
|
|
795
804
|
{
|
|
796
805
|
icon: "filter_list",
|
|
797
|
-
variant: "
|
|
806
|
+
variant: "secondary",
|
|
798
807
|
tone: "neutral",
|
|
799
808
|
size,
|
|
800
809
|
ariaLabel: labels.filters(activeFilters),
|
|
@@ -1081,7 +1090,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1081
1090
|
CircularButton,
|
|
1082
1091
|
{
|
|
1083
1092
|
icon: "swap_vert",
|
|
1084
|
-
variant: "
|
|
1093
|
+
variant: "secondary",
|
|
1085
1094
|
tone: "neutral",
|
|
1086
1095
|
size,
|
|
1087
1096
|
ariaLabel: labels.sort(sorts.length),
|
|
@@ -1276,7 +1285,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1276
1285
|
CircularButton,
|
|
1277
1286
|
{
|
|
1278
1287
|
icon: "view_agenda",
|
|
1279
|
-
variant: "
|
|
1288
|
+
variant: "secondary",
|
|
1280
1289
|
tone: "neutral",
|
|
1281
1290
|
size,
|
|
1282
1291
|
ariaLabel: labels.group(Boolean(groupedBy)),
|
|
@@ -1304,7 +1313,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1304
1313
|
CircularButton,
|
|
1305
1314
|
{
|
|
1306
1315
|
icon: "view_column",
|
|
1307
|
-
variant: "
|
|
1316
|
+
variant: "secondary",
|
|
1308
1317
|
tone: "neutral",
|
|
1309
1318
|
size,
|
|
1310
1319
|
ariaLabel: labels.columns,
|
|
@@ -1349,7 +1358,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1349
1358
|
CircularButton,
|
|
1350
1359
|
{
|
|
1351
1360
|
icon: "more_horiz",
|
|
1352
|
-
variant: "
|
|
1361
|
+
variant: "secondary",
|
|
1353
1362
|
tone: "neutral",
|
|
1354
1363
|
size,
|
|
1355
1364
|
ariaLabel: labels.more,
|
|
@@ -1457,7 +1466,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1457
1466
|
CircularButton,
|
|
1458
1467
|
{
|
|
1459
1468
|
icon: "search",
|
|
1460
|
-
variant: "
|
|
1469
|
+
variant: "secondary",
|
|
1461
1470
|
tone: "neutral",
|
|
1462
1471
|
size,
|
|
1463
1472
|
ariaLabel: labels.search,
|
|
@@ -1478,7 +1487,7 @@ const TableToolbar = React.forwardRef(
|
|
|
1478
1487
|
CircularButton,
|
|
1479
1488
|
{
|
|
1480
1489
|
icon: action.icon,
|
|
1481
|
-
variant: "
|
|
1490
|
+
variant: "secondary",
|
|
1482
1491
|
tone: "neutral",
|
|
1483
1492
|
size,
|
|
1484
1493
|
ariaLabel: action.label,
|
|
@@ -8,6 +8,8 @@ export interface Tab {
|
|
|
8
8
|
icon?: string | React.ReactNode;
|
|
9
9
|
/** Whether this tab is disabled */
|
|
10
10
|
disabled?: boolean;
|
|
11
|
+
/** The id of the `role="tabpanel"` element this tab shows, written as the tab's `aria-controls`. The consumer renders the panels. */
|
|
12
|
+
panelId?: string;
|
|
11
13
|
}
|
|
12
14
|
/** Props owned by Tabs itself — everything else falls through to the tablist. */
|
|
13
15
|
type TabsOwnProps = {
|
package/components/Tabs/Tabs.js
CHANGED
|
@@ -30,6 +30,13 @@ type TagInputOwnProps = {
|
|
|
30
30
|
removeLabel?: (tag: string) => string;
|
|
31
31
|
/** Additional CSS classes — applied to the wrapper, not the <input> */
|
|
32
32
|
className?: string;
|
|
33
|
+
/**
|
|
34
|
+
* Form field name. When set, the committed tags submit with an enclosing
|
|
35
|
+
* form through hidden inputs, one entry per tag, nothing while disabled.
|
|
36
|
+
* The draft text being typed is never submitted. Also the fallback for the
|
|
37
|
+
* element id (`id || name || label`).
|
|
38
|
+
*/
|
|
39
|
+
name?: string;
|
|
33
40
|
};
|
|
34
41
|
export interface TagInputProps extends TagInputOwnProps, Omit<React.ComponentPropsWithoutRef<'input'>, keyof TagInputOwnProps | 'type' | 'value' | 'defaultValue'> {
|
|
35
42
|
}
|
|
@@ -22,6 +22,7 @@ const TagInput = React.forwardRef(
|
|
|
22
22
|
onChange,
|
|
23
23
|
onKeyDown,
|
|
24
24
|
name,
|
|
25
|
+
form,
|
|
25
26
|
id,
|
|
26
27
|
...rest
|
|
27
28
|
}, ref) => {
|
|
@@ -116,21 +117,22 @@ const TagInput = React.forwardRef(
|
|
|
116
117
|
"input",
|
|
117
118
|
{
|
|
118
119
|
...rest,
|
|
120
|
+
form,
|
|
119
121
|
ref: setRef,
|
|
120
122
|
className: `${baseClass}__input`,
|
|
121
123
|
type: "text",
|
|
122
124
|
id: inputId,
|
|
123
|
-
name,
|
|
124
125
|
value: draft,
|
|
125
126
|
placeholder: atLimit ? "" : placeholder,
|
|
126
127
|
disabled,
|
|
127
|
-
required,
|
|
128
|
+
"aria-required": required || void 0,
|
|
128
129
|
"aria-invalid": error,
|
|
129
130
|
"aria-describedby": describedBy,
|
|
130
131
|
onChange: handleChange,
|
|
131
132
|
onKeyDown: handleKeyDown
|
|
132
133
|
}
|
|
133
|
-
)
|
|
134
|
+
),
|
|
135
|
+
name && tags.map((tag) => /* @__PURE__ */ jsx("input", { type: "hidden", name, value: tag, form, disabled }, tag))
|
|
134
136
|
] })
|
|
135
137
|
}
|
|
136
138
|
);
|
|
@@ -11,28 +11,6 @@
|
|
|
11
11
|
flex-shrink: 0;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
/* The cycle form
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
a row; it hovers like the picker's trigger, the fill stepping up. */
|
|
18
|
-
.ds-theme-toggle--cycle {
|
|
19
|
-
display: inline-flex;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
.ds-theme-toggle--cycle .ds-circular-button {
|
|
23
|
-
background-color: var(--color-bg-container-primary);
|
|
24
|
-
border: var(--border-025) solid var(--color-bg-container-border);
|
|
25
|
-
border-radius: calc(var(--radius-pill) + var(--padding-100));
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.ds-theme-toggle--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover {
|
|
29
|
-
background-color: var(--color-bg-container-secondary);
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/* The glyph holds the icon colour in every state, as the family's glyphs
|
|
33
|
-
do: only the fill steps on hover. */
|
|
34
|
-
.ds-theme-toggle--cycle .ds-circular-button .ds-circular-button__icon,
|
|
35
|
-
.ds-theme-toggle--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover .ds-circular-button__icon,
|
|
36
|
-
.ds-theme-toggle--cycle .ds-circular-button:not(.ds-circular-button--disabled):active .ds-circular-button__icon {
|
|
37
|
-
color: var(--color-action-icon-default);
|
|
38
|
-
}
|
|
14
|
+
/* The cycle form is SegmentedControl's (`ds-segmented-control--cycle`),
|
|
15
|
+
which draws the circle; `ds-theme-toggle--cycle` stays as a consumer
|
|
16
|
+
hook and styles nothing here. */
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useEffect } from "react";
|
|
4
4
|
import { SegmentedControl } from "../SegmentedControl/SegmentedControl.js";
|
|
5
|
-
import { CircularButton } from "../CircularButton/CircularButton.js";
|
|
6
5
|
import { DEFAULT_COLOR_MODE_STORAGE_KEY } from "./colorMode.js";
|
|
7
6
|
import { useColorMode } from "./useColorMode.js";
|
|
8
7
|
import "./ThemeToggle.css";
|
|
@@ -44,30 +43,19 @@ const ThemeToggle = React.forwardRef(
|
|
|
44
43
|
onValueChange?.(next);
|
|
45
44
|
};
|
|
46
45
|
if (cycle) {
|
|
47
|
-
const index = Math.max(
|
|
48
|
-
segments.findIndex((segment) => segment.value === setting),
|
|
49
|
-
0
|
|
50
|
-
);
|
|
51
|
-
const current = segments[index];
|
|
52
|
-
const next = segments[(index + 1) % segments.length];
|
|
53
46
|
return /* @__PURE__ */ jsx(
|
|
54
|
-
|
|
47
|
+
SegmentedControl,
|
|
55
48
|
{
|
|
49
|
+
"aria-label": ariaLabel,
|
|
56
50
|
...rest,
|
|
57
51
|
ref,
|
|
58
52
|
className: ["ds-theme-toggle", "ds-theme-toggle--cycle", className].filter(Boolean).join(" "),
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
tone: "neutral",
|
|
66
|
-
ariaLabel: cycleLabel(current.label, next.label),
|
|
67
|
-
tooltip: current.label,
|
|
68
|
-
onClick: () => pick(next.value)
|
|
69
|
-
}
|
|
70
|
-
)
|
|
53
|
+
segments,
|
|
54
|
+
value: setting,
|
|
55
|
+
onValueChange: (next) => pick(next),
|
|
56
|
+
size,
|
|
57
|
+
cycle: true,
|
|
58
|
+
cycleLabel
|
|
71
59
|
}
|
|
72
60
|
);
|
|
73
61
|
}
|
|
@@ -28,6 +28,12 @@ type TimePickerOwnProps = {
|
|
|
28
28
|
* `en-US`.
|
|
29
29
|
*/
|
|
30
30
|
locale?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Form field name. When set, the selected 24-hour "HH:MM" value submits with
|
|
33
|
+
* an enclosing form through a hidden input (nothing while no value is set,
|
|
34
|
+
* nothing while disabled), as Dropdown does.
|
|
35
|
+
*/
|
|
36
|
+
name?: string;
|
|
31
37
|
/** Component size */
|
|
32
38
|
size?: 'default' | 'compact';
|
|
33
39
|
/** Whether the picker is disabled */
|
|
@@ -45,6 +45,8 @@ const TimePicker = React.forwardRef(
|
|
|
45
45
|
stepMinutes = 30,
|
|
46
46
|
hourFormat: hourFormatProp,
|
|
47
47
|
locale: localeProp,
|
|
48
|
+
name,
|
|
49
|
+
form,
|
|
48
50
|
size = "default",
|
|
49
51
|
disabled = false,
|
|
50
52
|
required = false,
|
|
@@ -212,6 +214,7 @@ const TimePicker = React.forwardRef(
|
|
|
212
214
|
{
|
|
213
215
|
...rest,
|
|
214
216
|
type: "button",
|
|
217
|
+
form,
|
|
215
218
|
id: inputId,
|
|
216
219
|
ref: setTriggerRef,
|
|
217
220
|
className: `${baseClass}__trigger`,
|
|
@@ -238,6 +241,7 @@ const TimePicker = React.forwardRef(
|
|
|
238
241
|
]
|
|
239
242
|
}
|
|
240
243
|
),
|
|
244
|
+
name && selectedValue !== void 0 && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: selectedValue, form, disabled }),
|
|
241
245
|
isOpen && /* @__PURE__ */ jsx(
|
|
242
246
|
"ul",
|
|
243
247
|
{
|
|
@@ -253,16 +253,21 @@
|
|
|
253
253
|
gap: var(--gap-200);
|
|
254
254
|
}
|
|
255
255
|
|
|
256
|
+
/* A long role title takes its own line above the dates rather than
|
|
257
|
+
running under them. */
|
|
256
258
|
.ds-timeline__role-header {
|
|
257
259
|
display: flex;
|
|
260
|
+
flex-wrap: wrap;
|
|
258
261
|
align-items: center;
|
|
259
262
|
justify-content: space-between;
|
|
260
|
-
gap: var(--gap-400);
|
|
263
|
+
gap: var(--gap-100) var(--gap-400);
|
|
261
264
|
}
|
|
262
265
|
|
|
263
266
|
.ds-timeline__role-title {
|
|
264
267
|
margin: 0;
|
|
265
|
-
|
|
268
|
+
/* Sized by its text, so a title that cannot sit beside the dates wraps
|
|
269
|
+
the header (a zero basis would never wrap it). */
|
|
270
|
+
flex: 1 1 auto;
|
|
266
271
|
min-width: 0;
|
|
267
272
|
font-family: var(--font-heading-3-family);
|
|
268
273
|
font-size: var(--font-heading-3-size);
|
|
@@ -37,9 +37,9 @@ export interface TimelineCompany {
|
|
|
37
37
|
}
|
|
38
38
|
/** Default variant — a flat sequence of steps/events with dot, badge, or icon markers. */
|
|
39
39
|
export interface TimelineDefaultProps {
|
|
40
|
-
/**
|
|
40
|
+
/** Which layout the timeline draws. Omitted or `default`: a flat sequence of steps or events with dot, number or icon markers. */
|
|
41
41
|
variant?: 'default';
|
|
42
|
-
/**
|
|
42
|
+
/** The entries, in order. Their shape follows `variant`: in the default layout, steps or events (`TimelineItem`). */
|
|
43
43
|
items: TimelineItem[];
|
|
44
44
|
/** `vertical` timeline (default) or `horizontal` stepper */
|
|
45
45
|
orientation?: 'vertical' | 'horizontal';
|
|
@@ -52,9 +52,9 @@ export interface TimelineDefaultProps {
|
|
|
52
52
|
}
|
|
53
53
|
/** Company variant — grouped roles under a logo, for résumé/pipeline histories. */
|
|
54
54
|
export interface TimelineCompanyProps {
|
|
55
|
-
/**
|
|
55
|
+
/** `company`: roles grouped under a company logo, for résumé and pipeline histories. */
|
|
56
56
|
variant: 'company';
|
|
57
|
-
/**
|
|
57
|
+
/** In the `company` layout, companies with their roles (`TimelineCompany`). */
|
|
58
58
|
items: TimelineCompany[];
|
|
59
59
|
/** Text shown in place of the end date for a role marked `present` */
|
|
60
60
|
presentLabel?: string;
|
|
@@ -34,6 +34,14 @@ type ToggleSwitchOwnProps = {
|
|
|
34
34
|
* @deprecated Pass the native `aria-label` attribute instead.
|
|
35
35
|
*/
|
|
36
36
|
ariaLabel?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Form field name. When set, the switch submits with an enclosing form
|
|
39
|
+
* through a hidden input: `value` while on, nothing while off or disabled,
|
|
40
|
+
* as a native checkbox does.
|
|
41
|
+
*/
|
|
42
|
+
name?: string;
|
|
43
|
+
/** The value submitted under `name` while on. Defaults to "on", the native checkbox's. */
|
|
44
|
+
value?: React.ComponentPropsWithoutRef<'button'>['value'];
|
|
37
45
|
};
|
|
38
46
|
export interface ToggleSwitchProps extends ToggleSwitchOwnProps, Omit<React.ComponentPropsWithoutRef<'button'>, keyof ToggleSwitchOwnProps | 'type'> {
|
|
39
47
|
}
|
|
@@ -19,6 +19,9 @@ const ToggleSwitch = React.forwardRef(
|
|
|
19
19
|
onClick,
|
|
20
20
|
className = "",
|
|
21
21
|
ariaLabel,
|
|
22
|
+
name,
|
|
23
|
+
value = "on",
|
|
24
|
+
form,
|
|
22
25
|
...rest
|
|
23
26
|
}, ref) => {
|
|
24
27
|
const baseClass = "ds-toggle-switch";
|
|
@@ -52,6 +55,7 @@ const ToggleSwitch = React.forwardRef(
|
|
|
52
55
|
type: "button",
|
|
53
56
|
className: classes,
|
|
54
57
|
onClick: handleClick,
|
|
58
|
+
form,
|
|
55
59
|
disabled,
|
|
56
60
|
role: "switch",
|
|
57
61
|
"aria-checked": checked,
|
|
@@ -63,7 +67,8 @@ const ToggleSwitch = React.forwardRef(
|
|
|
63
67
|
helperText ? /* @__PURE__ */ jsxs("span", { className: `${baseClass}__text`, children: [
|
|
64
68
|
showLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
|
|
65
69
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__helper`, id: helperId, children: helperText })
|
|
66
|
-
] }) : showLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label })
|
|
70
|
+
] }) : showLabel && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
|
|
71
|
+
name && checked && /* @__PURE__ */ jsx("input", { type: "hidden", name, value, form, disabled })
|
|
67
72
|
]
|
|
68
73
|
}
|
|
69
74
|
);
|
|
@@ -83,17 +83,25 @@
|
|
|
83
83
|
}
|
|
84
84
|
|
|
85
85
|
/* The tool name is an identifier, so it takes the code stack —
|
|
86
|
-
the one place the system leaves Nunito Sans
|
|
86
|
+
the one place the system leaves Nunito Sans. It yields to the status
|
|
87
|
+
when the row is short of room, ending in an ellipsis, so a long name
|
|
88
|
+
never pushes the status out of the card. */
|
|
87
89
|
.ds-tool-call__name {
|
|
88
|
-
flex:
|
|
90
|
+
flex: 0 1 auto;
|
|
91
|
+
min-width: 0;
|
|
92
|
+
overflow: hidden;
|
|
93
|
+
text-overflow: ellipsis;
|
|
94
|
+
white-space: nowrap;
|
|
89
95
|
font-family: var(--font-family-code);
|
|
90
96
|
font-size: var(--font-paragraph-sm-size);
|
|
91
97
|
line-height: var(--font-paragraph-sm-line-height);
|
|
92
98
|
color: var(--color-text-primary);
|
|
93
99
|
}
|
|
94
100
|
|
|
101
|
+
/* A zero basis, so the summary yields all its room before the name gives
|
|
102
|
+
up any of its own. */
|
|
95
103
|
.ds-tool-call__summary {
|
|
96
|
-
flex: 1 1
|
|
104
|
+
flex: 1 1 0;
|
|
97
105
|
min-width: 0;
|
|
98
106
|
overflow: hidden;
|
|
99
107
|
text-overflow: ellipsis;
|