@acronis-platform/ui-react 0.54.0 → 0.55.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 (65) hide show
  1. package/dist/components/ui/avatar/avatar.js +1 -1
  2. package/dist/components/ui/avatar/avatar.js.map +1 -1
  3. package/dist/components/ui/breadcrumb/breadcrumb.js +5 -5
  4. package/dist/components/ui/breadcrumb/breadcrumb.js.map +1 -1
  5. package/dist/components/ui/chip/chip.js +1 -1
  6. package/dist/components/ui/chip/chip.js.map +1 -1
  7. package/dist/components/ui/combobox/combobox.js +51 -47
  8. package/dist/components/ui/combobox/combobox.js.map +1 -1
  9. package/dist/components/ui/data-table/data-table-column-header.js +7 -7
  10. package/dist/components/ui/data-table/data-table-column-header.js.map +1 -1
  11. package/dist/components/ui/data-table/data-table-view-options.js +4 -4
  12. package/dist/components/ui/data-table/data-table-view-options.js.map +1 -1
  13. package/dist/components/ui/data-table/data-table.js +1 -1
  14. package/dist/components/ui/data-table/data-table.js.map +1 -1
  15. package/dist/components/ui/dialog/dialog.js +36 -35
  16. package/dist/components/ui/dialog/dialog.js.map +1 -1
  17. package/dist/components/ui/dropdown-menu/dropdown-menu.js +55 -54
  18. package/dist/components/ui/dropdown-menu/dropdown-menu.js.map +1 -1
  19. package/dist/components/ui/filter-search/filter-search.js +28 -0
  20. package/dist/components/ui/filter-search/filter-search.js.map +1 -0
  21. package/dist/components/ui/input-date-picker/input-date-picker.js +8 -8
  22. package/dist/components/ui/input-date-picker/input-date-picker.js.map +1 -1
  23. package/dist/components/ui/input-search/input-search.js +11 -12
  24. package/dist/components/ui/input-search/input-search.js.map +1 -1
  25. package/dist/components/ui/input-select/input-select.js +72 -68
  26. package/dist/components/ui/input-select/input-select.js.map +1 -1
  27. package/dist/components/ui/input-text/input-text.js +6 -6
  28. package/dist/components/ui/input-text/input-text.js.map +1 -1
  29. package/dist/components/ui/popover/popover.js +18 -17
  30. package/dist/components/ui/popover/popover.js.map +1 -1
  31. package/dist/components/ui/resizable/resizable.js +24 -32
  32. package/dist/components/ui/resizable/resizable.js.map +1 -1
  33. package/dist/components/ui/sheet/sheet.js +38 -37
  34. package/dist/components/ui/sheet/sheet.js.map +1 -1
  35. package/dist/components/ui/sidebar-primary/sidebar-primary.js +200 -134
  36. package/dist/components/ui/sidebar-primary/sidebar-primary.js.map +1 -1
  37. package/dist/components/ui/sidebar-secondary/sidebar-secondary.js +511 -357
  38. package/dist/components/ui/sidebar-secondary/sidebar-secondary.js.map +1 -1
  39. package/dist/components/ui/switch/switch.js +6 -6
  40. package/dist/components/ui/switch/switch.js.map +1 -1
  41. package/dist/components/ui/table/table.js +7 -7
  42. package/dist/components/ui/table/table.js.map +1 -1
  43. package/dist/components/ui/tabs/tabs.js +11 -11
  44. package/dist/components/ui/tabs/tabs.js.map +1 -1
  45. package/dist/components/ui/toast/toast.js +35 -33
  46. package/dist/components/ui/toast/toast.js.map +1 -1
  47. package/dist/components/ui/tooltip/tooltip.js +41 -37
  48. package/dist/components/ui/tooltip/tooltip.js.map +1 -1
  49. package/dist/index.js +356 -355
  50. package/dist/index.js.map +1 -1
  51. package/dist/lib/portal-container.js +14 -0
  52. package/dist/lib/portal-container.js.map +1 -0
  53. package/dist/react.js +356 -355
  54. package/dist/react.js.map +1 -1
  55. package/dist/src/components/ui/filter-search/filter-search.d.ts +6 -0
  56. package/dist/src/components/ui/filter-search/index.d.ts +2 -0
  57. package/dist/src/components/ui/resizable/index.d.ts +2 -1
  58. package/dist/src/components/ui/resizable/resizable.d.ts +2 -5
  59. package/dist/src/components/ui/sidebar-primary/sidebar-primary.d.ts +48 -3
  60. package/dist/src/components/ui/sidebar-secondary/index.d.ts +1 -1
  61. package/dist/src/components/ui/sidebar-secondary/sidebar-secondary.d.ts +38 -33
  62. package/dist/src/index.d.ts +2 -0
  63. package/dist/src/lib/portal-container.d.ts +36 -0
  64. package/dist/ui-react.css +1 -1
  65. package/package.json +1 -1
