rift-ds 1.19.1 → 1.21.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.
Files changed (77) hide show
  1. package/README.md +3 -3
  2. package/components/AgentStatus/AgentStatus.css +8 -0
  3. package/components/AppSidebar/AppSidebar.css +37 -0
  4. package/components/AppSidebar/AppSidebar.d.ts +2 -0
  5. package/components/AppSidebar/AppSidebar.js +248 -215
  6. package/components/Checkbox/Checkbox.css +4 -1
  7. package/components/Checkbox/Checkbox.d.ts +12 -5
  8. package/components/Checkbox/Checkbox.js +7 -2
  9. package/components/ColorPicker/ColorPicker.js +3 -1
  10. package/components/Combobox/Combobox.d.ts +1 -1
  11. package/components/Composer/Composer.css +42 -2
  12. package/components/Composer/Composer.d.ts +1 -1
  13. package/components/Composer/Composer.js +1 -0
  14. package/components/DataTable/DataTable.js +64 -29
  15. package/components/DataTable/tableContext.d.ts +2 -0
  16. package/components/Dropdown/Dropdown.d.ts +4 -4
  17. package/components/Dropdown/Dropdown.js +1 -0
  18. package/components/EventCalendar/EventCalendar.css +3 -1
  19. package/components/LegendTile/LegendTile.css +10 -3
  20. package/components/LegendTile/LegendTile.d.ts +1 -1
  21. package/components/LegendTile/LegendTile.js +1 -1
  22. package/components/PinInput/PinInput.d.ts +6 -0
  23. package/components/PinInput/PinInput.js +38 -34
  24. package/components/RadioButton/RadioButton.css +4 -1
  25. package/components/RadioButton/RadioButton.d.ts +10 -12
  26. package/components/RadioButton/RadioButton.js +8 -6
  27. package/components/Reasoning/Reasoning.css +14 -0
  28. package/components/RichDropdown/RichDropdown.d.ts +4 -5
  29. package/components/RichDropdown/RichDropdown.js +1 -0
  30. package/components/SegmentedControl/SegmentedControl.css +37 -0
  31. package/components/SegmentedControl/SegmentedControl.d.ts +16 -2
  32. package/components/SegmentedControl/SegmentedControl.js +41 -4
  33. package/components/SelectionCard/SelectionCard.d.ts +7 -1
  34. package/components/SelectionCard/SelectionCard.js +2 -1
  35. package/components/Stat/Stat.css +2 -2
  36. package/components/TableToolbar/TableToolbar.css +13 -3
  37. package/components/TableToolbar/TableToolbar.d.ts +1 -0
  38. package/components/TableToolbar/TableToolbar.js +18 -4
  39. package/components/Tabs/Tabs.d.ts +2 -0
  40. package/components/Tabs/Tabs.js +1 -0
  41. package/components/TagInput/TagInput.d.ts +7 -0
  42. package/components/TagInput/TagInput.js +5 -3
  43. package/components/ThemeToggle/ThemeToggle.css +3 -25
  44. package/components/ThemeToggle/ThemeToggle.js +8 -20
  45. package/components/TimePicker/TimePicker.d.ts +6 -0
  46. package/components/TimePicker/TimePicker.js +4 -0
  47. package/components/Timeline/Timeline.css +7 -2
  48. package/components/Timeline/Timeline.d.ts +4 -4
  49. package/components/ToggleSwitch/ToggleSwitch.d.ts +8 -0
  50. package/components/ToggleSwitch/ToggleSwitch.js +6 -1
  51. package/components/ToolCall/ToolCall.css +11 -3
  52. package/components/TypographySwatch/TypographySwatch.css +3 -1
  53. package/components/WorldMap/WorldMap.d.ts +1 -1
  54. package/components/WorldMap/WorldMap.js +1 -1
  55. package/components/registry.json +1 -1
  56. package/components/registry.json.d.ts +1 -1
  57. package/components/registry.json.js +1 -1
  58. package/package.json +5 -1
  59. package/tokens/motion.d.ts +2 -0
  60. package/tokens/motion.js +2 -0
  61. package/tokens/presets/contrast.css +8 -8
  62. package/tokens/presets/forest.css +10 -8
  63. package/tokens/presets/gold.css +12 -10
  64. package/tokens/presets/marquee.css +9 -9
  65. package/tokens/presets/pink.css +8 -8
  66. package/tokens/presets/terminal.css +8 -8
  67. package/tokens/presets/violet.css +8 -8
  68. package/tokens/presets/warm.css +8 -8
  69. package/tokens/presets/zest.css +8 -8
  70. package/tokens/registry.json +2 -0
  71. package/tokens/registry.json.d.ts +2 -0
  72. package/tokens/registry.json.js +1 -1
  73. package/tokens/tokens-dark.css +4 -0
  74. package/tokens/tokens-light.css +8 -4
  75. package/tokens/values.d.ts +34 -0
  76. package/tokens/values.js +11 -0
  77. package/tokens/values.json.js +8 -0
package/README.md CHANGED
@@ -9,7 +9,7 @@
9
9
  <!-- npm-badge:end -->
