rift-ds 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/components/AgentStatus/AgentStatus.css +8 -0
- package/components/AppSidebar/AppSidebar.css +37 -0
- package/components/AppSidebar/AppSidebar.d.ts +2 -0
- package/components/AppSidebar/AppSidebar.js +248 -215
- package/components/Attachment/AttachmentViewer.js +2 -0
- package/components/BentoTile/BentoTile.js +2 -0
- package/components/Checkbox/Checkbox.css +4 -1
- package/components/Checkbox/Checkbox.d.ts +12 -5
- package/components/Checkbox/Checkbox.js +7 -2
- package/components/ColorPicker/ColorPicker.js +3 -1
- package/components/Combobox/Combobox.d.ts +1 -1
- package/components/Composer/Composer.css +42 -2
- package/components/Composer/Composer.d.ts +1 -1
- package/components/Composer/Composer.js +1 -0
- package/components/Dropdown/Dropdown.d.ts +4 -4
- package/components/Dropdown/Dropdown.js +1 -0
- package/components/EventCalendar/EventCalendar.css +3 -1
- package/components/LegendTile/LegendTile.css +10 -3
- package/components/LegendTile/LegendTile.d.ts +1 -1
- package/components/LegendTile/LegendTile.js +1 -1
- package/components/PinInput/PinInput.d.ts +6 -0
- package/components/PinInput/PinInput.js +38 -34
- package/components/RadioButton/RadioButton.css +4 -1
- package/components/RadioButton/RadioButton.d.ts +10 -12
- package/components/RadioButton/RadioButton.js +8 -6
- package/components/Reasoning/Reasoning.css +14 -0
- package/components/RichDropdown/RichDropdown.d.ts +4 -5
- package/components/RichDropdown/RichDropdown.js +1 -0
- package/components/SegmentedControl/SegmentedControl.css +43 -0
- package/components/SegmentedControl/SegmentedControl.d.ts +16 -2
- package/components/SegmentedControl/SegmentedControl.js +41 -4
- package/components/SelectionCard/SelectionCard.d.ts +7 -1
- package/components/SelectionCard/SelectionCard.js +2 -1
- package/components/Stat/Stat.css +2 -2
- package/components/TableToolbar/TableToolbar.css +15 -4
- package/components/TableToolbar/TableToolbar.d.ts +1 -0
- package/components/TableToolbar/TableToolbar.js +18 -9
- package/components/Tabs/Tabs.d.ts +2 -0
- package/components/Tabs/Tabs.js +1 -0
- package/components/TagInput/TagInput.d.ts +7 -0
- package/components/TagInput/TagInput.js +5 -3
- package/components/ThemeToggle/ThemeToggle.css +3 -25
- package/components/ThemeToggle/ThemeToggle.js +8 -20
- package/components/TimePicker/TimePicker.d.ts +6 -0
- package/components/TimePicker/TimePicker.js +4 -0
- package/components/Timeline/Timeline.css +7 -2
- package/components/Timeline/Timeline.d.ts +4 -4
- package/components/ToggleSwitch/ToggleSwitch.d.ts +8 -0
- package/components/ToggleSwitch/ToggleSwitch.js +6 -1
- package/components/ToolCall/ToolCall.css +11 -3
- package/components/TypographySwatch/TypographySwatch.css +3 -1
- package/components/WorldMap/WorldMap.d.ts +1 -1
- package/components/WorldMap/WorldMap.js +1 -1
- package/components/registry.json +1 -1
- package/components/registry.json.d.ts +1 -1
- package/components/registry.json.js +1 -1
- package/package.json +5 -1
- package/tokens/presets/contrast.css +8 -8
- package/tokens/presets/forest.css +10 -8
- package/tokens/presets/gold.css +12 -10
- package/tokens/presets/marquee.css +9 -9
- package/tokens/presets/mono.css +14 -0
- package/tokens/presets/pink.css +8 -8
- package/tokens/presets/terminal.css +8 -8
- package/tokens/presets/violet.css +8 -8
- package/tokens/presets/warm.css +8 -8
- package/tokens/presets/zest.css +10 -8
- package/tokens/registry.json +2 -0
- package/tokens/registry.json.d.ts +2 -0
- package/tokens/registry.json.js +1 -1
- package/tokens/tokens-dark.css +5 -1
- package/tokens/tokens-light.css +23 -18
- package/tokens/values.d.ts +34 -0
- package/tokens/values.js +11 -0
- package/tokens/values.json.js +8 -0
package/README.md
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
<!-- npm-badge:end -->
|
|
10
10
|
[](LICENSE)
|
|
11
11
|
|
|
12
|
-
An open source React design system built for AI products and coding agents: components on a three-tier token architecture, complete theme presets that restyle everything with one attribute, and machine surfaces (an MCP endpoint, per-component contracts, installable agent skills) so your coding agent knows the library as well as you do.
|
|
12
|
+
An open source React design system built for AI products and coding agents: components on a three-tier token architecture, complete theme presets that restyle everything with one attribute, and machine surfaces (an MCP endpoint, per-component contracts as markdown and JSON schema, the tokens as DTCG files, installable agent skills) so your coding agent knows the library as well as you do.
|
|
13
13
|
|
|
14
14
|
## Why Rift DS
|
|
15
15
|
|
|
@@ -81,13 +81,13 @@ For the full setup, one command teaches a coding agent the system: it installs t
|
|
|
81
81
|
npx rift-ds init
|
|
82
82
|
```
|
|
83
83
|
|
|
84
|
-
The MCP endpoint serves the component catalogue, per-component prop APIs, the token registry, install setup, and docs search to any client. No key, no account, no model calls: every tool reads only published, generated data, built from the same JSDoc that produces the shipped `.d.ts`, so an agent reads the exact contract npm ships.
|
|
84
|
+
The MCP endpoint serves the component catalogue, per-component prop APIs, the token registry with its values resolved per theme, install setup, and docs search to any client. No key, no account, no model calls: every tool reads only published, generated data, built from the same JSDoc that produces the shipped `.d.ts`, so an agent reads the exact contract npm ships.
|
|
85
85
|
|
|
86
86
|
```bash
|
|
87
87
|
claude mcp add --transport http rift-ds https://rift-ds.com/api/mcp
|
|
88
88
|
```
|
|
89
89
|
|
|
90
|
-
Every component's prop contract is also plain markdown (append `.md` to its docs URL), and [llms.txt](https://rift-ds.com/llms.txt) indexes every machine surface. A theme made in the [playground](https://rift-ds.com/playground) exports as one AGENTS.md that carries the setup, your theme in words and its CSS, so the agent can read the look as well as the code. Then just ask: "Build a settings page with Rift components."
|
|
90
|
+
Every component's prop contract is also plain markdown (append `.md` to its docs URL) and a JSON schema at `/schema/components/<slug>.json`, the tokens are published in the DTCG format and as `rift-ds/tokens/values` ([schemas](https://rift-ds.com/docs/schemas)), and [llms.txt](https://rift-ds.com/llms.txt) indexes every machine surface. A theme made in the [playground](https://rift-ds.com/playground) exports as one AGENTS.md that carries the setup, your theme in words and its CSS, so the agent can read the look as well as the code. Then just ask: "Build a settings page with Rift components."
|
|
91
91
|
|
|
92
92
|
## Theming
|
|
93
93
|
|
|
@@ -269,6 +269,14 @@
|
|
|
269
269
|
white-space: nowrap;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
+
/* The text itself sits in an inline-block span, which an ellipsis on the
|
|
273
|
+
label cannot cut, so the span carries its own. */
|
|
274
|
+
.ds-agent-status--pill .ds-agent-status__label-text {
|
|
275
|
+
display: block;
|
|
276
|
+
overflow: hidden;
|
|
277
|
+
text-overflow: ellipsis;
|
|
278
|
+
}
|
|
279
|
+
|
|
272
280
|
.ds-agent-status__action {
|
|
273
281
|
display: inline-flex;
|
|
274
282
|
flex: none;
|
|
@@ -33,6 +33,13 @@
|
|
|
33
33
|
width: 280px;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
+
/* Collapsed, the rail's dead space is an expand target (ThreadPanel's
|
|
37
|
+
rule: a click anywhere that is not a control reopens it); the cursor
|
|
38
|
+
says so. */
|
|
39
|
+
.ds-app-sidebar:not(.ds-app-sidebar--expanded) {
|
|
40
|
+
cursor: pointer;
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
/* ============================================
|
|
37
44
|
FLOATING VARIANT — the rail as a glass card
|
|
38
45
|
inset from the viewport edges (the same
|
|
@@ -506,6 +513,36 @@
|
|
|
506
513
|
pointer-events: auto;
|
|
507
514
|
}
|
|
508
515
|
|
|
516
|
+
/* The footer's two forms share one cell, so the slot keeps one height in
|
|
517
|
+
both states and the rail's layout never snaps: the expanded form fades
|
|
518
|
+
out as the collapsed form fades in, the inverse of the rules above. The
|
|
519
|
+
collapsed form stacks its controls (the same ones at their smallest)
|
|
520
|
+
and centres them on the rail's axis, floored with the expanded form. */
|
|
521
|
+
.ds-app-sidebar__footer {
|
|
522
|
+
display: grid;
|
|
523
|
+
min-width: 0;
|
|
524
|
+
}
|
|
525
|
+
|
|
526
|
+
.ds-app-sidebar__footer > .ds-app-sidebar__footer-slot {
|
|
527
|
+
grid-area: 1 / 1;
|
|
528
|
+
}
|
|
529
|
+
|
|
530
|
+
.ds-app-sidebar__footer-slot--collapsed {
|
|
531
|
+
display: flex;
|
|
532
|
+
flex-direction: column;
|
|
533
|
+
align-items: center;
|
|
534
|
+
justify-content: flex-end;
|
|
535
|
+
gap: var(--gap-200);
|
|
536
|
+
padding: 0;
|
|
537
|
+
opacity: 1;
|
|
538
|
+
pointer-events: auto;
|
|
539
|
+
}
|
|
540
|
+
|
|
541
|
+
.ds-app-sidebar--expanded .ds-app-sidebar__footer-slot--collapsed {
|
|
542
|
+
opacity: 0;
|
|
543
|
+
pointer-events: none;
|
|
544
|
+
}
|
|
545
|
+
|
|
509
546
|
/* ============================================
|
|
510
547
|
PROFILE
|
|
511
548
|
============================================ */
|
|
@@ -118,6 +118,8 @@ type AppSidebarOwnProps = {
|
|
|
118
118
|
topSlot?: React.ReactNode;
|
|
119
119
|
/** Rendered above the profile block; fades out while collapsed */
|
|
120
120
|
footerSlot?: React.ReactNode;
|
|
121
|
+
/** Rendered above the profile block while the rail is collapsed, in `footerSlot`'s place: the same controls at their smallest, such as a SegmentedControl's or ThemeToggle's `cycle` circle, stacked and centred on the rail's axis. The two forms share one cell and crossfade with the rail, and whichever is hidden is inert */
|
|
122
|
+
collapsedFooterSlot?: React.ReactNode;
|
|
121
123
|
/** Additional CSS classes */
|
|
122
124
|
className?: string;
|
|
123
125
|
/**
|
|
@@ -53,6 +53,7 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
53
53
|
floating: floatingProp = false,
|
|
54
54
|
topSlot,
|
|
55
55
|
footerSlot,
|
|
56
|
+
collapsedFooterSlot,
|
|
56
57
|
className = "",
|
|
57
58
|
logo,
|
|
58
59
|
logoText = "Rift",
|
|
@@ -228,6 +229,17 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
228
229
|
},
|
|
229
230
|
[mobileOpen, panelSourceKey, isPanelOpen, setPanelOpen]
|
|
230
231
|
);
|
|
232
|
+
const showExpanded = isExpanded || mobileOpen;
|
|
233
|
+
const expandOnClick = !showExpanded ? (event) => {
|
|
234
|
+
rest.onClick?.(event);
|
|
235
|
+
if (event.defaultPrevented) return;
|
|
236
|
+
const rail = event.currentTarget;
|
|
237
|
+
const target = event.target;
|
|
238
|
+
if (!rail.contains(target)) return;
|
|
239
|
+
const control = target.closest('button, a, input, select, textarea, label, [tabindex], [role="button"], [role="menu"], [role="listbox"], [role="dialog"], [role="alertdialog"]');
|
|
240
|
+
if (control && control !== rail && rail.contains(control)) return;
|
|
241
|
+
toggleExpanded();
|
|
242
|
+
} : void 0;
|
|
231
243
|
const classes = [
|
|
232
244
|
baseClass,
|
|
233
245
|
// The drawer always shows the expanded layout: an icon rail inside
|
|
@@ -253,234 +265,255 @@ const AppSidebar = React.forwardRef(function AppSidebar2({
|
|
|
253
265
|
}
|
|
254
266
|
),
|
|
255
267
|
mobileOpen && /* @__PURE__ */ jsx("div", { className: `${baseClass}__scrim`, onClick: () => layer.ownsPress() && closeMobile(), "aria-hidden": "true" }),
|
|
256
|
-
/* @__PURE__ */ jsxs(
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
268
|
+
/* @__PURE__ */ jsxs(
|
|
269
|
+
"nav",
|
|
270
|
+
{
|
|
271
|
+
"aria-label": "App navigation",
|
|
272
|
+
...rest,
|
|
273
|
+
ref: setDrawerRef,
|
|
274
|
+
id: drawerId,
|
|
275
|
+
className: classes,
|
|
276
|
+
onClick: expandOnClick ?? rest.onClick,
|
|
277
|
+
children: [
|
|
278
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__top`, children: [
|
|
279
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__logo`, children: [
|
|
280
|
+
/* @__PURE__ */ jsxs(
|
|
281
|
+
"div",
|
|
282
|
+
{
|
|
283
|
+
className: `${baseClass}__logo-inner`,
|
|
284
|
+
onClick: !isExpanded ? toggleExpanded : void 0,
|
|
285
|
+
role: !isExpanded ? "button" : void 0,
|
|
286
|
+
tabIndex: !isExpanded ? 0 : void 0,
|
|
287
|
+
"aria-label": !isExpanded ? expandLabel : void 0,
|
|
288
|
+
onKeyDown: !isExpanded ? (e) => {
|
|
289
|
+
if (e.key === "Enter" || e.key === " ") {
|
|
290
|
+
e.preventDefault();
|
|
291
|
+
toggleExpanded();
|
|
292
|
+
}
|
|
293
|
+
} : void 0,
|
|
294
|
+
style: !isExpanded ? { cursor: "pointer" } : void 0,
|
|
295
|
+
children: [
|
|
296
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__logo-icon`, children: logo || /* @__PURE__ */ jsx(DefaultLogo, {}) }),
|
|
297
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__logo-text`, children: logoText })
|
|
298
|
+
]
|
|
271
299
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
300
|
+
),
|
|
301
|
+
/* @__PURE__ */ jsx(
|
|
302
|
+
"button",
|
|
303
|
+
{
|
|
304
|
+
className: `${baseClass}__toggle`,
|
|
305
|
+
onClick: mobileOpen ? closeMobile : toggleExpanded,
|
|
306
|
+
"aria-label": mobileOpen ? closeLabel : isExpanded ? collapseLabel : expandLabel,
|
|
307
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded ds-mirror-rtl", children: mobileOpen ? "close" : isExpanded ? "left_panel_close" : "left_panel_open" })
|
|
308
|
+
}
|
|
309
|
+
)
|
|
310
|
+
] }),
|
|
311
|
+
topSlot && /* @__PURE__ */ jsx("div", { className: `${baseClass}__top-slot`, children: topSlot }),
|
|
312
|
+
mobileOpen && drilled && panelSource ? /* @__PURE__ */ jsx(
|
|
313
|
+
SidebarPanel,
|
|
314
|
+
{
|
|
315
|
+
linkComponent: Link,
|
|
316
|
+
className: `${baseClass}__drill`,
|
|
317
|
+
items: panelSource.items,
|
|
318
|
+
title: panelSource.label,
|
|
319
|
+
activeKey: activeTertiaryKey ?? activeSubKey,
|
|
320
|
+
onBack: () => {
|
|
321
|
+
focusAfterDrill.current = "out";
|
|
322
|
+
setDrilled(false);
|
|
323
|
+
},
|
|
324
|
+
backLabel: panelSource.parentLabel ?? menuLabel
|
|
325
|
+
},
|
|
326
|
+
panelSourceKey
|
|
327
|
+
) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__sections`, children: sections.map((section, si) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__nav`, children: [
|
|
328
|
+
section.category && /* @__PURE__ */ jsx("div", { className: `${baseClass}__category`, children: section.category }),
|
|
329
|
+
section.items.map((item) => {
|
|
330
|
+
const hasChildren = item.children && item.children.length > 0;
|
|
331
|
+
const isOpen = openKeys.has(item.key);
|
|
332
|
+
const feedsPanel = isPanelMode && hasChildren;
|
|
333
|
+
const isSource = feedsPanel && item.key === panelSourceKey;
|
|
334
|
+
const isActive = isPanelMode && panelVisible ? isSource : activeKey === item.key;
|
|
335
|
+
const isLink = Boolean(item.href) && !hasChildren;
|
|
336
|
+
const itemClasses = [
|
|
337
|
+
`${baseClass}__btn`,
|
|
338
|
+
isActive ? `${baseClass}__btn--active` : ""
|
|
339
|
+
].filter(Boolean).join(" ");
|
|
340
|
+
const itemContent = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
341
|
+
/* @__PURE__ */ jsxs("span", { className: `${baseClass}__btn-left`, children: [
|
|
342
|
+
/* @__PURE__ */ jsxs("span", { className: `${baseClass}__btn-seat`, children: [
|
|
343
|
+
item.pixelAvatar ? /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-icon ${baseClass}__btn-icon--avatar`, children: /* @__PURE__ */ jsx(PixelAvatar, { name: avatarSeed(item), ink: avatarInks.get(item.key) }) }) : /* @__PURE__ */ jsx(
|
|
344
|
+
"span",
|
|
345
|
+
{
|
|
346
|
+
className: `${baseClass}__btn-icon${typeof item.icon === "string" ? ` material-symbols-rounded ${mirrorClass(item.icon)}` : ""}`,
|
|
347
|
+
children: item.icon
|
|
348
|
+
}
|
|
349
|
+
),
|
|
350
|
+
item.badge !== void 0 && isCount(item.badge) && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-corner-badge`, "aria-hidden": "true", children: item.badge })
|
|
351
|
+
] }),
|
|
352
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-label`, children: item.label })
|
|
353
|
+
] }),
|
|
354
|
+
isPanelMode && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-caption`, "aria-hidden": "true", children: item.label }),
|
|
355
|
+
item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-badge${isCount(item.badge) ? ` ${baseClass}__btn-badge--count` : ""}`, children: item.badge }),
|
|
356
|
+
hasChildren && /* @__PURE__ */ jsx(
|
|
323
357
|
"span",
|
|
324
358
|
{
|
|
325
|
-
className:
|
|
326
|
-
|
|
359
|
+
className: [
|
|
360
|
+
`${baseClass}__btn-chevron material-symbols-rounded ds-mirror-rtl`,
|
|
361
|
+
isOpen && !isPanelMode ? `${baseClass}__btn-chevron--open` : ""
|
|
362
|
+
].filter(Boolean).join(" "),
|
|
363
|
+
children: "chevron_right"
|
|
364
|
+
}
|
|
365
|
+
)
|
|
366
|
+
] });
|
|
367
|
+
return /* @__PURE__ */ jsxs(React.Fragment, { children: [
|
|
368
|
+
isLink && item.href ? /* @__PURE__ */ jsx(
|
|
369
|
+
Link,
|
|
370
|
+
{
|
|
371
|
+
className: itemClasses,
|
|
372
|
+
href: item.href,
|
|
373
|
+
onClick: () => item.onClick?.(),
|
|
374
|
+
"aria-current": isActive ? "page" : void 0,
|
|
375
|
+
title: !isExpanded ? item.label : void 0,
|
|
376
|
+
children: itemContent
|
|
377
|
+
}
|
|
378
|
+
) : /* @__PURE__ */ jsx(
|
|
379
|
+
"button",
|
|
380
|
+
{
|
|
381
|
+
type: "button",
|
|
382
|
+
className: itemClasses,
|
|
383
|
+
onClick: () => {
|
|
384
|
+
if (feedsPanel) {
|
|
385
|
+
selectPanelSource(item.key);
|
|
386
|
+
} else if (hasChildren) {
|
|
387
|
+
if (!isExpanded && !mobileOpen) {
|
|
388
|
+
toggleExpanded();
|
|
389
|
+
setOpenKeys((prev) => new Set(prev).add(item.key));
|
|
390
|
+
} else {
|
|
391
|
+
toggleAccordion(item.key);
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
item.onClick?.();
|
|
395
|
+
},
|
|
396
|
+
"aria-expanded": feedsPanel ? mobileOpen ? void 0 : isSource && panelVisible : hasChildren ? isOpen : void 0,
|
|
397
|
+
"aria-controls": feedsPanel && !mobileOpen ? panelId : void 0,
|
|
398
|
+
"aria-current": activeKey === item.key ? "page" : void 0,
|
|
399
|
+
"data-panel-source": isSource ? "true" : void 0,
|
|
400
|
+
title: !isExpanded && !isPanelMode ? item.label : void 0,
|
|
401
|
+
children: itemContent
|
|
327
402
|
}
|
|
328
403
|
),
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
404
|
+
hasChildren && !isPanelMode && /* @__PURE__ */ jsx(
|
|
405
|
+
"div",
|
|
406
|
+
{
|
|
407
|
+
className: [
|
|
408
|
+
`${baseClass}__sub-items`,
|
|
409
|
+
isOpen && isExpanded ? `${baseClass}__sub-items--open` : ""
|
|
410
|
+
].filter(Boolean).join(" "),
|
|
411
|
+
children: item.children.map((sub) => {
|
|
412
|
+
const subHasChildren = Boolean(sub.children?.length);
|
|
413
|
+
const subIsSource = subHasChildren && sub.key === panelSourceKey;
|
|
414
|
+
const subActive = panelVisible && subHasChildren ? subIsSource : activeSubKey === sub.key;
|
|
415
|
+
const subClasses = [
|
|
416
|
+
`${baseClass}__sub-btn`,
|
|
417
|
+
subActive ? `${baseClass}__sub-btn--active` : ""
|
|
418
|
+
].filter(Boolean).join(" ");
|
|
419
|
+
const subLabel = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
420
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__sub-label`, children: sub.label }),
|
|
421
|
+
sub.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-badge${isCount(sub.badge) ? ` ${baseClass}__btn-badge--count` : ""}`, children: sub.badge }),
|
|
422
|
+
subHasChildren && /* @__PURE__ */ jsx(
|
|
423
|
+
"span",
|
|
424
|
+
{
|
|
425
|
+
className: `${baseClass}__sub-chevron material-symbols-rounded ds-mirror-rtl`,
|
|
426
|
+
"aria-hidden": "true",
|
|
427
|
+
children: "chevron_right"
|
|
428
|
+
}
|
|
429
|
+
)
|
|
430
|
+
] });
|
|
431
|
+
return /* @__PURE__ */ jsxs("div", { className: `${baseClass}__sub-item`, children: [
|
|
432
|
+
/* @__PURE__ */ jsx("div", { className: `${baseClass}__sub-line` }),
|
|
433
|
+
subHasChildren ? /* @__PURE__ */ jsx(
|
|
434
|
+
"button",
|
|
435
|
+
{
|
|
436
|
+
type: "button",
|
|
437
|
+
className: subClasses,
|
|
438
|
+
onClick: () => {
|
|
439
|
+
selectPanelSource(sub.key);
|
|
440
|
+
sub.onClick?.();
|
|
441
|
+
},
|
|
442
|
+
"aria-expanded": mobileOpen ? void 0 : subIsSource && panelVisible,
|
|
443
|
+
"aria-controls": mobileOpen ? void 0 : panelId,
|
|
444
|
+
"aria-current": activeSubKey === sub.key ? "page" : void 0,
|
|
445
|
+
"data-panel-source": subIsSource ? "true" : void 0,
|
|
446
|
+
children: subLabel
|
|
447
|
+
}
|
|
448
|
+
) : sub.href ? /* @__PURE__ */ jsx(
|
|
449
|
+
Link,
|
|
450
|
+
{
|
|
451
|
+
className: subClasses,
|
|
452
|
+
href: sub.href,
|
|
453
|
+
onClick: sub.onClick,
|
|
454
|
+
"aria-current": subActive ? "page" : void 0,
|
|
455
|
+
children: subLabel
|
|
456
|
+
}
|
|
457
|
+
) : /* @__PURE__ */ jsx(
|
|
458
|
+
"button",
|
|
459
|
+
{
|
|
460
|
+
type: "button",
|
|
461
|
+
className: subClasses,
|
|
462
|
+
onClick: sub.onClick,
|
|
463
|
+
"aria-current": subActive ? "page" : void 0,
|
|
464
|
+
children: subLabel
|
|
465
|
+
}
|
|
466
|
+
)
|
|
467
|
+
] }, sub.key);
|
|
468
|
+
})
|
|
469
|
+
}
|
|
470
|
+
)
|
|
471
|
+
] }, item.key);
|
|
472
|
+
})
|
|
473
|
+
] }, si)) })
|
|
474
|
+
] }),
|
|
475
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__bottom`, children: [
|
|
476
|
+
(footerSlot || collapsedFooterSlot) && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__footer`, children: [
|
|
477
|
+
footerSlot && /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer-slot`, inert: !showExpanded, children: footerSlot }),
|
|
478
|
+
collapsedFooterSlot && /* @__PURE__ */ jsx(
|
|
479
|
+
"div",
|
|
337
480
|
{
|
|
338
|
-
className:
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
].filter(Boolean).join(" "),
|
|
342
|
-
children: "chevron_right"
|
|
481
|
+
className: `${baseClass}__footer-slot ${baseClass}__footer-slot--collapsed`,
|
|
482
|
+
inert: showExpanded,
|
|
483
|
+
children: collapsedFooterSlot
|
|
343
484
|
}
|
|
344
485
|
)
|
|
345
|
-
] })
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
486
|
+
] }),
|
|
487
|
+
profile && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile`, children: [
|
|
488
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile-left`, children: [
|
|
489
|
+
/* @__PURE__ */ jsx(
|
|
490
|
+
Avatar,
|
|
491
|
+
{
|
|
492
|
+
className: `${baseClass}__avatar`,
|
|
493
|
+
size: "md",
|
|
494
|
+
name: profile.name,
|
|
495
|
+
src: profile.avatarUrl
|
|
496
|
+
}
|
|
497
|
+
),
|
|
498
|
+
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile-info`, children: [
|
|
499
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-name`, children: profile.name }),
|
|
500
|
+
/* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-email`, children: profile.email })
|
|
501
|
+
] })
|
|
502
|
+
] }),
|
|
503
|
+
/* @__PURE__ */ jsx(
|
|
358
504
|
"button",
|
|
359
505
|
{
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
selectPanelSource(item.key);
|
|
365
|
-
} else if (hasChildren) {
|
|
366
|
-
if (!isExpanded && !mobileOpen) {
|
|
367
|
-
toggleExpanded();
|
|
368
|
-
setOpenKeys((prev) => new Set(prev).add(item.key));
|
|
369
|
-
} else {
|
|
370
|
-
toggleAccordion(item.key);
|
|
371
|
-
}
|
|
372
|
-
}
|
|
373
|
-
item.onClick?.();
|
|
374
|
-
},
|
|
375
|
-
"aria-expanded": feedsPanel ? mobileOpen ? void 0 : isSource && panelVisible : hasChildren ? isOpen : void 0,
|
|
376
|
-
"aria-controls": feedsPanel && !mobileOpen ? panelId : void 0,
|
|
377
|
-
"aria-current": activeKey === item.key ? "page" : void 0,
|
|
378
|
-
"data-panel-source": isSource ? "true" : void 0,
|
|
379
|
-
title: !isExpanded && !isPanelMode ? item.label : void 0,
|
|
380
|
-
children: itemContent
|
|
381
|
-
}
|
|
382
|
-
),
|
|
383
|
-
hasChildren && !isPanelMode && /* @__PURE__ */ jsx(
|
|
384
|
-
"div",
|
|
385
|
-
{
|
|
386
|
-
className: [
|
|
387
|
-
`${baseClass}__sub-items`,
|
|
388
|
-
isOpen && isExpanded ? `${baseClass}__sub-items--open` : ""
|
|
389
|
-
].filter(Boolean).join(" "),
|
|
390
|
-
children: item.children.map((sub) => {
|
|
391
|
-
const subHasChildren = Boolean(sub.children?.length);
|
|
392
|
-
const subIsSource = subHasChildren && sub.key === panelSourceKey;
|
|
393
|
-
const subActive = panelVisible && subHasChildren ? subIsSource : activeSubKey === sub.key;
|
|
394
|
-
const subClasses = [
|
|
395
|
-
`${baseClass}__sub-btn`,
|
|
396
|
-
subActive ? `${baseClass}__sub-btn--active` : ""
|
|
397
|
-
].filter(Boolean).join(" ");
|
|
398
|
-
const subLabel = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
399
|
-
/* @__PURE__ */ jsx("span", { className: `${baseClass}__sub-label`, children: sub.label }),
|
|
400
|
-
sub.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-badge${isCount(sub.badge) ? ` ${baseClass}__btn-badge--count` : ""}`, children: sub.badge }),
|
|
401
|
-
subHasChildren && /* @__PURE__ */ jsx(
|
|
402
|
-
"span",
|
|
403
|
-
{
|
|
404
|
-
className: `${baseClass}__sub-chevron material-symbols-rounded ds-mirror-rtl`,
|
|
405
|
-
"aria-hidden": "true",
|
|
406
|
-
children: "chevron_right"
|
|
407
|
-
}
|
|
408
|
-
)
|
|
409
|
-
] });
|
|
410
|
-
return /* @__PURE__ */ jsxs("div", { className: `${baseClass}__sub-item`, children: [
|
|
411
|
-
/* @__PURE__ */ jsx("div", { className: `${baseClass}__sub-line` }),
|
|
412
|
-
subHasChildren ? /* @__PURE__ */ jsx(
|
|
413
|
-
"button",
|
|
414
|
-
{
|
|
415
|
-
type: "button",
|
|
416
|
-
className: subClasses,
|
|
417
|
-
onClick: () => {
|
|
418
|
-
selectPanelSource(sub.key);
|
|
419
|
-
sub.onClick?.();
|
|
420
|
-
},
|
|
421
|
-
"aria-expanded": mobileOpen ? void 0 : subIsSource && panelVisible,
|
|
422
|
-
"aria-controls": mobileOpen ? void 0 : panelId,
|
|
423
|
-
"aria-current": activeSubKey === sub.key ? "page" : void 0,
|
|
424
|
-
"data-panel-source": subIsSource ? "true" : void 0,
|
|
425
|
-
children: subLabel
|
|
426
|
-
}
|
|
427
|
-
) : sub.href ? /* @__PURE__ */ jsx(
|
|
428
|
-
Link,
|
|
429
|
-
{
|
|
430
|
-
className: subClasses,
|
|
431
|
-
href: sub.href,
|
|
432
|
-
onClick: sub.onClick,
|
|
433
|
-
"aria-current": subActive ? "page" : void 0,
|
|
434
|
-
children: subLabel
|
|
435
|
-
}
|
|
436
|
-
) : /* @__PURE__ */ jsx(
|
|
437
|
-
"button",
|
|
438
|
-
{
|
|
439
|
-
type: "button",
|
|
440
|
-
className: subClasses,
|
|
441
|
-
onClick: sub.onClick,
|
|
442
|
-
"aria-current": subActive ? "page" : void 0,
|
|
443
|
-
children: subLabel
|
|
444
|
-
}
|
|
445
|
-
)
|
|
446
|
-
] }, sub.key);
|
|
447
|
-
})
|
|
506
|
+
className: `${baseClass}__profile-more`,
|
|
507
|
+
onClick: onProfileMore,
|
|
508
|
+
"aria-label": profileMoreLabel,
|
|
509
|
+
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: "more_horiz" })
|
|
448
510
|
}
|
|
449
511
|
)
|
|
450
|
-
] }, item.key);
|
|
451
|
-
})
|
|
452
|
-
] }, si)) })
|
|
453
|
-
] }),
|
|
454
|
-
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__bottom`, children: [
|
|
455
|
-
footerSlot && /* @__PURE__ */ jsx("div", { className: `${baseClass}__footer-slot`, children: footerSlot }),
|
|
456
|
-
profile && /* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile`, children: [
|
|
457
|
-
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile-left`, children: [
|
|
458
|
-
/* @__PURE__ */ jsx(
|
|
459
|
-
Avatar,
|
|
460
|
-
{
|
|
461
|
-
className: `${baseClass}__avatar`,
|
|
462
|
-
size: "md",
|
|
463
|
-
name: profile.name,
|
|
464
|
-
src: profile.avatarUrl
|
|
465
|
-
}
|
|
466
|
-
),
|
|
467
|
-
/* @__PURE__ */ jsxs("div", { className: `${baseClass}__profile-info`, children: [
|
|
468
|
-
/* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-name`, children: profile.name }),
|
|
469
|
-
/* @__PURE__ */ jsx("span", { className: `${baseClass}__profile-email`, children: profile.email })
|
|
470
512
|
] })
|
|
471
|
-
] })
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
className: `${baseClass}__profile-more`,
|
|
476
|
-
onClick: onProfileMore,
|
|
477
|
-
"aria-label": profileMoreLabel,
|
|
478
|
-
children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded", children: "more_horiz" })
|
|
479
|
-
}
|
|
480
|
-
)
|
|
481
|
-
] })
|
|
482
|
-
] })
|
|
483
|
-
] }),
|
|
513
|
+
] })
|
|
514
|
+
]
|
|
515
|
+
}
|
|
516
|
+
),
|
|
484
517
|
panelSource && !mobileOpen && /* @__PURE__ */ jsx(
|
|
485
518
|
SidebarPanel,
|
|
486
519
|
{
|
|
@@ -178,6 +178,7 @@ const AttachmentViewer = React.forwardRef(
|
|
|
178
178
|
{
|
|
179
179
|
icon: "chevron_left",
|
|
180
180
|
variant: "secondary",
|
|
181
|
+
tone: "neutral",
|
|
181
182
|
size: "compact",
|
|
182
183
|
ariaLabel: previousLabel,
|
|
183
184
|
tooltip: false,
|
|
@@ -190,6 +191,7 @@ const AttachmentViewer = React.forwardRef(
|
|
|
190
191
|
{
|
|
191
192
|
icon: "chevron_right",
|
|
192
193
|
variant: "secondary",
|
|
194
|
+
tone: "neutral",
|
|
193
195
|
size: "compact",
|
|
194
196
|
ariaLabel: nextLabel,
|
|
195
197
|
tooltip: false,
|
|
@@ -197,6 +197,7 @@ const BentoTile = React.forwardRef(
|
|
|
197
197
|
ref: triggerRef,
|
|
198
198
|
icon: "open_in_full",
|
|
199
199
|
variant: awake ? "primary" : "secondary",
|
|
200
|
+
tone: awake ? void 0 : "neutral",
|
|
200
201
|
size: "compact",
|
|
201
202
|
ariaLabel: label,
|
|
202
203
|
tooltip: false,
|
|
@@ -280,6 +281,7 @@ function BentoTileOverlay({ title, titleId, panelName, toggleName, closeLabel, o
|
|
|
280
281
|
ref: closeRef,
|
|
281
282
|
icon: "close_fullscreen",
|
|
282
283
|
variant: "secondary",
|
|
284
|
+
tone: "neutral",
|
|
283
285
|
size: "compact",
|
|
284
286
|
ariaLabel: closeLabel,
|
|
285
287
|
tooltip: false,
|