@@ -1,255 +1,467 @@
1
- import { jsx as e, jsxs as m, Fragment as k } from "react/jsx-runtime";
2
- import * as o from "react";
3
- import { mergeProps as S } from "@base-ui/react/merge-props";
4
- import { useRender as N } from "@base-ui/react/use-render";
5
- import { Collapsible as x } from "@base-ui/react/collapsible";
6
- import { ChevronRightIcon as T, SquareArrowUpRightIcon as I, ChevronDownIcon as R } from "@acronis-platform/icons-react/stroke-mono";
7
- import { cva as E } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
8
- import { cn as t } from "../../../lib/utils.js";
9
- import { ScrollArea as z } from "../scroll-area/scroll-area.js";
10
- const M = o.createContext(null);
11
- function g() {
12
- return o.useContext(M) ?? {
1
+ import { jsxs as f, Fragment as _, jsx as e } from "react/jsx-runtime";
2
+ import * as n from "react";
3
+ import { mergeProps as j } from "@base-ui/react/merge-props";
4
+ import { useRender as q } from "@base-ui/react/use-render";
5
+ import { Collapsible as X } from "@base-ui/react/collapsible";
6
+ import { SquareArrowUpRightIcon as ae, ChevronDownIcon as G } from "@acronis-platform/icons-react/stroke-mono";
7
+ import { cva as te } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
8
+ import { cn as b } from "../../../lib/utils.js";
9
+ import { Tooltip as P, TooltipTrigger as A, TooltipContent as M } from "../tooltip/tooltip.js";
10
+ function J() {
11
+ const [t, r] = n.useState("ltr");
12
+ return n.useEffect(() => {
13
+ r(document.documentElement.dir === "rtl" ? "rtl" : "ltr");
14
+ }, []), t;
15
+ }
16
+ function K(t, { enabled: r }) {
17
+ const [s, l] = n.useState(!1);
18
+ return n.useEffect(() => {
19
+ const i = t.current;
20
+ if (!r || !i) {
21
+ l(!1);
22
+ return;
23
+ }
24
+ const a = () => l(i.scrollWidth > i.clientWidth);
25
+ a();
26
+ const o = new ResizeObserver(a);
27
+ return o.observe(i), () => o.disconnect();
28
+ }, [t, r]), s;
29
+ }
30
+ const R = 256, Q = R * 2, Y = /* @__PURE__ */ f(_, { children: [
31
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Resize:" }),
32
+ " Drag",
33
+ /* @__PURE__ */ e("br", {}),
34
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Collapse:" }),
35
+ " Click",
36
+ /* @__PURE__ */ e("br", {}),
37
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Reset size:" }),
38
+ " Double click"
39
+ ] }), Z = /* @__PURE__ */ f(_, { children: [
40
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Resize:" }),
41
+ " Drag",
42
+ /* @__PURE__ */ e("br", {}),
43
+ /* @__PURE__ */ e("span", { className: "font-semibold", children: "Expand:" }),
44
+ " Click"
45
+ ] }), $ = n.createContext(null);
46
+ function I() {
47
+ return n.useContext($) ?? {
13
48
  expanded: !0,
14
49
  toggleExpanded: () => {
15
- }
50
+ },
51
+ resizable: !1,
52
+ width: R,
53
+ setWidth: () => {
54
+ },
55
+ minWidth: R,
56
+ maxWidth: Q,
57
+ defaultWidth: R,
58
+ headerLabel: void 0,
59
+ setHeaderLabel: () => {
60
+ },
61
+ selectedLabel: void 0,
62
+ setSelectedLabel: () => {
63
+ },
64
+ resizeAriaLabel: "Resize sidebar",
65
+ resizeTooltipExpanded: Y,
66
+ resizeTooltipCollapsed: Z
16
67
  };
17
68
  }
18
- function P(n, a, r) {
19
- const [s, i] = o.useState(a), d = n !== void 0, c = d ? n : s, l = o.useCallback(
20
- (u) => {
21
- d || i(u), r == null || r(u);
69
+ function ne(t, r, s) {
70
+ const [l, i] = n.useState(r), a = t !== void 0, o = a ? t : l, u = n.useCallback(
71
+ (d) => {
72
+ a || i(d), s == null || s(d);
22
73
  },
23
- [d, r]
74
+ [a, s]
75
+ );
76
+ return [o, u];
77
+ }
78
+ function ie() {
79
+ const t = I(), { expanded: r, toggleExpanded: s, resizable: l } = t, i = J(), a = n.useRef(t);
80
+ a.current = t;
81
+ const o = n.useRef(!1), [u, d] = n.useState(!1), [c, v] = n.useState(!1), m = n.useRef(
82
+ null
24
83
  );
25
- return [c, l];
84
+ if (n.useEffect(() => () => {
85
+ m.current && clearTimeout(m.current);
86
+ }, []), !l) return null;
87
+ const S = (p) => {
88
+ p.preventDefault();
89
+ const C = p.currentTarget;
90
+ C.setPointerCapture(p.pointerId), o.current = !1, v(!0), d(!1);
91
+ const h = C.closest("[data-state]");
92
+ if (!h) {
93
+ v(!1), C.releasePointerCapture(p.pointerId);
94
+ return;
95
+ }
96
+ h.style.transitionProperty = "none";
97
+ const w = getComputedStyle(h).direction === "rtl", N = h.getBoundingClientRect(), { minWidth: x, maxWidth: T } = a.current, y = x / 2, z = (O) => {
98
+ o.current = !0;
99
+ const D = w ? N.right - O.clientX : O.clientX - N.left, { expanded: B } = a.current;
100
+ B ? D < y ? a.current.toggleExpanded() : a.current.setWidth(
101
+ Math.min(Math.max(D, x), T)
102
+ ) : D > y && a.current.toggleExpanded();
103
+ }, W = () => {
104
+ v(!1), h && (h.style.transitionProperty = ""), window.removeEventListener("pointermove", z), window.removeEventListener("pointerup", W);
105
+ };
106
+ window.addEventListener("pointermove", z), window.addEventListener("pointerup", W);
107
+ }, E = () => {
108
+ o.current || (m.current && clearTimeout(m.current), m.current = setTimeout(() => {
109
+ s();
110
+ }, 250));
111
+ }, L = () => {
112
+ m.current && (clearTimeout(m.current), m.current = null), r || s(), a.current.setWidth(a.current.defaultWidth);
113
+ }, g = (p) => {
114
+ const {
115
+ minWidth: C,
116
+ maxWidth: h,
117
+ defaultWidth: w,
118
+ width: N,
119
+ setWidth: x,
120
+ expanded: T,
121
+ toggleExpanded: y
122
+ } = a.current, z = 16, W = i === "rtl" ? "ArrowLeft" : "ArrowRight", O = i === "rtl" ? "ArrowRight" : "ArrowLeft";
123
+ if (p.key === W && T)
124
+ p.preventDefault(), x(Math.min(N + z, h));
125
+ else if (p.key === O && T) {
126
+ p.preventDefault();
127
+ const D = N - z;
128
+ D < C ? y() : x(D);
129
+ } else p.key === "Enter" ? (p.preventDefault(), y()) : p.key === "Home" && (p.preventDefault(), T || y(), x(w));
130
+ };
131
+ return /* @__PURE__ */ f(P, { open: u, onOpenChange: (p) => {
132
+ c || d(p);
133
+ }, children: [
134
+ /* @__PURE__ */ e(
135
+ A,
136
+ {
137
+ render: /* @__PURE__ */ e(
138
+ "div",
139
+ {
140
+ role: "separator",
141
+ "aria-orientation": "vertical",
142
+ "aria-label": t.resizeAriaLabel,
143
+ className: b(
144
+ // 9px hit area matching ResizableHandle, absolutely positioned on inline-end edge.
145
+ // No after: divider — the sidebar's own border-e changes color via :has() on hover/active/focus.
146
+ "absolute end-0 top-0 h-full w-[9px] ltr:translate-x-1/2 rtl:-translate-x-1/2 cursor-[var(--ui-resizable-cursor,ew-resize)] z-10",
147
+ "focus-visible:outline-none"
148
+ ),
149
+ tabIndex: 0,
150
+ onKeyDown: g,
151
+ onPointerDown: S,
152
+ onClick: E,
153
+ onDoubleClick: L
154
+ }
155
+ )
156
+ }
157
+ ),
158
+ (r ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed) != null && /* @__PURE__ */ e(M, { side: i === "rtl" ? "left" : "right", align: "center", children: r ? t.resizeTooltipExpanded : t.resizeTooltipCollapsed })
159
+ ] });
26
160
  }
27
- const L = o.forwardRef(
161
+ const se = n.forwardRef(
28
162
  ({
29
- className: n,
30
- expanded: a,
31
- defaultExpanded: r = !0,
32
- onExpandedChange: s,
33
- "aria-label": i = "Section navigation",
34
- render: d,
35
- children: c,
36
- ...l
37
- }, u) => {
38
- const [b, p] = P(
39
- a,
163
+ className: t,
164
+ expanded: r,
165
+ defaultExpanded: s = !0,
166
+ onExpandedChange: l,
167
+ resizable: i = !0,
168
+ width: a,
169
+ onWidthChange: o,
170
+ resizeAriaLabel: u = "Resize sidebar",
171
+ resizeTooltipExpanded: d = Y,
172
+ resizeTooltipCollapsed: c = Z,
173
+ "aria-label": v = "Section navigation",
174
+ render: m,
175
+ children: S,
176
+ ...E
177
+ }, L) => {
178
+ const [g, k] = ne(
40
179
  r,
41
- s
42
- ), h = o.useMemo(
43
- () => ({ expanded: b, toggleExpanded: () => p(!b) }),
44
- [b, p]
45
- ), y = N({
46
- render: d,
47
- ref: u,
180
+ s,
181
+ l
182
+ ), [p, C] = n.useState(R), h = a !== void 0, w = h ? a : p, N = n.useCallback(
183
+ (F) => {
184
+ h || C(F), o == null || o(F);
185
+ },
186
+ [h, o]
187
+ ), [x, T] = n.useState(void 0), [y, z] = n.useState(void 0), W = n.useMemo(
188
+ () => ({
189
+ expanded: g,
190
+ toggleExpanded: () => k(!g),
191
+ resizable: i,
192
+ width: w,
193
+ setWidth: N,
194
+ minWidth: R,
195
+ maxWidth: Q,
196
+ defaultWidth: R,
197
+ headerLabel: x,
198
+ setHeaderLabel: T,
199
+ selectedLabel: y,
200
+ setSelectedLabel: z,
201
+ resizeAriaLabel: u,
202
+ resizeTooltipExpanded: d,
203
+ resizeTooltipCollapsed: c
204
+ }),
205
+ [
206
+ g,
207
+ k,
208
+ i,
209
+ w,
210
+ N,
211
+ x,
212
+ y,
213
+ u,
214
+ d,
215
+ c
216
+ ]
217
+ ), B = q({
218
+ render: m,
219
+ ref: L,
48
220
  defaultTagName: "nav",
49
- props: S(
221
+ props: j(
50
222
  {
51
- "aria-label": i,
52
- "data-state": b ? "expanded" : "collapsed",
53
- className: t(
54
- "group/sidebar flex h-full flex-col bg-[var(--ui-sidebar-secondary-global-container-color)] border-r border-[var(--ui-sidebar-secondary-global-container-border-color)] [border-right-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]",
55
- n
223
+ "aria-label": v,
224
+ "data-state": g ? "expanded" : "collapsed",
225
+ style: i && g && (h || w !== R) ? { width: w } : void 0,
226
+ className: b(
227
+ "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]",
228
+ i && "transition-[width,border-color] has-[[role=separator]:hover]:border-[var(--ui-resizable-border-color-hover)] has-[[role=separator]:active]:border-[var(--ui-resizable-border-color-active)] has-[[role=separator]:focus-visible]:border-[var(--ui-resizable-border-color-hover)] has-[[role=separator]:focus-visible]:ring-[3px] has-[[role=separator]:focus-visible]:ring-[var(--ui-focus-primary)]",
229
+ t
56
230
  ),
57
- children: c
231
+ children: /* @__PURE__ */ f(_, { children: [
232
+ /* @__PURE__ */ e(ee, {}),
233
+ S,
234
+ /* @__PURE__ */ e(ie, {})
235
+ ] })
58
236
  },
59
- l
237
+ E
60
238
  )
61
239
  });
62
- return /* @__PURE__ */ e(M.Provider, { value: h, children: y });
240
+ return /* @__PURE__ */ e($.Provider, { value: W, children: B });
63
241
  }
64
242
  );
65
- L.displayName = "SidebarSecondary";
66
- const A = o.forwardRef(({ className: n, label: a, children: r, ...s }, i) => (
67
- // Hidden in collapsed mode — the CollapsedBreadcrumb's parent label carries the
68
- // section context in the rail, so a truncated single-letter heading is omitted.
69
- /* @__PURE__ */ e(
243
+ se.displayName = "SidebarSecondary";
244
+ const oe = n.forwardRef(({ className: t, label: r, children: s, ...l }, i) => {
245
+ const { setHeaderLabel: a } = I(), o = r ?? s;
246
+ return n.useEffect(() => {
247
+ a(o);
248
+ }, [o, a]), /* @__PURE__ */ e(
70
249
  "div",
71
250
  {
72
251
  ref: i,
73
- className: t(
74
- "flex items-center shrink-0",
75
- "hidden group-data-[state=expanded]/sidebar:flex",
76
- "px-[var(--ui-sidebar-secondary-collapsed-container-header-padding-x)] py-[var(--ui-sidebar-secondary-collapsed-container-header-padding-y)]",
77
- "group-data-[state=expanded]/sidebar:px-[var(--ui-sidebar-secondary-expanded-container-header-padding-x)] group-data-[state=expanded]/sidebar:py-[var(--ui-sidebar-secondary-expanded-container-header-padding-y)]",
78
- n
252
+ className: b(
253
+ "hidden items-center shrink-0",
254
+ "group-data-[state=expanded]/sidebar:flex",
255
+ "px-[var(--ui-sidebar-secondary-global-container-header-padding-x)] py-[var(--ui-sidebar-secondary-global-container-header-padding-y)]",
256
+ t
79
257
  ),
80
- ...s,
81
- children: /* @__PURE__ */ e("h2", { className: "ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]", children: a ?? r })
258
+ ...l,
259
+ children: /* @__PURE__ */ e("h2", { className: "ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]", children: o })
82
260
  }
83
- )
84
- ));
85
- A.displayName = "SidebarSecondaryHeader";
86
- const _ = o.forwardRef(({ className: n, children: a, ...r }, s) => (
87
- // Expanded: the section list, scrolling inside a ScrollArea whose overlay
88
- // scrollbar floats over the content and reserves no gutter (full-bleed rows
89
- // are never cropped). Hidden in collapsed mode, where the CollapsedBreadcrumb
90
- // sibling takes over.
261
+ );
262
+ });
263
+ oe.displayName = "SidebarSecondaryHeader";
264
+ const le = n.forwardRef(({ className: t, ...r }, s) => (
265
+ // Expanded: the section list. Hidden in collapsed mode, where the
266
+ // CollapsedBreadcrumb sibling takes over.
91
267
  /* @__PURE__ */ e(
92
- z,
268
+ "div",
93
269
  {
94
270
  ref: s,
95
- className: t(
96
- "min-h-0 flex-1",
97
- "hidden group-data-[state=expanded]/sidebar:block",
98
- n
271
+ className: b(
272
+ "flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]",
273
+ "hidden group-data-[state=expanded]/sidebar:flex",
274
+ t
99
275
  ),
100
- ...r,
101
- children: /* @__PURE__ */ e("div", { className: "flex flex-col gap-[var(--ui-sidebar-secondary-global-section-list-gap)]", children: a })
276
+ ...r
102
277
  }
103
278
  )
104
279
  ));
105
- _.displayName = "SidebarSecondaryContent";
106
- const B = o.forwardRef(({ className: n, parentLabel: a, currentLabel: r, separator: s, ...i }, d) => (
107
- // Shown only in collapsed mode — toggled by the same data-[state] selector so
108
- // it stays in the DOM (SSR-present) with no JS branch. Stacked top→bottom:
109
- // parent → separator → current page. In the ~48px rail the labels are rotated
110
- // to read vertically (`writing-mode: vertical-rl`, glyphs tilted 90° clockwise,
111
- // reading top-to-bottom) so long labels run down the rail instead of clipping;
112
- // the separator chevron is turned to point down to match that flow.
113
- /* @__PURE__ */ m(
114
- "div",
115
- {
116
- ref: d,
117
- className: t(
118
- // `flex-1` so the rail fills the space between the (hidden) header and the
119
- // footer, keeping the collapse trigger pinned to the bottom; the breadcrumb
120
- // content stays at the top of that space.
121
- "flex flex-1 flex-col items-center",
122
- "gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]",
123
- "flex group-data-[state=expanded]/sidebar:hidden",
124
- n
125
- ),
126
- ...i,
127
- children: [
128
- /* @__PURE__ */ e("span", { className: "ui-sidebar-secondary-collapsed-breadcrumb-label-text-style whitespace-nowrap [writing-mode:vertical-rl] text-[var(--ui-sidebar-secondary-collapsed-breadcrumb-label-color)]", children: a }),
129
- /* @__PURE__ */ e(
130
- "span",
131
- {
132
- "aria-hidden": "true",
133
- className: "inline-flex items-center text-[var(--ui-sidebar-secondary-collapsed-icon-separator-color)] [&>svg]:size-[var(--ui-sidebar-secondary-collapsed-icon-separator-size)]",
134
- children: s ?? /* @__PURE__ */ e(T, { size: 16, className: "rotate-90" })
135
- }
280
+ le.displayName = "SidebarSecondaryContent";
281
+ const ee = n.forwardRef(({ className: t, parentLabel: r, currentLabel: s, separator: l, ...i }, a) => {
282
+ const { headerLabel: o, selectedLabel: u } = I(), d = r ?? o, c = s ?? u;
283
+ return (
284
+ // Shown only in collapsed mode — toggled by the same data-[state] selector so
285
+ // it stays in the DOM (SSR-present) with no JS branch. Laid out vertically:
286
+ // parent → separator → current page.
287
+ /* @__PURE__ */ f(
288
+ "div",
289
+ {
290
+ ref: a,
291
+ className: b(
292
+ "flex flex-1 flex-col items-center min-h-0",
293
+ "gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]",
294
+ "flex group-data-[state=expanded]/sidebar:hidden",
295
+ t
136
296
  ),
137
- /* @__PURE__ */ e("span", { className: "ui-sidebar-secondary-collapsed-label-current-page-text-style whitespace-nowrap [writing-mode:vertical-rl] text-[var(--ui-sidebar-secondary-collapsed-label-current-page-color)]", children: r })
138
- ]
139
- }
140
- )
141
- ));
142
- B.displayName = "SidebarSecondaryCollapsedBreadcrumb";
143
- const V = o.forwardRef(({ className: n, ...a }, r) => /* @__PURE__ */ e(
297
+ ...i,
298
+ children: [
299
+ /* @__PURE__ */ e("span", { className: "[writing-mode:vertical-rl] [direction:ltr] shrink-0 ui-sidebar-secondary-collapsed-breadcrumb-label-text-style text-[var(--ui-sidebar-secondary-collapsed-breadcrumb-label-color)]", children: d }),
300
+ /* @__PURE__ */ e(
301
+ "span",
302
+ {
303
+ "aria-hidden": "true",
304
+ className: "inline-flex items-center text-[var(--ui-sidebar-secondary-collapsed-icon-separator-color)] [&>svg]:size-[var(--ui-sidebar-secondary-collapsed-icon-separator-size)]",
305
+ children: l ?? /* @__PURE__ */ e(G, { size: 16 })
306
+ }
307
+ ),
308
+ /* @__PURE__ */ e("span", { className: "[writing-mode:vertical-rl] [direction:ltr] flex-1 min-h-0 overflow-hidden ui-sidebar-secondary-collapsed-label-current-page-text-style text-[var(--ui-sidebar-secondary-collapsed-label-current-page-color)]", children: c })
309
+ ]
310
+ }
311
+ )
312
+ );
313
+ });
314
+ ee.displayName = "SidebarSecondaryCollapsedBreadcrumb";
315
+ const de = n.forwardRef(({ className: t, ...r }, s) => /* @__PURE__ */ e(
144
316
  "div",
145
317
  {
146
- ref: r,
147
- className: t(
318
+ ref: s,
319
+ className: b(
148
320
  "flex flex-col shrink-0",
149
321
  "border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]",
150
322
  "py-[var(--ui-sidebar-secondary-section-container-padding-y)]",
151
- n
323
+ t
152
324
  ),
153
- ...a
325
+ ...r
154
326
  }
155
327
  ));
156
- V.displayName = "SidebarSecondaryFooter";
157
- const f = o.createContext({ expandable: !1 }), F = { expandable: !1 }, H = { expandable: !0 }, j = o.forwardRef(
158
- ({ className: n, expandable: a = !1, open: r, defaultOpen: s = !0, onOpenChange: i, children: d, ...c }, l) => {
159
- const u = t(
328
+ de.displayName = "SidebarSecondaryFooter";
329
+ const H = n.createContext({
330
+ expandable: !1
331
+ }), ce = {
332
+ expandable: !1
333
+ }, ue = {
334
+ expandable: !0
335
+ }, be = n.forwardRef(
336
+ ({
337
+ className: t,
338
+ expandable: r = !1,
339
+ open: s,
340
+ defaultOpen: l = !0,
341
+ onOpenChange: i,
342
+ children: a,
343
+ ...o
344
+ }, u) => {
345
+ const d = b(
160
346
  "flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]",
161
- n
347
+ t
162
348
  );
163
- return a ? /* @__PURE__ */ e(f.Provider, { value: H, children: /* @__PURE__ */ e(
164
- x.Root,
349
+ return r ? /* @__PURE__ */ e(H.Provider, { value: ue, children: /* @__PURE__ */ e(
350
+ X.Root,
165
351
  {
166
- ref: l,
167
- open: r,
168
- defaultOpen: s,
352
+ ref: u,
353
+ open: s,
354
+ defaultOpen: l,
169
355
  onOpenChange: i,
170
- render: /* @__PURE__ */ e("div", { className: u }),
171
- ...c,
172
- children: d
356
+ render: /* @__PURE__ */ e("div", { className: d }),
357
+ ...o,
358
+ children: a
173
359
  }
174
- ) }) : /* @__PURE__ */ e(f.Provider, { value: F, children: /* @__PURE__ */ e("div", { ref: l, className: u, ...c, children: d }) });
360
+ ) }) : /* @__PURE__ */ e(H.Provider, { value: ce, children: /* @__PURE__ */ e("div", { ref: u, className: d, ...o, children: a }) });
175
361
  }
176
362
  );
177
- j.displayName = "SidebarSecondarySection";
178
- const w = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", C = "flex min-h-9 items-center px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", D = o.forwardRef(({ className: n, actions: a, unreadRollup: r, children: s, ...i }, d) => {
179
- const { expandable: c } = o.useContext(f);
180
- if (!c) {
181
- const l = t(w, C, n);
182
- return a == null ? /* @__PURE__ */ e("div", { ref: d, className: l, ...i, children: s }) : /* @__PURE__ */ m(
363
+ be.displayName = "SidebarSecondarySection";
364
+ const U = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", V = "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)]", pe = n.forwardRef(({ className: t, actions: r, unreadRollup: s, children: l, ...i }, a) => {
365
+ const { expandable: o } = n.useContext(H), u = n.useRef(null), d = K(u, { enabled: !0 }), c = /* @__PURE__ */ f(P, { disabled: !d, children: [
366
+ /* @__PURE__ */ e(
367
+ A,
368
+ {
369
+ render: /* @__PURE__ */ e(
370
+ "span",
371
+ {
372
+ ref: u,
373
+ className: "min-w-0 flex-1 truncate"
374
+ }
375
+ ),
376
+ children: l
377
+ }
378
+ ),
379
+ /* @__PURE__ */ e(M, { children: l })
380
+ ] });
381
+ if (!o) {
382
+ const v = b(U, V, t);
383
+ return r == null ? /* @__PURE__ */ e(
183
384
  "div",
184
385
  {
185
- ref: d,
186
- className: t(
187
- l,
386
+ ref: a,
387
+ className: b(
388
+ v,
389
+ "flex items-center"
390
+ ),
391
+ ...i,
392
+ children: c
393
+ }
394
+ ) : /* @__PURE__ */ f(
395
+ "div",
396
+ {
397
+ ref: a,
398
+ className: b(
399
+ v,
188
400
  "flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]"
189
401
  ),
190
402
  ...i,
191
403
  children: [
192
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: s }),
193
- /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: a })
404
+ c,
405
+ /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: r })
194
406
  ]
195
407
  }
196
408
  );
197
409
  }
198
- return /* @__PURE__ */ m(
410
+ return /* @__PURE__ */ f(
199
411
  "div",
200
412
  {
201
- ref: d,
202
- className: t(
413
+ ref: a,
414
+ className: b(
203
415
  "flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]",
204
- C,
205
- n
416
+ V,
417
+ t
206
418
  ),
207
419
  ...i,
208
420
  children: [
209
- /* @__PURE__ */ m(
210
- x.Trigger,
421
+ /* @__PURE__ */ f(
422
+ X.Trigger,
211
423
  {
212
- className: t(
213
- "group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-left",
214
- w,
424
+ className: b(
425
+ "group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-start",
426
+ U,
215
427
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset"
216
428
  ),
217
429
  children: [
218
430
  /* @__PURE__ */ e(
219
- R,
431
+ G,
220
432
  {
221
433
  size: 16,
222
434
  "aria-hidden": "true",
223
- className: "shrink-0 -rotate-90 transition-transform group-data-[panel-open]/section:rotate-0 text-[var(--ui-sidebar-secondary-section-icon-arrow-color)]"
435
+ className: "shrink-0 ltr:-rotate-90 rtl:rotate-90 transition-transform group-data-[panel-open]/section:rotate-0 text-[var(--ui-sidebar-secondary-section-icon-arrow-color)]"
224
436
  }
225
437
  ),
226
- /* @__PURE__ */ e("span", { className: "min-w-0 flex-1 truncate", children: s }),
227
- r != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center group-data-[panel-open]/section:hidden", children: r })
438
+ c,
439
+ s != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center group-data-[panel-open]/section:hidden", children: s })
228
440
  ]
229
441
  }
230
442
  ),
231
- a != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: a })
443
+ r != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: r })
232
444
  ]
233
445
  }
234
446
  );
235
447
  });
236
- D.displayName = "SidebarSecondarySectionLabel";
237
- const O = o.forwardRef(({ className: n, ...a }, r) => {
238
- const { expandable: s } = o.useContext(f), i = /* @__PURE__ */ e(
448
+ pe.displayName = "SidebarSecondarySectionLabel";
449
+ const me = n.forwardRef(({ className: t, ...r }, s) => {
450
+ const { expandable: l } = n.useContext(H), i = /* @__PURE__ */ e(
239
451
  "ul",
240
452
  {
241
- ref: r,
242
- className: t(
453
+ ref: s,
454
+ className: b(
243
455
  "flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]",
244
- n
456
+ t
245
457
  ),
246
- ...a
458
+ ...r
247
459
  }
248
460
  );
249
- return s ? /* @__PURE__ */ e(x.Panel, { children: i }) : i;
461
+ return l ? /* @__PURE__ */ e(X.Panel, { children: i }) : i;
250
462
  });
251
- O.displayName = "SidebarSecondaryMenu";
252
- const U = "group/row flex w-full items-center 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 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)]", v = E(U, {
463
+ me.displayName = "SidebarSecondaryMenu";
464
+ const fe = "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 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)]", re = te(fe, {
253
465
  variants: {
254
466
  variant: {
255
467
  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)]",
@@ -259,139 +471,77 @@ const U = "group/row flex w-full items-center gap-[var(--ui-sidebar-secondary-me
259
471
  defaultVariants: {
260
472
  variant: "unselected"
261
473
  }
262
- }), q = o.forwardRef(({ className: n, selected: a = !1, icon: r, render: s, children: i, ...d }, c) => {
263
- const { expanded: l } = g(), u = o.Children.toArray(i), b = u.filter(
264
- (y) => o.isValidElement(y) && y.type.displayName === "SidebarSecondaryMenuItemExtras"
265
- ), p = u.filter(
266
- (y) => !b.includes(y)
267
- ), h = N({
268
- render: s,
269
- ref: c,
270
- defaultTagName: "a",
271
- props: S(
272
- {
273
- className: t(
274
- v({
275
- variant: a ? "selected" : "unselected"
276
- }),
277
- n
278
- ),
279
- "aria-current": a ? "page" : void 0,
280
- children: /* @__PURE__ */ m(k, { children: [
281
- r != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: r }),
282
- /* @__PURE__ */ e(
283
- "span",
284
- {
285
- className: t(
286
- "min-w-0 flex-1 truncate text-left",
287
- !l && "sr-only"
288
- ),
289
- children: p
290
- }
474
+ }), ve = n.forwardRef(
475
+ ({ className: t, selected: r = !1, icon: s, extras: l, render: i, children: a, ...o }, u) => {
476
+ const { expanded: d, setSelectedLabel: c } = I(), { expandable: v } = n.useContext(H), m = n.useRef(null), S = K(m, { enabled: d });
477
+ n.useEffect(() => {
478
+ r && c(a);
479
+ }, [r, a, c]);
480
+ const E = q({
481
+ render: i,
482
+ ref: u,
483
+ defaultTagName: "a",
484
+ props: j(
485
+ {
486
+ className: b(
487
+ re({
488
+ variant: r ? "selected" : "unselected"
489
+ }),
490
+ // Inside an expandable section, increase start padding so the
491
+ // label aligns with the section header text (after chevron + gap)
492
+ // while keeping the container full-width for hover/active fills.
493
+ v && "ps-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-section-container-header-gap)+16px)]",
494
+ t
291
495
  ),
292
- b.length > 0 && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center", children: b })
293
- ] })
294
- },
295
- d
296
- )
297
- });
298
- return /* @__PURE__ */ e("li", { className: "contents", children: h });
299
- });
300
- q.displayName = "SidebarSecondaryMenuItem";
301
- const X = o.forwardRef(({ className: n, render: a, ...r }, s) => (
302
- // Disclosure row: Base UI Collapsible gives per-row open state +
303
- // aria-expanded/aria-controls. Rendered as the list `<li>` wrapper.
304
- /* @__PURE__ */ e(
305
- x.Root,
306
- {
307
- ref: s,
308
- render: a ?? /* @__PURE__ */ e("li", {}),
309
- className: t("contents", n),
310
- ...r
311
- }
312
- )
313
- ));
314
- X.displayName = "SidebarSecondaryMenuSub";
315
- const G = o.forwardRef(({ className: n, selected: a = !1, icon: r, children: s, ...i }, d) => {
316
- const { expanded: c } = g();
317
- return /* @__PURE__ */ m(
318
- x.Trigger,
319
- {
320
- ref: d,
321
- "aria-current": a ? "page" : void 0,
322
- className: t(
323
- v({
324
- variant: a ? "selected" : "unselected"
325
- }),
326
- "text-left",
327
- n
328
- ),
329
- ...i,
330
- children: [
331
- r != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: r }),
332
- /* @__PURE__ */ e("span", { className: t("flex-1 truncate", !c && "sr-only"), children: s }),
333
- /* @__PURE__ */ e(
334
- R,
335
- {
336
- size: 16,
337
- "aria-hidden": "true",
338
- className: t(
339
- "shrink-0 transition-transform group-data-[panel-open]/row:rotate-180",
340
- !c && "hidden"
341
- )
342
- }
343
- )
344
- ]
345
- }
346
- );
347
- });
348
- G.displayName = "SidebarSecondaryMenuSubTrigger";
349
- const J = o.forwardRef(({ className: n, children: a, ...r }, s) => /* @__PURE__ */ e(x.Panel, { ref: s, className: t(n), ...r, children: /* @__PURE__ */ e("ul", { className: "flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]", children: a }) }));
350
- J.displayName = "SidebarSecondaryMenuSubContent";
351
- const K = o.forwardRef(({ className: n, selected: a = !1, render: r, children: s, ...i }, d) => {
352
- const { expanded: c } = g(), l = N({
353
- render: r,
354
- ref: d,
355
- defaultTagName: "a",
356
- props: S(
357
- {
358
- className: t(
359
- v({
360
- variant: a ? "selected" : "unselected"
361
- }),
362
- // Level-2 left indent (no icon column). The dedicated level-2 padding
363
- // token was removed in the next-gen sync; reconstruct the indent from
364
- // surviving tokens so the label aligns under level-1 labels (row
365
- // padding + icon column + gap).
366
- "pl-[calc(var(--ui-sidebar-secondary-menu-item-global-container-padding-x)+var(--ui-sidebar-secondary-menu-item-global-icon-size)+var(--ui-sidebar-secondary-menu-item-global-container-gap))]",
367
- n
368
- ),
369
- "aria-current": a ? "page" : void 0,
370
- children: /* @__PURE__ */ e("span", { className: t("flex-1 truncate text-left", !c && "sr-only"), children: s })
371
- },
372
- i
373
- )
374
- });
375
- return /* @__PURE__ */ e("li", { className: "contents", children: l });
376
- });
377
- K.displayName = "SidebarSecondaryMenuSubItem";
378
- const Q = o.forwardRef(({ className: n, variant: a, shortcut: r, tag: s, children: i, ...d }, c) => {
379
- const { expanded: l } = g(), u = a === "tag" || a === "tag-externalLink", b = a === "externalLink" || a === "tag-externalLink", p = a === "shortcut";
380
- return /* @__PURE__ */ m(
496
+ "aria-current": r ? "page" : void 0,
497
+ children: /* @__PURE__ */ f(_, { children: [
498
+ s != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: s }),
499
+ /* @__PURE__ */ f(P, { disabled: !S, children: [
500
+ /* @__PURE__ */ e(
501
+ A,
502
+ {
503
+ render: /* @__PURE__ */ e(
504
+ "span",
505
+ {
506
+ ref: m,
507
+ className: b(
508
+ "flex-1 min-w-[60px] truncate text-start",
509
+ !d && "sr-only"
510
+ )
511
+ }
512
+ ),
513
+ children: a
514
+ }
515
+ ),
516
+ /* @__PURE__ */ e(M, { children: a })
517
+ ] }),
518
+ l
519
+ ] })
520
+ },
521
+ o
522
+ )
523
+ });
524
+ return /* @__PURE__ */ e("li", { className: "contents", children: E });
525
+ }
526
+ );
527
+ ve.displayName = "SidebarSecondaryMenuItem";
528
+ const he = n.forwardRef(({ className: t, variant: r, shortcut: s, tag: l, children: i, ...a }, o) => {
529
+ const { expanded: u } = I(), d = r === "tag" || r === "tag-externalLink", c = r === "externalLink" || r === "tag-externalLink", v = r === "shortcut";
530
+ return /* @__PURE__ */ f(
381
531
  "span",
382
532
  {
383
- ref: c,
384
- className: t(
385
- "inline-flex items-center gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]",
386
- !l && "hidden",
387
- n
533
+ ref: o,
534
+ className: b(
535
+ "inline-flex items-center shrink-0 min-h-6 overflow-clip gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]",
536
+ !u && "hidden",
537
+ t
388
538
  ),
389
- ...d,
539
+ ...a,
390
540
  children: [
391
- u && (s ?? i),
392
- p && /* @__PURE__ */ e("span", { className: "ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]", children: r ?? i }),
393
- b && /* @__PURE__ */ e(
394
- I,
541
+ d && (l ?? i),
542
+ v && /* @__PURE__ */ e("span", { className: "ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]", children: s ?? i }),
543
+ c && /* @__PURE__ */ e(
544
+ ae,
395
545
  {
396
546
  size: 16,
397
547
  className: "text-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-color)] size-[var(--ui-sidebar-secondary-menu-item-extras-global-external-icon-size)]"
@@ -401,70 +551,74 @@ const Q = o.forwardRef(({ className: n, variant: a, shortcut: r, tag: s, childre
401
551
  }
402
552
  );
403
553
  });
404
- Q.displayName = "SidebarSecondaryMenuItemExtras";
405
- const W = o.forwardRef(({ className: n, icon: a, shortcut: r, children: s, onClick: i, ...d }, c) => {
406
- const { expanded: l, toggleExpanded: u } = g();
407
- return /* @__PURE__ */ e("li", { className: "contents", children: /* @__PURE__ */ m(
408
- "button",
409
- {
410
- ref: c,
411
- type: "button",
412
- "aria-expanded": l,
413
- className: t(
414
- v({ variant: "unselected" }),
415
- "text-left",
416
- n
417
- ),
418
- onClick: (b) => {
419
- i == null || i(b), b.defaultPrevented || u();
420
- },
421
- ...d,
422
- children: [
423
- a != null && // Flip the chevron when collapsed so a chevron-left ("collapse")
424
- // becomes a chevron-right ("expand") — the icon always points toward
425
- // the action it triggers.
426
- /* @__PURE__ */ e(
427
- "span",
428
- {
429
- className: t(
430
- "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform",
431
- !l && "rotate-180"
432
- ),
433
- children: a
434
- }
554
+ he.displayName = "SidebarSecondaryMenuItemExtras";
555
+ const ge = n.forwardRef(
556
+ ({
557
+ className: t,
558
+ icon: r,
559
+ expandIcon: s,
560
+ expandTooltip: l = "Expand",
561
+ extras: i,
562
+ children: a,
563
+ onClick: o,
564
+ ...u
565
+ }, d) => {
566
+ const { expanded: c, toggleExpanded: v } = I(), m = J(), S = n.useRef(null), E = K(S, { enabled: c }), L = c ? r : s ?? r, g = /* @__PURE__ */ f(
567
+ "button",
568
+ {
569
+ ref: d,
570
+ type: "button",
571
+ "aria-expanded": c,
572
+ className: b(
573
+ re({ variant: "unselected" }),
574
+ "text-start",
575
+ t
435
576
  ),
436
- /* @__PURE__ */ e("span", { className: t("flex-1 truncate", !l && "sr-only"), children: s }),
437
- r != null && /* @__PURE__ */ e(
438
- "span",
439
- {
440
- className: t(
441
- "shrink-0 ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]",
442
- !l && "sr-only"
577
+ onClick: (k) => {
578
+ o == null || o(k), k.defaultPrevented || v();
579
+ },
580
+ ...u,
581
+ children: [
582
+ L != null && /* @__PURE__ */ e("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] rtl:-scale-x-100", children: L }),
583
+ /* @__PURE__ */ f(P, { disabled: !E, children: [
584
+ /* @__PURE__ */ e(
585
+ A,
586
+ {
587
+ render: /* @__PURE__ */ e(
588
+ "span",
589
+ {
590
+ ref: S,
591
+ className: b("flex-1 min-w-[60px] truncate", !c && "sr-only")
592
+ }
593
+ ),
594
+ children: a
595
+ }
443
596
  ),
444
- children: r
445
- }
446
- )
447
- ]
448
- }
449
- ) });
450
- });
451
- W.displayName = "SidebarSecondaryCollapseTrigger";
597
+ /* @__PURE__ */ e(M, { children: a })
598
+ ] }),
599
+ i
600
+ ]
601
+ }
602
+ );
603
+ return /* @__PURE__ */ e("li", { className: "contents", children: c ? g : /* @__PURE__ */ f(P, { children: [
604
+ /* @__PURE__ */ e(A, { render: g }),
605
+ /* @__PURE__ */ e(M, { side: m === "rtl" ? "left" : "right", children: l })
606
+ ] }) });
607
+ }
608
+ );
609
+ ge.displayName = "SidebarSecondaryCollapseTrigger";
452
610
  export {
453
- L as SidebarSecondary,
454
- W as SidebarSecondaryCollapseTrigger,
455
- B as SidebarSecondaryCollapsedBreadcrumb,
456
- _ as SidebarSecondaryContent,
457
- V as SidebarSecondaryFooter,
458
- A as SidebarSecondaryHeader,
459
- O as SidebarSecondaryMenu,
460
- q as SidebarSecondaryMenuItem,
461
- Q as SidebarSecondaryMenuItemExtras,
462
- X as SidebarSecondaryMenuSub,
463
- J as SidebarSecondaryMenuSubContent,
464
- K as SidebarSecondaryMenuSubItem,
465
- G as SidebarSecondaryMenuSubTrigger,
466
- j as SidebarSecondarySection,
467
- D as SidebarSecondarySectionLabel,
468
- v as sidebarSecondaryMenuItemVariants
611
+ se as SidebarSecondary,
612
+ ge as SidebarSecondaryCollapseTrigger,
613
+ ee as SidebarSecondaryCollapsedBreadcrumb,
614
+ le as SidebarSecondaryContent,
615
+ de as SidebarSecondaryFooter,
616
+ oe as SidebarSecondaryHeader,
617
+ me as SidebarSecondaryMenu,
618
+ ve as SidebarSecondaryMenuItem,
619
+ he as SidebarSecondaryMenuItemExtras,
620
+ be as SidebarSecondarySection,
621
+ pe as SidebarSecondarySectionLabel,
622
+ re as sidebarSecondaryMenuItemVariants
469
623
  };
470
624
  //# sourceMappingURL=sidebar-secondary.js.map