@acronis-platform/ui-react 4.1.0 → 5.1.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 (79) hide show
  1. package/dist/components/ui/area-chart/area-chart.js +191 -85
  2. package/dist/components/ui/area-chart/area-chart.js.map +1 -1
  3. package/dist/components/ui/bar-chart/bar-chart.js +288 -225
  4. package/dist/components/ui/bar-chart/bar-chart.js.map +1 -1
  5. package/dist/components/ui/card-widget-carousel/card-widget-carousel.js +85 -0
  6. package/dist/components/ui/card-widget-carousel/card-widget-carousel.js.map +1 -0
  7. package/dist/components/ui/card-widget-carousel/card-widget.js +82 -0
  8. package/dist/components/ui/card-widget-carousel/card-widget.js.map +1 -0
  9. package/dist/components/ui/category-bar/category-bar.js.map +1 -1
  10. package/dist/components/ui/chart/chart-format.js +25 -22
  11. package/dist/components/ui/chart/chart-format.js.map +1 -1
  12. package/dist/components/ui/chart/chart-palette.js +9 -8
  13. package/dist/components/ui/chart/chart-palette.js.map +1 -1
  14. package/dist/components/ui/chart/chart.js +127 -89
  15. package/dist/components/ui/chart/chart.js.map +1 -1
  16. package/dist/components/ui/funnel-chart/funnel-chart.js +189 -113
  17. package/dist/components/ui/funnel-chart/funnel-chart.js.map +1 -1
  18. package/dist/components/ui/input-select/input-select.js +18 -9
  19. package/dist/components/ui/input-select/input-select.js.map +1 -1
  20. package/dist/components/ui/line-chart/line-chart.js +194 -86
  21. package/dist/components/ui/line-chart/line-chart.js.map +1 -1
  22. package/dist/components/ui/radar-chart/radar-chart.js +76 -66
  23. package/dist/components/ui/radar-chart/radar-chart.js.map +1 -1
  24. package/dist/components/ui/scatter-chart/scatter-chart.js +5 -2
  25. package/dist/components/ui/scatter-chart/scatter-chart.js.map +1 -1
  26. package/dist/components/ui/separator/separator.js +52 -10
  27. package/dist/components/ui/separator/separator.js.map +1 -1
  28. package/dist/components/ui/sidebar-secondary/sidebar-secondary.js +144 -121
  29. package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
  30. package/dist/components/ui/tree-item/tree-item.js +67 -0
  31. package/dist/components/ui/tree-item/tree-item.js.map +1 -0
  32. package/dist/components/ui/treemap/treemap.js +73 -66
  33. package/dist/components/ui/treemap/treemap.js.map +1 -1
  34. package/dist/index.js +109 -107
  35. package/dist/llms/area-chart.md +2 -1
  36. package/dist/llms/bar-chart.md +132 -33
  37. package/dist/llms/card-widget-carousel.md +252 -0
  38. package/dist/llms/category-bar.md +2 -2
  39. package/dist/llms/funnel-chart.md +269 -101
  40. package/dist/llms/input-select.md +175 -1
  41. package/dist/llms/line-chart.md +2 -1
  42. package/dist/llms/metric.md +10 -5
  43. package/dist/llms/radar-chart.md +15 -5
  44. package/dist/llms/scatter-chart.md +2 -1
  45. package/dist/llms/separator.md +27 -8
  46. package/dist/llms/sidebar-secondary.md +235 -4
  47. package/dist/llms/tree-item.md +359 -0
  48. package/dist/llms/treemap.md +47 -36
  49. package/dist/llms.txt +5 -4
  50. package/dist/react.js +109 -107
  51. package/dist/src/components/ui/area-chart/area-chart.d.ts +10 -0
  52. package/dist/src/components/ui/bar-chart/bar-chart.d.ts +75 -10
  53. package/dist/src/components/ui/bar-chart/bar-chart.docs.d.ts +146 -0
  54. package/dist/src/components/ui/bar-chart/index.d.ts +1 -1
  55. package/dist/src/components/ui/card-widget-carousel/card-widget-carousel.d.ts +9 -0
  56. package/dist/src/components/ui/card-widget-carousel/card-widget.d.ts +43 -0
  57. package/dist/src/components/ui/card-widget-carousel/index.d.ts +2 -0
  58. package/dist/src/components/ui/chart/chart-format.d.ts +9 -1
  59. package/dist/src/components/ui/chart/chart-palette.d.ts +38 -10
  60. package/dist/src/components/ui/chart/chart.d.ts +8 -1
  61. package/dist/src/components/ui/chart/index.d.ts +2 -2
  62. package/dist/src/components/ui/funnel-chart/funnel-chart.d.ts +92 -26
  63. package/dist/src/components/ui/funnel-chart/index.d.ts +1 -1
  64. package/dist/src/components/ui/input-select/input-select.d.ts +34 -2
  65. package/dist/src/components/ui/line-chart/line-chart.d.ts +11 -1
  66. package/dist/src/components/ui/radar-chart/radar-chart.d.ts +42 -9
  67. package/dist/src/components/ui/separator/separator.d.ts +9 -1
  68. package/dist/src/components/ui/sidebar-secondary/sidebar-secondary.d.ts +23 -3
  69. package/dist/src/components/ui/tree-item/index.d.ts +1 -0
  70. package/dist/src/components/ui/tree-item/tree-item.d.ts +64 -0
  71. package/dist/src/components/ui/treemap/treemap.d.ts +16 -5
  72. package/dist/src/index.d.ts +2 -1
  73. package/dist/ui-react.css +1 -1
  74. package/package.json +1 -1
  75. package/dist/components/ui/meter/meter.js +0 -79
  76. package/dist/components/ui/meter/meter.js.map +0 -1
  77. package/dist/llms/meter.md +0 -177
  78. package/dist/src/components/ui/meter/index.d.ts +0 -1
  79. package/dist/src/components/ui/meter/meter.d.ts +0 -25
