rift-ds 1.19.1 → 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.
Files changed (73) hide show
  1. package/README.md +3 -3
  2. package/components/AgentStatus/AgentStatus.css +8 -0
  3. package/components/AppSidebar/AppSidebar.css +37 -0
  4. package/components/AppSidebar/AppSidebar.d.ts +2 -0
  5. package/components/AppSidebar/AppSidebar.js +248 -215
  6. package/components/Checkbox/Checkbox.css +4 -1
  7. package/components/Checkbox/Checkbox.d.ts +12 -5
  8. package/components/Checkbox/Checkbox.js +7 -2
  9. package/components/ColorPicker/ColorPicker.js +3 -1
  10. package/components/Combobox/Combobox.d.ts +1 -1
  11. package/components/Composer/Composer.css +42 -2
  12. package/components/Composer/Composer.d.ts +1 -1
  13. package/components/Composer/Composer.js +1 -0
  14. package/components/Dropdown/Dropdown.d.ts +4 -4
  15. package/components/Dropdown/Dropdown.js +1 -0
  16. package/components/EventCalendar/EventCalendar.css +3 -1
  17. package/components/LegendTile/LegendTile.css +10 -3
  18. package/components/LegendTile/LegendTile.d.ts +1 -1
  19. package/components/LegendTile/LegendTile.js +1 -1
  20. package/components/PinInput/PinInput.d.ts +6 -0
  21. package/components/PinInput/PinInput.js +38 -34
  22. package/components/RadioButton/RadioButton.css +4 -1
  23. package/components/RadioButton/RadioButton.d.ts +10 -12
  24. package/components/RadioButton/RadioButton.js +8 -6
  25. package/components/Reasoning/Reasoning.css +14 -0
  26. package/components/RichDropdown/RichDropdown.d.ts +4 -5
  27. package/components/RichDropdown/RichDropdown.js +1 -0
  28. package/components/SegmentedControl/SegmentedControl.css +37 -0
  29. package/components/SegmentedControl/SegmentedControl.d.ts +16 -2
  30. package/components/SegmentedControl/SegmentedControl.js +41 -4
  31. package/components/SelectionCard/SelectionCard.d.ts +7 -1
  32. package/components/SelectionCard/SelectionCard.js +2 -1
  33. package/components/Stat/Stat.css +2 -2
  34. package/components/TableToolbar/TableToolbar.css +13 -3
  35. package/components/TableToolbar/TableToolbar.d.ts +1 -0
  36. package/components/TableToolbar/TableToolbar.js +11 -2
  37. package/components/Tabs/Tabs.d.ts +2 -0
  38. package/components/Tabs/Tabs.js +1 -0
  39. package/components/TagInput/TagInput.d.ts +7 -0
  40. package/components/TagInput/TagInput.js +5 -3
  41. package/components/ThemeToggle/ThemeToggle.css +3 -25
  42. package/components/ThemeToggle/ThemeToggle.js +8 -20
  43. package/components/TimePicker/TimePicker.d.ts +6 -0
  44. package/components/TimePicker/TimePicker.js +4 -0
  45. package/components/Timeline/Timeline.css +7 -2
  46. package/components/Timeline/Timeline.d.ts +4 -4
  47. package/components/ToggleSwitch/ToggleSwitch.d.ts +8 -0
  48. package/components/ToggleSwitch/ToggleSwitch.js +6 -1
  49. package/components/ToolCall/ToolCall.css +11 -3
  50. package/components/TypographySwatch/TypographySwatch.css +3 -1
  51. package/components/WorldMap/WorldMap.d.ts +1 -1
  52. package/components/WorldMap/WorldMap.js +1 -1
  53. package/components/registry.json +1 -1
  54. package/components/registry.json.d.ts +1 -1
  55. package/components/registry.json.js +1 -1
  56. package/package.json +5 -1
  57. package/tokens/presets/contrast.css +8 -8
  58. package/tokens/presets/forest.css +10 -8
  59. package/tokens/presets/gold.css +12 -10
  60. package/tokens/presets/marquee.css +9 -9
  61. package/tokens/presets/pink.css +8 -8
  62. package/tokens/presets/terminal.css +8 -8
  63. package/tokens/presets/violet.css +8 -8
  64. package/tokens/presets/warm.css +8 -8
  65. package/tokens/presets/zest.css +8 -8
  66. package/tokens/registry.json +2 -0
  67. package/tokens/registry.json.d.ts +2 -0
  68. package/tokens/registry.json.js +1 -1
  69. package/tokens/tokens-dark.css +4 -0
  70. package/tokens/tokens-light.css +8 -4
  71. package/tokens/values.d.ts +34 -0
  72. package/tokens/values.js +11 -0
  73. package/tokens/values.json.js +8 -0
