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
|
@@ -437,7 +437,7 @@ const Globe = React.forwardRef(
|
|
|
437
437
|
"button",
|
|
438
438
|
{
|
|
439
439
|
type: "button",
|
|
440
|
-
className: `${baseClass}__marker`,
|
|
440
|
+
className: `${baseClass}__marker${at.visible ? "" : ` ${baseClass}__marker--back`}`,
|
|
441
441
|
style: {
|
|
442
442
|
left: pct(at.x / VIEW * 100),
|
|
443
443
|
top: pct(at.y / VIEW * 100),
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/* ============================================
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
ICON BUTTON
|
|
3
|
+
A button holding a single icon, shaped by the theme's button radius
|
|
4
4
|
============================================ */
|
|
5
5
|
|
|
6
|
-
.ds-
|
|
6
|
+
.ds-icon-button {
|
|
7
7
|
/* Layout */
|
|
8
8
|
display: inline-flex;
|
|
9
9
|
align-items: center;
|
|
10
10
|
justify-content: center;
|
|
11
11
|
|
|
12
|
-
/* Size — default: the row height (--control-height-*), as
|
|
12
|
+
/* Size — default: the row height (--control-height-*), as an even box */
|
|
13
13
|
box-sizing: border-box;
|
|
14
14
|
width: var(--control-height-default);
|
|
15
15
|
height: var(--control-height-default);
|
|
16
16
|
|
|
17
17
|
/* Shape */
|
|
18
|
-
border-radius: var(--radius-pill); /*
|
|
18
|
+
border-radius: var(--radius-pill); /* the button radius: a circle in a round theme, a square in a square one */
|
|
19
19
|
|
|
20
20
|
/* Transitions */
|
|
21
21
|
transition: background-color var(--motion-duration-base) var(--motion-ease-standard), border-color var(--motion-duration-base) var(--motion-ease-standard), opacity var(--motion-duration-base) var(--motion-ease-standard);
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
SIZE — DEFAULT
|
|
33
33
|
============================================ */
|
|
34
34
|
|
|
35
|
-
.ds-
|
|
35
|
+
.ds-icon-button--default {
|
|
36
36
|
width: var(--control-height-default);
|
|
37
37
|
height: var(--control-height-default);
|
|
38
38
|
}
|
|
@@ -41,12 +41,12 @@
|
|
|
41
41
|
SIZE — COMPACT
|
|
42
42
|
============================================ */
|
|
43
43
|
|
|
44
|
-
.ds-
|
|
44
|
+
.ds-icon-button--compact {
|
|
45
45
|
width: var(--control-height-compact);
|
|
46
46
|
height: var(--control-height-compact);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
|
-
.ds-
|
|
49
|
+
.ds-icon-button--compact .ds-icon-button__icon {
|
|
50
50
|
--icon-size: var(--icon-size-500);
|
|
51
51
|
}
|
|
52
52
|
|
|
@@ -54,60 +54,70 @@
|
|
|
54
54
|
ICON
|
|
55
55
|
============================================ */
|
|
56
56
|
|
|
57
|
-
.ds-
|
|
57
|
+
.ds-icon-button__icon {
|
|
58
58
|
flex-shrink: 0;
|
|
59
59
|
--icon-size: var(--icon-size-600);
|
|
60
60
|
line-height: 1;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
/* A node icon (an avatar, a spinner, an SVG) is laid out as a flex item:
|
|
64
|
+
inline in a block slot it would sit on the text baseline, and the room
|
|
65
|
+
left under it for descenders made the slot taller than the node and
|
|
66
|
+
lifted the node off the button's centre. */
|
|
67
|
+
.ds-icon-button__icon:not(.material-symbols-rounded) {
|
|
68
|
+
display: flex;
|
|
69
|
+
align-items: center;
|
|
70
|
+
justify-content: center;
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
/* ============================================
|
|
64
74
|
PRIMARY VARIANT (SOLID)
|
|
65
75
|
============================================ */
|
|
66
76
|
|
|
67
|
-
.ds-
|
|
77
|
+
.ds-icon-button--primary {
|
|
68
78
|
background-color: var(--color-action-primary-bg);
|
|
69
79
|
border: none;
|
|
70
80
|
}
|
|
71
81
|
|
|
72
|
-
.ds-
|
|
82
|
+
.ds-icon-button--primary .ds-icon-button__icon {
|
|
73
83
|
color: var(--color-action-primary-text);
|
|
74
84
|
}
|
|
75
85
|
|
|
76
|
-
.ds-
|
|
86
|
+
.ds-icon-button--primary.ds-icon-button--hover {
|
|
77
87
|
background-color: var(--color-action-primary-bg-hover);
|
|
78
88
|
}
|
|
79
89
|
|
|
80
|
-
.ds-
|
|
90
|
+
.ds-icon-button--primary.ds-icon-button--hover .ds-icon-button__icon {
|
|
81
91
|
color: var(--color-action-primary-text-active);
|
|
82
92
|
}
|
|
83
93
|
|
|
84
|
-
.ds-
|
|
94
|
+
.ds-icon-button--primary.ds-icon-button--active {
|
|
85
95
|
background-color: var(--color-action-primary-bg-active);
|
|
86
96
|
}
|
|
87
97
|
|
|
88
|
-
.ds-
|
|
98
|
+
.ds-icon-button--primary.ds-icon-button--active .ds-icon-button__icon {
|
|
89
99
|
color: var(--color-action-primary-text-active);
|
|
90
100
|
}
|
|
91
101
|
|
|
92
|
-
.ds-
|
|
102
|
+
.ds-icon-button--primary.ds-icon-button--disabled {
|
|
93
103
|
opacity: 0.4;
|
|
94
104
|
cursor: not-allowed;
|
|
95
105
|
}
|
|
96
106
|
|
|
97
107
|
/* Interactive hover/active */
|
|
98
|
-
.ds-
|
|
108
|
+
.ds-icon-button--primary:not(.ds-icon-button--disabled):hover {
|
|
99
109
|
background-color: var(--color-action-primary-bg-hover);
|
|
100
110
|
}
|
|
101
111
|
|
|
102
|
-
.ds-
|
|
112
|
+
.ds-icon-button--primary:not(.ds-icon-button--disabled):hover .ds-icon-button__icon {
|
|
103
113
|
color: var(--color-action-primary-text-active);
|
|
104
114
|
}
|
|
105
115
|
|
|
106
|
-
.ds-
|
|
116
|
+
.ds-icon-button--primary:not(.ds-icon-button--disabled):active {
|
|
107
117
|
background-color: var(--color-action-primary-bg-active);
|
|
108
118
|
}
|
|
109
119
|
|
|
110
|
-
.ds-
|
|
120
|
+
.ds-icon-button--primary:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
111
121
|
color: var(--color-action-primary-text-active);
|
|
112
122
|
}
|
|
113
123
|
|
|
@@ -115,50 +125,50 @@
|
|
|
115
125
|
SECONDARY VARIANT (OUTLINED)
|
|
116
126
|
============================================ */
|
|
117
127
|
|
|
118
|
-
.ds-
|
|
128
|
+
.ds-icon-button--secondary {
|
|
119
129
|
border: var(--border-025) solid var(--color-action-primary-border);
|
|
120
130
|
background-color: transparent;
|
|
121
131
|
}
|
|
122
132
|
|
|
123
|
-
.ds-
|
|
133
|
+
.ds-icon-button--secondary .ds-icon-button__icon {
|
|
124
134
|
color: var(--color-action-icon-default);
|
|
125
135
|
}
|
|
126
136
|
|
|
127
|
-
.ds-
|
|
137
|
+
.ds-icon-button--secondary.ds-icon-button--hover {
|
|
128
138
|
background-color: var(--color-action-primary-bg-hover);
|
|
129
139
|
}
|
|
130
140
|
|
|
131
|
-
.ds-
|
|
141
|
+
.ds-icon-button--secondary.ds-icon-button--hover .ds-icon-button__icon {
|
|
132
142
|
color: var(--color-action-icon-active);
|
|
133
143
|
}
|
|
134
144
|
|
|
135
|
-
.ds-
|
|
145
|
+
.ds-icon-button--secondary.ds-icon-button--active {
|
|
136
146
|
background-color: var(--color-action-primary-bg-active);
|
|
137
147
|
}
|
|
138
148
|
|
|
139
|
-
.ds-
|
|
149
|
+
.ds-icon-button--secondary.ds-icon-button--active .ds-icon-button__icon {
|
|
140
150
|
color: var(--color-action-icon-active);
|
|
141
151
|
}
|
|
142
152
|
|
|
143
|
-
.ds-
|
|
153
|
+
.ds-icon-button--secondary.ds-icon-button--disabled {
|
|
144
154
|
opacity: 0.4;
|
|
145
155
|
cursor: not-allowed;
|
|
146
156
|
}
|
|
147
157
|
|
|
148
158
|
/* Interactive hover/active */
|
|
149
|
-
.ds-
|
|
159
|
+
.ds-icon-button--secondary:not(.ds-icon-button--disabled):hover {
|
|
150
160
|
background-color: var(--color-action-primary-bg-hover);
|
|
151
161
|
}
|
|
152
162
|
|
|
153
|
-
.ds-
|
|
163
|
+
.ds-icon-button--secondary:not(.ds-icon-button--disabled):hover .ds-icon-button__icon {
|
|
154
164
|
color: var(--color-action-icon-active);
|
|
155
165
|
}
|
|
156
166
|
|
|
157
|
-
.ds-
|
|
167
|
+
.ds-icon-button--secondary:not(.ds-icon-button--disabled):active {
|
|
158
168
|
background-color: var(--color-action-primary-bg-active);
|
|
159
169
|
}
|
|
160
170
|
|
|
161
|
-
.ds-
|
|
171
|
+
.ds-icon-button--secondary:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
162
172
|
color: var(--color-action-icon-active);
|
|
163
173
|
}
|
|
164
174
|
|
|
@@ -166,34 +176,34 @@
|
|
|
166
176
|
TERTIARY VARIANT (PASSIVE / GHOST)
|
|
167
177
|
============================================ */
|
|
168
178
|
|
|
169
|
-
.ds-
|
|
179
|
+
.ds-icon-button--tertiary {
|
|
170
180
|
background-color: var(--color-action-passive-bg);
|
|
171
181
|
border: none;
|
|
172
182
|
}
|
|
173
183
|
|
|
174
|
-
.ds-
|
|
184
|
+
.ds-icon-button--tertiary .ds-icon-button__icon {
|
|
175
185
|
color: var(--color-icon-primary);
|
|
176
186
|
}
|
|
177
187
|
|
|
178
|
-
.ds-
|
|
188
|
+
.ds-icon-button--tertiary.ds-icon-button--hover {
|
|
179
189
|
background-color: var(--color-action-passive-bg-hover);
|
|
180
190
|
}
|
|
181
191
|
|
|
182
|
-
.ds-
|
|
192
|
+
.ds-icon-button--tertiary.ds-icon-button--active {
|
|
183
193
|
background-color: var(--color-action-passive-bg-active);
|
|
184
194
|
}
|
|
185
195
|
|
|
186
|
-
.ds-
|
|
196
|
+
.ds-icon-button--tertiary.ds-icon-button--disabled {
|
|
187
197
|
opacity: 0.4;
|
|
188
198
|
cursor: not-allowed;
|
|
189
199
|
}
|
|
190
200
|
|
|
191
201
|
/* Interactive hover/active */
|
|
192
|
-
.ds-
|
|
202
|
+
.ds-icon-button--tertiary:not(.ds-icon-button--disabled):hover {
|
|
193
203
|
background-color: var(--color-action-passive-bg-hover);
|
|
194
204
|
}
|
|
195
205
|
|
|
196
|
-
.ds-
|
|
206
|
+
.ds-icon-button--tertiary:not(.ds-icon-button--disabled):active {
|
|
197
207
|
background-color: var(--color-action-passive-bg-active);
|
|
198
208
|
}
|
|
199
209
|
|
|
@@ -204,34 +214,34 @@
|
|
|
204
214
|
unlike tertiary, the background is always shown.
|
|
205
215
|
============================================ */
|
|
206
216
|
|
|
207
|
-
.ds-
|
|
217
|
+
.ds-icon-button--neutral {
|
|
208
218
|
background-color: var(--color-action-neutral-bg);
|
|
209
219
|
border: none;
|
|
210
220
|
}
|
|
211
221
|
|
|
212
|
-
.ds-
|
|
222
|
+
.ds-icon-button--neutral .ds-icon-button__icon {
|
|
213
223
|
color: var(--color-action-neutral-text);
|
|
214
224
|
}
|
|
215
225
|
|
|
216
|
-
.ds-
|
|
226
|
+
.ds-icon-button--neutral.ds-icon-button--hover {
|
|
217
227
|
background-color: var(--color-action-neutral-bg-hover);
|
|
218
228
|
}
|
|
219
229
|
|
|
220
|
-
.ds-
|
|
230
|
+
.ds-icon-button--neutral.ds-icon-button--active {
|
|
221
231
|
background-color: var(--color-action-neutral-bg-active);
|
|
222
232
|
}
|
|
223
233
|
|
|
224
|
-
.ds-
|
|
234
|
+
.ds-icon-button--neutral.ds-icon-button--disabled {
|
|
225
235
|
opacity: 0.4;
|
|
226
236
|
cursor: not-allowed;
|
|
227
237
|
}
|
|
228
238
|
|
|
229
239
|
/* Interactive hover/active */
|
|
230
|
-
.ds-
|
|
240
|
+
.ds-icon-button--neutral:not(.ds-icon-button--disabled):hover {
|
|
231
241
|
background-color: var(--color-action-neutral-bg-hover);
|
|
232
242
|
}
|
|
233
243
|
|
|
234
|
-
.ds-
|
|
244
|
+
.ds-icon-button--neutral:not(.ds-icon-button--disabled):active {
|
|
235
245
|
background-color: var(--color-action-neutral-bg-active);
|
|
236
246
|
}
|
|
237
247
|
|
|
@@ -241,44 +251,44 @@
|
|
|
241
251
|
press fill with the solid neutral fills.
|
|
242
252
|
============================================ */
|
|
243
253
|
|
|
244
|
-
.ds-
|
|
254
|
+
.ds-icon-button--secondary-neutral {
|
|
245
255
|
border: var(--border-025) solid var(--color-action-neutral-border);
|
|
246
256
|
background-color: transparent;
|
|
247
257
|
}
|
|
248
258
|
|
|
249
|
-
.ds-
|
|
259
|
+
.ds-icon-button--secondary-neutral .ds-icon-button__icon {
|
|
250
260
|
color: var(--color-action-icon-default);
|
|
251
261
|
}
|
|
252
262
|
|
|
253
|
-
.ds-
|
|
263
|
+
.ds-icon-button--secondary-neutral.ds-icon-button--hover {
|
|
254
264
|
background-color: var(--color-action-neutral-bg-hover);
|
|
255
265
|
}
|
|
256
266
|
|
|
257
|
-
.ds-
|
|
267
|
+
.ds-icon-button--secondary-neutral.ds-icon-button--active {
|
|
258
268
|
background-color: var(--color-action-neutral-bg-active);
|
|
259
269
|
}
|
|
260
270
|
|
|
261
|
-
.ds-
|
|
262
|
-
.ds-
|
|
271
|
+
.ds-icon-button--secondary-neutral.ds-icon-button--hover .ds-icon-button__icon,
|
|
272
|
+
.ds-icon-button--secondary-neutral.ds-icon-button--active .ds-icon-button__icon {
|
|
263
273
|
color: var(--color-action-neutral-text);
|
|
264
274
|
}
|
|
265
275
|
|
|
266
|
-
.ds-
|
|
276
|
+
.ds-icon-button--secondary-neutral.ds-icon-button--disabled {
|
|
267
277
|
opacity: 0.4;
|
|
268
278
|
cursor: not-allowed;
|
|
269
279
|
}
|
|
270
280
|
|
|
271
281
|
/* Interactive hover/active */
|
|
272
|
-
.ds-
|
|
282
|
+
.ds-icon-button--secondary-neutral:not(.ds-icon-button--disabled):hover {
|
|
273
283
|
background-color: var(--color-action-neutral-bg-hover);
|
|
274
284
|
}
|
|
275
285
|
|
|
276
|
-
.ds-
|
|
286
|
+
.ds-icon-button--secondary-neutral:not(.ds-icon-button--disabled):active {
|
|
277
287
|
background-color: var(--color-action-neutral-bg-active);
|
|
278
288
|
}
|
|
279
289
|
|
|
280
|
-
.ds-
|
|
281
|
-
.ds-
|
|
290
|
+
.ds-icon-button--secondary-neutral:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
|
|
291
|
+
.ds-icon-button--secondary-neutral:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
282
292
|
color: var(--color-action-neutral-text);
|
|
283
293
|
}
|
|
284
294
|
|
|
@@ -287,33 +297,33 @@
|
|
|
287
297
|
variant="primary" tone="destructive".
|
|
288
298
|
============================================ */
|
|
289
299
|
|
|
290
|
-
.ds-
|
|
300
|
+
.ds-icon-button--primary-destructive {
|
|
291
301
|
background-color: var(--color-action-destructive-bg);
|
|
292
302
|
border: none;
|
|
293
303
|
}
|
|
294
304
|
|
|
295
|
-
.ds-
|
|
305
|
+
.ds-icon-button--primary-destructive .ds-icon-button__icon {
|
|
296
306
|
color: var(--color-action-destructive-text);
|
|
297
307
|
}
|
|
298
308
|
|
|
299
|
-
.ds-
|
|
309
|
+
.ds-icon-button--primary-destructive.ds-icon-button--hover {
|
|
300
310
|
background-color: var(--color-action-destructive-bg-hover);
|
|
301
311
|
}
|
|
302
312
|
|
|
303
|
-
.ds-
|
|
313
|
+
.ds-icon-button--primary-destructive.ds-icon-button--active {
|
|
304
314
|
background-color: var(--color-action-destructive-bg-active);
|
|
305
315
|
}
|
|
306
316
|
|
|
307
|
-
.ds-
|
|
317
|
+
.ds-icon-button--primary-destructive.ds-icon-button--disabled {
|
|
308
318
|
opacity: 0.4;
|
|
309
319
|
cursor: not-allowed;
|
|
310
320
|
}
|
|
311
321
|
|
|
312
|
-
.ds-
|
|
322
|
+
.ds-icon-button--primary-destructive:not(.ds-icon-button--disabled):hover {
|
|
313
323
|
background-color: var(--color-action-destructive-bg-hover);
|
|
314
324
|
}
|
|
315
325
|
|
|
316
|
-
.ds-
|
|
326
|
+
.ds-icon-button--primary-destructive:not(.ds-icon-button--disabled):active {
|
|
317
327
|
background-color: var(--color-action-destructive-bg-active);
|
|
318
328
|
}
|
|
319
329
|
|
|
@@ -321,42 +331,42 @@
|
|
|
321
331
|
DESTRUCTIVE TONE (OUTLINED DANGER)
|
|
322
332
|
tone="destructive" at secondary or tertiary
|
|
323
333
|
emphasis: Button's outlined danger look on the
|
|
324
|
-
|
|
334
|
+
button, filling with the danger colour on hover
|
|
325
335
|
and press.
|
|
326
336
|
============================================ */
|
|
327
337
|
|
|
328
|
-
.ds-
|
|
338
|
+
.ds-icon-button--destructive {
|
|
329
339
|
border: var(--border-025) solid var(--color-action-destructive-border);
|
|
330
340
|
background-color: transparent;
|
|
331
341
|
}
|
|
332
342
|
|
|
333
|
-
.ds-
|
|
343
|
+
.ds-icon-button--destructive .ds-icon-button__icon {
|
|
334
344
|
color: var(--color-action-destructive-text-secondary);
|
|
335
345
|
}
|
|
336
346
|
|
|
337
|
-
.ds-
|
|
338
|
-
.ds-
|
|
347
|
+
.ds-icon-button--destructive.ds-icon-button--hover,
|
|
348
|
+
.ds-icon-button--destructive.ds-icon-button--active {
|
|
339
349
|
background-color: var(--color-action-destructive-bg);
|
|
340
350
|
}
|
|
341
351
|
|
|
342
|
-
.ds-
|
|
343
|
-
.ds-
|
|
352
|
+
.ds-icon-button--destructive.ds-icon-button--hover .ds-icon-button__icon,
|
|
353
|
+
.ds-icon-button--destructive.ds-icon-button--active .ds-icon-button__icon {
|
|
344
354
|
color: var(--color-action-destructive-text);
|
|
345
355
|
}
|
|
346
356
|
|
|
347
|
-
.ds-
|
|
357
|
+
.ds-icon-button--destructive.ds-icon-button--disabled {
|
|
348
358
|
opacity: 0.4;
|
|
349
359
|
cursor: not-allowed;
|
|
350
360
|
}
|
|
351
361
|
|
|
352
362
|
/* Interactive hover/active */
|
|
353
|
-
.ds-
|
|
354
|
-
.ds-
|
|
363
|
+
.ds-icon-button--destructive:not(.ds-icon-button--disabled):hover,
|
|
364
|
+
.ds-icon-button--destructive:not(.ds-icon-button--disabled):active {
|
|
355
365
|
background-color: var(--color-action-destructive-bg);
|
|
356
366
|
}
|
|
357
367
|
|
|
358
|
-
.ds-
|
|
359
|
-
.ds-
|
|
368
|
+
.ds-icon-button--destructive:not(.ds-icon-button--disabled):hover .ds-icon-button__icon,
|
|
369
|
+
.ds-icon-button--destructive:not(.ds-icon-button--disabled):active .ds-icon-button__icon {
|
|
360
370
|
color: var(--color-action-destructive-text);
|
|
361
371
|
}
|
|
362
372
|
|
|
@@ -366,7 +376,7 @@
|
|
|
366
376
|
the spinner replaces the icon and inherits its colour.
|
|
367
377
|
============================================ */
|
|
368
378
|
|
|
369
|
-
.ds-
|
|
379
|
+
.ds-icon-button--loading {
|
|
370
380
|
cursor: progress;
|
|
371
381
|
pointer-events: none;
|
|
372
382
|
}
|
|
@@ -374,7 +384,7 @@
|
|
|
374
384
|
/* The spinner is a box, not a glyph: left inline, it sits on the text
|
|
375
385
|
baseline and the strut's descender pushes it ~1px above the button's
|
|
376
386
|
centre. Flex centres it geometrically. */
|
|
377
|
-
.ds-
|
|
387
|
+
.ds-icon-button--loading .ds-icon-button__icon {
|
|
378
388
|
display: inline-flex;
|
|
379
389
|
align-items: center;
|
|
380
390
|
justify-content: center;
|
|
@@ -384,7 +394,7 @@
|
|
|
384
394
|
FOCUS
|
|
385
395
|
============================================ */
|
|
386
396
|
|
|
387
|
-
.ds-
|
|
397
|
+
.ds-icon-button:focus-visible {
|
|
388
398
|
outline: 2px solid var(--color-action-primary-bg);
|
|
389
399
|
outline-offset: 2px;
|
|
390
400
|
}
|
|
@@ -395,11 +405,11 @@
|
|
|
395
405
|
BottomNav's count-badge treatment.
|
|
396
406
|
============================================ */
|
|
397
407
|
|
|
398
|
-
.ds-
|
|
408
|
+
.ds-icon-button--badged {
|
|
399
409
|
position: relative;
|
|
400
410
|
}
|
|
401
411
|
|
|
402
|
-
.ds-
|
|
412
|
+
.ds-icon-button__badge {
|
|
403
413
|
position: absolute;
|
|
404
414
|
inset-block-start: calc(var(--padding-100) * -1);
|
|
405
415
|
inset-inline-end: calc(var(--padding-100) * -1);
|
|
@@ -419,7 +429,7 @@
|
|
|
419
429
|
pointer-events: none;
|
|
420
430
|
}
|
|
421
431
|
|
|
422
|
-
.ds-
|
|
432
|
+
.ds-icon-button__badge--dot {
|
|
423
433
|
inset-block-start: var(--padding-050);
|
|
424
434
|
inset-inline-end: var(--padding-050);
|
|
425
435
|
min-width: 0;
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { LinkComponent } from '../../behaviors/LinkProvider';
|
|
3
|
+
/** Props owned by IconButton itself — everything else falls through to the DOM node. */
|
|
4
|
+
type IconButtonOwnProps = {
|
|
5
|
+
/** The icon — Material Symbol name (string) or custom element (ReactNode) */
|
|
6
|
+
icon: string | React.ReactNode;
|
|
7
|
+
/**
|
|
8
|
+
* Emphasis: `primary` (filled), `secondary` (outlined) or `tertiary`
|
|
9
|
+
* (ghost). The colour is `tone`'s job. `neutral` is the legacy value from
|
|
10
|
+
* before the split and renders as `variant="primary" tone="neutral"`.
|
|
11
|
+
*/
|
|
12
|
+
variant?: 'primary' | 'secondary' | 'tertiary' | 'neutral';
|
|
13
|
+
/**
|
|
14
|
+
* Colour, independent of emphasis: `default` carries the action colour,
|
|
15
|
+
* `neutral` the greys, `destructive` the danger colour. Tertiary is
|
|
16
|
+
* already grey, so `neutral` leaves it unchanged; a tertiary
|
|
17
|
+
* `destructive` takes the outlined look, since a danger action needs a
|
|
18
|
+
* visible edge.
|
|
19
|
+
*/
|
|
20
|
+
tone?: 'default' | 'neutral' | 'destructive';
|
|
21
|
+
/**
|
|
22
|
+
* Legacy alias for `variant`.
|
|
23
|
+
*
|
|
24
|
+
* @deprecated Use `variant` instead.
|
|
25
|
+
*/
|
|
26
|
+
priority?: 'primary' | 'secondary' | 'tertiary';
|
|
27
|
+
/** Whether the button is disabled */
|
|
28
|
+
disabled?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* Documentation-only interaction state.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated Use `disabled` for the disabled state.
|
|
33
|
+
*
|
|
34
|
+
* Documentation-only affordance for rendering a *static* interaction state in
|
|
35
|
+
* Storybook and the showcase site. Real hover/active styling comes from CSS
|
|
36
|
+
* pseudo-classes and needs no prop — for docs, prefer
|
|
37
|
+
* `className="ds-icon-button--hover"`.
|
|
38
|
+
*/
|
|
39
|
+
state?: 'default' | 'hover' | 'active' | 'disabled';
|
|
40
|
+
/** Button size */
|
|
41
|
+
size?: 'default' | 'compact';
|
|
42
|
+
/**
|
|
43
|
+
* Shows a spinner in place of the icon and blocks interaction while an
|
|
44
|
+
* async action runs. Keeps the variant's full-colour appearance (unlike
|
|
45
|
+
* the disabled state) and sets `aria-busy` on the rendered element.
|
|
46
|
+
*/
|
|
47
|
+
loading?: boolean;
|
|
48
|
+
/**
|
|
49
|
+
* The button's name: what a screen reader announces and, by default, what
|
|
50
|
+
* the tooltip shows. Required, because the button has no visible text.
|
|
51
|
+
* Named as Button's and AiButton's text is, so the family spells it one way.
|
|
52
|
+
*/
|
|
53
|
+
label: string;
|
|
54
|
+
/**
|
|
55
|
+
* The hover/focus tooltip. An icon-only control names itself: by default
|
|
56
|
+
* the button wears a Tooltip carrying `label`. Pass a string to show
|
|
57
|
+
* different wording, or `false` to opt out — for a host that labels the
|
|
58
|
+
* control another way, or one that owns the button's box directly
|
|
59
|
+
* (SplitButton's trigger stretches to its sibling segment, which the
|
|
60
|
+
* tooltip wrapper would block).
|
|
61
|
+
*/
|
|
62
|
+
tooltip?: string | false;
|
|
63
|
+
/** Which side the tooltip opens on. `start` and `end` follow the reading direction. */
|
|
64
|
+
tooltipPosition?: 'top' | 'bottom' | 'left' | 'right' | 'start' | 'end';
|
|
65
|
+
/** Optional href — renders as <a> instead of <button> */
|
|
66
|
+
href?: string;
|
|
67
|
+
/** Optional target attribute for links */
|
|
68
|
+
target?: string;
|
|
69
|
+
/** Optional rel attribute for links */
|
|
70
|
+
rel?: string;
|
|
71
|
+
/** A mark on the button's top-end corner, as BottomNav draws one: a count (a notification bell's unread), or `true` for a dot with no number. */
|
|
72
|
+
badge?: number | string | true;
|
|
73
|
+
/** The highest count the badge spells out; a larger one reads "99+". Defaults to 99. */
|
|
74
|
+
badgeMax?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Text read after `label` while the button carries a badge, given the
|
|
77
|
+
* badge. Defaults to ", new" for a dot and ", 3 new" for a count; the
|
|
78
|
+
* leading comma and space are part of the text. The tooltip keeps
|
|
79
|
+
* `label` alone.
|
|
80
|
+
*/
|
|
81
|
+
badgeLabel?: (badge: number | string | true) => string;
|
|
82
|
+
/** The BCP 47 locale a numeric badge is written in, such as `ar-EG`. Defaults to `en-US`. This component can render from a Server Component, so it takes the prop alone and reads no LocaleProvider. */
|
|
83
|
+
locale?: string;
|
|
84
|
+
/** Additional CSS classes */
|
|
85
|
+
className?: string;
|
|
86
|
+
/**
|
|
87
|
+
* The component the link renders with, such as Next.js's `Link`, so it
|
|
88
|
+
* navigates through the app's router; a plain `<a>` when unset. This
|
|
89
|
+
* component can render on the server, so it never reads a LinkProvider:
|
|
90
|
+
* pass the prop even under one.
|
|
91
|
+
*/
|
|
92
|
+
linkComponent?: LinkComponent;
|
|
93
|
+
};
|
|
94
|
+
export interface IconButtonProps extends IconButtonOwnProps, Omit<React.ComponentPropsWithoutRef<'button'>, keyof IconButtonOwnProps | 'type'> {
|
|
95
|
+
}
|
|
96
|
+
/**
|
|
97
|
+
* Icon button component.
|
|
98
|
+
* A button holding a single icon and no visible text, round or square as
|
|
99
|
+
* the theme's button radius makes it. `variant` sets the emphasis
|
|
100
|
+
* (primary, secondary, tertiary) and `tone` the colour (default, neutral,
|
|
101
|
+
* destructive),
|
|
102
|
+
* in default and compact sizes.
|
|
103
|
+
*
|
|
104
|
+
* Renders a `<button>`, or an `<a>` when `href` is supplied. Forwards a ref to
|
|
105
|
+
* whichever element it renders, and spreads unrecognised props onto it.
|
|
106
|
+
*/
|
|
107
|
+
export declare const IconButton: React.ForwardRefExoticComponent<IconButtonProps & React.RefAttributes<HTMLAnchorElement | HTMLButtonElement>>;
|
|
108
|
+
export {};
|