rift-ds 1.42.0 → 1.43.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 +2 -2
- package/bin/rift-ds.mjs +1 -0
- package/bin/templates/blocks/app/dashboard/page.module.css +2 -2
- package/bin/templates/blocks/app/notifications/Inbox.tsx +13 -45
- package/bin/templates/blocks/app/notifications/page.module.css +5 -0
- package/bin/templates/blocks/app/planner/page.tsx +2 -2
- package/bin/templates/blocks/app/settings/Settings.tsx +4 -4
- package/bin/templates/blocks/components/blocks/AppShell.tsx +13 -18
- package/bin/templates/blocks/components/blocks/notifications.ts +77 -0
- package/bin/templates/blocks/registry.json +5 -0
- package/chat/ChatWidget.js +2 -1
- package/components/AppLayout/AppLayout.css +6 -0
- package/components/AppLayout/AppLayout.d.ts +4 -0
- package/components/AppLayout/AppLayout.js +5 -1
- package/components/AppSidebar/AppSidebar.css +4 -0
- package/components/AppSidebar/AppSidebar.js +2 -0
- package/components/AppToolbar/AppToolbar.d.ts +5 -2
- package/components/AppToolbar/AppToolbar.js +3 -1
- package/components/Chart/AreaChart.js +7 -1
- package/components/Chart/Chart.css +12 -0
- package/components/Chart/LineChart.js +7 -1
- package/components/Chart/RadarChart.js +2 -1
- package/components/Chart/ScatterChart.js +7 -1
- package/components/Chart/StackedBarChart.js +7 -1
- package/components/ChatMessage/ChatMessage.css +6 -0
- package/components/DataTable/DataTable.css +6 -0
- package/components/DataTable/DataTable.js +3 -2
- package/components/Dropdown/Dropdown.js +8 -0
- package/components/EventCalendar/EventCalendar.css +12 -0
- package/components/Input/Input.css +12 -0
- package/components/Inspector/Inspector.css +4 -1
- package/components/NotificationCenter/NotificationCenter.css +136 -27
- package/components/NotificationCenter/NotificationCenter.d.ts +67 -8
- package/components/NotificationCenter/NotificationCenter.js +97 -12
- package/components/Popover/Popover.css +3 -0
- package/components/Popover/Popover.d.ts +1 -1
- package/components/Popover/Popover.js +9 -1
- package/components/QuestionCard/QuestionCard.css +7 -4
- package/components/SegmentedControl/SegmentedControl.css +5 -0
- package/components/Stat/Stat.css +8 -0
- package/components/Table/Table.css +5 -0
- package/components/ThemeToggle/colorMode.d.ts +3 -3
- package/components/Toolbar/Toolbar.d.ts +6 -1
- package/components/Wizard/Wizard.d.ts +8 -3
- package/components/Wizard/Wizard.js +4 -1
- package/components/registry.json +11 -5
- package/components/registry.json.d.ts +11 -5
- package/components/registry.json.js +1 -1
- package/package.json +1 -1
- package/tokens/presets/zest.css +9 -11
- package/tokens/values.d.ts +10 -3
- package/tokens/values.js +11 -5
- package/tokens/values.json.js +1 -1
|
@@ -127,7 +127,13 @@ const StackedBarChart = React.forwardRef(({
|
|
|
127
127
|
},
|
|
128
128
|
s.dataKey
|
|
129
129
|
)),
|
|
130
|
-
showLegend && series.length > 1 && /* @__PURE__ */ jsx(
|
|
130
|
+
showLegend && series.length > 1 && /* @__PURE__ */ jsx(
|
|
131
|
+
Legend,
|
|
132
|
+
{
|
|
133
|
+
wrapperStyle: { color: textSecondary, fontSize: textSize },
|
|
134
|
+
formatter: (value) => /* @__PURE__ */ jsx("span", { style: { color: textSecondary }, children: value })
|
|
135
|
+
}
|
|
136
|
+
)
|
|
131
137
|
] }) })
|
|
132
138
|
] })
|
|
133
139
|
]
|
|
@@ -166,6 +166,12 @@
|
|
|
166
166
|
.ds-chat-message--bubble.ds-chat-message--user .ds-chat-message__content {
|
|
167
167
|
background-color: var(--color-chat-bubble-sent-bg);
|
|
168
168
|
color: var(--color-chat-bubble-sent-text);
|
|
169
|
+
/* A theme may fill this bubble with its action colour, and a mention
|
|
170
|
+
written in the action colour then disappears into it. Inside the
|
|
171
|
+
bubble the tag takes the bubble's own ink, and a wash of it gives the
|
|
172
|
+
tag its edge, so it reads on any fill a theme picks. */
|
|
173
|
+
--ds-mention-color: currentColor;
|
|
174
|
+
--ds-mention-bg: color-mix(in srgb, currentColor 16%, transparent);
|
|
169
175
|
}
|
|
170
176
|
|
|
171
177
|
/* Received — an assistant turn opted into a bubble */
|
|
@@ -832,6 +832,12 @@
|
|
|
832
832
|
min-width: 0;
|
|
833
833
|
}
|
|
834
834
|
|
|
835
|
+
/* A cell that does not wrap shrinks to its content, and a bar has no content
|
|
836
|
+
width of its own, so there it would get none: it keeps a floor instead. */
|
|
837
|
+
.ds-data-table__text > .ds-data-table__typed-progress {
|
|
838
|
+
min-width: calc(var(--control-height-default) * 3);
|
|
839
|
+
}
|
|
840
|
+
|
|
835
841
|
.ds-data-table__typed-person {
|
|
836
842
|
display: inline-flex;
|
|
837
843
|
align-items: center;
|
|
@@ -2378,13 +2378,14 @@ function DataTable({
|
|
|
2378
2378
|
striped ? "ds-table--striped" : "",
|
|
2379
2379
|
frameless ? "ds-table--frameless" : "ds-table--bordered",
|
|
2380
2380
|
outer ? "ds-table--outer-control" : "",
|
|
2381
|
-
|
|
2381
|
+
// A stacked card has no columns for a rule to part.
|
|
2382
|
+
columnDividers && !frameless && !stacked ? "ds-table--column-dividers" : "",
|
|
2382
2383
|
layoutReady ? `${baseClass}__grid--fixed` : "",
|
|
2383
2384
|
stickyHeader || virtual ? `${baseClass}__grid--sticky` : "",
|
|
2384
2385
|
stacked ? `${baseClass}__grid--stacked` : "",
|
|
2385
2386
|
showActions && rowActionsVisibility === "hover" ? `${baseClass}__grid--actions-hover` : ""
|
|
2386
2387
|
].filter(Boolean).join(" ");
|
|
2387
|
-
const frameMax = maxHeight ?? (virtual ? VIRTUAL_HEIGHT : void 0);
|
|
2388
|
+
const frameMax = stacked && !virtual ? void 0 : maxHeight ?? (virtual ? VIRTUAL_HEIGHT : void 0);
|
|
2388
2389
|
const frameStyle = frameMax !== void 0 ? { maxHeight: typeof frameMax === "number" ? `${frameMax}px` : frameMax } : void 0;
|
|
2389
2390
|
return /* @__PURE__ */ jsx(TableContext.Provider, { value: tableContext, children: /* @__PURE__ */ jsxs("div", { ...rest, ref: setRootRef, className: classes, children: [
|
|
2390
2391
|
/* @__PURE__ */ jsx("span", { className: "ds-visually-hidden", "aria-live": "polite", "aria-atomic": "true", children: announcement }),
|
|
@@ -221,11 +221,19 @@ const Dropdown = React.forwardRef(
|
|
|
221
221
|
disabled,
|
|
222
222
|
size,
|
|
223
223
|
id: inputId,
|
|
224
|
+
onClick: (event) => {
|
|
225
|
+
rest.onClick?.(event);
|
|
226
|
+
if (disabled || event.defaultPrevented) return;
|
|
227
|
+
if (event.target instanceof Element && event.target.closest(`#${CSS.escape(`${inputId}-label`)}`)) {
|
|
228
|
+
triggerRef.current?.focus();
|
|
229
|
+
}
|
|
230
|
+
},
|
|
224
231
|
children: [
|
|
225
232
|
/* @__PURE__ */ jsxs(
|
|
226
233
|
"div",
|
|
227
234
|
{
|
|
228
235
|
ref: triggerRef,
|
|
236
|
+
id: inputId,
|
|
229
237
|
className: `${baseClass}__trigger`,
|
|
230
238
|
role: "combobox",
|
|
231
239
|
"aria-expanded": isOpen,
|
|
@@ -229,6 +229,8 @@ button.ds-event-calendar__day:focus-visible {
|
|
|
229
229
|
flex-direction: column;
|
|
230
230
|
gap: var(--gap-050);
|
|
231
231
|
min-width: 0;
|
|
232
|
+
/* A day's pills answer to the day's own width, whatever the screen's. */
|
|
233
|
+
container-type: inline-size;
|
|
232
234
|
}
|
|
233
235
|
|
|
234
236
|
.ds-event-calendar__event {
|
|
@@ -245,6 +247,8 @@ button.ds-event-calendar__day:focus-visible {
|
|
|
245
247
|
border: var(--border-025) solid transparent;
|
|
246
248
|
border-radius: var(--radius-100);
|
|
247
249
|
text-align: start;
|
|
250
|
+
/* Nothing a pill holds runs past its edge. */
|
|
251
|
+
overflow: hidden;
|
|
248
252
|
}
|
|
249
253
|
|
|
250
254
|
button.ds-event-calendar__event {
|
|
@@ -297,6 +301,14 @@ button.ds-event-calendar__event:focus-visible {
|
|
|
297
301
|
font-variant-numeric: tabular-nums;
|
|
298
302
|
}
|
|
299
303
|
|
|
304
|
+
/* The title comes first: in a day too narrow for both, the time gives way
|
|
305
|
+
and the title takes the pill. The time stays in the pill's name. */
|
|
306
|
+
@container (max-width: 200px) {
|
|
307
|
+
.ds-event-calendar__event-time {
|
|
308
|
+
display: none;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
|
|
300
312
|
/* ============================================
|
|
301
313
|
SPANS — an event over several days
|
|
302
314
|
Its pill on each day squares off the side the
|
|
@@ -108,6 +108,18 @@
|
|
|
108
108
|
border-color: var(--color-status-error-border);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
+
/* The border is the error's already, so it cannot also say "you are here":
|
|
112
|
+
a field in error takes the system ring while it holds the focus. */
|
|
113
|
+
.ds-input--error .ds-input__field:focus-visible,
|
|
114
|
+
.ds-input--affixed.ds-input--error .ds-input__field-wrapper:focus-within {
|
|
115
|
+
outline: 2px solid var(--color-action-primary-bg);
|
|
116
|
+
outline-offset: 2px;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
.ds-input--affixed.ds-input--error .ds-input__field:focus-visible {
|
|
120
|
+
outline: none;
|
|
121
|
+
}
|
|
122
|
+
|
|
111
123
|
/* ============================================
|
|
112
124
|
DISABLED STATE
|
|
113
125
|
============================================ */
|
|
@@ -361,9 +361,12 @@
|
|
|
361
361
|
background: var(--color-action-primary-bg-hover);
|
|
362
362
|
}
|
|
363
363
|
|
|
364
|
+
/* The ring stands off the chip, as SegmentedControl's does: the chosen chip
|
|
365
|
+
is filled with the ring's own colour, so a ring drawn on its edge would
|
|
366
|
+
not show. */
|
|
364
367
|
.ds-inspector-segmented-control__segment:has(:focus-visible) {
|
|
365
368
|
outline: 2px solid var(--color-action-primary-bg);
|
|
366
|
-
outline-offset:
|
|
369
|
+
outline-offset: 2px;
|
|
367
370
|
}
|
|
368
371
|
|
|
369
372
|
.ds-inspector-segmented-control__segment:has(:disabled) {
|
|
@@ -27,9 +27,8 @@
|
|
|
27
27
|
HEADER
|
|
28
28
|
============================================ */
|
|
29
29
|
|
|
30
|
-
/* The header
|
|
31
|
-
|
|
32
|
-
rule over it, so a notification panel reads as the palette's sibling. */
|
|
30
|
+
/* The header takes CommandPalette's search-row frame: 16px by 20px with a
|
|
31
|
+
rule under it, so a notification panel reads as the palette's sibling. */
|
|
33
32
|
.ds-notification-center__header {
|
|
34
33
|
display: flex;
|
|
35
34
|
align-items: center;
|
|
@@ -64,6 +63,13 @@
|
|
|
64
63
|
flex: none;
|
|
65
64
|
}
|
|
66
65
|
|
|
66
|
+
/* Round marks, the default: the shared mark hook at a true circle, so every
|
|
67
|
+
Avatar, icon tile and logo in the rows draws round whatever the theme's
|
|
68
|
+
radius, as Table's `roundMarks` does for its cells. */
|
|
69
|
+
.ds-notification-center--round-marks {
|
|
70
|
+
--ds-mark-radius: 50%;
|
|
71
|
+
}
|
|
72
|
+
|
|
67
73
|
/* ============================================
|
|
68
74
|
FILTER TABS
|
|
69
75
|
============================================ */
|
|
@@ -110,10 +116,15 @@
|
|
|
110
116
|
|
|
111
117
|
.ds-notification-item {
|
|
112
118
|
display: flex;
|
|
113
|
-
|
|
119
|
+
/* The mark hangs from the row's top beside the title, so a row of any
|
|
120
|
+
height (two lines of copy, an action row) keeps it in one place. */
|
|
121
|
+
align-items: flex-start;
|
|
122
|
+
/* Never squeezed by a list held to a height: the list scrolls instead. */
|
|
123
|
+
flex: none;
|
|
114
124
|
gap: var(--gap-300);
|
|
115
|
-
/* A CommandPalette row
|
|
116
|
-
|
|
125
|
+
/* A CommandPalette row's 12px inline, inside the list's 8px inset, with
|
|
126
|
+
a step more above and below: a notification is read, not scanned. */
|
|
127
|
+
padding: var(--padding-400) var(--padding-300);
|
|
117
128
|
border-radius: var(--radius-200);
|
|
118
129
|
}
|
|
119
130
|
|
|
@@ -130,31 +141,36 @@
|
|
|
130
141
|
color: var(--color-icon-primary);
|
|
131
142
|
}
|
|
132
143
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
144
|
+
/* A named icon never stands alone: it sits on Icon's tile, cut to the
|
|
145
|
+
slot's width so it matches the avatar in the row beside it. */
|
|
146
|
+
.ds-notification-item__media .ds-icon--tile {
|
|
147
|
+
width: var(--icon-size-800);
|
|
148
|
+
height: var(--icon-size-800);
|
|
136
149
|
}
|
|
137
150
|
|
|
138
151
|
.ds-notification-item__body {
|
|
139
152
|
display: flex;
|
|
140
153
|
flex-direction: column;
|
|
141
|
-
gap: var(--gap-
|
|
154
|
+
gap: var(--gap-100);
|
|
142
155
|
min-width: 0;
|
|
143
156
|
flex: 1 1 auto;
|
|
144
157
|
}
|
|
145
158
|
|
|
146
159
|
.ds-notification-item__top {
|
|
147
160
|
display: flex;
|
|
148
|
-
align-items:
|
|
149
|
-
|
|
161
|
+
align-items: flex-start;
|
|
162
|
+
/* Room between a title cut at its ellipsis and the time. */
|
|
163
|
+
gap: var(--gap-300);
|
|
150
164
|
}
|
|
151
165
|
|
|
152
166
|
.ds-notification-item__title {
|
|
153
167
|
flex: 1 1 auto;
|
|
154
168
|
min-width: 0;
|
|
155
|
-
/*
|
|
156
|
-
|
|
157
|
-
overflow
|
|
169
|
+
/* One line, cut with an ellipsis: the title is the row's headline and
|
|
170
|
+
the copy under it carries the detail, in full. */
|
|
171
|
+
overflow: hidden;
|
|
172
|
+
white-space: nowrap;
|
|
173
|
+
text-overflow: ellipsis;
|
|
158
174
|
/* A read row: the paragraph face in the secondary text colour. Unread
|
|
159
175
|
takes the palette's emphasised label in the primary colour, so a row
|
|
160
176
|
reads as new by weight, colour and the dot, and opening it only
|
|
@@ -214,11 +230,20 @@
|
|
|
214
230
|
letter-spacing: var(--font-paragraph-sm-letter-spacing);
|
|
215
231
|
}
|
|
216
232
|
|
|
233
|
+
/* An unread row's copy takes the primary colour with its title, so the
|
|
234
|
+
whole row reads as new and dims as one once it is read. */
|
|
235
|
+
.ds-notification-item--unread .ds-notification-item__text {
|
|
236
|
+
color: var(--color-text-primary);
|
|
237
|
+
}
|
|
238
|
+
|
|
217
239
|
.ds-notification-item__actions {
|
|
218
240
|
display: flex;
|
|
241
|
+
/* In a narrow panel the buttons wrap under each other, never clip. */
|
|
242
|
+
flex-wrap: wrap;
|
|
219
243
|
align-items: center;
|
|
220
244
|
gap: var(--gap-200);
|
|
221
|
-
|
|
245
|
+
/* Parts the buttons from the copy: 12px with the body's gap. */
|
|
246
|
+
padding-top: var(--padding-200);
|
|
222
247
|
}
|
|
223
248
|
|
|
224
249
|
/* ============================================
|
|
@@ -242,6 +267,29 @@
|
|
|
242
267
|
background-color: var(--color-action-passive-bg-hover);
|
|
243
268
|
}
|
|
244
269
|
|
|
270
|
+
/* Leaving: a dismissed row fades and folds shut from the height it stood
|
|
271
|
+
at, pinned by the component, so the rows under it slide up; the host
|
|
272
|
+
takes it away once the exit has run. */
|
|
273
|
+
.ds-notification-item--leaving {
|
|
274
|
+
flex: none;
|
|
275
|
+
overflow: hidden;
|
|
276
|
+
pointer-events: none;
|
|
277
|
+
animation: ds-notification-item-leave var(--motion-duration-base) var(--motion-ease-emphasized) forwards;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
@keyframes ds-notification-item-leave {
|
|
281
|
+
from {
|
|
282
|
+
height: var(--ds-notification-item-height, auto);
|
|
283
|
+
opacity: 1;
|
|
284
|
+
}
|
|
285
|
+
|
|
286
|
+
to {
|
|
287
|
+
height: 0;
|
|
288
|
+
padding-block: 0;
|
|
289
|
+
opacity: 0;
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
|
|
245
293
|
.ds-notification-item__open {
|
|
246
294
|
display: block;
|
|
247
295
|
padding: 0;
|
|
@@ -260,17 +308,38 @@
|
|
|
260
308
|
inset: 0;
|
|
261
309
|
}
|
|
262
310
|
|
|
263
|
-
.ds-notification-item--interactive
|
|
311
|
+
.ds-notification-item--interactive /* An unread row's copy takes the primary colour with its title, so the
|
|
312
|
+
whole row reads as new and dims as one once it is read. */
|
|
313
|
+
.ds-notification-item--unread .ds-notification-item__text {
|
|
314
|
+
color: var(--color-text-primary);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
.ds-notification-item__actions {
|
|
264
318
|
position: relative;
|
|
265
319
|
z-index: 1;
|
|
266
320
|
}
|
|
267
321
|
|
|
268
|
-
/* The
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
322
|
+
/* The row's end: the time and the unread dot, and the options button that
|
|
323
|
+
covers them. */
|
|
324
|
+
.ds-notification-item__end {
|
|
325
|
+
position: relative;
|
|
326
|
+
flex: none;
|
|
327
|
+
display: inline-flex;
|
|
328
|
+
align-items: center;
|
|
329
|
+
gap: var(--gap-100);
|
|
330
|
+
/* One line of the title tall, so the time and the dot centre on it. */
|
|
331
|
+
min-height: var(--font-paragraph-line-height);
|
|
332
|
+
}
|
|
333
|
+
|
|
334
|
+
.ds-notification-item__time,
|
|
335
|
+
.ds-notification-item__dot {
|
|
336
|
+
transition: opacity var(--motion-duration-fast) var(--motion-ease-standard);
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
/* The options button (the class keeps the name of the dismiss it replaced):
|
|
340
|
+
above the stretched open control, shown while the row is hovered, holds
|
|
341
|
+
focus or has its menu open. Pulled into the row's padding above and below,
|
|
342
|
+
so the compact button never makes the row taller than its text. */
|
|
274
343
|
.ds-notification-item__dismiss {
|
|
275
344
|
position: relative;
|
|
276
345
|
z-index: 1;
|
|
@@ -281,13 +350,42 @@
|
|
|
281
350
|
transition: opacity var(--motion-duration-fast) var(--motion-ease-standard);
|
|
282
351
|
}
|
|
283
352
|
|
|
353
|
+
/* Over the time and the dot: out of the flow at the row's end, centred on
|
|
354
|
+
their line, so nothing is reserved for it at rest and the row never
|
|
355
|
+
shifts; the time and the dot fade out under it as it shows. */
|
|
356
|
+
.ds-notification-item__dismiss--over {
|
|
357
|
+
position: absolute;
|
|
358
|
+
inset-block-start: 50%;
|
|
359
|
+
inset-inline-end: 0;
|
|
360
|
+
margin-block: 0;
|
|
361
|
+
transform: translateY(-50%);
|
|
362
|
+
}
|
|
363
|
+
|
|
284
364
|
.ds-notification-item:hover .ds-notification-item__dismiss,
|
|
285
|
-
.ds-notification-item:focus-within .ds-notification-item__dismiss
|
|
365
|
+
.ds-notification-item:focus-within .ds-notification-item__dismiss,
|
|
366
|
+
.ds-notification-item__dismiss:has([aria-expanded='true']) {
|
|
286
367
|
opacity: 1;
|
|
287
368
|
}
|
|
288
369
|
|
|
370
|
+
.ds-notification-item:hover .ds-notification-item__dismiss--over ~ :is(.ds-notification-item__time, .ds-notification-item__dot),
|
|
371
|
+
.ds-notification-item:focus-within .ds-notification-item__dismiss--over ~ :is(.ds-notification-item__time, .ds-notification-item__dot),
|
|
372
|
+
.ds-notification-item__dismiss--over:has([aria-expanded='true']) ~ :is(.ds-notification-item__time, .ds-notification-item__dot) {
|
|
373
|
+
opacity: 0;
|
|
374
|
+
}
|
|
375
|
+
|
|
376
|
+
/* No hover to reveal it: the dismiss always shows, in the row before the
|
|
377
|
+
time, which stays. */
|
|
289
378
|
@media (hover: none) {
|
|
290
|
-
.ds-notification-item__dismiss
|
|
379
|
+
.ds-notification-item__dismiss,
|
|
380
|
+
.ds-notification-item__dismiss--over {
|
|
381
|
+
position: relative;
|
|
382
|
+
inset: auto;
|
|
383
|
+
margin-block: calc(var(--padding-150) * -1);
|
|
384
|
+
transform: none;
|
|
385
|
+
opacity: 1;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
.ds-notification-item .ds-notification-item__dismiss--over ~ :is(.ds-notification-item__time, .ds-notification-item__dot) {
|
|
291
389
|
opacity: 1;
|
|
292
390
|
}
|
|
293
391
|
}
|
|
@@ -296,13 +394,20 @@
|
|
|
296
394
|
FOOTER
|
|
297
395
|
============================================ */
|
|
298
396
|
|
|
397
|
+
/* The footer takes the list's 8px inset and its See all button fills it,
|
|
398
|
+
so the button's wash lines up with a row's and the whole foot is the
|
|
399
|
+
target. */
|
|
299
400
|
.ds-notification-center__footer {
|
|
300
401
|
display: flex;
|
|
301
|
-
|
|
302
|
-
padding: var(--padding-300) var(--padding-500);
|
|
402
|
+
padding: var(--padding-200);
|
|
303
403
|
border-top: var(--border-025) solid var(--color-divider);
|
|
304
404
|
}
|
|
305
405
|
|
|
406
|
+
.ds-notification-center__footer > .ds-button {
|
|
407
|
+
flex: 1 1 auto;
|
|
408
|
+
justify-content: center;
|
|
409
|
+
}
|
|
410
|
+
|
|
306
411
|
/* ============================================
|
|
307
412
|
SCREEN READER TEXT
|
|
308
413
|
============================================ */
|
|
@@ -327,6 +432,10 @@
|
|
|
327
432
|
min-width: 0;
|
|
328
433
|
}
|
|
329
434
|
|
|
435
|
+
.ds-notification-item--loading {
|
|
436
|
+
align-items: center;
|
|
437
|
+
}
|
|
438
|
+
|
|
330
439
|
.ds-notification-item--loading .ds-skeleton--circular {
|
|
331
440
|
width: var(--icon-size-800);
|
|
332
441
|
height: var(--icon-size-800);
|
|
@@ -13,19 +13,29 @@ export interface NotificationCenterTab {
|
|
|
13
13
|
/** Props owned by NotificationItem itself — everything else falls through to the root element. */
|
|
14
14
|
type NotificationItemOwnProps = {
|
|
15
15
|
/**
|
|
16
|
-
* One-line headline, e.g. who did what.
|
|
16
|
+
* One-line headline, e.g. who did what. A title longer than the row is
|
|
17
|
+
* cut with an ellipsis and keeps its full text as the hover tooltip; put
|
|
18
|
+
* the detail in the copy, which wraps in full.
|
|
17
19
|
* Note: this shadows the native `title` tooltip attribute, which NotificationItem does not expose.
|
|
18
20
|
*/
|
|
19
21
|
title: string;
|
|
20
22
|
/** When it happened, as already-formatted text like "2m" or "Mon". */
|
|
21
23
|
time?: string;
|
|
22
|
-
/** Marks the notification as not yet read: a dot beside the time
|
|
24
|
+
/** Marks the notification as not yet read: a dot beside the time, an emphasised title, and the title and copy in the primary text colour. */
|
|
23
25
|
unread?: boolean;
|
|
24
26
|
/** Visually hidden text announcing the unread dot. Defaults to "Unread". */
|
|
25
27
|
unreadLabel?: string;
|
|
26
|
-
/**
|
|
28
|
+
/**
|
|
29
|
+
* Leading visual: a Material Symbol name (string), drawn on an icon tile,
|
|
30
|
+
* or a custom element with a ground of its own, such as an Avatar or a
|
|
31
|
+
* logo tile. A mark never stands bare in a row.
|
|
32
|
+
*/
|
|
27
33
|
media?: string | React.ReactNode;
|
|
28
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* Action row under the body: compact Buttons, each with a leading icon, in one of three forms, the
|
|
36
|
+
* primary, the neutral primary (`variant="primary" tone="neutral"`) or
|
|
37
|
+
* the neutral secondary (`variant="secondary" tone="neutral"`).
|
|
38
|
+
*/
|
|
29
39
|
actions?: React.ReactNode;
|
|
30
40
|
/**
|
|
31
41
|
* Opens the notification. The title becomes a button whose hit area
|
|
@@ -37,13 +47,40 @@ type NotificationItemOwnProps = {
|
|
|
37
47
|
/** Opens the notification at this address instead: the title becomes a link covering the row. */
|
|
38
48
|
href?: string;
|
|
39
49
|
/**
|
|
40
|
-
* Clears this one notification
|
|
41
|
-
*
|
|
42
|
-
*
|
|
50
|
+
* Clears this one notification, as the last item of the row's options
|
|
51
|
+
* menu. The row fades and folds shut first, and this fires once it has
|
|
52
|
+
* gone, so the rows under it slide up instead of jumping. With any of `onDismiss`, `onMarkRead`, `onMarkUnread` or
|
|
53
|
+
* `menuItems`, a compact options button takes the place of the time and
|
|
54
|
+
* the unread dot at the row's end while the row is hovered or holds focus,
|
|
55
|
+
* above the row's own click; on a touch screen it always shows, beside
|
|
56
|
+
* them.
|
|
43
57
|
*/
|
|
44
58
|
onDismiss?: () => void;
|
|
45
|
-
/** The
|
|
59
|
+
/** The options menu's dismiss item. Default "Dismiss". */
|
|
60
|
+
dismissItemLabel?: string;
|
|
61
|
+
/**
|
|
62
|
+
* No longer drawn: the dismiss is an item of the row's options menu,
|
|
63
|
+
* labelled by `dismissItemLabel`.
|
|
64
|
+
*
|
|
65
|
+
* @deprecated Use `dismissItemLabel` and `optionsLabel` instead.
|
|
66
|
+
*/
|
|
46
67
|
dismissLabel?: (title: string) => string;
|
|
68
|
+
/** Marks this one notification as read: the first item of the row's options menu while the item is `unread`. */
|
|
69
|
+
onMarkRead?: () => void;
|
|
70
|
+
/** The options menu's mark-as-read item. Default "Mark as read". */
|
|
71
|
+
markReadLabel?: string;
|
|
72
|
+
/** Marks this one notification as unread again: the first item of the row's options menu once the item is read. */
|
|
73
|
+
onMarkUnread?: () => void;
|
|
74
|
+
/** The options menu's mark-as-unread item. Default "Mark as unread". */
|
|
75
|
+
markUnreadLabel?: string;
|
|
76
|
+
/**
|
|
77
|
+
* More items for the row's options menu, after the read item and before
|
|
78
|
+
* Dismiss: repeat the row's `actions` here, so every action is in the
|
|
79
|
+
* menu as well as on the row.
|
|
80
|
+
*/
|
|
81
|
+
menuItems?: DropdownMenuEntry[];
|
|
82
|
+
/** The options button's accessible name and tooltip, from the title. Default "Options for <title>". */
|
|
83
|
+
optionsLabel?: (title: string) => string;
|
|
47
84
|
/**
|
|
48
85
|
* The component the row's link renders with, such as Next.js's `Link`, so
|
|
49
86
|
* it navigates through the app's router. Wins over a LinkProvider's; a
|
|
@@ -83,6 +120,13 @@ type NotificationCenterOwnProps = {
|
|
|
83
120
|
onMarkAllRead?: () => void;
|
|
84
121
|
/** The options menu's mark-all-read item. Default "Mark all as read". */
|
|
85
122
|
markAllLabel?: string;
|
|
123
|
+
/**
|
|
124
|
+
* Fires when Mark all as unread is chosen from the header's options menu,
|
|
125
|
+
* the item after Mark all as read. Disabled while the list is empty.
|
|
126
|
+
*/
|
|
127
|
+
onMarkAllUnread?: () => void;
|
|
128
|
+
/** The options menu's mark-all-unread item. Default "Mark all as unread". */
|
|
129
|
+
markAllUnreadLabel?: string;
|
|
86
130
|
/** Fires when Clear all is chosen from the header's options menu, a destructive item that empties the inbox. */
|
|
87
131
|
onClearAll?: () => void;
|
|
88
132
|
/** The options menu's clear-all item. Default "Clear all". */
|
|
@@ -151,6 +195,21 @@ type NotificationCenterOwnProps = {
|
|
|
151
195
|
emptyStateLabels?: Partial<Pick<EmptyStateProps, 'title' | 'description'>>;
|
|
152
196
|
/** The BCP 47 locale the tab counts are written in, such as `ar-EG`. Defaults to the nearest LocaleProvider's, else `en-US`. */
|
|
153
197
|
locale?: string;
|
|
198
|
+
/**
|
|
199
|
+
* How many rows the list shows at full height before it scrolls: up to
|
|
200
|
+
* six by default, whatever their heights, with no scrollbar; from the
|
|
201
|
+
* seventh on, the list stays as tall as its first six and the rest are a
|
|
202
|
+
* scroll away behind a thin scrollbar. Pass `Infinity` to show every row
|
|
203
|
+
* and let the host bound the panel.
|
|
204
|
+
*/
|
|
205
|
+
maxVisibleItems?: number;
|
|
206
|
+
/**
|
|
207
|
+
* Draws every mark in the rows (an Avatar, an icon tile, a logo) as a true
|
|
208
|
+
* circle whatever the theme's radius, through the shared mark hook,
|
|
209
|
+
* `--ds-mark-radius`, as Table's `roundMarks` does. On by default; pass
|
|
210
|
+
* `false` to give the marks the theme's own radius.
|
|
211
|
+
*/
|
|
212
|
+
roundMarks?: boolean;
|
|
154
213
|
/** Holds three placeholder rows, a mark beside two lines, in the list while the notifications are being fetched. The header, tabs and footer stay. */
|
|
155
214
|
loading?: boolean;
|
|
156
215
|
/** Accessible name announced while `loading`. */
|