rift-ds 1.31.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 +1 -1
- package/behaviors/chat-card.css +4 -1
- package/behaviors/deferComponent.d.ts +43 -0
- package/behaviors/deferComponent.js +35 -0
- package/bin/templates/blocks/components/blocks/AppShell.module.css +10 -1
- package/chat/ChatLauncher.d.ts +9 -1
- package/chat/ChatLauncher.js +51 -33
- package/chat/ChatWidget.css +13 -4
- package/chat/ChatWidget.js +15 -15
- package/chat/deferredChatWidget.d.ts +10 -0
- package/chat/deferredChatWidget.js +10 -0
- package/chat/index.d.ts +1 -0
- package/chat/index.js +2 -0
- package/chat/registry.json.d.ts +2 -1
- package/chat/registry.json.js +1 -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/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/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 +2 -2
- package/components/DataTable/DataTable.js +15 -15
- package/components/DateInput/DateInput.css +20 -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/FileInput/FileInput.css +9 -0
- package/components/FilterBar/FilterBar.css +12 -0
- 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/TableToolbar/TableToolbar.css +2 -2
- package/components/TableToolbar/TableToolbar.js +36 -37
- package/components/ThreadPanel/ThreadPanel.css +8 -0
- package/components/ThreadTabs/ThreadTabs.css +7 -0
- package/components/TimePicker/TimePicker.css +12 -0
- package/components/ToolCall/ToolCall.css +8 -0
- package/components/Tooltip/Tooltip.js +3 -2
- package/components/WorldMap/WorldMap.js +5 -5
- package/components/registry.d.ts +3 -1
- package/components/registry.json +19 -10
- package/components/registry.json.d.ts +19 -10
- package/components/registry.json.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +6 -2
|
@@ -19,8 +19,16 @@ type CommandPaletteTriggerOwnProps = {
|
|
|
19
19
|
icon?: string | React.ReactNode;
|
|
20
20
|
/** Control size, on the row-control scale: `default` is 40px, `compact` 32px. */
|
|
21
21
|
size?: 'default' | 'compact';
|
|
22
|
-
/** Fold to the icon alone,
|
|
22
|
+
/** Fold to the icon alone, an even box the row height across, for a row with no room for the field. The label stays the accessible name. */
|
|
23
23
|
iconOnly?: boolean;
|
|
24
|
+
/**
|
|
25
|
+
* The hover and focus tooltip of the icon-only form, which names itself as
|
|
26
|
+
* IconButton does: by default it carries `label`. Pass a string to show
|
|
27
|
+
* different wording, or `false` to opt out.
|
|
28
|
+
*/
|
|
29
|
+
tooltip?: string | false;
|
|
30
|
+
/** Which side the tooltip opens on; below by default, since the trigger usually sits in a top bar. `start` and `end` follow the reading direction. */
|
|
31
|
+
tooltipPosition?: 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end';
|
|
24
32
|
/** Additional CSS classes */
|
|
25
33
|
className?: string;
|
|
26
34
|
};
|
|
@@ -30,7 +38,7 @@ export interface CommandPaletteTriggerProps extends CommandPaletteTriggerOwnProp
|
|
|
30
38
|
* The entry point to a command palette: a button dressed as a search field
|
|
31
39
|
* (icon, prompt and the shortcut's keycaps), because typing happens in the
|
|
32
40
|
* palette itself. It sits on the row-control height, so it lines up with
|
|
33
|
-
* the buttons and pickers beside it, and folds to
|
|
41
|
+
* the buttons and pickers beside it, and folds to its icon alone with
|
|
34
42
|
* `iconOnly`. Pair it with CommandPalette: the trigger's `onClick` opens
|
|
35
43
|
* the palette, and the palette owns the shortcut. `aria-keyshortcuts`
|
|
36
44
|
* defaults to the shortcut it draws.
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
import { Kbd } from "../Kbd/Kbd.js";
|
|
4
|
+
import { Tooltip } from "../Tooltip/Tooltip.js";
|
|
4
5
|
import { shortcutAriaAnyPlatform } from "../../behaviors/shortcut-keys.js";
|
|
5
6
|
import "./CommandPaletteTrigger.css";
|
|
6
7
|
import "../../fonts/material-symbols.css";
|
|
@@ -14,6 +15,8 @@ const CommandPaletteTrigger = React.forwardRef(
|
|
|
14
15
|
icon = "search",
|
|
15
16
|
size = "default",
|
|
16
17
|
iconOnly = false,
|
|
18
|
+
tooltip,
|
|
19
|
+
tooltipPosition = "bottom",
|
|
17
20
|
className = "",
|
|
18
21
|
...rest
|
|
19
22
|
}, ref) => {
|
|
@@ -31,12 +34,11 @@ const CommandPaletteTrigger = React.forwardRef(
|
|
|
31
34
|
} else {
|
|
32
35
|
announced = shortcutAriaAnyPlatform(keys) ?? "";
|
|
33
36
|
}
|
|
34
|
-
|
|
37
|
+
const control = /* @__PURE__ */ jsxs(
|
|
35
38
|
"button",
|
|
36
39
|
{
|
|
37
40
|
"aria-label": label,
|
|
38
41
|
"aria-keyshortcuts": announced || void 0,
|
|
39
|
-
title: iconOnly ? label : void 0,
|
|
40
42
|
...rest,
|
|
41
43
|
ref,
|
|
42
44
|
type: "button",
|
|
@@ -50,6 +52,9 @@ const CommandPaletteTrigger = React.forwardRef(
|
|
|
50
52
|
]
|
|
51
53
|
}
|
|
52
54
|
);
|
|
55
|
+
const tooltipContent = !iconOnly || tooltip === false ? null : tooltip ?? label;
|
|
56
|
+
if (!tooltipContent) return control;
|
|
57
|
+
return /* @__PURE__ */ jsx(Tooltip, { content: tooltipContent, position: tooltipPosition, children: control });
|
|
53
58
|
}
|
|
54
59
|
);
|
|
55
60
|
CommandPaletteTrigger.displayName = "CommandPaletteTrigger";
|
|
@@ -20,8 +20,8 @@
|
|
|
20
20
|
display: flex;
|
|
21
21
|
flex-direction: column;
|
|
22
22
|
width: 100%;
|
|
23
|
-
/* The send button's diameter —
|
|
24
|
-
a raw value in
|
|
23
|
+
/* The send button's diameter — IconButton's default size, which is
|
|
24
|
+
a raw value in IconButton.css too (icon-button sizes are not on
|
|
25
25
|
a token scale). Everything concentric derives from it. */
|
|
26
26
|
--ds-composer-send-size: 40px;
|
|
27
27
|
/* The shell's concentric corner, derived rather than frozen: the send
|
|
@@ -748,7 +748,7 @@
|
|
|
748
748
|
padding: var(--padding-050);
|
|
749
749
|
}
|
|
750
750
|
|
|
751
|
-
.ds-composer--inline .ds-composer__footer .ds-
|
|
751
|
+
.ds-composer--inline .ds-composer__footer .ds-icon-button {
|
|
752
752
|
width: var(--ds-composer-send-size);
|
|
753
753
|
height: var(--ds-composer-send-size);
|
|
754
754
|
}
|
|
@@ -3,7 +3,7 @@ import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
|
3
3
|
import React, { useRef, useState, useId, useLayoutEffect, useEffect } from "react";
|
|
4
4
|
import { AttachmentTile } from "../Attachment/AttachmentTile.js";
|
|
5
5
|
import { formatBytes } from "../Attachment/fileTypes.js";
|
|
6
|
-
import {
|
|
6
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
7
7
|
import { MentionText, MentionMenu } from "../Mention/Mention.js";
|
|
8
8
|
import "../../fonts/material-symbols.css";
|
|
9
9
|
import "./Composer.css";
|
|
@@ -389,13 +389,13 @@ const Composer = React.forwardRef(
|
|
|
389
389
|
contextIcon && /* @__PURE__ */ jsx("span", { className: `${baseClass}__context-icon`, "aria-hidden": "true", children: typeof contextIcon === "string" ? /* @__PURE__ */ jsx("span", { className: `material-symbols-rounded ${mirrorClass(contextIcon)}`, children: contextIcon }) : contextIcon }),
|
|
390
390
|
/* @__PURE__ */ jsx("span", { className: `${baseClass}__context-text`, children: context }),
|
|
391
391
|
onContextClear && /* @__PURE__ */ jsx(
|
|
392
|
-
|
|
392
|
+
IconButton,
|
|
393
393
|
{
|
|
394
394
|
icon: "close",
|
|
395
395
|
variant: "tertiary",
|
|
396
396
|
tone: "neutral",
|
|
397
397
|
size: "compact",
|
|
398
|
-
|
|
398
|
+
label: contextClearLabel,
|
|
399
399
|
tooltip: false,
|
|
400
400
|
className: `${baseClass}__context-clear`,
|
|
401
401
|
onClick: (event) => {
|
|
@@ -489,12 +489,12 @@ const Composer = React.forwardRef(
|
|
|
489
489
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__footer`, children: [
|
|
490
490
|
(actions || armed && attachButton) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__actions`, children: [
|
|
491
491
|
armed && attachButton && /* @__PURE__ */ jsx(
|
|
492
|
-
|
|
492
|
+
IconButton,
|
|
493
493
|
{
|
|
494
494
|
icon: "add",
|
|
495
495
|
variant: "tertiary",
|
|
496
496
|
size,
|
|
497
|
-
|
|
497
|
+
label: attachLabel,
|
|
498
498
|
disabled,
|
|
499
499
|
onClick: () => fileInputRef.current?.click()
|
|
500
500
|
}
|
|
@@ -504,22 +504,22 @@ const Composer = React.forwardRef(
|
|
|
504
504
|
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__trailing`, children: [
|
|
505
505
|
trailingActions,
|
|
506
506
|
streaming ? /* @__PURE__ */ jsx(
|
|
507
|
-
|
|
507
|
+
IconButton,
|
|
508
508
|
{
|
|
509
509
|
icon: "stop",
|
|
510
510
|
variant: "primary",
|
|
511
511
|
size,
|
|
512
|
-
|
|
512
|
+
label: stopLabel,
|
|
513
513
|
disabled,
|
|
514
514
|
onClick: onStop
|
|
515
515
|
}
|
|
516
516
|
) : /* @__PURE__ */ jsx(
|
|
517
|
-
|
|
517
|
+
IconButton,
|
|
518
518
|
{
|
|
519
519
|
icon: "arrow_upward",
|
|
520
520
|
variant: "primary",
|
|
521
521
|
size,
|
|
522
|
-
|
|
522
|
+
label: sendLabel,
|
|
523
523
|
disabled: !canSend,
|
|
524
524
|
onClick: submit
|
|
525
525
|
}
|
|
@@ -287,3 +287,27 @@
|
|
|
287
287
|
transform: scale(1);
|
|
288
288
|
}
|
|
289
289
|
}
|
|
290
|
+
|
|
291
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
292
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
293
|
+
side. A row that leads with an icon, or ends on a trailing icon or the
|
|
294
|
+
submenu chevron, steps that side down (16 → 12, compact 12 → 8). The
|
|
295
|
+
compact rules carry the panel class, so the compact chevron side keeps
|
|
296
|
+
its trim instead of losing it to the compact row's padding. */
|
|
297
|
+
.ds-context-menu__item:has(.ds-context-menu__item-label > .ds-context-menu__item-icon:first-child) {
|
|
298
|
+
padding-inline-start: var(--padding-300);
|
|
299
|
+
}
|
|
300
|
+
|
|
301
|
+
.ds-context-menu__item:has(.ds-context-menu__item-icon-right),
|
|
302
|
+
.ds-context-menu__item--has-submenu {
|
|
303
|
+
padding-inline-end: var(--padding-300);
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
.ds-context-menu__panel--compact .ds-context-menu__item:has(.ds-context-menu__item-label > .ds-context-menu__item-icon:first-child) {
|
|
307
|
+
padding-inline-start: var(--padding-200);
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
.ds-context-menu__panel--compact .ds-context-menu__item:has(.ds-context-menu__item-icon-right),
|
|
311
|
+
.ds-context-menu__panel--compact .ds-context-menu__item--has-submenu {
|
|
312
|
+
padding-inline-end: var(--padding-200);
|
|
313
|
+
}
|
|
@@ -688,11 +688,11 @@
|
|
|
688
688
|
}
|
|
689
689
|
|
|
690
690
|
/* Save and Cancel say which is which by colour as well as by shape. */
|
|
691
|
-
.ds-data-table__save .ds-
|
|
691
|
+
.ds-data-table__save .ds-icon-button__icon {
|
|
692
692
|
color: var(--color-status-positive-icon);
|
|
693
693
|
}
|
|
694
694
|
|
|
695
|
-
.ds-data-table__cancel .ds-
|
|
695
|
+
.ds-data-table__cancel .ds-icon-button__icon {
|
|
696
696
|
color: var(--color-status-error-icon);
|
|
697
697
|
}
|
|
698
698
|
|
|
@@ -4,7 +4,7 @@ import React, { useMemo, useState, useEffect, useRef, useId, useLayoutEffect, us
|
|
|
4
4
|
import { useTable, tableFeatures, columnVisibilityFeature, columnPinningFeature, columnOrderingFeature, rowSelectionFeature, globalFilteringFeature, columnFilteringFeature, rowSortingFeature, createFilteredRowModel, createSortedRowModel } from "@tanstack/react-table";
|
|
5
5
|
import { DropdownMenu } from "../DropdownMenu/DropdownMenu.js";
|
|
6
6
|
import { Dropdown } from "../Dropdown/Dropdown.js";
|
|
7
|
-
import {
|
|
7
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
8
8
|
import { Button } from "../Button/Button.js";
|
|
9
9
|
import { Spinner } from "../Spinner/Spinner.js";
|
|
10
10
|
import { VirtualRows } from "./VirtualRows.js";
|
|
@@ -1763,13 +1763,13 @@ function DataTable({
|
|
|
1763
1763
|
onOpenChange: (open) => setMenuKey(open ? key : null),
|
|
1764
1764
|
items: menuItems(key),
|
|
1765
1765
|
trigger: /* @__PURE__ */ jsx(
|
|
1766
|
-
|
|
1766
|
+
IconButton,
|
|
1767
1767
|
{
|
|
1768
1768
|
icon: "more_horiz",
|
|
1769
1769
|
variant: "tertiary",
|
|
1770
1770
|
size: "compact",
|
|
1771
1771
|
tooltip: false,
|
|
1772
|
-
|
|
1772
|
+
label: labels.menu(text),
|
|
1773
1773
|
tabIndex: innerTab
|
|
1774
1774
|
}
|
|
1775
1775
|
)
|
|
@@ -2162,13 +2162,13 @@ function DataTable({
|
|
|
2162
2162
|
}
|
|
2163
2163
|
),
|
|
2164
2164
|
editMode === "cell" && editable && !isLive(col) && !editingHere && /* @__PURE__ */ jsx(
|
|
2165
|
-
|
|
2165
|
+
IconButton,
|
|
2166
2166
|
{
|
|
2167
2167
|
className: `${baseClass}__edit-hint${alignsEnd(col.align) ? ` ${baseClass}__edit-hint--start` : ""}`,
|
|
2168
2168
|
icon: "edit",
|
|
2169
2169
|
variant: "tertiary",
|
|
2170
2170
|
size: "compact",
|
|
2171
|
-
|
|
2171
|
+
label: labels.editCell(headerText(col), name),
|
|
2172
2172
|
tooltip: false,
|
|
2173
2173
|
tabIndex: -1,
|
|
2174
2174
|
onClick: () => startEdit(row.id, key)
|
|
@@ -2223,13 +2223,13 @@ function DataTable({
|
|
|
2223
2223
|
children: /* @__PURE__ */ jsxs("div", { className: `ds-table__cell-content ${baseClass}__actions-row`, children: [
|
|
2224
2224
|
editMode === "row" && editing?.row === row.id ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2225
2225
|
/* @__PURE__ */ jsx(
|
|
2226
|
-
|
|
2226
|
+
IconButton,
|
|
2227
2227
|
{
|
|
2228
2228
|
className: `${baseClass}__save`,
|
|
2229
2229
|
icon: "check",
|
|
2230
2230
|
variant: "tertiary",
|
|
2231
2231
|
size: "compact",
|
|
2232
|
-
|
|
2232
|
+
label: labels.saveRow(name),
|
|
2233
2233
|
tooltip: labels.saveRow(name),
|
|
2234
2234
|
tooltipPosition: "start",
|
|
2235
2235
|
onClick: () => commitEdit("stay"),
|
|
@@ -2237,13 +2237,13 @@ function DataTable({
|
|
|
2237
2237
|
}
|
|
2238
2238
|
),
|
|
2239
2239
|
/* @__PURE__ */ jsx(
|
|
2240
|
-
|
|
2240
|
+
IconButton,
|
|
2241
2241
|
{
|
|
2242
2242
|
className: `${baseClass}__cancel`,
|
|
2243
2243
|
icon: "close",
|
|
2244
2244
|
variant: "tertiary",
|
|
2245
2245
|
size: "compact",
|
|
2246
|
-
|
|
2246
|
+
label: labels.cancelRow(name),
|
|
2247
2247
|
tooltip: labels.cancelRow(name),
|
|
2248
2248
|
tooltipPosition: "start",
|
|
2249
2249
|
onClick: cancelEdit,
|
|
@@ -2251,13 +2251,13 @@ function DataTable({
|
|
|
2251
2251
|
}
|
|
2252
2252
|
)
|
|
2253
2253
|
] }) : editMode === "row" && visibleKeys.some((k) => canEdit(byKey.get(k), row) && !isLive(byKey.get(k))) && /* @__PURE__ */ jsx(
|
|
2254
|
-
|
|
2254
|
+
IconButton,
|
|
2255
2255
|
{
|
|
2256
2256
|
className: `${baseClass}__inline-action`,
|
|
2257
2257
|
icon: "edit",
|
|
2258
2258
|
variant: "tertiary",
|
|
2259
2259
|
size: "compact",
|
|
2260
|
-
|
|
2260
|
+
label: labels.editRow(name),
|
|
2261
2261
|
tooltip: labels.editRow(name),
|
|
2262
2262
|
tooltipPosition: "start",
|
|
2263
2263
|
disabled: editing !== null,
|
|
@@ -2266,13 +2266,13 @@ function DataTable({
|
|
|
2266
2266
|
}
|
|
2267
2267
|
),
|
|
2268
2268
|
!(editMode === "row" && editing?.row === row.id) && actionsFor(row).filter((action) => action.inline).map((action) => /* @__PURE__ */ jsx(
|
|
2269
|
-
|
|
2269
|
+
IconButton,
|
|
2270
2270
|
{
|
|
2271
2271
|
className: `${baseClass}__inline-action`,
|
|
2272
2272
|
icon: action.icon ?? "bolt",
|
|
2273
2273
|
variant: "tertiary",
|
|
2274
2274
|
size: "compact",
|
|
2275
|
-
|
|
2275
|
+
label: action.label,
|
|
2276
2276
|
tooltip: action.label,
|
|
2277
2277
|
tooltipPosition: "start",
|
|
2278
2278
|
disabled: action.disabled,
|
|
@@ -2294,13 +2294,13 @@ function DataTable({
|
|
|
2294
2294
|
onClick: action.onSelect
|
|
2295
2295
|
})),
|
|
2296
2296
|
trigger: /* @__PURE__ */ jsx(
|
|
2297
|
-
|
|
2297
|
+
IconButton,
|
|
2298
2298
|
{
|
|
2299
2299
|
icon: "more_horiz",
|
|
2300
2300
|
variant: "tertiary",
|
|
2301
2301
|
size: "compact",
|
|
2302
2302
|
tooltip: false,
|
|
2303
|
-
|
|
2303
|
+
label: labels.moreActions(name),
|
|
2304
2304
|
tabIndex: innerTab
|
|
2305
2305
|
}
|
|
2306
2306
|
)
|
|
@@ -131,3 +131,23 @@
|
|
|
131
131
|
.ds-date-input--disabled .ds-date-input__icon {
|
|
132
132
|
color: var(--color-input-text-disabled);
|
|
133
133
|
}
|
|
134
|
+
|
|
135
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
136
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
137
|
+
side. The calendar glyph moves in one step and the text keeps its
|
|
138
|
+
distance from it (16 → 12, compact 12 → 8). */
|
|
139
|
+
.ds-date-input__icon {
|
|
140
|
+
inset-inline-start: var(--padding-300);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.ds-date-input__field {
|
|
144
|
+
padding-inline-start: calc(var(--padding-300) + 24px + var(--gap-200)); /* 12px + 24px icon + 8px gap */
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.ds-date-input--compact .ds-date-input__icon {
|
|
148
|
+
inset-inline-start: var(--padding-200);
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.ds-date-input--compact .ds-date-input__field {
|
|
152
|
+
padding-inline-start: calc(var(--padding-200) + 20px + var(--gap-200)); /* 8px + 20px icon + 8px gap */
|
|
153
|
+
}
|
|
@@ -12,7 +12,7 @@ export interface DescriptionListCopyProps {
|
|
|
12
12
|
/**
|
|
13
13
|
* The copy button beside a description list value. Internal: DescriptionList
|
|
14
14
|
* renders it for a `copyable` item, so the list itself stays
|
|
15
|
-
* server-renderable. A compact tertiary
|
|
15
|
+
* server-renderable. A compact tertiary IconButton whose glyph and name
|
|
16
16
|
* turn to "Copied" for a moment after a press.
|
|
17
17
|
*/
|
|
18
18
|
export declare function DescriptionListCopy({ value, label, copiedLabel, onCopied }: DescriptionListCopyProps): import("react").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useRef, useEffect } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
5
|
import { MOTION_FEEDBACK_RESET_MS } from "../../tokens/motion.js";
|
|
6
6
|
function writeClipboard(text) {
|
|
7
7
|
const fallback = () => {
|
|
@@ -31,13 +31,13 @@ function DescriptionListCopy({ value, label, copiedLabel, onCopied }) {
|
|
|
31
31
|
timer.current = window.setTimeout(() => setCopied(false), MOTION_FEEDBACK_RESET_MS);
|
|
32
32
|
};
|
|
33
33
|
return /* @__PURE__ */ jsx(
|
|
34
|
-
|
|
34
|
+
IconButton,
|
|
35
35
|
{
|
|
36
36
|
className: "ds-description-list__copy",
|
|
37
37
|
icon: copied ? "check" : "content_copy",
|
|
38
38
|
variant: "tertiary",
|
|
39
39
|
size: "compact",
|
|
40
|
-
|
|
40
|
+
label: copied ? copiedLabel : label,
|
|
41
41
|
onClick: copy
|
|
42
42
|
}
|
|
43
43
|
);
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
}
|
|
111
111
|
|
|
112
112
|
/* Close button — ghost icon button */
|
|
113
|
-
/* The close is the library's
|
|
113
|
+
/* The close is the library's IconButton (tertiary, compact); the
|
|
114
114
|
header only seats it. */
|
|
115
115
|
.ds-dialog__close {
|
|
116
116
|
flex-shrink: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useId } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
5
|
import ReactDOM from "react-dom";
|
|
6
6
|
import "./Dialog.css";
|
|
7
7
|
import "../../fonts/material-symbols.css";
|
|
@@ -65,14 +65,14 @@ const Dialog = React.forwardRef(
|
|
|
65
65
|
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description })
|
|
66
66
|
] }),
|
|
67
67
|
dismissible && /* @__PURE__ */ jsx(
|
|
68
|
-
|
|
68
|
+
IconButton,
|
|
69
69
|
{
|
|
70
70
|
className: `${baseClass}__close`,
|
|
71
71
|
icon: "close",
|
|
72
72
|
variant: "tertiary",
|
|
73
73
|
size: "compact",
|
|
74
74
|
tooltip: false,
|
|
75
|
-
|
|
75
|
+
label: closeLabel,
|
|
76
76
|
onClick: () => onOpenChange(false)
|
|
77
77
|
}
|
|
78
78
|
)
|
|
@@ -212,3 +212,15 @@
|
|
|
212
212
|
.ds-document-chip .material-symbols-rounded {
|
|
213
213
|
color: inherit;
|
|
214
214
|
}
|
|
215
|
+
|
|
216
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
217
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
218
|
+
side. The chip always leads with its type glyph and may end on the
|
|
219
|
+
remove glyph (12 → 8). Compact is already at 8, the floor. */
|
|
220
|
+
.ds-document-chip {
|
|
221
|
+
padding-inline-start: var(--padding-200);
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.ds-document-chip:has(> .ds-document-chip__remove) {
|
|
225
|
+
padding-inline-end: var(--padding-200);
|
|
226
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
3
3
|
import { useState, useEffect } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
5
|
import { Button } from "../Button/Button.js";
|
|
6
6
|
import { Spinner } from "../Spinner/Spinner.js";
|
|
7
7
|
import { useLocale } from "../../behaviors/LocaleProvider.js";
|
|
@@ -56,13 +56,13 @@ function DocumentViewer({
|
|
|
56
56
|
};
|
|
57
57
|
}, [resolved, src]);
|
|
58
58
|
const downloadName = typeof download === "string" ? download : name || void 0;
|
|
59
|
-
const downloadButton = download ? onDownload ? /* @__PURE__ */ jsx(
|
|
60
|
-
|
|
59
|
+
const downloadButton = download ? onDownload ? /* @__PURE__ */ jsx(IconButton, { icon: "download", variant: "tertiary", size: "compact", label: downloadLabel, onClick: onDownload }) : /* @__PURE__ */ jsx(
|
|
60
|
+
IconButton,
|
|
61
61
|
{
|
|
62
62
|
icon: "download",
|
|
63
63
|
variant: "tertiary",
|
|
64
64
|
size: "compact",
|
|
65
|
-
|
|
65
|
+
label: downloadLabel,
|
|
66
66
|
href: src,
|
|
67
67
|
...{ download: downloadName }
|
|
68
68
|
}
|
|
@@ -126,12 +126,12 @@ function DocumentViewer({
|
|
|
126
126
|
/* @__PURE__ */ jsxs("div", { className: "ds-document-viewer__actions", children: [
|
|
127
127
|
resolved === "image" && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
128
128
|
/* @__PURE__ */ jsx(
|
|
129
|
-
|
|
129
|
+
IconButton,
|
|
130
130
|
{
|
|
131
131
|
icon: "zoom_out",
|
|
132
132
|
variant: "tertiary",
|
|
133
133
|
size: "compact",
|
|
134
|
-
|
|
134
|
+
label: zoomOutLabel,
|
|
135
135
|
disabled: zoom === 0,
|
|
136
136
|
onClick: () => setZoom((z) => Math.max(0, z - 1))
|
|
137
137
|
}
|
|
@@ -147,12 +147,12 @@ function DocumentViewer({
|
|
|
147
147
|
}
|
|
148
148
|
),
|
|
149
149
|
/* @__PURE__ */ jsx(
|
|
150
|
-
|
|
150
|
+
IconButton,
|
|
151
151
|
{
|
|
152
152
|
icon: "zoom_in",
|
|
153
153
|
variant: "tertiary",
|
|
154
154
|
size: "compact",
|
|
155
|
-
|
|
155
|
+
label: zoomInLabel,
|
|
156
156
|
disabled: zoom === ZOOMS.length - 1,
|
|
157
157
|
onClick: () => setZoom((z) => Math.min(ZOOMS.length - 1, z + 1))
|
|
158
158
|
}
|
|
@@ -160,12 +160,12 @@ function DocumentViewer({
|
|
|
160
160
|
] }),
|
|
161
161
|
toolbar,
|
|
162
162
|
openInNewTab && /* @__PURE__ */ jsx(
|
|
163
|
-
|
|
163
|
+
IconButton,
|
|
164
164
|
{
|
|
165
165
|
icon: "open_in_new",
|
|
166
166
|
variant: "tertiary",
|
|
167
167
|
size: "compact",
|
|
168
|
-
|
|
168
|
+
label: openLabel,
|
|
169
169
|
href: src,
|
|
170
170
|
target: "_blank",
|
|
171
171
|
rel: "noopener noreferrer"
|
|
@@ -213,7 +213,7 @@
|
|
|
213
213
|
}
|
|
214
214
|
|
|
215
215
|
/* Close button — ghost icon button */
|
|
216
|
-
/* The close is the library's
|
|
216
|
+
/* The close is the library's IconButton (tertiary, compact); the
|
|
217
217
|
header only seats it. */
|
|
218
218
|
.ds-drawer__close {
|
|
219
219
|
flex-shrink: 0;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
3
3
|
import React, { useRef, useId } from "react";
|
|
4
|
-
import {
|
|
4
|
+
import { IconButton } from "../IconButton/IconButton.js";
|
|
5
5
|
import ReactDOM from "react-dom";
|
|
6
6
|
import "./Drawer.css";
|
|
7
7
|
import "../../behaviors/direction.css";
|
|
@@ -79,14 +79,14 @@ const Drawer = React.forwardRef(
|
|
|
79
79
|
description && /* @__PURE__ */ jsx("p", { className: `${baseClass}__description`, id: descId, children: description })
|
|
80
80
|
] }),
|
|
81
81
|
dismissible && /* @__PURE__ */ jsx(
|
|
82
|
-
|
|
82
|
+
IconButton,
|
|
83
83
|
{
|
|
84
84
|
className: `${baseClass}__close`,
|
|
85
85
|
icon: "close",
|
|
86
86
|
variant: "tertiary",
|
|
87
87
|
size: "compact",
|
|
88
88
|
tooltip: false,
|
|
89
|
-
|
|
89
|
+
label: closeLabel,
|
|
90
90
|
onClick: () => onOpenChange(false)
|
|
91
91
|
}
|
|
92
92
|
)
|
|
@@ -290,3 +290,33 @@
|
|
|
290
290
|
/* Compact group labels keep the base --font-paragraph-sm-* type — the
|
|
291
291
|
scale has no smaller step. */
|
|
292
292
|
|
|
293
|
+
|
|
294
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
295
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
296
|
+
side. The trigger always ends on its chevron and may lead with the
|
|
297
|
+
value's icon (16 → 12, compact 12 → 8); an option may lead with an icon
|
|
298
|
+
and a chosen option ends on the chosen mark (12 → 8; compact is
|
|
299
|
+
already at 8, the floor). */
|
|
300
|
+
.ds-dropdown__trigger {
|
|
301
|
+
padding-inline-end: var(--padding-300);
|
|
302
|
+
}
|
|
303
|
+
|
|
304
|
+
.ds-dropdown__trigger:has(.ds-dropdown__value-icon) {
|
|
305
|
+
padding-inline-start: var(--padding-300);
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
.ds-dropdown--compact .ds-dropdown__trigger {
|
|
309
|
+
padding-inline-end: var(--padding-200);
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
.ds-dropdown--compact .ds-dropdown__trigger:has(.ds-dropdown__value-icon) {
|
|
313
|
+
padding-inline-start: var(--padding-200);
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
.ds-dropdown__option:has(.ds-dropdown__option-icon) {
|
|
317
|
+
padding-inline-start: var(--padding-200);
|
|
318
|
+
}
|
|
319
|
+
|
|
320
|
+
.ds-dropdown__option:has(.ds-chosen-mark) {
|
|
321
|
+
padding-inline-end: var(--padding-200);
|
|
322
|
+
}
|
|
@@ -381,3 +381,27 @@
|
|
|
381
381
|
transform: scale(1);
|
|
382
382
|
}
|
|
383
383
|
}
|
|
384
|
+
|
|
385
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
386
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
387
|
+
side. A row that leads with an icon, or ends on a trailing icon or the
|
|
388
|
+
submenu chevron, steps that side down (16 → 12, compact 12 → 8). The
|
|
389
|
+
compact rules carry the panel class, so the compact chevron side keeps
|
|
390
|
+
its trim instead of losing it to the compact row's padding. */
|
|
391
|
+
.ds-dropdown-menu__item:has(.ds-dropdown-menu__item-label > .ds-dropdown-menu__item-icon:first-child) {
|
|
392
|
+
padding-inline-start: var(--padding-300);
|
|
393
|
+
}
|
|
394
|
+
|
|
395
|
+
.ds-dropdown-menu__item:has(.ds-dropdown-menu__item-icon-right),
|
|
396
|
+
.ds-dropdown-menu__item--has-submenu {
|
|
397
|
+
padding-inline-end: var(--padding-300);
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
.ds-dropdown-menu__panel--compact .ds-dropdown-menu__item:has(.ds-dropdown-menu__item-label > .ds-dropdown-menu__item-icon:first-child) {
|
|
401
|
+
padding-inline-start: var(--padding-200);
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
.ds-dropdown-menu__panel--compact .ds-dropdown-menu__item:has(.ds-dropdown-menu__item-icon-right),
|
|
405
|
+
.ds-dropdown-menu__panel--compact .ds-dropdown-menu__item--has-submenu {
|
|
406
|
+
padding-inline-end: var(--padding-200);
|
|
407
|
+
}
|
|
@@ -279,3 +279,12 @@
|
|
|
279
279
|
.ds-file-input .material-symbols-rounded {
|
|
280
280
|
color: inherit;
|
|
281
281
|
}
|
|
282
|
+
|
|
283
|
+
/* Icon side padding, Button's rule (design.md): a glyph's box carries its
|
|
284
|
+
own side bearing, so a side that holds one takes the step below the text
|
|
285
|
+
side. A file row always leads with its type glyph (12 → 8,
|
|
286
|
+
compact is already at 8, the floor); its remove circle pads its own
|
|
287
|
+
glyph. */
|
|
288
|
+
.ds-file-input__file {
|
|
289
|
+
padding-inline-start: var(--padding-200);
|
|
290
|
+
}
|
|
@@ -196,3 +196,15 @@
|
|
|
196
196
|
.ds-filter-bar .material-symbols-rounded {
|
|
197
197
|
color: inherit;
|
|
198
198
|
}
|
|
199
|
+
|
|
200
|
+
/* Icon side padding, Button's rule: a side that holds a glyph takes the
|
|
201
|
+
step below the text side, since the glyph's box carries its own side
|
|
202
|
+
bearing. The caret always trails; the leading icon is optional
|
|
203
|
+
(12 → 8; compact is already at 8, the floor). */
|
|
204
|
+
.ds-filter-bar__chip {
|
|
205
|
+
padding-inline-end: var(--padding-200);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
.ds-filter-bar__chip:has(.ds-filter-bar__icon) {
|
|
209
|
+
padding-inline-start: var(--padding-200);
|
|
210
|
+
}
|