10
10
  [![license: MIT](https://img.shields.io/badge/license-MIT-4c1)](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("nav", { "aria-label": "App navigation", ...rest, ref: setDrawerRef, id: drawerId, className: classes, children: [
257
- /* @__PURE__ */ jsxs("div", { className: `${baseClass}__top`, children: [
258
- /* @__PURE__ */ jsxs("div", { className: `${baseClass}__logo`, children: [
259
- /* @__PURE__ */ jsxs(
260
- "div",
261
- {
262
- className: `${baseClass}__logo-inner`,
263
- onClick: !isExpanded ? toggleExpanded : void 0,
264
- role: !isExpanded ? "button" : void 0,
265
- tabIndex: !isExpanded ? 0 : void 0,
266
- "aria-label": !isExpanded ? expandLabel : void 0,
267
- onKeyDown: !isExpanded ? (e) => {
268
- if (e.key === "Enter" || e.key === " ") {
269
- e.preventDefault();
270
- toggleExpanded();
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
- } : void 0,
273
- style: !isExpanded ? { cursor: "pointer" } : void 0,
274
- children: [
275
- /* @__PURE__ */ jsx("span", { className: `${baseClass}__logo-icon`, children: logo || /* @__PURE__ */ jsx(DefaultLogo, {}) }),
276
- /* @__PURE__ */ jsx("span", { className: `${baseClass}__logo-text`, children: logoText })
277
- ]
278
- }
279
- ),
280
- /* @__PURE__ */ jsx(
281
- "button",
282
- {
283
- className: `${baseClass}__toggle`,
284
- onClick: mobileOpen ? closeMobile : toggleExpanded,
285
- "aria-label": mobileOpen ? closeLabel : isExpanded ? collapseLabel : expandLabel,
286
- children: /* @__PURE__ */ jsx("span", { className: "material-symbols-rounded ds-mirror-rtl", children: mobileOpen ? "close" : isExpanded ? "left_panel_close" : "left_panel_open" })
287
- }
288
- )
289
- ] }),
290
- topSlot && /* @__PURE__ */ jsx("div", { className: `${baseClass}__top-slot`, children: topSlot }),
291
- mobileOpen && drilled && panelSource ? /* @__PURE__ */ jsx(
292
- SidebarPanel,
293
- {
294
- linkComponent: Link,
295
- className: `${baseClass}__drill`,
296
- items: panelSource.items,
297
- title: panelSource.label,
298
- activeKey: activeTertiaryKey ?? activeSubKey,
299
- onBack: () => {
300
- focusAfterDrill.current = "out";
301
- setDrilled(false);
302
- },
303
- backLabel: panelSource.parentLabel ?? menuLabel
304
- },
305
- panelSourceKey
306
- ) : /* @__PURE__ */ jsx("div", { className: `${baseClass}__sections`, children: sections.map((section, si) => /* @__PURE__ */ jsxs("div", { className: `${baseClass}__nav`, children: [
307
- section.category && /* @__PURE__ */ jsx("div", { className: `${baseClass}__category`, children: section.category }),
308
- section.items.map((item) => {
309
- const hasChildren = item.children && item.children.length > 0;
310
- const isOpen = openKeys.has(item.key);
311
- const feedsPanel = isPanelMode && hasChildren;
312
- const isSource = feedsPanel && item.key === panelSourceKey;
313
- const isActive = isPanelMode && panelVisible ? isSource : activeKey === item.key;
314
- const isLink = Boolean(item.href) && !hasChildren;
315
- const itemClasses = [
316
- `${baseClass}__btn`,
317
- isActive ? `${baseClass}__btn--active` : ""
318
- ].filter(Boolean).join(" ");
319
- const itemContent = /* @__PURE__ */ jsxs(Fragment, { children: [
320
- /* @__PURE__ */ jsxs("span", { className: `${baseClass}__btn-left`, children: [
321
- /* @__PURE__ */ jsxs("span", { className: `${baseClass}__btn-seat`, children: [
322
- 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(
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: `${baseClass}__btn-icon${typeof item.icon === "string" ? ` material-symbols-rounded ${mirrorClass(item.icon)}` : ""}`,
326
- children: item.icon
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
- item.badge !== void 0 && isCount(item.badge) && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-corner-badge`, "aria-hidden": "true", children: item.badge })
330
- ] }),
331
- /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-label`, children: item.label })
332
- ] }),
333
- isPanelMode && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-caption`, "aria-hidden": "true", children: item.label }),
334
- item.badge !== void 0 && /* @__PURE__ */ jsx("span", { className: `${baseClass}__btn-badge${isCount(item.badge) ? ` ${baseClass}__btn-badge--count` : ""}`, children: item.badge }),
335
- hasChildren && /* @__PURE__ */ jsx(
336
- "span",
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
- `${baseClass}__btn-chevron material-symbols-rounded ds-mirror-rtl`,
340
- isOpen && !isPanelMode ? `${baseClass}__btn-chevron--open` : ""
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
- return /* @__PURE__ */ jsxs(React.Fragment, { children: [
347
- isLink && item.href ? /* @__PURE__ */ jsx(
348
- Link,
349
- {
350
- className: itemClasses,
351
- href: item.href,
352
- onClick: () => item.onClick?.(),
353
- "aria-current": isActive ? "page" : void 0,
354
- title: !isExpanded ? item.label : void 0,
355
- children: itemContent
356
- }
357
- ) : /* @__PURE__ */ jsx(
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
- type: "button",
361
- className: itemClasses,
362
- onClick: () => {
363
- if (feedsPanel) {
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
- /* @__PURE__ */ jsx(
473
- "button",
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
  {
@@ -188,7 +188,10 @@
188
188
  gap: var(--gap-200); /* 8px */
189
189
  }
190
190
 
191
+ /* A row that runs out of room wraps, at the vertical layout's own gap,
192
+ rather than running past its container on a phone. */
191
193
  .ds-checkbox-group--horizontal .ds-checkbox-group__items {
192
194
  flex-direction: row;
193
- gap: var(--gap-500); /* 20px */
195
+ flex-wrap: wrap;
196
+ gap: var(--gap-200) var(--gap-500); /* 8px rows, 20px between options */
194
197
  }