@@ -37,13 +37,13 @@ type CheckboxOwnProps = {
37
37
  */
38
38
  ariaLabel?: string;
39
39
  /**
40
- * Legacy form-field name.
41
- *
42
- * @deprecated No-op. This component renders a `<div role="checkbox">`, not a
43
- * native `<input>`, so it cannot participate in native form submission.
44
- * Declared only so the attribute is not forwarded to an element that rejects it.
40
+ * Form field name. When set, the checkbox submits with an enclosing form
41
+ * through a hidden input: `value` while checked, nothing while unchecked
42
+ * or disabled, as a native checkbox does.
45
43
  */
46
44
  name?: string;
45
+ /** The value submitted under `name` while checked. Defaults to "on", the native checkbox's. */
46
+ value?: string;
47
47
  };
48
48
  export interface CheckboxProps extends CheckboxOwnProps, Omit<React.ComponentPropsWithoutRef<'div'>, keyof CheckboxOwnProps> {
49
49
  }
@@ -57,6 +57,13 @@ type CheckboxGroupOwnProps = {
57
57
  error?: boolean;
58
58
  /** Marks the group required and renders the required marker on its label */
59
59
  required?: boolean;
60
+ /**
61
+ * Form field name shared by every item. When set, each checked item submits
62
+ * its `value` under this name through a hidden input, so a form reads the
63
+ * selection as repeated entries, as a set of native checkboxes does; a disabled
64
+ * item submits nothing.
65
+ */
66
+ name?: string;
60
67
  /** Checkbox options */
61
68
  items: {
62
69
  label: string;
@@ -17,7 +17,8 @@ const Checkbox = React.forwardRef(
17
17
  onChange,
18
18
  className = "",
19
19
  ariaLabel,
20
- name: _name,
20
+ name,
21
+ value = "on",
21
22
  onClick,
22
23
  onKeyDown,
23
24
  ...rest
@@ -77,7 +78,8 @@ const Checkbox = React.forwardRef(
77
78
  helperText ? /* @__PURE__ */ jsxs("span", { className: `${baseClass}__text`, children: [
78
79
  label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
79
80
  /* @__PURE__ */ jsx("span", { className: `${baseClass}__helper`, id: helperId, children: helperText })
80
- ] }) : label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label })
81
+ ] }) : label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
82
+ name && checked && /* @__PURE__ */ jsx("input", { type: "hidden", name, value, disabled })
81
83
  ]
82
84
  }
83
85
  );