@@ -1,16 +1,58 @@
1
1
  import { cn as e } from "../../../lib/utils.js";
2
- import * as t from "react";
3
- import { jsx as n } from "react/jsx-runtime";
4
- import { Separator as r } from "@base-ui/react/separator";
2
+ import { cva as t } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
3
+ import * as n from "react";
4
+ import { jsx as r } from "react/jsx-runtime";
5
+ import { Separator as i } from "@base-ui/react/separator";
5
6
  //#region src/components/ui/separator/separator.tsx
6
- var i = t.forwardRef(({ className: t, orientation: i = "horizontal", ...a }, o) => /* @__PURE__ */ n(r, {
7
- ref: o,
8
- orientation: i,
9
- className: e("shrink-0 bg-border", i === "horizontal" ? "h-px w-full" : "h-full w-px", t),
10
- ...a
7
+ var a = t("shrink-0 bg-[var(--ui-border-on-surface-divider)]", {
8
+ variants: {
9
+ orientation: {
10
+ horizontal: "h-px w-full",
11
+ vertical: "h-full w-px"
12
+ },
13
+ size: {
14
+ S1: "",
15
+ S2: "",
16
+ S3: ""
17
+ }
18
+ },
19
+ compoundVariants: [
20
+ {
21
+ orientation: "horizontal",
22
+ size: "S2",
23
+ class: "my-[var(--ui-gap-4)]"
24
+ },
25
+ {
26
+ orientation: "horizontal",
27
+ size: "S3",
28
+ class: "my-[var(--ui-gap-8)]"
29
+ },
30
+ {
31
+ orientation: "vertical",
32
+ size: "S2",
33
+ class: "mx-[var(--ui-gap-4)]"
34
+ },
35
+ {
36
+ orientation: "vertical",
37
+ size: "S3",
38
+ class: "mx-[var(--ui-gap-8)]"
39
+ }
40
+ ],
41
+ defaultVariants: {
42
+ orientation: "horizontal",
43
+ size: "S1"
44
+ }
45
+ }), o = n.forwardRef(({ className: t, orientation: n = "horizontal", size: o = "S1", ...s }, c) => /* @__PURE__ */ r(i, {
46
+ ref: c,
47
+ orientation: n,
48
+ className: e(a({
49
+ orientation: n,
50
+ size: o
51
+ }), t),
52
+ ...s
11
53
  }));
12
- i.displayName = "Separator";
54
+ o.displayName = "Separator";
13
55
  //#endregion
14
- export { i as Separator };
56
+ export { o as Separator };
15
57
 
16
58
  //# sourceMappingURL=separator.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"separator.js","names":[],"sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `separator`\n// (packages/ui-legacy/src/components/ui/separator.tsx). A thin divider built on\n// the Base UI Separator primitive (sets the `separator` role + aria-orientation).\n// No `--ui-separator-*` tier; the line uses the shared divider token `bg-border`\n// (--ui-border-on-surface-border), replacing the legacy `bg-primary/10` hack.\n\nconst Separator = React.forwardRef<\n React.ElementRef<typeof SeparatorPrimitive>,\n React.ComponentPropsWithoutRef<typeof SeparatorPrimitive>\n>(({ className, orientation = 'horizontal', ...props }, ref) => (\n <SeparatorPrimitive\n ref={ref}\n orientation={orientation}\n className={cn(\n 'shrink-0 bg-border',\n orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',\n className\n )}\n {...props}\n />\n));\nSeparator.displayName = 'Separator';\n\nexport { Separator };\n"],"mappings":";;;;;AAWA,IAAM,IAAY,EAAM,YAGrB,EAAE,cAAW,iBAAc,cAAc,GAAG,KAAS,MACtD,kBAAC,GAAD;CACO;CACQ;CACb,WAAW,EACT,sBACA,MAAgB,eAAe,gBAAgB,eAC/C,CACF;CACA,GAAI;AACL,CAAA,CACF;AACD,EAAU,cAAc"}
1
+ {"version":3,"file":"separator.js","names":[],"sources":["../../../../src/components/ui/separator/separator.tsx"],"sourcesContent":["import * as React from 'react';\nimport { Separator as SeparatorPrimitive } from '@base-ui/react/separator';\nimport { cva, type VariantProps } from 'class-variance-authority';\n\nimport { cn } from '@/lib/utils';\n\n// Ported from `@acronis-platform/shadcn-uikit`'s `separator`\n// (packages/ui-legacy/src/components/ui/separator.tsx). A thin divider built on\n// the Base UI Separator primitive (sets the `separator` role + aria-orientation).\n// No `--ui-separator-*` tier; the line uses the shared divider token\n// `--ui-border-on-surface-divider` directly, matching every other divider\n// consumer in this package (Card, Wizard, Section, ...) rather than the\n// `bg-border` bridge (`--ui-border-on-surface-border`), a distinct semantic role\n// that happens to share the same value today.\n// `size` (Figma: S1/S2/S3) is the surrounding spacing Figma bakes into the\n// component itself; S1 (default) has none.\n\nconst separatorVariants = cva('shrink-0 bg-[var(--ui-border-on-surface-divider)]', {\n variants: {\n orientation: {\n horizontal: 'h-px w-full',\n vertical: 'h-full w-px',\n },\n size: {\n S1: '',\n S2: '',\n S3: '',\n },\n },\n compoundVariants: [\n { orientation: 'horizontal', size: 'S2', class: 'my-[var(--ui-gap-4)]' },\n { orientation: 'horizontal', size: 'S3', class: 'my-[var(--ui-gap-8)]' },\n { orientation: 'vertical', size: 'S2', class: 'mx-[var(--ui-gap-4)]' },\n { orientation: 'vertical', size: 'S3', class: 'mx-[var(--ui-gap-8)]' },\n ],\n defaultVariants: {\n orientation: 'horizontal',\n size: 'S1',\n },\n});\n\ninterface SeparatorProps\n extends React.ComponentPropsWithoutRef<typeof SeparatorPrimitive>,\n Pick<VariantProps<typeof separatorVariants>, 'size'> {}\n\nconst Separator = React.forwardRef<React.ElementRef<typeof SeparatorPrimitive>, SeparatorProps>(\n ({ className, orientation = 'horizontal', size = 'S1', ...props }, ref) => (\n <SeparatorPrimitive\n ref={ref}\n orientation={orientation}\n className={cn(separatorVariants({ orientation, size }), className)}\n {...props}\n />\n )\n);\nSeparator.displayName = 'Separator';\n\nexport { Separator };\n"],"mappings":";;;;;;AAiBA,IAAM,IAAoB,EAAI,qDAAqD;CACjF,UAAU;EACR,aAAa;GACX,YAAY;GACZ,UAAU;EACZ;EACA,MAAM;GACJ,IAAI;GACJ,IAAI;GACJ,IAAI;EACN;CACF;CACA,kBAAkB;EAChB;GAAE,aAAa;GAAc,MAAM;GAAM,OAAO;EAAuB;EACvE;GAAE,aAAa;GAAc,MAAM;GAAM,OAAO;EAAuB;EACvE;GAAE,aAAa;GAAY,MAAM;GAAM,OAAO;EAAuB;EACrE;GAAE,aAAa;GAAY,MAAM;GAAM,OAAO;EAAuB;CACvE;CACA,iBAAiB;EACf,aAAa;EACb,MAAM;CACR;AACF,CAAC,GAMK,IAAY,EAAM,YACrB,EAAE,cAAW,iBAAc,cAAc,UAAO,MAAM,GAAG,KAAS,MACjE,kBAAC,GAAD;CACO;CACQ;CACb,WAAW,EAAG,EAAkB;EAAE;EAAa;CAAK,CAAC,GAAG,CAAS;CACjE,GAAI;AACL,CAAA,CAEL;AACA,EAAU,cAAc"}
@@ -42,6 +42,18 @@ var g = 256, _ = g * 2, v = /* @__PURE__ */ l(s, { children: [
42
42
  }),
43
43
  " Double click"
44
44
  ] }), y = /* @__PURE__ */ l(s, { children: [
45
+ /* @__PURE__ */ c("span", {
46
+ className: "font-semibold",
47
+ children: "Resize:"
48
+ }),
49
+ " Drag",
50
+ /* @__PURE__ */ c("br", {}),
51
+ /* @__PURE__ */ c("span", {
52
+ className: "font-semibold",
53
+ children: "Reset size:"
54
+ }),
55
+ " Double click"
56
+ ] }), b = /* @__PURE__ */ l(s, { children: [
45
57
  /* @__PURE__ */ c("span", {
46
58
  className: "font-semibold",
47
59
  children: "Resize:"
@@ -53,11 +65,15 @@ var g = 256, _ = g * 2, v = /* @__PURE__ */ l(s, { children: [
53
65
  children: "Expand:"
54
66
  }),
55
67
  " Click"
56
- ] }), b = o.createContext(null);
57
- function x() {
58
- return o.useContext(b) ?? {
68
+ ] }), x = /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c("span", {
69
+ className: "font-semibold",
70
+ children: "Reset size:"
71
+ }), " Double click"] }), S = o.createContext(null);
72
+ function C() {
73
+ return o.useContext(S) ?? {
59
74
  expanded: !0,
60
75
  toggleExpanded: () => {},
76
+ collapsible: !0,
61
77
  resizable: !1,
62
78
  width: g,
63
79
  setWidth: () => {},
@@ -70,25 +86,25 @@ function x() {
70
86
  setSelectedLabel: () => {},
71
87
  resizeAriaLabel: "Resize sidebar",
72
88
  resizeTooltipExpanded: v,
73
- resizeTooltipCollapsed: y
89
+ resizeTooltipCollapsed: b
74
90
  };
75
91
  }
76
- function S(e, t, n) {
92
+ function w(e, t, n) {
77
93
  let [r, i] = o.useState(t), a = e !== void 0;
78
94
  return [a ? e : r, o.useCallback((e) => {
79
95
  a || i(e), n?.(e);
80
96
  }, [a, n])];
81
97
  }
82
- function C() {
83
- let t = x(), { expanded: s, toggleExpanded: u, resizable: d } = t, f = n(), p = o.useRef(t);
84
- p.current = t;
85
- let m = o.useRef(!1), [h, g] = o.useState(!1), [_, v] = o.useState(!1), y = o.useRef(null);
98
+ function T() {
99
+ let t = C(), { expanded: s, toggleExpanded: u, resizable: d, collapsible: f } = t, p = n(), m = o.useRef(t);
100
+ m.current = t;
101
+ let h = o.useRef(!1), [g, _] = o.useState(!1), [v, y] = o.useState(!1), b = o.useRef(null);
86
102
  return o.useEffect(() => () => {
87
- y.current && clearTimeout(y.current);
103
+ b.current && clearTimeout(b.current);
88
104
  }, []), d ? /* @__PURE__ */ l(r, {
89
- open: h,
105
+ open: g,
90
106
  onOpenChange: (e) => {
91
- _ || g(e);
107
+ v || _(e);
92
108
  },
93
109
  trackCursorAxis: "y",
94
110
  children: [/* @__PURE__ */ c(a, { render: /* @__PURE__ */ c("div", {
@@ -98,103 +114,109 @@ function C() {
98
114
  className: e("absolute end-0 top-0 h-full w-[17px] ltr:translate-x-1/2 rtl:-translate-x-1/2 cursor-[var(--ui-resizable-cursor,ew-resize)] z-10", "after:absolute after:inset-y-0 after:inset-x-0 after:mx-auto after:w-0 after:pointer-events-none", "after:[border-inline-start-width:var(--ui-resizable-border-width,1px)] after:border-solid after:border-transparent", "focus-visible:outline-none focus-visible:after:[border-inline-start-color:var(--ui-resizable-border-color-active)] focus-visible:after:[box-shadow:0_0_0_3px_var(--ui-focus-primary)]"),
99
115
  tabIndex: 0,
100
116
  onKeyDown: (e) => {
101
- let { minWidth: t, maxWidth: n, defaultWidth: r, width: i, setWidth: a, expanded: o, toggleExpanded: s } = p.current, c = f === "rtl" ? "ArrowLeft" : "ArrowRight", l = f === "rtl" ? "ArrowRight" : "ArrowLeft";
102
- if (e.key === c && o) e.preventDefault(), a(Math.min(i + 16, n));
103
- else if (e.key === c && !o) e.preventDefault(), s();
104
- else if (e.key === l && o) {
117
+ let { minWidth: t, maxWidth: n, defaultWidth: r, width: i, setWidth: a, expanded: o, toggleExpanded: s, collapsible: c } = m.current, l = p === "rtl" ? "ArrowLeft" : "ArrowRight", u = p === "rtl" ? "ArrowRight" : "ArrowLeft";
118
+ if (e.key === l && o) e.preventDefault(), a(Math.min(i + 16, n));
119
+ else if (e.key === l && !o) e.preventDefault(), c && s();
120
+ else if (e.key === u && o) {
105
121
  e.preventDefault();
106
122
  let n = i - 16;
107
- n < t ? s() : a(n);
108
- } else e.key === "Enter" || e.key === " " ? (e.preventDefault(), s()) : e.key === "Home" && (e.preventDefault(), o || s(), a(r));
123
+ n < t ? c ? s() : a(t) : a(n);
124
+ } else e.key === "Enter" || e.key === " " ? (e.preventDefault(), c && s()) : e.key === "Home" && (e.preventDefault(), !o && c && s(), a(r));
109
125
  },
110
126
  onPointerDown: (e) => {
111
127
  e.preventDefault();
112
128
  let t = e.currentTarget;
113
- t.setPointerCapture(e.pointerId), m.current = !1, v(!0), g(!1);
129
+ t.setPointerCapture(e.pointerId), h.current = !1, y(!0), _(!1);
114
130
  let n = t.closest("[data-state]");
115
131
  if (!n) {
116
- v(!1), t.releasePointerCapture(e.pointerId);
132
+ y(!1), t.releasePointerCapture(e.pointerId);
117
133
  return;
118
134
  }
119
135
  n.style.transitionProperty = "none";
120
- let r = getComputedStyle(n).direction === "rtl", i = n.getBoundingClientRect(), { minWidth: a, maxWidth: o } = p.current, s = a / 2, c = (e) => {
121
- m.current = !0;
122
- let t = r ? i.right - e.clientX : e.clientX - i.left, { expanded: n } = p.current;
123
- n ? t < s ? p.current.toggleExpanded() : p.current.setWidth(Math.min(Math.max(t, a), o)) : t > s && p.current.toggleExpanded();
136
+ let r = getComputedStyle(n).direction === "rtl", i = n.getBoundingClientRect(), { minWidth: a, maxWidth: o } = m.current, s = a / 2, c = (e) => {
137
+ h.current = !0;
138
+ let t = r ? i.right - e.clientX : e.clientX - i.left, { expanded: n, collapsible: c } = m.current;
139
+ n ? t < s && c ? m.current.toggleExpanded() : m.current.setWidth(Math.min(Math.max(t, a), o)) : t > s && c && m.current.toggleExpanded();
124
140
  }, l = () => {
125
- v(!1), n && (n.style.transitionProperty = ""), window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l);
141
+ y(!1), n && (n.style.transitionProperty = ""), window.removeEventListener("pointermove", c), window.removeEventListener("pointerup", l);
126
142
  };
127
143
  window.addEventListener("pointermove", c), window.addEventListener("pointerup", l);
128
144
  },
129
145
  onClick: () => {
130
- m.current || (y.current && clearTimeout(y.current), y.current = setTimeout(() => {
131
- u();
132
- }, 250));
146
+ f && (h.current || (b.current && clearTimeout(b.current), b.current = setTimeout(() => {
147
+ m.current.collapsible && m.current.toggleExpanded();
148
+ }, 250)));
133
149
  },
134
150
  onDoubleClick: () => {
135
- y.current &&= (clearTimeout(y.current), null), s || u(), p.current.setWidth(p.current.defaultWidth);
151
+ b.current &&= (clearTimeout(b.current), null), !s && f && u(), m.current.setWidth(m.current.defaultWidth);
136
152
  }
137
153
  }) }), (s ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed) != null && /* @__PURE__ */ c(i, {
138
- side: f === "rtl" ? "left" : "right",
154
+ side: p === "rtl" ? "left" : "right",
139
155
  align: "center",
140
156
  children: s ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed
141
157
  })]
142
158
  }) : null;
143
159
  }
144
- var w = o.forwardRef(({ className: t, expanded: n, defaultExpanded: r = !0, onExpandedChange: i, resizable: a = !0, width: u, onWidthChange: d, resizeAriaLabel: f = "Resize sidebar", resizeTooltipExpanded: h = v, resizeTooltipCollapsed: x = y, "aria-label": w = "Section navigation", render: T, children: E, ...O }, k) => {
145
- let [A, j] = S(n, r, i), [M, N] = o.useState(g), P = u !== void 0, F = P ? u : M, I = o.useCallback((e) => {
146
- P || N(e), d?.(e);
147
- }, [P, d]), [L, R] = o.useState(void 0), [z, B] = o.useState(void 0), V = o.useMemo(() => ({
148
- expanded: A,
149
- toggleExpanded: () => j(!A),
150
- resizable: a,
151
- width: F,
152
- setWidth: I,
160
+ var E = o.forwardRef(({ className: t, expanded: n, defaultExpanded: r = !0, onExpandedChange: i, collapsible: a = !0, resizable: u = !0, width: d, onWidthChange: f, resizeAriaLabel: h = "Resize sidebar", resizeTooltipExpanded: C = a ? v : y, resizeTooltipCollapsed: E = a ? b : x, "aria-label": D = "Section navigation", render: O, children: A, ...j }, M) => {
161
+ let [N, P] = w(n, r, i), [F, I] = o.useState(g), L = d !== void 0, R = L ? d : F, z = o.useCallback((e) => {
162
+ e !== R && (L || I(e), f?.(e));
163
+ }, [
164
+ L,
165
+ f,
166
+ R
167
+ ]), [B, V] = o.useState(void 0), [H, U] = o.useState(void 0), W = o.useMemo(() => ({
168
+ expanded: N,
169
+ toggleExpanded: () => P(!N),
170
+ collapsible: a,
171
+ resizable: u,
172
+ width: R,
173
+ setWidth: z,
153
174
  minWidth: g,
154
175
  maxWidth: _,
155
176
  defaultWidth: g,
156
- headerLabel: L,
157
- setHeaderLabel: R,
158
- selectedLabel: z,
159
- setSelectedLabel: B,
160
- resizeAriaLabel: f,
161
- resizeTooltipExpanded: h,
162
- resizeTooltipCollapsed: x
177
+ headerLabel: B,
178
+ setHeaderLabel: V,
179
+ selectedLabel: H,
180
+ setSelectedLabel: U,
181
+ resizeAriaLabel: h,
182
+ resizeTooltipExpanded: C,
183
+ resizeTooltipCollapsed: E
163
184
  }), [
164
- A,
165
- j,
185
+ N,
186
+ P,
166
187
  a,
167
- F,
168
- I,
169
- L,
188
+ u,
189
+ R,
170
190
  z,
171
- f,
191
+ B,
192
+ H,
172
193
  h,
173
- x
174
- ]), H = p({
175
- render: T,
176
- ref: k,
194
+ C,
195
+ E
196
+ ]), G = p({
197
+ render: O,
198
+ ref: M,
177
199
  defaultTagName: "nav",
178
200
  props: m({
179
- "aria-label": w,
180
- "data-state": A ? "expanded" : "collapsed",
181
- style: a && A && (P || F !== g) ? { width: F } : void 0,
182
- className: e("group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]", a && "transition-[width,border-color] has-[[role=separator]:hover]:[border-inline-end-color:var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:[border-inline-end-color:var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:[border-inline-end-color:var(--ui-resizable-border-color-active)]", t),
201
+ "aria-label": D,
202
+ "data-state": N ? "expanded" : "collapsed",
203
+ style: u && N && (L || R !== g) ? { width: R } : void 0,
204
+ className: e("group/sidebar relative flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-e border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-inline-end-width:var(--ui-sidebar-secondary-global-container-border-width)] w-[var(--ui-sidebar-secondary-collapsed-container-width)] data-[state=expanded]:w-[var(--ui-sidebar-secondary-expanded-container-width)] transition-[width]", u && "transition-[width,border-color] has-[[role=separator]:hover]:[border-inline-end-color:var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:[border-inline-end-color:var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:[border-inline-end-color:var(--ui-resizable-border-color-active)]", t),
183
205
  children: /* @__PURE__ */ l(s, { children: [
184
- /* @__PURE__ */ c(D, {}),
185
- E,
186
- /* @__PURE__ */ c(C, {})
206
+ /* @__PURE__ */ c(k, {}),
207
+ A,
208
+ /* @__PURE__ */ c(T, {})
187
209
  ] })
188
- }, O)
210
+ }, j)
189
211
  });
190
- return /* @__PURE__ */ c(b.Provider, {
191
- value: V,
192
- children: H
212
+ return /* @__PURE__ */ c(S.Provider, {
213
+ value: W,
214
+ children: G
193
215
  });
194
216
  });
195
- w.displayName = "SidebarSecondary";
196
- var T = o.forwardRef(({ className: t, label: n, children: r, ...i }, a) => {
197
- let { setHeaderLabel: s } = x(), l = n ?? r;
217
+ E.displayName = "SidebarSecondary";
218
+ var D = o.forwardRef(({ className: t, label: n, children: r, ...i }, a) => {
219
+ let { setHeaderLabel: s } = C(), l = n ?? r;
198
220
  return o.useEffect(() => {
199
221
  s(l);
200
222
  }, [l, s]), /* @__PURE__ */ c("div", {
@@ -207,15 +229,15 @@ var T = o.forwardRef(({ className: t, label: n, children: r, ...i }, a) => {
207
229
  })
208
230
  });
209
231
  });
210
- T.displayName = "SidebarSecondaryHeader";
211
- var E = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
232
+ D.displayName = "SidebarSecondaryHeader";
233
+ var O = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
212
234
  ref: r,
213
235
  className: e("flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]", "hidden group-data-[state=expanded]/sidebar:flex", t),
214
236
  ...n
215
237
  }));
216
- E.displayName = "SidebarSecondaryContent";
217
- var D = o.forwardRef(({ className: t, parentLabel: n, currentLabel: r, separator: i, ...a }, o) => {
218
- let { headerLabel: s, selectedLabel: d } = x(), f = n ?? s, p = r ?? d;
238
+ O.displayName = "SidebarSecondaryContent";
239
+ var k = o.forwardRef(({ className: t, parentLabel: n, currentLabel: r, separator: i, ...a }, o) => {
240
+ let { headerLabel: s, selectedLabel: d } = C(), f = n ?? s, p = r ?? d;
219
241
  return /* @__PURE__ */ l("div", {
220
242
  ref: o,
221
243
  className: e("flex flex-1 flex-col items-center min-h-0", "gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]", "flex group-data-[state=expanded]/sidebar:hidden", t),
@@ -237,17 +259,17 @@ var D = o.forwardRef(({ className: t, parentLabel: n, currentLabel: r, separator
237
259
  ]
238
260
  });
239
261
  });
240
- D.displayName = "SidebarSecondaryCollapsedBreadcrumb";
241
- var O = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
262
+ k.displayName = "SidebarSecondaryCollapsedBreadcrumb";
263
+ var A = o.forwardRef(({ className: t, ...n }, r) => /* @__PURE__ */ c("div", {
242
264
  ref: r,
243
265
  className: e("flex flex-col shrink-0", "border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]", "py-[var(--ui-sidebar-secondary-section-container-padding-y)]", t),
244
266
  ...n
245
267
  }));
246
- O.displayName = "SidebarSecondaryFooter";
247
- var k = o.createContext({ expandable: !1 }), A = { expandable: !1 }, j = { expandable: !0 }, M = o.forwardRef(({ className: t, expandable: n = !1, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, ...s }, l) => {
268
+ A.displayName = "SidebarSecondaryFooter";
269
+ var j = o.createContext({ expandable: !1 }), M = { expandable: !1 }, N = { expandable: !0 }, P = o.forwardRef(({ className: t, expandable: n = !1, open: r, defaultOpen: i = !0, onOpenChange: a, children: o, ...s }, l) => {
248
270
  let u = e("flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]", t);
249
- return n ? /* @__PURE__ */ c(k.Provider, {
250
- value: j,
271
+ return n ? /* @__PURE__ */ c(j.Provider, {
272
+ value: N,
251
273
  children: /* @__PURE__ */ c(f.Root, {
252
274
  ref: l,
253
275
  open: r,
@@ -257,8 +279,8 @@ var k = o.createContext({ expandable: !1 }), A = { expandable: !1 }, j = { expan
257
279
  ...s,
258
280
  children: o
259
281
  })
260
- }) : /* @__PURE__ */ c(k.Provider, {
261
- value: A,
282
+ }) : /* @__PURE__ */ c(j.Provider, {
283
+ value: M,
262
284
  children: /* @__PURE__ */ c("div", {
263
285
  ref: l,
264
286
  className: u,
@@ -267,9 +289,9 @@ var k = o.createContext({ expandable: !1 }), A = { expandable: !1 }, j = { expan
267
289
  })
268
290
  });
269
291
  });
270
- M.displayName = "SidebarSecondarySection";
271
- var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", P = "min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] py-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", F = o.forwardRef(({ className: t, actions: s, unreadRollup: d, children: p, ...m }, g) => {
272
- let { expandable: _ } = o.useContext(k), v = n(), y = o.useRef(null), b = o.useRef(null), x = h(b, { enabled: !0 }), S = (e) => {
292
+ P.displayName = "SidebarSecondarySection";
293
+ var F = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", I = "min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] py-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", L = o.forwardRef(({ className: t, actions: s, unreadRollup: d, children: p, ...m }, g) => {
294
+ let { expandable: _ } = o.useContext(j), v = n(), y = o.useRef(null), b = o.useRef(null), x = h(b, { enabled: !0 }), S = (e) => {
273
295
  y.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
274
296
  }, C = /* @__PURE__ */ l(r, {
275
297
  disabled: !x,
@@ -286,7 +308,7 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
286
308
  })]
287
309
  });
288
310
  if (!_) {
289
- let n = e(N, P, t);
311
+ let n = e(F, I, t);
290
312
  return s == null ? /* @__PURE__ */ c("div", {
291
313
  ref: S,
292
314
  className: e(n, "flex items-center"),
@@ -304,10 +326,10 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
304
326
  }
305
327
  return /* @__PURE__ */ l("div", {
306
328
  ref: S,
307
- className: e("flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]", P, t),
329
+ className: e("flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]", I, t),
308
330
  ...m,
309
331
  children: [/* @__PURE__ */ l(f.Trigger, {
310
- className: e("group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer", N, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset"),
332
+ className: e("group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start cursor-pointer", F, "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset"),
311
333
  children: [
312
334
  /* @__PURE__ */ c(u, {
313
335
  size: 16,
@@ -326,37 +348,37 @@ var N = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-si
326
348
  })]
327
349
  });
328
350
  });
329
- F.displayName = "SidebarSecondarySectionLabel";
330
- var I = o.forwardRef(({ className: t, ...n }, r) => {
331
- let { expandable: i } = o.useContext(k), a = /* @__PURE__ */ c("ul", {
351
+ L.displayName = "SidebarSecondarySectionLabel";
352
+ var R = o.forwardRef(({ className: t, ...n }, r) => {
353
+ let { expandable: i } = o.useContext(j), a = /* @__PURE__ */ c("ul", {
332
354
  ref: r,
333
355
  className: e("flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]", t),
334
356
  ...n
335
357
  });
336
358
  return i ? /* @__PURE__ */ c(f.Panel, { children: a }) : a;
337
359
  });
338
- I.displayName = "SidebarSecondaryMenu";
339
- var L = t("group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-menu-item-global-container-gap)] min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] px-[var(--ui-sidebar-secondary-menu-item-global-container-padding-x)] py-[var(--ui-sidebar-secondary-menu-item-global-container-padding-y)] no-underline ui-sidebar-secondary-menu-item-global-label-text-style transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset text-[var(--ui-sidebar-secondary-menu-item-global-label-color-color)] [&_svg]:shrink-0 [&_svg]:size-[var(--ui-sidebar-secondary-menu-item-global-icon-size)] [&_svg]:text-[var(--ui-sidebar-secondary-menu-item-global-icon-color-color)]", {
360
+ R.displayName = "SidebarSecondaryMenu";
361
+ var z = t("group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-menu-item-global-container-gap)] min-h-[var(--ui-sidebar-secondary-menu-item-global-container-height-min)] px-[var(--ui-sidebar-secondary-menu-item-global-container-padding-x)] py-[var(--ui-sidebar-secondary-menu-item-global-container-padding-y)] no-underline ui-sidebar-secondary-menu-item-global-label-text-style transition-colors cursor-pointer focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset text-[var(--ui-sidebar-secondary-menu-item-global-label-color-color)] [&_svg]:shrink-0 [&_svg]:size-[var(--ui-sidebar-secondary-menu-item-global-icon-size)] [&_svg]:text-[var(--ui-sidebar-secondary-menu-item-global-icon-color-color)]", {
340
362
  variants: { variant: {
341
363
  unselected: "bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-active)]",
342
364
  selected: "bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-idle)] hover:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-hover)] active:bg-[var(--ui-sidebar-secondary-menu-item-selected-container-color-active)]"
343
365
  } },
344
366
  defaultVariants: { variant: "unselected" }
345
- }), R = o.forwardRef(({ className: t, selected: u = !1, icon: d, extras: f, render: g, children: _, ...v }, y) => {
346
- let { expanded: b, setSelectedLabel: S } = x(), { expandable: C } = o.useContext(k), w = n(), T = o.useRef(null), E = o.useRef(null), D = h(E, { enabled: b });
367
+ }), B = o.forwardRef(({ className: t, selected: u = !1, icon: d, extras: f, render: g, children: _, ...v }, y) => {
368
+ let { expanded: b, setSelectedLabel: x } = C(), { expandable: S } = o.useContext(j), w = n(), T = o.useRef(null), E = o.useRef(null), D = h(E, { enabled: b });
347
369
  o.useEffect(() => {
348
- u && S(_);
370
+ u && x(_);
349
371
  }, [
350
372
  u,
351
373
  _,
352
- S
374
+ x
353
375
  ]);
354
376
  let O = p({
355
377
  render: g,
356
378
  ref: [y, T],
357
379
  defaultTagName: "a",
358
380
  props: m({
359
- className: e(L({ variant: u ? "selected" : "unselected" }), C && "ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]", t),
381
+ className: e(z({ variant: u ? "selected" : "unselected" }), S && "ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]", t),
360
382
  "aria-current": u ? "page" : void 0,
361
383
  onKeyDown: (e) => {
362
384
  e.key === " " && (e.preventDefault(), e.currentTarget.click());
@@ -395,9 +417,9 @@ var L = t("group/row flex w-full items-start gap-[var(--ui-sidebar-secondary-men
395
417
  })
396
418
  });
397
419
  });
398
- R.displayName = "SidebarSecondaryMenuItem";
399
- var z = o.forwardRef(({ className: t, variant: n, shortcut: r, tag: i, children: a, ...o }, s) => {
400
- let { expanded: u } = x(), f = n === "tag" || n === "tag-externalLink", p = n === "externalLink" || n === "tag-externalLink", m = n === "shortcut";
420
+ B.displayName = "SidebarSecondaryMenuItem";
421
+ var V = o.forwardRef(({ className: t, variant: n, shortcut: r, tag: i, children: a, ...o }, s) => {
422
+ let { expanded: u } = C(), f = n === "tag" || n === "tag-externalLink", p = n === "externalLink" || n === "tag-externalLink", m = n === "shortcut";
401
423
  return /* @__PURE__ */ l("span", {
402
424
  ref: s,
403
425
  className: e("inline-flex items-center shrink-0 min-h-6 overflow-clip gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]", !u && "hidden", t),
@@ -415,35 +437,36 @@ var z = o.forwardRef(({ className: t, variant: n, shortcut: r, tag: i, children:
415
437
  ]
416
438
  });
417
439
  });
418
- z.displayName = "SidebarSecondaryMenuItemExtras";
419
- var B = o.forwardRef(({ className: t, icon: s, expandTooltip: u = "Expand", extras: d, children: f, onClick: p, ...m }, g) => {
420
- let { expanded: _, toggleExpanded: v } = x(), y = n(), b = o.useRef(null), S = o.useRef(null), C = h(S, { enabled: _ }), w = /* @__PURE__ */ l("button", {
440
+ V.displayName = "SidebarSecondaryMenuItemExtras";
441
+ var H = o.forwardRef(({ className: t, icon: s, expandTooltip: u = "Expand", extras: d, children: f, onClick: p, disabled: m, ...g }, _) => {
442
+ let { expanded: v, toggleExpanded: y, collapsible: b } = C(), x = n(), S = o.useRef(null), w = o.useRef(null), T = h(w, { enabled: v }), E = /* @__PURE__ */ l("button", {
421
443
  ref: (e) => {
422
- b.current = e, typeof g == "function" ? g(e) : g && (g.current = e);
444
+ S.current = e, typeof _ == "function" ? _(e) : _ && (_.current = e);
423
445
  },
424
446
  type: "button",
425
- "aria-expanded": _,
426
- className: e(L({ variant: "unselected" }), "text-start", t),
447
+ "aria-expanded": b ? v : void 0,
448
+ disabled: m || !b,
449
+ className: e(z({ variant: "unselected" }), "text-start", "disabled:cursor-not-allowed disabled:text-[var(--ui-text-on-surface-disabled)] disabled:[&_svg]:text-[var(--ui-text-on-surface-disabled)] disabled:hover:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)] disabled:active:bg-[var(--ui-sidebar-secondary-menu-item-unselected-container-color-idle)]", t),
427
450
  onClick: (e) => {
428
- p?.(e), e.defaultPrevented || v();
451
+ p?.(e), !e.defaultPrevented && b && y();
429
452
  },
430
- ...m,
453
+ ...g,
431
454
  children: [
432
455
  s != null && /* @__PURE__ */ c("span", {
433
- className: e("flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform", _ ? "rtl:rotate-180" : "ltr:rotate-180"),
456
+ className: e("flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform", v ? "rtl:rotate-180" : "ltr:rotate-180"),
434
457
  children: s
435
458
  }),
436
459
  /* @__PURE__ */ l(r, {
437
- disabled: !C,
460
+ disabled: !T,
438
461
  children: [/* @__PURE__ */ c(a, {
439
462
  render: /* @__PURE__ */ c("span", {
440
- ref: S,
441
- className: e("flex-1 min-w-[60px] truncate", !_ && "sr-only")
463
+ ref: w,
464
+ className: e("flex-1 min-w-[60px] truncate", !v && "sr-only")
442
465
  }),
443
466
  children: f
444
467
  }), /* @__PURE__ */ c(i, {
445
- anchor: b,
446
- side: y === "rtl" ? "left" : "right",
468
+ anchor: S,
469
+ side: x === "rtl" ? "left" : "right",
447
470
  children: f
448
471
  })]
449
472
  }),
@@ -453,16 +476,16 @@ var B = o.forwardRef(({ className: t, icon: s, expandTooltip: u = "Expand", extr
453
476
  return /* @__PURE__ */ c("li", {
454
477
  className: "contents",
455
478
  children: /* @__PURE__ */ l(r, {
456
- disabled: _,
457
- children: [/* @__PURE__ */ c(a, { render: w }), /* @__PURE__ */ c(i, {
458
- side: y === "rtl" ? "left" : "right",
479
+ disabled: v || !b,
480
+ children: [/* @__PURE__ */ c(a, { render: E }), /* @__PURE__ */ c(i, {
481
+ side: x === "rtl" ? "left" : "right",
459
482
  children: u
460
483
  })]
461
484
  })
462
485
  });
463
486
  });
464
- B.displayName = "SidebarSecondaryCollapseTrigger";
487
+ H.displayName = "SidebarSecondaryCollapseTrigger";
465
488
  //#endregion
466
- export { w as SidebarSecondary, B as SidebarSecondaryCollapseTrigger, D as SidebarSecondaryCollapsedBreadcrumb, E as SidebarSecondaryContent, O as SidebarSecondaryFooter, T as SidebarSecondaryHeader, I as SidebarSecondaryMenu, R as SidebarSecondaryMenuItem, z as SidebarSecondaryMenuItemExtras, M as SidebarSecondarySection, F as SidebarSecondarySectionLabel, L as sidebarSecondaryMenuItemVariants };
489
+ export { E as SidebarSecondary, H as SidebarSecondaryCollapseTrigger, k as SidebarSecondaryCollapsedBreadcrumb, O as SidebarSecondaryContent, A as SidebarSecondaryFooter, D as SidebarSecondaryHeader, R as SidebarSecondaryMenu, B as SidebarSecondaryMenuItem, V as SidebarSecondaryMenuItemExtras, P as SidebarSecondarySection, L as SidebarSecondarySectionLabel, z as sidebarSecondaryMenuItemVariants };
467
490
 
468
491
  //# sourceMappingURL=sidebar-secondary.js.map