rift-ds 1.30.0 → 1.32.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 +6 -4
- package/behaviors/chat-card.css +4 -1
- package/behaviors/deferComponent.d.ts +43 -0
- package/behaviors/deferComponent.js +35 -0
- package/behaviors/locale.d.ts +7 -0
- package/behaviors/locale.js +5 -0
- package/behaviors/shell.css +33 -0
- package/bin/rift-ds.mjs +35 -9
- package/bin/templates/blocks/app/planner/PlannerGrid.tsx +58 -0
- package/bin/templates/blocks/app/planner/Requests.tsx +42 -0
- package/bin/templates/blocks/app/planner/page.module.css +17 -0
- package/bin/templates/blocks/app/planner/page.tsx +32 -0
- package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -1
- package/bin/templates/blocks/registry.json +14 -0
- package/bin/templates/chat/app/api/chat/route.actions.ts +108 -0
- package/bin/templates/chat/components/chat/ChatMount.actions.tsx +55 -0
- package/bin/templates/chat/components/chat/ChatMount.tsx +14 -1
- package/bin/templates/chat/components/chat/proposals/ProposalCard.tsx +81 -0
- package/bin/templates/chat/components/chat/proposals/actions.ts +60 -0
- package/bin/templates/chat/components/chat/proposals/confirmation.ts +9 -0
- package/bin/templates/chat/components/chat/proposals/renderers.tsx +9 -0
- package/chat/ChatLauncher.d.ts +13 -2
- package/chat/ChatLauncher.js +52 -29
- package/chat/ChatProvider.d.ts +19 -2
- package/chat/ChatProvider.js +26 -3
- package/chat/ChatWidget.css +23 -4
- package/chat/ChatWidget.d.ts +2 -1
- package/chat/ChatWidget.js +23 -21
- package/chat/actions.d.ts +52 -6
- package/chat/actions.js +53 -5
- package/chat/contextSchema.d.ts +76 -0
- package/chat/contextSchema.js +58 -0
- package/chat/deferredChatWidget.d.ts +10 -0
- package/chat/deferredChatWidget.js +10 -0
- package/chat/index.d.ts +3 -2
- package/chat/index.js +7 -1
- package/chat/registry.json.d.ts +4 -3
- package/chat/registry.json.js +1 -1
- package/chat/server.d.ts +18 -2
- package/chat/server.js +10 -1
- package/chat/suggestions.d.ts +7 -0
- package/chat/suggestions.js +13 -1
- package/chat/types.d.ts +23 -0
- package/chat/useChat.d.ts +2 -2
- package/chat/useChat.js +15 -1
- package/components/Accordion/Accordion.css +8 -0
- package/components/AgentPlan/AgentPlan.css +8 -0
- package/components/AgentRail/AgentRail.css +3 -3
- package/components/AiButton/AiButton.css +19 -0
- package/components/AiButton/AiButton.d.ts +10 -1
- package/components/AiButton/AiButton.js +6 -1
- package/components/AppSidebar/AppSidebar.css +12 -0
- package/components/ArtifactPanel/ArtifactPanel.js +5 -5
- package/components/Attachment/AttachmentViewer.js +7 -7
- package/components/BentoTile/BentoTile.css +1 -1
- package/components/BentoTile/BentoTile.js +5 -5
- package/components/Button/Button.css +28 -1
- package/components/Button/Button.d.ts +7 -2
- package/components/Button/Button.js +7 -3
- package/components/ButtonGroup/ButtonGroup.css +10 -1
- package/components/Chart/RadarChart.js +24 -10
- package/components/ChatHeader/ChatHeader.d.ts +1 -1
- package/components/ChatThread/ChatThread.css +1 -1
- package/components/Chip/Chip.css +26 -0
- package/components/CircularButton/CircularButton.d.ts +16 -96
- package/components/CircularButton/CircularButton.js +11 -94
- package/components/Combobox/Combobox.css +12 -0
- package/components/CommandPalette/CommandPalette.css +1 -1
- package/components/CommandPalette/CommandPalette.js +3 -3
- package/components/CommandPaletteTrigger/CommandPaletteTrigger.css +9 -0
- package/components/CommandPaletteTrigger/CommandPaletteTrigger.d.ts +10 -2
- package/components/CommandPaletteTrigger/CommandPaletteTrigger.js +7 -2
- package/components/Composer/Composer.css +3 -3
- package/components/Composer/Composer.js +9 -9
- package/components/ContextMenu/ContextMenu.css +24 -0
- package/components/DataTable/DataTable.css +19 -4
- package/components/DataTable/DataTable.d.ts +14 -2
- package/components/DataTable/DataTable.js +28 -17
- package/components/DataTable/periodColumns.d.ts +37 -0
- package/components/DataTable/periodColumns.js +48 -0
- package/components/DateInput/DateInput.css +20 -0
- package/components/DatePicker/DatePicker.css +22 -6
- package/components/DatePicker/DatePicker.d.ts +2 -1
- package/components/DatePicker/DatePicker.js +2 -2
- package/components/DateRangePicker/DateRangePicker.js +2 -2
- package/components/DecisionRow/DecisionRow.css +46 -0
- package/components/DecisionRow/DecisionRow.d.ts +62 -0
- package/components/DecisionRow/DecisionRow.js +93 -0
- package/components/DescriptionList/DescriptionListCopy.d.ts +1 -1
- package/components/DescriptionList/DescriptionListCopy.js +3 -3
- package/components/Dialog/Dialog.css +1 -1
- package/components/Dialog/Dialog.js +3 -3
- package/components/DocumentChip/DocumentChip.css +12 -0
- package/components/DocumentViewer/DocumentViewer.js +10 -10
- package/components/Drawer/Drawer.css +1 -1
- package/components/Drawer/Drawer.js +3 -3
- package/components/Dropdown/Dropdown.css +30 -0
- package/components/DropdownMenu/DropdownMenu.css +24 -0
- package/components/EventCalendar/EventCalendar.css +54 -0
- package/components/EventCalendar/EventCalendar.d.ts +27 -5
- package/components/EventCalendar/EventCalendar.js +50 -15
- package/components/FileInput/FileInput.css +9 -0
- package/components/FilterBar/FilterBar.css +12 -0
- package/components/FunnelChart/FunnelChart.js +33 -22
- package/components/Globe/Globe.css +7 -0
- package/components/Globe/Globe.js +1 -1
- package/components/{CircularButton/CircularButton.css → IconButton/IconButton.css} +91 -81
- package/components/IconButton/IconButton.d.ts +108 -0
- package/components/IconButton/IconButton.js +101 -0
- package/components/Input/Input.css +53 -0
- package/components/Input/Input.js +3 -3
- package/components/MaskedInput/MaskedInput.js +3 -3
- package/components/ModelPicker/ModelPicker.css +12 -1
- package/components/NavList/NavList.css +1 -1
- package/components/Pagination/Pagination.css +1 -1
- package/components/QuestionCard/QuestionCard.js +3 -3
- package/components/RadioButton/RadioButton.css +14 -12
- package/components/RichDropdown/RichDropdown.css +7 -0
- package/components/SegmentedControl/SegmentedControl.css +16 -5
- package/components/SegmentedControl/SegmentedControl.js +7 -4
- package/components/SiteHeader/SiteHeader.css +12 -5
- package/components/SiteHeader/SiteHeader.js +3 -3
- package/components/SourceTrail/SourceTrail.css +8 -0
- package/components/SplitButton/SplitButton.css +14 -14
- package/components/SplitButton/SplitButton.js +3 -3
- package/components/Table/Table.css +7 -0
- package/components/Table/Table.js +1 -1
- package/components/TableToolbar/TableToolbar.css +2 -2
- package/components/TableToolbar/TableToolbar.js +36 -37
- package/components/Tabs/Tabs.css +21 -3
- package/components/ThreadPanel/ThreadPanel.css +8 -0
- package/components/ThreadTabs/ThreadTabs.css +7 -0
- package/components/TimePicker/TimePicker.css +12 -0
- package/components/Timeline/Timeline.css +8 -0
- package/components/ToolCall/ToolCall.css +8 -0
- package/components/Tooltip/Tooltip.js +3 -2
- package/components/Widget/Widget.css +2 -0
- package/components/WorldMap/WorldMap.css +15 -0
- package/components/WorldMap/WorldMap.js +61 -6
- package/components/registry.d.ts +3 -1
- package/components/registry.json +39 -13
- package/components/registry.json.d.ts +39 -13
- package/components/registry.json.js +1 -1
- package/index.d.ts +2 -0
- package/index.js +8 -0
- package/package.json +6 -2
- package/tokens/presets/blueprint.css +9 -0
- package/tokens/presets/bubblegum.css +9 -0
- package/tokens/presets/contrast.css +3 -3
- package/tokens/presets/coral.css +3 -3
- package/tokens/presets/ember.css +9 -0
- package/tokens/presets/getaway.css +9 -0
- package/tokens/presets/gold.css +3 -3
- package/tokens/presets/mono.css +3 -3
- package/tokens/presets/pink.css +3 -3
- package/tokens/presets/plum.css +3 -3
- package/tokens/presets/signal.css +9 -0
- package/tokens/presets/smoke.css +9 -0
- package/tokens/presets/velvet.css +9 -0
- package/tokens/presets/violet.css +3 -3
- package/tokens/presets/volt.css +9 -0
- package/tokens/presets/warm.css +3 -3
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Spinner } from "../Spinner/Spinner.js";
|
|
4
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
5
|
+
import "./IconButton.css";
|
|
6
|
+
import "../../fonts/material-symbols.css";
|
|
7
|
+
import { mirrorClass } from "../../behaviors/direction.js";
|
|
8
|
+
import { formatNumber, DEFAULT_LOCALE } from "../../behaviors/locale.js";
|
|
9
|
+
function resolveIconButtonCell(variant, tone) {
|
|
10
|
+
const emphasis = variant === "neutral" ? "primary" : variant;
|
|
11
|
+
const resolvedTone = tone ?? (variant === "neutral" ? "neutral" : "default");
|
|
12
|
+
if (resolvedTone === "destructive") {
|
|
13
|
+
return emphasis === "primary" ? "primary-destructive" : "destructive";
|
|
14
|
+
}
|
|
15
|
+
if (resolvedTone === "neutral" && emphasis !== "tertiary") {
|
|
16
|
+
return emphasis === "primary" ? "neutral" : "secondary-neutral";
|
|
17
|
+
}
|
|
18
|
+
return emphasis;
|
|
19
|
+
}
|
|
20
|
+
const IconButton = React.forwardRef(
|
|
21
|
+
({
|
|
22
|
+
icon,
|
|
23
|
+
variant,
|
|
24
|
+
tone,
|
|
25
|
+
priority,
|
|
26
|
+
disabled,
|
|
27
|
+
state,
|
|
28
|
+
size = "default",
|
|
29
|
+
loading,
|
|
30
|
+
label,
|
|
31
|
+
tooltip,
|
|
32
|
+
tooltipPosition = "top",
|
|
33
|
+
href,
|
|
34
|
+
target,
|
|
35
|
+
rel,
|
|
36
|
+
badge,
|
|
37
|
+
badgeMax = 99,
|
|
38
|
+
badgeLabel = defaultBadgeLabel,
|
|
39
|
+
locale = DEFAULT_LOCALE,
|
|
40
|
+
className = "",
|
|
41
|
+
linkComponent,
|
|
42
|
+
...rest
|
|
43
|
+
}, ref) => {
|
|
44
|
+
const baseClass = "ds-icon-button";
|
|
45
|
+
const Link = linkComponent ?? "a";
|
|
46
|
+
const resolvedVariant = resolveIconButtonCell(variant ?? priority ?? "primary", tone);
|
|
47
|
+
const isDisabled = disabled ?? state === "disabled";
|
|
48
|
+
const resolvedState = state ?? (isDisabled ? "disabled" : "default");
|
|
49
|
+
const isLoading = Boolean(loading);
|
|
50
|
+
const classes = [
|
|
51
|
+
baseClass,
|
|
52
|
+
`${baseClass}--${resolvedVariant}`,
|
|
53
|
+
`${baseClass}--${resolvedState}`,
|
|
54
|
+
`${baseClass}--${size}`,
|
|
55
|
+
isLoading && `${baseClass}--loading`,
|
|
56
|
+
badge !== void 0 && `${baseClass}--badged`,
|
|
57
|
+
className
|
|
58
|
+
].filter(Boolean).join(" ");
|
|
59
|
+
const glyph = isLoading ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon`, "aria-hidden": "true", children: /* @__PURE__ */ jsx(Spinner, { size: size === "compact" ? "sm" : "md", tone: "inherit" }) }) : /* @__PURE__ */ jsx("span", { className: `${baseClass}__icon${typeof icon === "string" ? ` material-symbols-rounded ${mirrorClass(icon)}` : ""}`, "aria-hidden": "true", children: icon });
|
|
60
|
+
const badgeText = badge === void 0 || badge === true ? null : typeof badge === "number" ? badge > badgeMax ? `${formatNumber(badgeMax, locale)}+` : formatNumber(badge, locale) : badge;
|
|
61
|
+
const children = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
62
|
+
glyph,
|
|
63
|
+
badge === true && /* @__PURE__ */ jsx("span", { className: `${baseClass}__badge ${baseClass}__badge--dot`, "aria-hidden": "true" }),
|
|
64
|
+
badgeText !== null && /* @__PURE__ */ jsx("span", { className: `${baseClass}__badge`, "aria-hidden": "true", children: badgeText })
|
|
65
|
+
] });
|
|
66
|
+
const accessibleName = badge === void 0 ? label : `${label}${badgeLabel(badge)}`;
|
|
67
|
+
const control = href && !isDisabled && !isLoading ? /* @__PURE__ */ jsx(
|
|
68
|
+
Link,
|
|
69
|
+
{
|
|
70
|
+
...rest,
|
|
71
|
+
ref,
|
|
72
|
+
className: classes,
|
|
73
|
+
href,
|
|
74
|
+
target,
|
|
75
|
+
rel,
|
|
76
|
+
"aria-label": accessibleName,
|
|
77
|
+
children
|
|
78
|
+
}
|
|
79
|
+
) : /* @__PURE__ */ jsx(
|
|
80
|
+
"button",
|
|
81
|
+
{
|
|
82
|
+
...rest,
|
|
83
|
+
ref,
|
|
84
|
+
type: "button",
|
|
85
|
+
className: classes,
|
|
86
|
+
disabled: isDisabled || isLoading,
|
|
87
|
+
"aria-busy": isLoading || void 0,
|
|
88
|
+
"aria-label": accessibleName,
|
|
89
|
+
children
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
const tooltipContent = tooltip === false ? null : tooltip ?? label;
|
|
93
|
+
if (!tooltipContent) return control;
|
|
94
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, position: tooltipPosition, children: control });
|
|
95
|
+
}
|
|
96
|
+
);
|
|
97
|
+
IconButton.displayName = "IconButton";
|
|
98
|
+
const defaultBadgeLabel = (badge) => badge === true ? ", new" : `, ${badge} new`;
|
|
99
|
+
export {
|
|
100
|
+
IconButton
|
|
101
|
+
};
|
|
@@ -274,3 +274,56 @@
|
|
|
274
274
|
.ds-input--affixed.ds-input--compact .ds-input__clear {
|
|
275
275
|
margin-inline-end: calc(-1 * var(--padding-300));
|
|
276
276
|
}
|
|
277
|
+
|
|
278
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
279
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
280
|
+
side. An icon drawn in the field moves in one step and the text keeps
|
|
281
|
+
its distance from it (16 → 12, compact 12 → 8). The affixed wrapper's clear
|
|
282
|
+
and action buttons already pull into the edge with their own margin. */
|
|
283
|
+
.ds-input__icon--left {
|
|
284
|
+
inset-inline-start: var(--padding-300);
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
.ds-input__icon--right {
|
|
288
|
+
inset-inline-end: var(--padding-300);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
.ds-input--has-icon-left .ds-input__field {
|
|
292
|
+
padding-inline-start: calc(var(--padding-300) + 24px + var(--gap-200)); /* 12px + 24px icon + 8px gap */
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
.ds-input--has-icon-right .ds-input__field {
|
|
296
|
+
padding-inline-end: calc(var(--padding-300) + 24px + var(--gap-200)); /* 12px + 24px icon + 8px gap */
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
.ds-input--compact .ds-input__icon--left {
|
|
300
|
+
inset-inline-start: var(--padding-200);
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
.ds-input--compact .ds-input__icon--right {
|
|
304
|
+
inset-inline-end: var(--padding-200);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
.ds-input--compact.ds-input--has-icon-left .ds-input__field {
|
|
308
|
+
padding-inline-start: calc(var(--padding-200) + 20px + var(--gap-200)); /* 8px + 20px icon + 8px gap */
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
.ds-input--compact.ds-input--has-icon-right .ds-input__field {
|
|
312
|
+
padding-inline-end: calc(var(--padding-200) + 20px + var(--gap-200)); /* 8px + 20px icon + 8px gap */
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
.ds-input--affixed.ds-input--has-icon-left .ds-input__field-wrapper {
|
|
316
|
+
padding-inline-start: var(--padding-300);
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
.ds-input--affixed.ds-input--has-icon-right .ds-input__field-wrapper {
|
|
320
|
+
padding-inline-end: var(--padding-300);
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
.ds-input--affixed.ds-input--compact.ds-input--has-icon-left .ds-input__field-wrapper {
|
|
324
|
+
padding-inline-start: var(--padding-200);
|
|
325
|
+
}
|
|
326
|
+
|
|
327
|
+
.ds-input--affixed.ds-input--compact.ds-input--has-icon-right .ds-input__field-wrapper {
|
|
328
|
+
padding-inline-end: var(--padding-200);
|
|
329
|
+
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useState, useId } from "react";
|
|
4
4
|
import { Field } from "../Field/Field.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
6
6
|
import "./Input.css";
|
|
7
7
|
import "../../fonts/material-symbols.css";
|
|
8
8
|
import { mirrorClass } from "../../behaviors/direction.js";
|
|
@@ -136,13 +136,13 @@ const Input = React.forwardRef(
|
|
|
136
136
|
hasSuffix && /* @__PURE__ */ jsx("span", { className: `${baseClass}__affix ${baseClass}__affix--suffix`, id: suffixId, dir: "auto", children: suffix }),
|
|
137
137
|
hasAction && /* @__PURE__ */ jsx("span", { className: `${baseClass}__action`, children: action }),
|
|
138
138
|
showClear && /* @__PURE__ */ jsx(
|
|
139
|
-
|
|
139
|
+
IconButton,
|
|
140
140
|
{
|
|
141
141
|
className: `${baseClass}__clear`,
|
|
142
142
|
icon: "close",
|
|
143
143
|
variant: "tertiary",
|
|
144
144
|
size: "compact",
|
|
145
|
-
|
|
145
|
+
label: clearLabel,
|
|
146
146
|
onClick: handleClear
|
|
147
147
|
}
|
|
148
148
|
),
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { jsxs, Fragment, jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useMemo, useRef, useLayoutEffect, useEffect } from "react";
|
|
4
4
|
import { Input } from "../Input/Input.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
6
6
|
import { MOTION_SENSITIVE_HIDE_MS } from "../../tokens/motion.js";
|
|
7
7
|
import { applyMask, concealMasked, maskIsNumeric, readEdit, maskCapacity, caretFor } from "./mask.js";
|
|
8
8
|
import { MASK_PRESETS } from "./mask.js";
|
|
@@ -89,12 +89,12 @@ function MaskedInput({
|
|
|
89
89
|
onValueChange?.(next.raw, next.text);
|
|
90
90
|
};
|
|
91
91
|
const revealButton = sensitive && revealable ? /* @__PURE__ */ jsx(
|
|
92
|
-
|
|
92
|
+
IconButton,
|
|
93
93
|
{
|
|
94
94
|
icon: revealed ? "visibility_off" : "visibility",
|
|
95
95
|
variant: "tertiary",
|
|
96
96
|
size: "compact",
|
|
97
|
-
|
|
97
|
+
label: revealed ? hideLabel : showLabel,
|
|
98
98
|
"aria-pressed": revealed,
|
|
99
99
|
disabled,
|
|
100
100
|
onClick: () => setRevealed(!revealed)
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
display: inline-flex;
|
|
23
23
|
align-items: center;
|
|
24
24
|
gap: var(--gap-050);
|
|
25
|
-
/* The row height (--control-height-*),
|
|
25
|
+
/* The row height (--control-height-*), IconButton's too, so the pill
|
|
26
26
|
and the composer's round icon buttons read as one row of equals. */
|
|
27
27
|
box-sizing: border-box;
|
|
28
28
|
height: var(--control-height-default);
|
|
@@ -203,3 +203,14 @@
|
|
|
203
203
|
.ds-model-picker__effort-options {
|
|
204
204
|
flex: none;
|
|
205
205
|
}
|
|
206
|
+
|
|
207
|
+
/* Icon side padding, Button's rule: the chevron always trails, and its box
|
|
208
|
+
carries its own side bearing, so the end takes the step below the label
|
|
209
|
+
side (16 → 12, compact 12 → 8). */
|
|
210
|
+
.ds-model-picker__trigger {
|
|
211
|
+
padding-inline-end: var(--padding-300);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
.ds-model-picker--compact .ds-model-picker__trigger {
|
|
215
|
+
padding-inline-end: var(--padding-200);
|
|
216
|
+
}
|
|
@@ -3,7 +3,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
3
3
|
import React from "react";
|
|
4
4
|
import { Button } from "../Button/Button.js";
|
|
5
5
|
import { CheckboxIndicator } from "../Checkbox/Checkbox.js";
|
|
6
|
-
import {
|
|
6
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
7
7
|
import { RadioIndicator } from "../RadioButton/RadioButton.js";
|
|
8
8
|
import "./QuestionCard.css";
|
|
9
9
|
import "../../behaviors/chat-card.css";
|
|
@@ -272,11 +272,11 @@ const QuestionCard = React.forwardRef(
|
|
|
272
272
|
),
|
|
273
273
|
showSubmit && /* @__PURE__ */ jsx(Mark, { base: baseClass, chosen: draft.other.trim() !== "", multi }),
|
|
274
274
|
!showSubmit && /* @__PURE__ */ jsx(
|
|
275
|
-
|
|
275
|
+
IconButton,
|
|
276
276
|
{
|
|
277
277
|
icon: "arrow_upward",
|
|
278
278
|
size: "compact",
|
|
279
|
-
|
|
279
|
+
label: labels.submit,
|
|
280
280
|
disabled: !draft.other.trim(),
|
|
281
281
|
onClick: submitDraft
|
|
282
282
|
}
|
|
@@ -31,24 +31,28 @@
|
|
|
31
31
|
meaning, so it never follows --radius-pill into a square. */
|
|
32
32
|
border-radius: 50%;
|
|
33
33
|
background-color: var(--color-input-bg-primary);
|
|
34
|
+
box-shadow: inset 0 0 0 var(--padding-300) var(--color-input-bg-primary);
|
|
35
|
+
transition: box-shadow var(--motion-duration-base) var(--motion-ease-standard), background-color var(--motion-duration-base) var(--motion-ease-standard), border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
34
36
|
display: inline-flex;
|
|
35
37
|
align-items: center;
|
|
36
38
|
justify-content: center;
|
|
37
39
|
flex-shrink: 0;
|
|
38
|
-
transition: border-color var(--motion-duration-base) var(--motion-ease-standard);
|
|
39
40
|
}
|
|
40
41
|
|
|
41
42
|
/* ============================================
|
|
42
43
|
DOT (inner fill)
|
|
43
44
|
============================================ */
|
|
44
45
|
|
|
46
|
+
/* The dot is painted by the circle itself, never by a child box: a child
|
|
47
|
+
centred by flex at a fractional page position rounds its edges apart from
|
|
48
|
+
the ring's, and the dot reads off-centre by a pixel. The checked circle
|
|
49
|
+
fills with the action colour and an inset ring of the field colour, one
|
|
50
|
+
padding step wide, carves the gap, so ring, gap and dot are one rounded
|
|
51
|
+
shape and stay concentric at any position or zoom. Unchecked, the inset
|
|
52
|
+
ring covers the whole face. The span stays in the markup for any
|
|
53
|
+
consumer that selects it, and draws nothing. */
|
|
45
54
|
.ds-radio__dot {
|
|
46
|
-
|
|
47
|
-
height: 12px;
|
|
48
|
-
border-radius: 50%;
|
|
49
|
-
background-color: var(--color-action-primary-bg);
|
|
50
|
-
transform: scale(0);
|
|
51
|
-
transition: transform var(--motion-duration-base) var(--motion-ease-standard);
|
|
55
|
+
display: none;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
58
|
/* ============================================
|
|
@@ -72,10 +76,8 @@
|
|
|
72
76
|
|
|
73
77
|
.ds-radio__circle--checked {
|
|
74
78
|
border-color: var(--color-action-primary-bg);
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
.ds-radio__circle--checked .ds-radio__dot {
|
|
78
|
-
transform: scale(1);
|
|
79
|
+
background-color: var(--color-action-primary-bg);
|
|
80
|
+
box-shadow: inset 0 0 0 var(--padding-100) var(--color-input-bg-primary);
|
|
79
81
|
}
|
|
80
82
|
|
|
81
83
|
/* ============================================
|
|
@@ -92,7 +94,7 @@
|
|
|
92
94
|
border-color: var(--color-action-primary-bg-hover);
|
|
93
95
|
}
|
|
94
96
|
|
|
95
|
-
.ds-control-host:not(:disabled):not([aria-disabled='true']):hover .ds-radio__circle--checked
|
|
97
|
+
.ds-control-host:not(:disabled):not([aria-disabled='true']):hover .ds-radio__circle--checked {
|
|
96
98
|
background-color: var(--color-action-primary-bg-hover);
|
|
97
99
|
}
|
|
98
100
|
|
|
@@ -241,3 +241,10 @@
|
|
|
241
241
|
.ds-rich-dropdown--disabled .ds-rich-dropdown__chevron {
|
|
242
242
|
color: var(--color-input-text-disabled);
|
|
243
243
|
}
|
|
244
|
+
|
|
245
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
246
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
247
|
+
side. The trigger always ends on its chevron (16 → 12). */
|
|
248
|
+
.ds-rich-dropdown__trigger {
|
|
249
|
+
padding-inline-end: var(--padding-300);
|
|
250
|
+
}
|
|
@@ -219,6 +219,17 @@
|
|
|
219
219
|
padding-block: 0;
|
|
220
220
|
}
|
|
221
221
|
|
|
222
|
+
/* Icon side padding: beside a label the icon's box carries its own side
|
|
223
|
+
bearing, so its edge takes the step below the text's, as Button's does:
|
|
224
|
+
16 → 12 at default, 12 → 8 at compact. */
|
|
225
|
+
.ds-segmented-control__segment--icon-start {
|
|
226
|
+
padding-inline-start: var(--padding-300);
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
.ds-segmented-control--compact .ds-segmented-control__segment--icon-start {
|
|
230
|
+
padding-inline-start: var(--padding-200);
|
|
231
|
+
}
|
|
232
|
+
|
|
222
233
|
.ds-segmented-control--compact .ds-segmented-control__label {
|
|
223
234
|
font-size: var(--font-paragraph-sm-emphasis-size);
|
|
224
235
|
line-height: var(--font-paragraph-sm-emphasis-line-height);
|
|
@@ -325,20 +336,20 @@
|
|
|
325
336
|
background: none;
|
|
326
337
|
}
|
|
327
338
|
|
|
328
|
-
.ds-segmented-control--cycle .ds-
|
|
339
|
+
.ds-segmented-control--cycle .ds-icon-button {
|
|
329
340
|
background-color: var(--color-bg-container-primary);
|
|
330
341
|
border: var(--border-025) solid var(--color-bg-container-border);
|
|
331
342
|
border-radius: calc(var(--radius-pill) + var(--padding-100));
|
|
332
343
|
}
|
|
333
344
|
|
|
334
|
-
.ds-segmented-control--cycle .ds-
|
|
345
|
+
.ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):hover {
|
|
335
346
|
background-color: var(--color-bg-container-secondary);
|
|
336
347
|
}
|
|
337
348
|
|
|
338
349
|
/* The glyph holds the icon colour in every state, as the family's glyphs
|
|
339
350
|
do: only the fill steps on hover. */
|
|
340
|
-
.ds-segmented-control--cycle .ds-
|
|
341
|
-
.ds-segmented-control--cycle .ds-
|
|
342
|
-
.ds-segmented-control--cycle .ds-
|
|
351
|
+
.ds-segmented-control--cycle .ds-icon-button .ds-icon-button__icon,
|
|
352
|
+
.ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
|
|
353
|
+
.ds-segmented-control--cycle .ds-icon-button:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
343
354
|
color: var(--color-action-icon-default);
|
|
344
355
|
}
|
|
@@ -7,7 +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 {
|
|
10
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
11
11
|
import { warnOnce } from "../../behaviors/devWarning.js";
|
|
12
12
|
const SegmentedControl = React.forwardRef(
|
|
13
13
|
({
|
|
@@ -266,13 +266,13 @@ const SegmentedControl = React.forwardRef(
|
|
|
266
266
|
ref: setRef,
|
|
267
267
|
className: [baseClass, sizeClass, variantClass, `${baseClass}--cycle`, className].filter(Boolean).join(" "),
|
|
268
268
|
children: current && /* @__PURE__ */ jsx(
|
|
269
|
-
|
|
269
|
+
IconButton,
|
|
270
270
|
{
|
|
271
271
|
icon: current.icon ?? /* @__PURE__ */ jsx("span", { "aria-hidden": "true", children: current.label.charAt(0) }),
|
|
272
272
|
size,
|
|
273
273
|
variant: "secondary",
|
|
274
274
|
tone: "neutral",
|
|
275
|
-
|
|
275
|
+
label,
|
|
276
276
|
tooltip: current.label,
|
|
277
277
|
disabled: next === current,
|
|
278
278
|
onClick: () => select(next.value)
|
|
@@ -304,7 +304,10 @@ const SegmentedControl = React.forwardRef(
|
|
|
304
304
|
const btnClasses = [
|
|
305
305
|
`${baseClass}__segment`,
|
|
306
306
|
isActive ? `${baseClass}__segment--active` : "",
|
|
307
|
-
segment.disabled ? `${baseClass}__segment--disabled` : ""
|
|
307
|
+
segment.disabled ? `${baseClass}__segment--disabled` : "",
|
|
308
|
+
// Icon and label both on screen: the icon's edge takes a step
|
|
309
|
+
// less padding (design.md, SegmentedControl).
|
|
310
|
+
segment.icon && showLabels && collapseMode === "full" ? `${baseClass}__segment--icon-start` : ""
|
|
308
311
|
].filter(Boolean).join(" ");
|
|
309
312
|
return /* @__PURE__ */ jsxs(
|
|
310
313
|
"button",
|
|
@@ -174,13 +174,13 @@
|
|
|
174
174
|
border-radius: calc(var(--radius-pill) + var(--padding-100));
|
|
175
175
|
}
|
|
176
176
|
|
|
177
|
-
.ds-site-header .ds-site-header__menu-button:not(.ds-
|
|
177
|
+
.ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):hover {
|
|
178
178
|
background-color: var(--color-bg-container-secondary);
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
-
.ds-site-header .ds-site-header__menu-button .ds-
|
|
182
|
-
.ds-site-header .ds-site-header__menu-button:not(.ds-
|
|
183
|
-
.ds-site-header .ds-site-header__menu-button:not(.ds-
|
|
181
|
+
.ds-site-header .ds-site-header__menu-button .ds-icon-button__icon,
|
|
182
|
+
.ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
|
|
183
|
+
.ds-site-header .ds-site-header__menu-button:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
184
184
|
color: var(--color-action-icon-default);
|
|
185
185
|
}
|
|
186
186
|
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
turning into another. */
|
|
329
329
|
.ds-site-header__drawer .ds-drawer__close .material-symbols-rounded {
|
|
330
330
|
--icon-size: var(--icon-size-600);
|
|
331
|
-
/* The glyph takes the close's on-scrim white, not
|
|
331
|
+
/* The glyph takes the close's on-scrim white, not IconButton's
|
|
332
332
|
icon colour, which is dark in light mode and vanished on the scrim. */
|
|
333
333
|
color: inherit;
|
|
334
334
|
}
|
|
@@ -361,3 +361,10 @@
|
|
|
361
361
|
.ds-site-header__drawer .ds-nav-list {
|
|
362
362
|
width: 100%;
|
|
363
363
|
}
|
|
364
|
+
|
|
365
|
+
/* Icon side padding, Button's rule: a section with a mega menu trails a
|
|
366
|
+
caret, whose box carries its own side bearing, so that pill's end takes
|
|
367
|
+
the step below the label side (16 → 12). */
|
|
368
|
+
.ds-site-header__pill:has(.ds-site-header__caret) {
|
|
369
|
+
padding-inline-end: var(--padding-300);
|
|
370
|
+
}
|
|
@@ -5,7 +5,7 @@ import { useLinkComponent } from "../../behaviors/LinkProvider.js";
|
|
|
5
5
|
import { useLayer } from "../../behaviors/useLayer.js";
|
|
6
6
|
import { isRtl } from "../../behaviors/direction.js";
|
|
7
7
|
import { MOTION_HOVER_HIDE_DELAY_MS } from "../../tokens/motion.js";
|
|
8
|
-
import {
|
|
8
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
9
9
|
import { Drawer } from "../Drawer/Drawer.js";
|
|
10
10
|
import { MegaMenu } from "../MegaMenu/MegaMenu.js";
|
|
11
11
|
import { NavList } from "../NavList/NavList.js";
|
|
@@ -284,7 +284,7 @@ function SiteHeader({
|
|
|
284
284
|
),
|
|
285
285
|
wideActions && /* @__PURE__ */ jsx("div", { ref: wideRef, className: `${baseClass}__wide-actions`, inert: folded, children: wideActions }),
|
|
286
286
|
/* @__PURE__ */ jsx(
|
|
287
|
-
|
|
287
|
+
IconButton,
|
|
288
288
|
{
|
|
289
289
|
ref: menuButtonRef,
|
|
290
290
|
className: [`${baseClass}__menu-button`, drawerOpen && `${baseClass}__menu-button--hidden`].filter(Boolean).join(" "),
|
|
@@ -292,7 +292,7 @@ function SiteHeader({
|
|
|
292
292
|
size: "compact",
|
|
293
293
|
variant: "secondary",
|
|
294
294
|
tone: "neutral",
|
|
295
|
-
|
|
295
|
+
label: drawerOpenLabel,
|
|
296
296
|
tooltip: false,
|
|
297
297
|
"aria-expanded": drawerOpen,
|
|
298
298
|
"aria-haspopup": "dialog",
|
|
@@ -216,3 +216,11 @@
|
|
|
216
216
|
.ds-source-trail .material-symbols-rounded:not(.ds-source-trail__chevron) {
|
|
217
217
|
color: inherit;
|
|
218
218
|
}
|
|
219
|
+
|
|
220
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
221
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
222
|
+
side. The header's chevron end steps in from the card inset; the
|
|
223
|
+
leading side keeps the inset, the line the body below it reads from. */
|
|
224
|
+
.ds-source-trail__header:has(.ds-source-trail__chevron) {
|
|
225
|
+
padding-inline-end: calc(var(--ds-chat-card-inset) - var(--padding-100));
|
|
226
|
+
}
|
|
@@ -35,33 +35,33 @@
|
|
|
35
35
|
.ds-split-button .ds-split-button__trigger {
|
|
36
36
|
border-start-start-radius: var(--radius-050);
|
|
37
37
|
border-end-start-radius: var(--radius-050);
|
|
38
|
-
/* Standalone,
|
|
38
|
+
/* Standalone, IconButton is a fixed even box; inside the split its
|
|
39
39
|
explicit height would block the wrapper's align-items: stretch, and
|
|
40
40
|
the main segment's height moves (secondary's border adds to it, a
|
|
41
41
|
loading spinner grows it) — so the flat edges overhang at the seam.
|
|
42
42
|
Let the flex stretch size it to the main segment instead. */
|
|
43
43
|
height: auto;
|
|
44
44
|
align-self: stretch;
|
|
45
|
+
/* Icon side padding, as Button's: the chevron's cap side takes one step
|
|
46
|
+
less than the even box would give it, so the trigger is a padding
|
|
47
|
+
step narrower than the row height and the chevron sits centred in it,
|
|
48
|
+
6px either side. This replaces the old optical nudge toward the seam,
|
|
49
|
+
which reached the same seam-side gap by moving the glyph instead of
|
|
50
|
+
trimming the cap. The compact trigger keeps its even box: its
|
|
51
|
+
chevron already sits 6px from either side, and trimming it would put
|
|
52
|
+
the glyph in the cap's curve. */
|
|
53
|
+
width: calc(var(--control-height-default) - var(--padding-100));
|
|
45
54
|
}
|
|
46
55
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
centroid of a square-plus-semicircle is ~5% of the width off-centre).
|
|
50
|
-
A geometrically centred chevron reads as pushed toward the cap; nudge
|
|
51
|
-
it toward the flat edge to match. */
|
|
52
|
-
.ds-split-button .ds-split-button__trigger .ds-circular-button__icon {
|
|
53
|
-
transform: translateX(calc(-2px * var(--ds-inline-sign, 1)));
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
.ds-split-button .ds-split-button__trigger.ds-circular-button--compact .ds-circular-button__icon {
|
|
57
|
-
transform: translateX(calc(-1px * var(--ds-inline-sign, 1)));
|
|
56
|
+
.ds-split-button .ds-split-button__trigger.ds-icon-button--compact {
|
|
57
|
+
width: var(--control-height-compact);
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
/* ============================================
|
|
61
61
|
LOADING
|
|
62
62
|
The trigger is inert while the main segment
|
|
63
63
|
runs its async action, but it is busy, not
|
|
64
|
-
broken: Button and
|
|
64
|
+
broken: Button and IconButton both define
|
|
65
65
|
loading as full-colour appearance with a
|
|
66
66
|
progress cursor, and the disabled dim on one
|
|
67
67
|
half would split the pill into two unrelated
|
|
@@ -70,7 +70,7 @@
|
|
|
70
70
|
this rule deliberately stands down.
|
|
71
71
|
============================================ */
|
|
72
72
|
|
|
73
|
-
.ds-split-button:has(.ds-button--loading:not(.ds-button--disabled)) .ds-split-button__trigger.ds-
|
|
73
|
+
.ds-split-button:has(.ds-button--loading:not(.ds-button--disabled)) .ds-split-button__trigger.ds-icon-button--disabled {
|
|
74
74
|
opacity: 1;
|
|
75
75
|
cursor: progress;
|
|
76
76
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Button } from "../Button/Button.js";
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
5
|
import { DropdownMenu } from "../DropdownMenu/DropdownMenu.js";
|
|
6
6
|
import "./SplitButton.css";
|
|
7
7
|
import "../../behaviors/direction.css";
|
|
@@ -55,12 +55,12 @@ const SplitButton = React.forwardRef(
|
|
|
55
55
|
size,
|
|
56
56
|
items,
|
|
57
57
|
trigger: /* @__PURE__ */ jsx(
|
|
58
|
-
|
|
58
|
+
IconButton,
|
|
59
59
|
{
|
|
60
60
|
className: `${baseClass}__trigger`,
|
|
61
61
|
icon: "keyboard_arrow_down",
|
|
62
62
|
tooltip: false,
|
|
63
|
-
|
|
63
|
+
label: menuLabel,
|
|
64
64
|
variant: emphasis,
|
|
65
65
|
tone: resolvedTone,
|
|
66
66
|
size,
|
|
@@ -154,7 +154,14 @@
|
|
|
154
154
|
(design.md's responsive contract). Natural column widths below the
|
|
155
155
|
mobile breakpoint force the overflow the wrapper exists to catch —
|
|
156
156
|
without this the table crushes to the viewport and cells clip. */
|
|
157
|
+
/* The plain table's scroll container: no surface of its own. */
|
|
158
|
+
.ds-table__scroll {
|
|
159
|
+
overflow-x: auto;
|
|
160
|
+
max-width: 100%;
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
@media (max-width: 768px) {
|
|
164
|
+
.ds-table__scroll .ds-table,
|
|
158
165
|
.ds-table__wrapper .ds-table {
|
|
159
166
|
min-width: max-content;
|
|
160
167
|
}
|
|
@@ -120,8 +120,8 @@
|
|
|
120
120
|
/* A trigger whose panel is open (the More panel's columns, the Filter menu, a
|
|
121
121
|
chip's editor) holds its pressed fill until the panel closes, so the
|
|
122
122
|
bar says which control the open panel belongs to. */
|
|
123
|
-
.ds-table-toolbar .ds-
|
|
124
|
-
.ds-table-toolbar .ds-
|
|
123
|
+
.ds-table-toolbar .ds-icon-button--tertiary[aria-expanded='true'],
|
|
124
|
+
.ds-table-toolbar .ds-icon-button--secondary-neutral[aria-expanded='true'],
|
|
125
125
|
.ds-table-toolbar .ds-chip[aria-expanded='true'],
|
|
126
126
|
.ds-table-toolbar .ds-button[aria-expanded='true'] {
|
|
127
127
|
background-color: var(--color-action-passive-bg-active);
|