@@ -90,6 +92,7 @@ const CheckboxGroup = React.forwardRef(
90
92
  helperText,
91
93
  error = false,
92
94
  required = false,
95
+ name,
93
96
  items,
94
97
  values: valuesProp,
95
98
  defaultValues = [],
@@ -135,6 +138,8 @@ const CheckboxGroup = React.forwardRef(
135
138
  children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__items`, children: items.map((item) => /* @__PURE__ */ jsx(
136
139
  Checkbox,
137
140
  {
141
+ name,
142
+ value: item.value,
138
143
  label: item.label,
139
144
  checked: values.includes(item.value),
140
145
  disabled: item.disabled,
@@ -76,6 +76,7 @@ const ColorPicker = React.forwardRef(
76
76
  error = false,
77
77
  helperText,
78
78
  name,
79
+ form,
79
80
  panelLabel,
80
81
  saturationLabel = "Saturation and brightness",
81
82
  saturationValueText = (saturation, brightness) => `Saturation ${saturation}%, brightness ${brightness}%`,
@@ -237,6 +238,7 @@ const ColorPicker = React.forwardRef(
237
238
  "button",
238
239
  {
239
240
  ...rest,
241
+ form,
240
242
  ref: setTriggerRef,
241
243
  type: "button",
242
244
  id: inputId,
@@ -263,7 +265,7 @@ const ColorPicker = React.forwardRef(
263
265
  ]
264
266
  }
265
267
  ),
266
- name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: displayHex, disabled }),
268
+ name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: displayHex, form, disabled }),
267
269
  isOpen && /* @__PURE__ */ jsxs(
268
270
  "div",
269
271
  {
@@ -90,7 +90,7 @@ type ComboboxOwnProps = {
90
90
  /**
91
91
  * Form field name. When set, the selection submits with an enclosing form
92
92
  * under this name through hidden inputs: the selected option's `value` in
93
- * single mode (nothing until one is chosen), one entry per selected value in
93
+ * single mode (nothing while no value is set), one entry per selected value in
94
94
  * `multiple` mode, nothing while disabled. The search text the user types
95
95
  * is never submitted. Also the fallback for the element id (`id || name || generated`).
96
96
  */
@@ -663,7 +663,8 @@
663
663
  }
664
664
 
665
665
  /* ============================================
666
- INLINE: one row at the control height, the send button on the text's line.
666
+ INLINE: one row at the control height until `maxRows` lets it grow, the send
667
+ button on the text's line.
667
668
  The shell is an input here, so it does not float, and the button sits
668
669
  inside the height, concentric on a thinner ring.
669
670
  ============================================ */
@@ -675,10 +676,49 @@
675
676
  min(var(--radius-pill), var(--ds-composer-send-size) / 2) + var(--padding-050) + var(--border-025)
676
677
  );
677
678
  flex-direction: row;
678
- align-items: center;
679
+ /* Level at one row; a maxRows above 1 grows the shell and the send button stays in the bottom corner. */
680
+ align-items: flex-end;
679
681
  box-shadow: none;
680
682
  }
681
683
 
684
+ /* Only typing grows the shell: a placeholder too long for the line ends in an
685
+ ellipsis. A browser will not ellipsize a textarea's own placeholder, so it
686
+ keeps the attribute, unpainted and on one line, and a copy draws the words. */
687
+ .ds-composer--inline .ds-composer__textarea:placeholder-shown {
688
+ max-height: var(--ds-composer-line);
689
+ overflow: hidden;
690
+ }
691
+
692
+ .ds-composer--inline .ds-composer__textarea::placeholder {
693
+ color: transparent;
694
+ white-space: nowrap;
695
+ }
696
+
697
+ .ds-composer--inline .ds-composer__content {
698
+ position: relative;
699
+ }
700
+
701
+ .ds-composer__placeholder {
702
+ position: absolute;
703
+ inset-block-start: var(--ds-composer-text-block);
704
+ inset-inline: var(--ds-composer-text-inset) var(--padding-100);
705
+ overflow: hidden;
706
+ text-overflow: ellipsis;
707
+ white-space: nowrap;
708
+ font-family: var(--font-paragraph-family);
709
+ font-size: var(--font-paragraph-size);
710
+ font-weight: var(--font-paragraph-weight);
711
+ line-height: var(--ds-composer-line);
712
+ letter-spacing: var(--font-paragraph-letter-spacing);
713
+ color: var(--color-input-text-placeholder);
714
+ pointer-events: none;
715
+ }
716
+
717
+ .ds-composer--compact .ds-composer__placeholder {
718
+ font-size: var(--font-paragraph-sm-size);
719
+ letter-spacing: var(--font-paragraph-sm-letter-spacing);
720
+ }
721
+
682
722
  .ds-composer--inline.ds-composer--compact {
683
723
  --ds-composer-control: var(--control-height-compact);
684
724
  --ds-composer-line: var(--font-paragraph-sm-line-height);
@@ -34,7 +34,7 @@ type ComposerOwnProps = {
34
34
  onStop?: () => void;
35
35
  /** The density, matching a table's or a bar's: `compact` tightens the padding and takes the smaller text and buttons. */
36
36
  size?: 'default' | 'compact';
37
- /** One row with the send button on the text's line, the shell exactly `size`'s control height, so it lines up with an Input or a table's toolbar. For a popover, a sheet or a tight bar. `maxRows` defaults to 1. */
37
+ /** One row with the send button on the text's line, the shell exactly `size`'s control height, so it lines up with an Input or a table's toolbar. For a popover, a sheet or a tight bar. `maxRows` defaults to 1; above it, typing grows the shell with the send button held in the bottom corner. A placeholder stays on one line and ends in an ellipsis. */
38
38
  inline?: boolean;
39
39
  /** Growth cap in text rows before the textarea scrolls internally. Defaults to 8, or 1 when `inline`. */
40
40
  maxRows?: number;
@@ -446,6 +446,7 @@ const Composer = React.forwardRef(
446
446
  onScroll: handleScroll
447
447
  }
448
448
  ),
449
+ inline && rest.placeholder && currentValue === "" && /* @__PURE__ */ jsx("span", { className: `${baseClass}__placeholder`, "aria-hidden": "true", children: rest.placeholder }),
449
450
  mentionsArmed && /* The words a person sees. The textarea beneath keeps the caret,
450
451
  the selection and every keystroke, with its own text
451
452
  transparent; this copy of the same string is where a mention
@@ -76,10 +76,10 @@ type DropdownOwnProps = {
76
76
  */
77
77
  ariaLabel?: string;
78
78
  /**
79
- * Used only as a fallback for deriving the element id (`id || name || label`).
80
- *
81
- * Note: Dropdown renders a `<div role="combobox">`, not a native `<select>`,
82
- * so `name` does **not** make it participate in native form submission.
79
+ * Form field name. When set, the selected option's `value` submits with an
80
+ * enclosing form through a hidden input (nothing while no value is set,
81
+ * nothing while disabled), as Combobox does. Also the fallback for the
82
+ * element id (`id || name || label`).
83
83
  */
84
84
  name?: string;
85
85
  };
@@ -227,6 +227,7 @@ const Dropdown = React.forwardRef(
227
227
  ]
228
228
  }
229
229
  ),
230
+ name && value !== void 0 && /* @__PURE__ */ jsx("input", { type: "hidden", name, value, disabled }),
230
231
  isOpen && /* @__PURE__ */ jsx(
231
232
  "ul",
232
233
  {
@@ -32,9 +32,11 @@
32
32
  gap: var(--gap-200);
33
33
  }
34
34
 
35
+ /* Never narrower than its longest word, so "September" stays whole on a
36
+ small phone and the year wraps under it instead. */
35
37
  .ds-event-calendar__month {
36
38
  flex: 1 1 auto;
37
- min-width: 0;
39
+ min-width: min-content;
38
40
  color: var(--color-text-primary);
39
41
  font-family: var(--font-title-body-family);
40
42
  font-size: var(--font-title-body-size);
@@ -1,7 +1,7 @@
1
1
  /* ============================================
2
2
  LEGEND TILE COMPONENT
3
- The labelled value tile under a chart: an
4
- inset surface one step below its panel, a
3
+ The labelled value tile under a chart: a
4
+ soft neutral fill inside its panel, a
5
5
  caption label with an optional series dot,
6
6
  and the value beneath. The dot's colour
7
7
  arrives per instance via the
@@ -17,7 +17,7 @@
17
17
  flex-direction: column;
18
18
  gap: var(--gap-050);
19
19
  min-width: 0;
20
- background-color: var(--color-bg-page-primary);
20
+ background-color: var(--color-label-bg);
21
21
  border-radius: var(--radius-300);
22
22
  padding: var(--padding-200) var(--padding-300);
23
23
  }
@@ -35,6 +35,13 @@
35
35
  line-height: var(--font-caption-line-height);
36
36
  letter-spacing: var(--font-caption-letter-spacing);
37
37
  color: var(--color-text-secondary);
38
+ }
39
+
40
+ /* The text sits in its own span: an ellipsis never draws on bare text
41
+ inside a flex container, so on the label itself a long caption was cut
42
+ mid-letter. */
43
+ .ds-legend-tile__label-text {
44
+ min-width: 0;
38
45
  white-space: nowrap;
39
46
  overflow: hidden;
40
47
  text-overflow: ellipsis;
@@ -26,7 +26,7 @@ export interface LegendTileProps extends LegendTileOwnProps, Omit<React.Componen
26
26
  }
27
27
  /**
28
28
  * LegendTile — the labelled value tile that sits under a chart and ties a
29
- * series to its number. An inset tile one surface step below its panel, with
29
+ * series to its number. A tile on a soft neutral fill inside its panel, with
30
30
  * an optional series dot matching the chart's palette. Pure JSX and CSS: no
31
31
  * charting library, no hooks, so it renders from a Server Component and a row
32
32
  * of them costs nothing under a dense dashboard.
@@ -10,7 +10,7 @@ const LegendTile = React.forwardRef(
10
10
  return /* @__PURE__ */ jsxs("div", { ...rest, ref, className: classes, style: mergedStyle, children: [
11
11
  /* @__PURE__ */ jsxs("span", { className: `${baseClass}__label`, children: [
12
12
  swatch && /* @__PURE__ */ jsx("span", { className: `${baseClass}__dot`, "aria-hidden": "true" }),
13
- label
13
+ /* @__PURE__ */ jsx("span", { className: `${baseClass}__label-text`, children: label })
14
14
  ] }),
15
15
  /* @__PURE__ */ jsx("span", { className: `${baseClass}__value`, children: typeof value === "number" ? formatNumber(value, locale) : value })
16
16
  ] });
@@ -27,6 +27,12 @@ type PinInputOwnProps = {
27
27
  error?: boolean;
28
28
  /** Whether the whole control is disabled */
29
29
  disabled?: boolean;
30
+ /**
31
+ * Form field name. When set, the joined code submits with an enclosing form
32
+ * through a hidden input, nothing while disabled. The cells themselves
33
+ * carry no name.
34
+ */
35
+ name?: string;
30
36
  /**
31
37
  * Accessible name of each cell, given its 1-based position and the cell count.
32
38
  * Defaults to "Digit <position> of <count>" for the numeric format and
@@ -1,5 +1,5 @@
1
1
  "use client";
2
- import { jsx } from "react/jsx-runtime";
2
+ import { jsxs, jsx } from "react/jsx-runtime";
3
3
  import React from "react";
4
4
  import { Field } from "../Field/Field.js";
5
5
  import "./PinInput.css";
@@ -18,6 +18,7 @@ const PinInput = React.forwardRef(
18
18
  helperText,
19
19
  error = false,
20
20
  disabled = false,
21
+ name,
21
22
  cellLabel,
22
23
  className = "",
23
24
  id,
@@ -113,7 +114,7 @@ const PinInput = React.forwardRef(
113
114
  const describedBy = helperText ? `${controlId}-helper` : rest["aria-describedby"];
114
115
  const characterNoun = format === "numeric" ? "Digit" : "Character";
115
116
  const labelCell = cellLabel ?? ((position, count) => `${characterNoun} ${position} of ${count}`);
116
- return /* @__PURE__ */ jsx(
117
+ return /* @__PURE__ */ jsxs(
117
118
  Field,
118
119
  {
119
120
  className: classes,
@@ -122,38 +123,41 @@ const PinInput = React.forwardRef(
122
123
  error,
123
124
  disabled,
124
125
  id: controlId,
125
- children: /* @__PURE__ */ jsx(
126
- "div",
127
- {
128
- ...rest,
129
- role: "group",
130
- "aria-labelledby": label ? `${controlId}-label` : void 0,
131
- "aria-label": !label ? rest["aria-label"] : void 0,
132
- "aria-describedby": describedBy,
133
- className: `${baseClass}__cells`,
134
- children: chars.map((char, index) => /* @__PURE__ */ jsx(
135
- "input",
136
- {
137
- ref: setCellRef(index),
138
- className: `${baseClass}__cell`,
139
- type: mask ? "password" : "text",
140
- inputMode: format === "numeric" ? "numeric" : "text",
141
- autoComplete: index === 0 ? "one-time-code" : "off",
142
- maxLength: 1,
143
- value: char,
144
- disabled,
145
- id: index === 0 ? controlId : void 0,
146
- "aria-label": labelCell(index + 1, length),
147
- "aria-invalid": error || void 0,
148
- onChange: handleCellChange(index),
149
- onKeyDown: handleCellKeyDown(index),
150
- onPaste: handlePaste,
151
- onFocus: (e) => e.target.select()
152
- },
153
- index
154
- ))
155
- }
156
- )
126
+ children: [
127
+ /* @__PURE__ */ jsx(
128
+ "div",
129
+ {
130
+ ...rest,
131
+ role: "group",
132
+ "aria-labelledby": label ? `${controlId}-label` : void 0,
133
+ "aria-label": !label ? rest["aria-label"] : void 0,
134
+ "aria-describedby": describedBy,
135
+ className: `${baseClass}__cells`,
136
+ children: chars.map((char, index) => /* @__PURE__ */ jsx(
137
+ "input",
138
+ {
139
+ ref: setCellRef(index),
140
+ className: `${baseClass}__cell`,
141
+ type: mask ? "password" : "text",
142
+ inputMode: format === "numeric" ? "numeric" : "text",
143
+ autoComplete: index === 0 ? "one-time-code" : "off",
144
+ maxLength: 1,
145
+ value: char,
146
+ disabled,
147
+ id: index === 0 ? controlId : void 0,
148
+ "aria-label": labelCell(index + 1, length),
149
+ "aria-invalid": error || void 0,
150
+ onChange: handleCellChange(index),
151
+ onKeyDown: handleCellKeyDown(index),
152
+ onPaste: handlePaste,
153
+ onFocus: (e) => e.target.select()
154
+ },
155
+ index
156
+ ))
157
+ }
158
+ ),
159
+ name && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: chars.join(""), disabled })
160
+ ]
157
161
  }
158
162
  );
159
163
  }
@@ -163,7 +163,10 @@
163
163
  gap: var(--gap-200); /* 8px */
164
164
  }
165
165
 
166
+ /* A row that runs out of room wraps, at the vertical layout's own gap,
167
+ rather than running past its container on a phone. */
166
168
  .ds-radio-group--horizontal .ds-radio-group__options {
167
169
  flex-direction: row;
168
- gap: var(--gap-500); /* 20px */
170
+ flex-wrap: wrap;
171
+ gap: var(--gap-200) var(--gap-500); /* 8px rows, 20px between options */
169
172
  }
@@ -15,7 +15,7 @@ type RadioButtonOwnProps = {
15
15
  checked?: boolean;
16
16
  /** Whether the radio is disabled */
17
17
  disabled?: boolean;
18
- /** Value for this radio option */
18
+ /** Value for this radio option, passed to the callbacks and submitted under `name`. A form reads "on", the native radio's, when it is omitted. */
19
19
  value?: string;
20
20
  /** Called with this radio's value when selected */
21
21
  onValueChange?: (value: string) => void;
@@ -34,12 +34,11 @@ type RadioButtonOwnProps = {
34
34
  */
35
35
  ariaLabel?: string;
36
36
  /**
37
- * Legacy form-field name.
38
- *
39
- * @deprecated No-op. This component renders a `<div role="radio">`, not a
40
- * native `<input type="radio">`, so it does not group by name or participate
41
- * in native form submission — `RadioGroup` handles grouping in React state.
42
- * Declared only so the attribute is not forwarded to an element that rejects it.
37
+ * Form field name. When set, the radio submits its `value` with an
38
+ * enclosing form through a hidden input while checked, nothing otherwise
39
+ * or while disabled, as a native radio does. Grouping stays React state
40
+ * (`RadioGroup` passes its own `name` to every option, so exactly one
41
+ * entry submits).
43
42
  */
44
43
  name?: string;
45
44
  };
@@ -63,11 +62,10 @@ type RadioGroupOwnProps = {
63
62
  /** Selected value on first render when uncontrolled (`value` undefined). */
64
63
  defaultValue?: string;
65
64
  /**
66
- * Legacy grouping name, never used.
67
- *
68
- * @deprecated No-op. Grouping is React state (`value`/`onValueChange`), not
69
- * native `name` semantics — the group renders `role="radiogroup"` over
70
- * `<div role="radio">`s, so there is nothing for a name to group.
65
+ * Form field name. When set, the checked option's `value` submits with an
66
+ * enclosing form through one hidden input, as a native radio set does; a
67
+ * disabled option submits nothing.
68
+ * Grouping itself stays React state (`value`/`onValueChange`).
71
69
  */
72
70
  name?: string;
73
71
  /** Radio options */
@@ -10,12 +10,12 @@ const RadioButton = React.forwardRef(
10
10
  error = false,
11
11
  checked = false,
12
12
  disabled = false,
13
- value = "",
13
+ value,
14
14
  onValueChange,
15
15
  onChange,
16
16
  className = "",
17
17
  ariaLabel,
18
- name: _name,
18
+ name,
19
19
  onClick,
20
20
  onKeyDown,
21
21
  ...rest
@@ -35,8 +35,8 @@ const RadioButton = React.forwardRef(
35
35
  ].filter(Boolean).join(" ");
36
36
  const select = () => {
37
37
  if (disabled) return;
38
- onValueChange?.(value);
39
- onChange?.(value);
38
+ onValueChange?.(value ?? "");
39
+ onChange?.(value ?? "");
40
40
  };
41
41
  const handleClick = (e) => {
42
42
  onClick?.(e);
@@ -68,7 +68,8 @@ const RadioButton = React.forwardRef(
68
68
  helperText ? /* @__PURE__ */ jsxs("span", { className: `${baseClass}__text`, children: [
69
69
  label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
70
70
  /* @__PURE__ */ jsx("span", { className: `${baseClass}__helper`, id: helperId, children: helperText })
71
- ] }) : label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label })
71
+ ] }) : label && /* @__PURE__ */ jsx("span", { className: `${baseClass}__label`, children: label }),
72
+ name && checked && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: value ?? "on", disabled })
72
73
  ]
73
74
  }
74
75
  );
@@ -83,7 +84,7 @@ const RadioGroup = React.forwardRef(
83
84
  required = false,
84
85
  value: valueProp,
85
86
  defaultValue,
86
- name: _name,
87
+ name,
87
88
  options,
88
89
  direction = "vertical",
89
90
  onValueChange,
@@ -125,6 +126,7 @@ const RadioGroup = React.forwardRef(
125
126
  children: /* @__PURE__ */ jsx("div", { className: `${baseClass}__options`, children: options.map((option) => /* @__PURE__ */ jsx(
126
127
  RadioButton,
127
128
  {
129
+ name,
128
130
  label: option.label,
129
131
  value: option.value,
130
132
  checked: value === option.value,
@@ -89,6 +89,20 @@
89
89
  white-space: nowrap;
90
90
  }
91
91
 
92
+ /* A text summary longer than its column ends in an ellipsis rather than
93
+ running the trigger off a phone screen; the trigger never grows past its
94
+ column. A node summary keeps its own layout. */
95
+ .ds-reasoning__trigger {
96
+ max-width: 100%;
97
+ min-width: 0;
98
+ }
99
+
100
+ .ds-reasoning__summary:not(.ds-reasoning__summary--node) {
101
+ min-width: 0;
102
+ overflow: hidden;
103
+ text-overflow: ellipsis;
104
+ }
105
+
92
106
  /* The live→done handoff. The departing node summary (an AgentStatus)
93
107
  overlays the incoming text, fading out in place, while the text summary
94
108
  slides left from where its label sat into the flush position. The
@@ -52,11 +52,10 @@ type RichDropdownOwnProps = {
52
52
  /** Additional CSS classes */
53
53
  className?: string;
54
54
  /**
55
- * Used only as a fallback for deriving the element id (`id || name || label`).
56
- *
57
- * Note: RichDropdown renders a `<div role="combobox">`, not a native
58
- * `<select>`, so `name` does **not** make it participate in native form
59
- * submission.
55
+ * Form field name. When set, the selected option's `value` submits with an
56
+ * enclosing form through a hidden input (nothing while no value is set,
57
+ * nothing while disabled), as Combobox does. Also the fallback for the
58
+ * element id (`id || name || label`).
60
59
  */
61
60
  name?: string;
62
61
  };
@@ -197,6 +197,7 @@ const RichDropdown = React.forwardRef(
197
197
  ]
198
198
  }
199
199
  ),
200
+ name && currentValue !== void 0 && /* @__PURE__ */ jsx("input", { type: "hidden", name, value: currentValue, disabled }),
200
201
  isOpen && /* @__PURE__ */ jsx(
201
202
  "ul",
202
203
  {
@@ -305,3 +305,40 @@
305
305
  transition: none;
306
306
  }
307
307
  }
308
+
309
+ /* ============================================
310
+ CYCLE FORM
311
+ One circle in place of the strip (`cycle`):
312
+ the current segment's glyph, stepping to the
313
+ next on each press. It wears the track recipe
314
+ the strip, the CommandPaletteTrigger and the
315
+ ThemePicker's trigger wear (container fill,
316
+ hairline border, the track's curve), so it
317
+ reads as one of that family in a row, and
318
+ hovers like the picker's trigger, the fill
319
+ stepping up. ThemeToggle's `cycle` is this.
320
+ ============================================ */
321
+ .ds-segmented-control--cycle {
322
+ display: inline-flex;
323
+ padding: 0;
324
+ border: none;
325
+ background: none;
326
+ }
327
+
328
+ .ds-segmented-control--cycle .ds-circular-button {
329
+ background-color: var(--color-bg-container-primary);
330
+ border: var(--border-025) solid var(--color-bg-container-border);
331
+ border-radius: calc(var(--radius-pill) + var(--padding-100));
332
+ }
333
+
334
+ .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover {
335
+ background-color: var(--color-bg-container-secondary);
336
+ }
337
+
338
+ /* The glyph holds the icon colour in every state, as the family's glyphs
339
+ do: only the fill steps on hover. */
340
+ .ds-segmented-control--cycle .ds-circular-button .ds-circular-button__icon,
341
+ .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):hover .ds-circular-button__icon,
342
+ .ds-segmented-control--cycle .ds-circular-button:not(.ds-circular-button--disabled):active .ds-circular-button__icon {
343
+ color: var(--color-action-icon-default);
344
+ }
@@ -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 onto it.
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 {};