@acronis-platform/ui-react 0.31.0 → 0.34.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.
@@ -1,55 +1,55 @@
1
- import { jsx as a, jsxs as b, Fragment as T } from "react/jsx-runtime";
2
- import * as d from "react";
3
- import { mergeProps as v } from "@base-ui/react/merge-props";
4
- import { useRender as S } from "@base-ui/react/use-render";
5
- import { Collapsible as p } from "@base-ui/react/collapsible";
6
- import { ChevronRightIcon as k, ChevronDownIcon as w, SquareArrowUpRightIcon as I } from "@acronis-platform/icons-react/stroke-mono";
7
- import { cva as z } from "../../../node_modules/.pnpm/class-variance-authority@0.7.1/node_modules/class-variance-authority/dist/index.js";
8
- import { cn as o } from "../../../lib/utils.js";
9
- const C = d.createContext(null);
10
- function y() {
11
- return d.useContext(C) ?? {
1
+ import { jsx as a, jsxs as m, Fragment as T } from "react/jsx-runtime";
2
+ import * as o from "react";
3
+ import { mergeProps as h } 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 k, ChevronDownIcon as R, SquareArrowUpRightIcon as I } 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
+ const M = o.createContext(null);
10
+ function g() {
11
+ return o.useContext(M) ?? {
12
12
  expanded: !0,
13
13
  toggleExpanded: () => {
14
14
  }
15
15
  };
16
16
  }
17
- function E(n, e, r) {
18
- const [s, i] = d.useState(e), t = n !== void 0, c = t ? n : s, l = d.useCallback(
17
+ function z(n, e, r) {
18
+ const [s, i] = o.useState(e), d = n !== void 0, c = d ? n : s, l = o.useCallback(
19
19
  (u) => {
20
- t || i(u), r == null || r(u);
20
+ d || i(u), r == null || r(u);
21
21
  },
22
- [t, r]
22
+ [d, r]
23
23
  );
24
24
  return [c, l];
25
25
  }
26
- const P = d.forwardRef(
26
+ const P = o.forwardRef(
27
27
  ({
28
28
  className: n,
29
29
  expanded: e,
30
30
  defaultExpanded: r = !0,
31
31
  onExpandedChange: s,
32
32
  "aria-label": i = "Section navigation",
33
- render: t,
33
+ render: d,
34
34
  children: c,
35
35
  ...l
36
36
  }, u) => {
37
- const [m, g] = E(
37
+ const [b, p] = z(
38
38
  e,
39
39
  r,
40
40
  s
41
- ), R = d.useMemo(
42
- () => ({ expanded: m, toggleExpanded: () => g(!m) }),
43
- [m, g]
44
- ), M = S({
45
- render: t,
41
+ ), S = o.useMemo(
42
+ () => ({ expanded: b, toggleExpanded: () => p(!b) }),
43
+ [b, p]
44
+ ), y = N({
45
+ render: d,
46
46
  ref: u,
47
47
  defaultTagName: "nav",
48
- props: v(
48
+ props: h(
49
49
  {
50
50
  "aria-label": i,
51
- "data-state": m ? "expanded" : "collapsed",
52
- className: o(
51
+ "data-state": b ? "expanded" : "collapsed",
52
+ className: t(
53
53
  "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]",
54
54
  n
55
55
  ),
@@ -58,33 +58,38 @@ const P = d.forwardRef(
58
58
  l
59
59
  )
60
60
  });
61
- return /* @__PURE__ */ a(C.Provider, { value: R, children: M });
61
+ return /* @__PURE__ */ a(M.Provider, { value: S, children: y });
62
62
  }
63
63
  );
64
64
  P.displayName = "SidebarSecondary";
65
- const L = d.forwardRef(({ className: n, label: e, children: r, ...s }, i) => /* @__PURE__ */ a(
66
- "div",
67
- {
68
- ref: i,
69
- className: o(
70
- "flex items-center shrink-0",
71
- "px-[var(--ui-sidebar-secondary-collapsed-container-header-padding-x)] py-[var(--ui-sidebar-secondary-collapsed-container-header-padding-y)]",
72
- "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)]",
73
- n
74
- ),
75
- ...s,
76
- children: /* @__PURE__ */ a("h2", { className: "ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]", children: e ?? r })
77
- }
65
+ const L = o.forwardRef(({ className: n, label: e, children: r, ...s }, i) => (
66
+ // Hidden in collapsed mode — the CollapsedBreadcrumb's parent label carries the
67
+ // section context in the rail, so a truncated single-letter heading is omitted.
68
+ /* @__PURE__ */ a(
69
+ "div",
70
+ {
71
+ ref: i,
72
+ className: t(
73
+ "flex items-center shrink-0",
74
+ "hidden group-data-[state=expanded]/sidebar:flex",
75
+ "px-[var(--ui-sidebar-secondary-collapsed-container-header-padding-x)] py-[var(--ui-sidebar-secondary-collapsed-container-header-padding-y)]",
76
+ "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)]",
77
+ n
78
+ ),
79
+ ...s,
80
+ children: /* @__PURE__ */ a("h2", { className: "ui-sidebar-secondary-global-header-label-text-style truncate text-[var(--ui-sidebar-secondary-global-header-label-color)]", children: e ?? r })
81
+ }
82
+ )
78
83
  ));
79
84
  L.displayName = "SidebarSecondaryHeader";
80
- const _ = d.forwardRef(({ className: n, ...e }, r) => (
85
+ const A = o.forwardRef(({ className: n, ...e }, r) => (
81
86
  // Expanded: the section list. Hidden in collapsed mode, where the
82
87
  // CollapsedBreadcrumb sibling takes over.
83
88
  /* @__PURE__ */ a(
84
89
  "div",
85
90
  {
86
91
  ref: r,
87
- className: o(
92
+ className: t(
88
93
  "flex flex-1 flex-col overflow-y-auto gap-[var(--ui-sidebar-secondary-global-section-list-gap)]",
89
94
  "hidden group-data-[state=expanded]/sidebar:flex",
90
95
  n
@@ -93,43 +98,49 @@ const _ = d.forwardRef(({ className: n, ...e }, r) => (
93
98
  }
94
99
  )
95
100
  ));
96
- _.displayName = "SidebarSecondaryContent";
97
- const A = d.forwardRef(({ className: n, parentLabel: e, currentLabel: r, separator: s, ...i }, t) => (
101
+ A.displayName = "SidebarSecondaryContent";
102
+ const _ = o.forwardRef(({ className: n, parentLabel: e, currentLabel: r, separator: s, ...i }, d) => (
98
103
  // Shown only in collapsed mode — toggled by the same data-[state] selector so
99
- // it stays in the DOM (SSR-present) with no JS branch. Laid out vertically:
100
- // parent → separator → current page.
101
- /* @__PURE__ */ b(
104
+ // it stays in the DOM (SSR-present) with no JS branch. Stacked top→bottom:
105
+ // parent → separator → current page. In the ~48px rail the labels are rotated
106
+ // to read vertically (`writing-mode: vertical-rl`, glyphs tilted 90° clockwise,
107
+ // reading top-to-bottom) so long labels run down the rail instead of clipping;
108
+ // the separator chevron is turned to point down to match that flow.
109
+ /* @__PURE__ */ m(
102
110
  "div",
103
111
  {
104
- ref: t,
105
- className: o(
106
- "flex flex-col items-center shrink-0",
112
+ ref: d,
113
+ className: t(
114
+ // `flex-1` so the rail fills the space between the (hidden) header and the
115
+ // footer, keeping the collapse trigger pinned to the bottom; the breadcrumb
116
+ // content stays at the top of that space.
117
+ "flex flex-1 flex-col items-center",
107
118
  "gap-[var(--ui-sidebar-secondary-collapsed-container-content-gap)] py-[var(--ui-sidebar-secondary-collapsed-container-content-padding-y)]",
108
119
  "flex group-data-[state=expanded]/sidebar:hidden",
109
120
  n
110
121
  ),
111
122
  ...i,
112
123
  children: [
113
- /* @__PURE__ */ a("span", { className: "ui-sidebar-secondary-collapsed-breadcrumb-label-text-style text-[var(--ui-sidebar-secondary-collapsed-breadcrumb-label-color)]", children: e }),
124
+ /* @__PURE__ */ a("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: e }),
114
125
  /* @__PURE__ */ a(
115
126
  "span",
116
127
  {
117
128
  "aria-hidden": "true",
118
129
  className: "inline-flex items-center text-[var(--ui-sidebar-secondary-collapsed-icon-separator-color)] [&>svg]:size-[var(--ui-sidebar-secondary-collapsed-icon-separator-size)]",
119
- children: s ?? /* @__PURE__ */ a(k, { size: 16 })
130
+ children: s ?? /* @__PURE__ */ a(k, { size: 16, className: "rotate-90" })
120
131
  }
121
132
  ),
122
- /* @__PURE__ */ a("span", { className: "ui-sidebar-secondary-collapsed-label-current-page-text-style text-[var(--ui-sidebar-secondary-collapsed-label-current-page-color)]", children: r })
133
+ /* @__PURE__ */ a("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 })
123
134
  ]
124
135
  }
125
136
  )
126
137
  ));
127
- A.displayName = "SidebarSecondaryCollapsedBreadcrumb";
128
- const B = d.forwardRef(({ className: n, ...e }, r) => /* @__PURE__ */ a(
138
+ _.displayName = "SidebarSecondaryCollapsedBreadcrumb";
139
+ const B = o.forwardRef(({ className: n, ...e }, r) => /* @__PURE__ */ a(
129
140
  "div",
130
141
  {
131
142
  ref: r,
132
- className: o(
143
+ className: t(
133
144
  "flex flex-col shrink-0",
134
145
  "border-t border-[var(--ui-sidebar-secondary-global-container-footer-border-color)] [border-top-width:var(--ui-sidebar-secondary-global-container-footer-border-width)]",
135
146
  "py-[var(--ui-sidebar-secondary-section-container-padding-y)]",
@@ -139,14 +150,14 @@ const B = d.forwardRef(({ className: n, ...e }, r) => /* @__PURE__ */ a(
139
150
  }
140
151
  ));
141
152
  B.displayName = "SidebarSecondaryFooter";
142
- const x = d.createContext({ expandable: !1 }), F = { expandable: !1 }, H = { expandable: !0 }, V = d.forwardRef(
143
- ({ className: n, expandable: e = !1, open: r, defaultOpen: s = !0, onOpenChange: i, children: t, ...c }, l) => {
144
- const u = o(
153
+ const f = o.createContext({ expandable: !1 }), V = { expandable: !1 }, F = { expandable: !0 }, H = o.forwardRef(
154
+ ({ className: n, expandable: e = !1, open: r, defaultOpen: s = !0, onOpenChange: i, children: d, ...c }, l) => {
155
+ const u = t(
145
156
  "flex flex-col py-[var(--ui-sidebar-secondary-section-container-padding-y)]",
146
157
  n
147
158
  );
148
- return e ? /* @__PURE__ */ a(x.Provider, { value: H, children: /* @__PURE__ */ a(
149
- p.Root,
159
+ return e ? /* @__PURE__ */ a(f.Provider, { value: F, children: /* @__PURE__ */ a(
160
+ x.Root,
150
161
  {
151
162
  ref: l,
152
163
  open: r,
@@ -154,21 +165,21 @@ const x = d.createContext({ expandable: !1 }), F = { expandable: !1 }, H = { exp
154
165
  onOpenChange: i,
155
166
  render: /* @__PURE__ */ a("div", { className: u }),
156
167
  ...c,
157
- children: t
168
+ children: d
158
169
  }
159
- ) }) : /* @__PURE__ */ a(x.Provider, { value: F, children: /* @__PURE__ */ a("div", { ref: l, className: u, ...c, children: t }) });
170
+ ) }) : /* @__PURE__ */ a(f.Provider, { value: V, children: /* @__PURE__ */ a("div", { ref: l, className: u, ...c, children: d }) });
160
171
  }
161
172
  );
162
- V.displayName = "SidebarSecondarySection";
163
- const h = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", N = "pb-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", j = d.forwardRef(({ className: n, actions: e, unreadRollup: r, children: s, ...i }, t) => {
164
- const { expandable: c } = d.useContext(x);
173
+ H.displayName = "SidebarSecondarySection";
174
+ const w = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-sidebar-secondary-section-label-section-color)]", C = "pb-[var(--ui-sidebar-secondary-section-container-header-padding-y)] px-[var(--ui-sidebar-secondary-section-container-header-padding-x)]", j = o.forwardRef(({ className: n, actions: e, unreadRollup: r, children: s, ...i }, d) => {
175
+ const { expandable: c } = o.useContext(f);
165
176
  if (!c) {
166
- const l = o(h, N, n);
167
- return e == null ? /* @__PURE__ */ a("div", { ref: t, className: l, ...i, children: s }) : /* @__PURE__ */ b(
177
+ const l = t(w, C, n);
178
+ return e == null ? /* @__PURE__ */ a("div", { ref: d, className: l, ...i, children: s }) : /* @__PURE__ */ m(
168
179
  "div",
169
180
  {
170
- ref: t,
171
- className: o(
181
+ ref: d,
182
+ className: t(
172
183
  l,
173
184
  "flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]"
174
185
  ),
@@ -180,28 +191,28 @@ const h = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-
180
191
  }
181
192
  );
182
193
  }
183
- return /* @__PURE__ */ b(
194
+ return /* @__PURE__ */ m(
184
195
  "div",
185
196
  {
186
- ref: t,
187
- className: o(
197
+ ref: d,
198
+ className: t(
188
199
  "flex items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)]",
189
- N,
200
+ C,
190
201
  n
191
202
  ),
192
203
  ...i,
193
204
  children: [
194
- /* @__PURE__ */ b(
195
- p.Trigger,
205
+ /* @__PURE__ */ m(
206
+ x.Trigger,
196
207
  {
197
- className: o(
208
+ className: t(
198
209
  "group/section flex min-w-0 flex-1 items-center gap-[var(--ui-sidebar-secondary-section-container-header-gap)] text-left",
199
- h,
210
+ w,
200
211
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--ui-focus-brand)] focus-visible:ring-inset"
201
212
  ),
202
213
  children: [
203
214
  /* @__PURE__ */ a(
204
- w,
215
+ R,
205
216
  {
206
217
  size: 16,
207
218
  "aria-hidden": "true",
@@ -219,22 +230,22 @@ const h = "ui-sidebar-secondary-section-label-section-text-style text-[var(--ui-
219
230
  );
220
231
  });
221
232
  j.displayName = "SidebarSecondarySectionLabel";
222
- const D = d.forwardRef(({ className: n, ...e }, r) => {
223
- const { expandable: s } = d.useContext(x), i = /* @__PURE__ */ a(
233
+ const D = o.forwardRef(({ className: n, ...e }, r) => {
234
+ const { expandable: s } = o.useContext(f), i = /* @__PURE__ */ a(
224
235
  "ul",
225
236
  {
226
237
  ref: r,
227
- className: o(
238
+ className: t(
228
239
  "flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]",
229
240
  n
230
241
  ),
231
242
  ...e
232
243
  }
233
244
  );
234
- return s ? /* @__PURE__ */ a(p.Panel, { children: i }) : i;
245
+ return s ? /* @__PURE__ */ a(x.Panel, { children: i }) : i;
235
246
  });
236
247
  D.displayName = "SidebarSecondaryMenu";
237
- const O = "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)]", f = z(O, {
248
+ const O = "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(O, {
238
249
  variants: {
239
250
  variant: {
240
251
  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)]",
@@ -244,60 +255,68 @@ const O = "group/row flex w-full items-center gap-[var(--ui-sidebar-secondary-me
244
255
  defaultVariants: {
245
256
  variant: "unselected"
246
257
  }
247
- }), U = d.forwardRef(({ className: n, selected: e = !1, icon: r, render: s, children: i, ...t }, c) => {
248
- const { expanded: l } = y(), u = S({
258
+ }), U = o.forwardRef(({ className: n, selected: e = !1, icon: r, render: s, children: i, ...d }, c) => {
259
+ const { expanded: l } = g(), u = o.Children.toArray(i), b = u.filter(
260
+ (y) => o.isValidElement(y) && y.type.displayName === "SidebarSecondaryMenuItemExtras"
261
+ ), p = u.filter(
262
+ (y) => !b.includes(y)
263
+ ), S = N({
249
264
  render: s,
250
265
  ref: c,
251
266
  defaultTagName: "a",
252
- props: v(
267
+ props: h(
253
268
  {
254
- className: o(
255
- f({
269
+ className: t(
270
+ v({
256
271
  variant: e ? "selected" : "unselected"
257
272
  }),
258
273
  n
259
274
  ),
260
275
  "aria-current": e ? "page" : void 0,
261
- children: /* @__PURE__ */ b(T, { children: [
276
+ children: /* @__PURE__ */ m(T, { children: [
262
277
  r != null && /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: r }),
263
278
  /* @__PURE__ */ a(
264
279
  "span",
265
280
  {
266
- className: o("flex-1 truncate text-left", !l && "sr-only"),
267
- children: i
281
+ className: t(
282
+ "min-w-0 flex-1 truncate text-left",
283
+ !l && "sr-only"
284
+ ),
285
+ children: p
268
286
  }
269
- )
287
+ ),
288
+ b.length > 0 && /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center", children: b })
270
289
  ] })
271
290
  },
272
- t
291
+ d
273
292
  )
274
293
  });
275
- return /* @__PURE__ */ a("li", { className: "contents", children: u });
294
+ return /* @__PURE__ */ a("li", { className: "contents", children: S });
276
295
  });
277
296
  U.displayName = "SidebarSecondaryMenuItem";
278
- const q = d.forwardRef(({ className: n, render: e, ...r }, s) => (
297
+ const q = o.forwardRef(({ className: n, render: e, ...r }, s) => (
279
298
  // Disclosure row: Base UI Collapsible gives per-row open state +
280
299
  // aria-expanded/aria-controls. Rendered as the list `<li>` wrapper.
281
300
  /* @__PURE__ */ a(
282
- p.Root,
301
+ x.Root,
283
302
  {
284
303
  ref: s,
285
304
  render: e ?? /* @__PURE__ */ a("li", {}),
286
- className: o("contents", n),
305
+ className: t("contents", n),
287
306
  ...r
288
307
  }
289
308
  )
290
309
  ));
291
310
  q.displayName = "SidebarSecondaryMenuSub";
292
- const X = d.forwardRef(({ className: n, selected: e = !1, icon: r, children: s, ...i }, t) => {
293
- const { expanded: c } = y();
294
- return /* @__PURE__ */ b(
295
- p.Trigger,
311
+ const X = o.forwardRef(({ className: n, selected: e = !1, icon: r, children: s, ...i }, d) => {
312
+ const { expanded: c } = g();
313
+ return /* @__PURE__ */ m(
314
+ x.Trigger,
296
315
  {
297
- ref: t,
316
+ ref: d,
298
317
  "aria-current": e ? "page" : void 0,
299
- className: o(
300
- f({
318
+ className: t(
319
+ v({
301
320
  variant: e ? "selected" : "unselected"
302
321
  }),
303
322
  "text-left",
@@ -306,13 +325,13 @@ const X = d.forwardRef(({ className: n, selected: e = !1, icon: r, children: s,
306
325
  ...i,
307
326
  children: [
308
327
  r != null && /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: r }),
309
- /* @__PURE__ */ a("span", { className: o("flex-1 truncate", !c && "sr-only"), children: s }),
328
+ /* @__PURE__ */ a("span", { className: t("flex-1 truncate", !c && "sr-only"), children: s }),
310
329
  /* @__PURE__ */ a(
311
- w,
330
+ R,
312
331
  {
313
332
  size: 16,
314
333
  "aria-hidden": "true",
315
- className: o(
334
+ className: t(
316
335
  "shrink-0 transition-transform group-data-[panel-open]/row:rotate-180",
317
336
  !c && "hidden"
318
337
  )
@@ -323,17 +342,17 @@ const X = d.forwardRef(({ className: n, selected: e = !1, icon: r, children: s,
323
342
  );
324
343
  });
325
344
  X.displayName = "SidebarSecondaryMenuSubTrigger";
326
- const G = d.forwardRef(({ className: n, children: e, ...r }, s) => /* @__PURE__ */ a(p.Panel, { ref: s, className: o(n), ...r, children: /* @__PURE__ */ a("ul", { className: "flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]", children: e }) }));
345
+ const G = o.forwardRef(({ className: n, children: e, ...r }, s) => /* @__PURE__ */ a(x.Panel, { ref: s, className: t(n), ...r, children: /* @__PURE__ */ a("ul", { className: "flex flex-col gap-[var(--ui-sidebar-secondary-section-menu-item-list-gap)]", children: e }) }));
327
346
  G.displayName = "SidebarSecondaryMenuSubContent";
328
- const J = d.forwardRef(({ className: n, selected: e = !1, render: r, children: s, ...i }, t) => {
329
- const { expanded: c } = y(), l = S({
347
+ const J = o.forwardRef(({ className: n, selected: e = !1, render: r, children: s, ...i }, d) => {
348
+ const { expanded: c } = g(), l = N({
330
349
  render: r,
331
- ref: t,
350
+ ref: d,
332
351
  defaultTagName: "a",
333
- props: v(
352
+ props: h(
334
353
  {
335
- className: o(
336
- f({
354
+ className: t(
355
+ v({
337
356
  variant: e ? "selected" : "unselected"
338
357
  }),
339
358
  // Level-2 left indent (no icon column). The dedicated level-2 padding
@@ -344,7 +363,7 @@ const J = d.forwardRef(({ className: n, selected: e = !1, render: r, children: s
344
363
  n
345
364
  ),
346
365
  "aria-current": e ? "page" : void 0,
347
- children: /* @__PURE__ */ a("span", { className: o("flex-1 truncate text-left", !c && "sr-only"), children: s })
366
+ children: /* @__PURE__ */ a("span", { className: t("flex-1 truncate text-left", !c && "sr-only"), children: s })
348
367
  },
349
368
  i
350
369
  )
@@ -352,22 +371,22 @@ const J = d.forwardRef(({ className: n, selected: e = !1, render: r, children: s
352
371
  return /* @__PURE__ */ a("li", { className: "contents", children: l });
353
372
  });
354
373
  J.displayName = "SidebarSecondaryMenuSubItem";
355
- const K = d.forwardRef(({ className: n, variant: e, shortcut: r, tag: s, children: i, ...t }, c) => {
356
- const { expanded: l } = y(), u = e === "tag" || e === "tag-externalLink", m = e === "externalLink" || e === "tag-externalLink", g = e === "shortcut";
357
- return /* @__PURE__ */ b(
374
+ const K = o.forwardRef(({ className: n, variant: e, shortcut: r, tag: s, children: i, ...d }, c) => {
375
+ const { expanded: l } = g(), u = e === "tag" || e === "tag-externalLink", b = e === "externalLink" || e === "tag-externalLink", p = e === "shortcut";
376
+ return /* @__PURE__ */ m(
358
377
  "span",
359
378
  {
360
379
  ref: c,
361
- className: o(
380
+ className: t(
362
381
  "inline-flex items-center gap-[var(--ui-sidebar-secondary-menu-item-extras-global-container-gap)]",
363
382
  !l && "hidden",
364
383
  n
365
384
  ),
366
- ...t,
385
+ ...d,
367
386
  children: [
368
387
  u && (s ?? i),
369
- g && /* @__PURE__ */ a("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 }),
370
- m && /* @__PURE__ */ a(
388
+ p && /* @__PURE__ */ a("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 }),
389
+ b && /* @__PURE__ */ a(
371
390
  I,
372
391
  {
373
392
  size: 16,
@@ -379,26 +398,48 @@ const K = d.forwardRef(({ className: n, variant: e, shortcut: r, tag: s, childre
379
398
  );
380
399
  });
381
400
  K.displayName = "SidebarSecondaryMenuItemExtras";
382
- const Q = d.forwardRef(({ className: n, icon: e, children: r, onClick: s, ...i }, t) => {
383
- const { expanded: c, toggleExpanded: l } = y();
384
- return /* @__PURE__ */ a("li", { className: "contents", children: /* @__PURE__ */ b(
401
+ const Q = o.forwardRef(({ className: n, icon: e, shortcut: r, children: s, onClick: i, ...d }, c) => {
402
+ const { expanded: l, toggleExpanded: u } = g();
403
+ return /* @__PURE__ */ a("li", { className: "contents", children: /* @__PURE__ */ m(
385
404
  "button",
386
405
  {
387
- ref: t,
406
+ ref: c,
388
407
  type: "button",
389
- "aria-expanded": c,
390
- className: o(
391
- f({ variant: "unselected" }),
408
+ "aria-expanded": l,
409
+ className: t(
410
+ v({ variant: "unselected" }),
392
411
  "text-left",
393
412
  n
394
413
  ),
395
- onClick: (u) => {
396
- s == null || s(u), u.defaultPrevented || l();
414
+ onClick: (b) => {
415
+ i == null || i(b), b.defaultPrevented || u();
397
416
  },
398
- ...i,
417
+ ...d,
399
418
  children: [
400
- e != null && /* @__PURE__ */ a("span", { className: "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)]", children: e }),
401
- /* @__PURE__ */ a("span", { className: o("flex-1 truncate", !c && "sr-only"), children: r })
419
+ e != null && // Flip the chevron when collapsed so a chevron-left ("collapse")
420
+ // becomes a chevron-right ("expand") the icon always points toward
421
+ // the action it triggers.
422
+ /* @__PURE__ */ a(
423
+ "span",
424
+ {
425
+ className: t(
426
+ "flex shrink-0 items-center self-start mt-[var(--ui-sidebar-secondary-menu-item-global-icon-margin-t)] transition-transform",
427
+ !l && "rotate-180"
428
+ ),
429
+ children: e
430
+ }
431
+ ),
432
+ /* @__PURE__ */ a("span", { className: t("flex-1 truncate", !l && "sr-only"), children: s }),
433
+ r != null && /* @__PURE__ */ a(
434
+ "span",
435
+ {
436
+ className: t(
437
+ "shrink-0 ui-sidebar-secondary-menu-item-extras-global-shortcut-text-style text-[var(--ui-sidebar-secondary-menu-item-extras-global-shortcut-color)]",
438
+ !l && "sr-only"
439
+ ),
440
+ children: r
441
+ }
442
+ )
402
443
  ]
403
444
  }
404
445
  ) });
@@ -407,8 +448,8 @@ Q.displayName = "SidebarSecondaryCollapseTrigger";
407
448
  export {
408
449
  P as SidebarSecondary,
409
450
  Q as SidebarSecondaryCollapseTrigger,
410
- A as SidebarSecondaryCollapsedBreadcrumb,
411
- _ as SidebarSecondaryContent,
451
+ _ as SidebarSecondaryCollapsedBreadcrumb,
452
+ A as SidebarSecondaryContent,
412
453
  B as SidebarSecondaryFooter,
413
454
  L as SidebarSecondaryHeader,
414
455
  D as SidebarSecondaryMenu,
@@ -418,8 +459,8 @@ export {
418
459
  G as SidebarSecondaryMenuSubContent,
419
460
  J as SidebarSecondaryMenuSubItem,
420
461
  X as SidebarSecondaryMenuSubTrigger,
421
- V as SidebarSecondarySection,
462
+ H as SidebarSecondarySection,
422
463
  j as SidebarSecondarySectionLabel,
423
- f as sidebarSecondaryMenuItemVariants
464
+ v as sidebarSecondaryMenuItemVariants
424
465
  };
425
466
  //# sourceMappingURL=sidebar-secondary.js.map