@burdenoff/fe-libs 2026.805.2 → 2026.805.3

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,11 +1,12 @@
1
1
  import { useShellUi as e } from "../shared/providers/shell/ShellUiProvider.js";
2
2
  import { useSafePersonaSurface as t } from "../shared/providers/shell/PersonaSurfaceProvider.js";
3
- import { useCallback as n, useEffect as r, useRef as i, useState as a } from "react";
4
- import { Check as o, ChevronsUpDown as s, Eye as c, Plus as l, Search as u, SlidersHorizontal as d, X as ee } from "lucide-react";
5
- import { Fragment as f, jsx as p, jsxs as m } from "react/jsx-runtime";
6
- import { createPortal as h } from "react-dom";
3
+ import { useShellLabel as n } from "../shared/providers/shell/useShellLabel.js";
4
+ import { useCallback as r, useEffect as i, useRef as a, useState as o } from "react";
5
+ import { Check as s, ChevronsUpDown as c, Eye as l, Plus as u, Search as d, SlidersHorizontal as f, X as p } from "lucide-react";
6
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
7
+ import { createPortal as _ } from "react-dom";
7
8
  //#region src/chrome/PersonaSurfaceControls.tsx
8
- function te(e, t) {
9
+ function ee(e, t) {
9
10
  let { surfaces: n, availableSurfaceIds: r, resolvedSurfaceId: i } = e, a = (e) => e === "everything" ? t : n.find((t) => t.id === e)?.label ?? e, o = [...r];
10
11
  return o.sort((e, t) => {
11
12
  let n = (e) => e === i ? 0 : e === "everything" ? 2 : 1;
@@ -16,15 +17,15 @@ function te(e, t) {
16
17
  isResolved: e === i
17
18
  }));
18
19
  }
19
- var g = 300;
20
- function _({ everythingLabel: e, onOpenCustomize: d }) {
21
- let _ = t(), [v, y] = a(!1), [b, x] = a(""), [S, C] = a(null), w = i(null), T = i(null), E = i(null), D = i(null), O = n(() => {
22
- y(!1), x("");
23
- }, []), k = n(() => {
24
- let e = T.current?.getBoundingClientRect();
20
+ var v = 300;
21
+ function y({ everythingLabel: e, onOpenCustomize: n }) {
22
+ let f = t(), [y, b] = o(!1), [x, S] = o(""), [C, w] = o(null), T = a(null), E = a(null), D = a(null), O = a(null), k = r(() => {
23
+ b(!1), S("");
24
+ }, []), A = r(() => {
25
+ let e = E.current?.getBoundingClientRect();
25
26
  if (!e) return;
26
- let t = window.innerWidth, n = Math.min(Math.max(e.width, g), t - 16), r = Math.min(Math.max(8, e.left), t - n - 8);
27
- C((t) => {
27
+ let t = window.innerWidth, n = Math.min(Math.max(e.width, v), t - 16), r = Math.min(Math.max(8, e.left), t - n - 8);
28
+ w((t) => {
28
29
  let i = window.innerHeight - e.top + 8;
29
30
  return t && t.left === r && t.bottom === i && t.width === n ? t : {
30
31
  left: r,
@@ -33,234 +34,234 @@ function _({ everythingLabel: e, onOpenCustomize: d }) {
33
34
  };
34
35
  });
35
36
  }, []);
36
- if (r(() => {
37
- if (!v) {
38
- C(null);
37
+ if (i(() => {
38
+ if (!y) {
39
+ w(null);
39
40
  return;
40
41
  }
41
- k(), window.addEventListener("resize", k), window.addEventListener("scroll", k, !0);
42
- let e = typeof ResizeObserver < "u" && T.current ? new ResizeObserver(k) : null;
43
- return e && T.current && e.observe(T.current), () => {
44
- window.removeEventListener("resize", k), window.removeEventListener("scroll", k, !0), e?.disconnect();
42
+ A(), window.addEventListener("resize", A), window.addEventListener("scroll", A, !0);
43
+ let e = typeof ResizeObserver < "u" && E.current ? new ResizeObserver(A) : null;
44
+ return e && E.current && e.observe(E.current), () => {
45
+ window.removeEventListener("resize", A), window.removeEventListener("scroll", A, !0), e?.disconnect();
45
46
  };
46
- }, [v, k]), r(() => {
47
- if (!v) return;
47
+ }, [y, A]), i(() => {
48
+ if (!y) return;
48
49
  let e = (e) => {
49
50
  let t = e.target;
50
- !w.current?.contains(t) && !E.current?.contains(t) && O();
51
+ !T.current?.contains(t) && !D.current?.contains(t) && k();
51
52
  };
52
53
  return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
53
54
  document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
54
55
  };
55
- }, [v, O]), r(() => {
56
- v && D.current?.focus();
57
- }, [v]), !_) return null;
58
- let { activeSurfaceId: A, surfaces: j, resolvedSurfaceId: M, setSurfaceId: N, canSimulate: P, simulation: F, startSimulation: I, stopSimulation: L, simulatableRoles: R, simulatableRolesLoading: z, loadSimulatableRoles: B, customViews: V, canManageViews: H } = _, U = te(_, e), W = b.trim().toLowerCase(), G = W ? U.filter((e) => e.label.toLowerCase().includes(W)) : U, K = W ? V.filter((e) => e.name.toLowerCase().includes(W)) : V, q = W ? R.filter((e) => e.name.toLowerCase().includes(W)) : R, J = F ? F.roleName : U.find((e) => e.id === A)?.label ?? j.find((e) => e.id === A)?.label ?? V.find((e) => e.id === A)?.name ?? e, Y = () => {
59
- if (v) {
60
- O();
56
+ }, [y, k]), i(() => {
57
+ y && O.current?.focus();
58
+ }, [y]), !f) return null;
59
+ let { activeSurfaceId: j, surfaces: te, resolvedSurfaceId: M, setSurfaceId: N, canSimulate: P, simulation: F, startSimulation: I, stopSimulation: L, simulatableRoles: R, simulatableRolesLoading: z, loadSimulatableRoles: B, customViews: V, canManageViews: H } = f, U = ee(f, e), W = x.trim().toLowerCase(), G = W ? U.filter((e) => e.label.toLowerCase().includes(W)) : U, K = W ? V.filter((e) => e.name.toLowerCase().includes(W)) : V, q = W ? R.filter((e) => e.name.toLowerCase().includes(W)) : R, J = F ? F.roleName : U.find((e) => e.id === j)?.label ?? te.find((e) => e.id === j)?.label ?? V.find((e) => e.id === j)?.name ?? e, Y = () => {
60
+ if (y) {
61
+ k();
61
62
  return;
62
63
  }
63
- P && B(), y(!0);
64
+ P && B(), b(!0);
64
65
  }, X = (e) => {
65
- e.key === "Escape" && v && (e.preventDefault(), e.stopPropagation(), O());
66
+ e.key === "Escape" && y && (e.preventDefault(), e.stopPropagation(), k());
66
67
  }, Z = (e) => {
67
- F && L(), N(e === M ? null : e), O();
68
+ F && L(), N(e === M ? null : e), k();
68
69
  }, Q = "flex w-full min-h-9 items-center gap-2 rounded-button px-2.5 py-1.5 text-left text-body-sm text-text-primary hover:bg-bg-sunken transition-colors", $ = "px-2.5 pb-1 pt-2.5 text-[11px] font-medium uppercase tracking-wider text-text-muted";
69
- return /* @__PURE__ */ m("div", {
70
- ref: w,
70
+ return /* @__PURE__ */ g("div", {
71
+ ref: T,
71
72
  className: "relative min-w-0 flex-1",
72
73
  onKeyDown: X,
73
- children: [v && S && typeof document < "u" && h(/* @__PURE__ */ m("div", {
74
- ref: E,
74
+ children: [y && C && typeof document < "u" && _(/* @__PURE__ */ g("div", {
75
+ ref: D,
75
76
  style: {
76
- left: S.left,
77
- bottom: S.bottom,
78
- width: S.width
77
+ left: C.left,
78
+ bottom: C.bottom,
79
+ width: C.width
79
80
  },
80
81
  className: "fixed z-[130] flex max-h-80 flex-col overflow-hidden rounded-card border border-border-subtle bg-bg-canvas shadow-lg",
81
82
  role: "listbox",
82
83
  "data-testid": "persona-view-panel",
83
84
  onKeyDown: X,
84
- children: [/* @__PURE__ */ m("div", {
85
+ children: [/* @__PURE__ */ g("div", {
85
86
  className: "flex items-center gap-2 border-b border-border-subtle px-2.5 py-2",
86
- children: [/* @__PURE__ */ p(u, { className: "size-4 flex-shrink-0 text-text-muted" }), /* @__PURE__ */ p("input", {
87
- ref: D,
88
- value: b,
89
- onChange: (e) => x(e.target.value),
87
+ children: [/* @__PURE__ */ h(d, { className: "size-4 flex-shrink-0 text-text-muted" }), /* @__PURE__ */ h("input", {
88
+ ref: O,
89
+ value: x,
90
+ onChange: (e) => S(e.target.value),
90
91
  placeholder: "Search views & roles",
91
92
  className: "w-full bg-transparent text-body-sm text-text-primary outline-none placeholder:text-text-muted",
92
93
  "data-testid": "persona-view-search"
93
94
  })]
94
- }), /* @__PURE__ */ m("div", {
95
+ }), /* @__PURE__ */ g("div", {
95
96
  className: "overflow-y-auto py-1",
96
97
  children: [
97
- G.length > 0 && /* @__PURE__ */ p("p", {
98
+ G.length > 0 && /* @__PURE__ */ h("p", {
98
99
  className: $,
99
100
  children: "Views"
100
101
  }),
101
102
  G.map((e) => {
102
- let t = !F && e.id === A;
103
- return /* @__PURE__ */ m("button", {
103
+ let t = !F && e.id === j;
104
+ return /* @__PURE__ */ g("button", {
104
105
  type: "button",
105
106
  onClick: () => Z(e.id),
106
107
  className: Q,
107
108
  "data-testid": `persona-view-${e.id}`,
108
109
  children: [
109
- /* @__PURE__ */ p(o, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }),
110
- /* @__PURE__ */ p("span", {
110
+ /* @__PURE__ */ h(s, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }),
111
+ /* @__PURE__ */ h("span", {
111
112
  className: "truncate",
112
113
  children: e.label
113
114
  }),
114
- e.isResolved && /* @__PURE__ */ p("span", {
115
+ e.isResolved && /* @__PURE__ */ h("span", {
115
116
  className: "ml-auto flex-shrink-0 rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
116
117
  children: "Your role"
117
118
  })
118
119
  ]
119
120
  }, e.id);
120
121
  }),
121
- (K.length > 0 || H && !W) && /* @__PURE__ */ m(f, { children: [
122
- /* @__PURE__ */ p("p", {
122
+ (K.length > 0 || H && !W) && /* @__PURE__ */ g(m, { children: [
123
+ /* @__PURE__ */ h("p", {
123
124
  className: $,
124
125
  children: "My views"
125
126
  }),
126
127
  K.map((e) => {
127
- let t = !F && e.id === A;
128
- return /* @__PURE__ */ m("button", {
128
+ let t = !F && e.id === j;
129
+ return /* @__PURE__ */ g("button", {
129
130
  type: "button",
130
131
  onClick: () => Z(e.id),
131
132
  className: Q,
132
133
  "data-testid": `persona-view-${e.id}`,
133
- children: [/* @__PURE__ */ p(o, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }), /* @__PURE__ */ p("span", {
134
+ children: [/* @__PURE__ */ h(s, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }), /* @__PURE__ */ h("span", {
134
135
  className: "truncate",
135
136
  children: e.name
136
137
  })]
137
138
  }, e.id);
138
139
  }),
139
- H && !W && /* @__PURE__ */ m("button", {
140
+ H && !W && /* @__PURE__ */ g("button", {
140
141
  type: "button",
141
142
  onClick: () => {
142
- O(), d();
143
+ k(), n();
143
144
  },
144
145
  className: `${Q} text-text-secondary`,
145
146
  "data-testid": "persona-view-create",
146
- children: [/* @__PURE__ */ p(l, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: "New view from current…" })]
147
+ children: [/* @__PURE__ */ h(u, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children: "New view from current…" })]
147
148
  })
148
149
  ] }),
149
- P && /* @__PURE__ */ m(f, { children: [
150
- /* @__PURE__ */ p("p", {
150
+ P && /* @__PURE__ */ g(m, { children: [
151
+ /* @__PURE__ */ h("p", {
151
152
  className: $,
152
153
  children: "Preview a role"
153
154
  }),
154
- F && /* @__PURE__ */ m("button", {
155
+ F && /* @__PURE__ */ g("button", {
155
156
  type: "button",
156
157
  onClick: () => {
157
- L(), O();
158
+ L(), k();
158
159
  },
159
160
  className: `${Q} text-status-warning-text`,
160
161
  "data-testid": "persona-view-exit-preview",
161
- children: [/* @__PURE__ */ p(ee, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ p("span", { children: "Exit preview" })]
162
+ children: [/* @__PURE__ */ h(p, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ h("span", { children: "Exit preview" })]
162
163
  }),
163
- z && /* @__PURE__ */ p("p", {
164
+ z && /* @__PURE__ */ h("p", {
164
165
  className: "px-2.5 py-1.5 text-body-sm text-text-muted",
165
166
  children: "Loading roles…"
166
167
  }),
167
168
  q.map((e) => {
168
169
  let t = F?.roleId === e.id;
169
- return /* @__PURE__ */ m("button", {
170
+ return /* @__PURE__ */ g("button", {
170
171
  type: "button",
171
172
  onClick: () => {
172
- I(e), O();
173
+ I(e), k();
173
174
  },
174
175
  className: Q,
175
176
  "data-testid": `persona-preview-${e.id}`,
176
177
  children: [
177
- /* @__PURE__ */ p(c, { className: `size-4 flex-shrink-0 ${t ? "text-status-warning-text" : "text-text-muted"}` }),
178
- /* @__PURE__ */ p("span", {
178
+ /* @__PURE__ */ h(l, { className: `size-4 flex-shrink-0 ${t ? "text-status-warning-text" : "text-text-muted"}` }),
179
+ /* @__PURE__ */ h("span", {
179
180
  className: "truncate",
180
181
  children: e.name
181
182
  }),
182
- t && /* @__PURE__ */ p(o, { className: "ml-auto size-4 flex-shrink-0" })
183
+ t && /* @__PURE__ */ h(s, { className: "ml-auto size-4 flex-shrink-0" })
183
184
  ]
184
185
  }, e.id);
185
186
  }),
186
- !z && q.length === 0 && W && /* @__PURE__ */ p("p", {
187
+ !z && q.length === 0 && W && /* @__PURE__ */ h("p", {
187
188
  className: "px-2.5 py-1.5 text-body-sm text-text-muted",
188
189
  children: "No matching roles"
189
190
  })
190
191
  ] }),
191
- G.length === 0 && (!P || q.length === 0) && W && /* @__PURE__ */ p("p", {
192
+ G.length === 0 && (!P || q.length === 0) && W && /* @__PURE__ */ h("p", {
192
193
  className: "px-2.5 py-1.5 text-body-sm text-text-muted",
193
194
  children: "No matches"
194
195
  })
195
196
  ]
196
197
  })]
197
- }), document.body), /* @__PURE__ */ m("button", {
198
- ref: T,
198
+ }), document.body), /* @__PURE__ */ g("button", {
199
+ ref: E,
199
200
  type: "button",
200
201
  onClick: Y,
201
- "aria-expanded": v,
202
+ "aria-expanded": y,
202
203
  "aria-haspopup": "listbox",
203
204
  className: `flex w-full min-h-9 items-center gap-2 rounded-button border px-2.5 py-1.5 text-body-sm transition-colors ${F ? "border-status-warning-text/40 bg-status-warning-bg-subtle text-text-primary" : "border-border-subtle bg-bg-canvas text-text-primary hover:bg-bg-sunken"}`,
204
205
  "data-testid": "persona-view-trigger",
205
206
  children: [
206
- F ? /* @__PURE__ */ p(c, { className: "size-4 flex-shrink-0 text-status-warning-text" }) : /* @__PURE__ */ p(o, { className: "size-4 flex-shrink-0 text-text-muted" }),
207
- /* @__PURE__ */ p("span", {
207
+ F ? /* @__PURE__ */ h(l, { className: "size-4 flex-shrink-0 text-status-warning-text" }) : /* @__PURE__ */ h(s, { className: "size-4 flex-shrink-0 text-text-muted" }),
208
+ /* @__PURE__ */ h("span", {
208
209
  className: "min-w-0 flex-1 truncate text-left",
209
210
  children: F ? `Preview: ${J}` : J
210
211
  }),
211
- /* @__PURE__ */ p(s, { className: "size-4 flex-shrink-0 text-text-muted" })
212
+ /* @__PURE__ */ h(c, { className: "size-4 flex-shrink-0 text-text-muted" })
212
213
  ]
213
214
  })]
214
215
  });
215
216
  }
216
- function v({ everythingLabel: n = "Everything", customizeLabel: r = "Customize menu" }) {
217
- let i = t(), { sidebarCollapsed: a, toggleSidebar: o } = e();
218
- if (!i) return null;
219
- let { setCustomizeOpen: s } = i, c = () => {
220
- typeof window < "u" && window.innerWidth < 768 && !a && o(), s(!0);
221
- }, l = /* @__PURE__ */ p("button", {
217
+ function b({ everythingLabel: r, customizeLabel: i }) {
218
+ let a = t(), { sidebarCollapsed: o, toggleSidebar: s } = e(), c = n(), l = r ?? c("nav.everything", "Everything"), u = i ?? c("nav.customizeMenu", "Customize menu");
219
+ if (!a) return null;
220
+ let { setCustomizeOpen: d } = a, p = () => {
221
+ typeof window < "u" && window.innerWidth < 768 && !o && s(), d(!0);
222
+ }, m = /* @__PURE__ */ h("button", {
222
223
  type: "button",
223
- onClick: c,
224
+ onClick: p,
224
225
  className: "p-2 rounded-button text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors flex-shrink-0",
225
- "aria-label": r,
226
- title: r,
226
+ "aria-label": u,
227
+ title: u,
227
228
  "data-testid": "persona-customize-trigger",
228
- children: /* @__PURE__ */ p(d, { className: "size-4" })
229
+ children: /* @__PURE__ */ h(f, { className: "size-4" })
229
230
  });
230
- return a ? /* @__PURE__ */ p("div", {
231
+ return o ? /* @__PURE__ */ h("div", {
231
232
  className: "hidden md:flex justify-center",
232
233
  "data-testid": "persona-controls-collapsed",
233
- children: l
234
- }) : /* @__PURE__ */ m("div", {
234
+ children: m
235
+ }) : /* @__PURE__ */ g("div", {
235
236
  className: "flex items-center gap-1",
236
237
  "data-testid": "persona-controls",
237
- children: [/* @__PURE__ */ p(_, {
238
- everythingLabel: n,
239
- onOpenCustomize: c
240
- }), l]
238
+ children: [/* @__PURE__ */ h(y, {
239
+ everythingLabel: l,
240
+ onOpenCustomize: p
241
+ }), m]
241
242
  });
242
243
  }
243
- function y() {
244
+ function x() {
244
245
  let e = t();
245
- return e?.simulation ? /* @__PURE__ */ m("div", {
246
+ return e?.simulation ? /* @__PURE__ */ g("div", {
246
247
  className: "fixed bottom-4 left-1/2 z-[120] -translate-x-1/2 flex max-w-[calc(100vw-2rem)] items-center gap-2 rounded-full border border-border-subtle bg-bg-canvas px-4 py-2 shadow-lg",
247
248
  style: { marginBottom: "env(safe-area-inset-bottom)" },
248
249
  role: "status",
249
250
  "data-testid": "persona-simulation-pill",
250
251
  children: [
251
- /* @__PURE__ */ p(c, { className: "size-4 flex-shrink-0 text-status-warning-text" }),
252
- /* @__PURE__ */ m("span", {
252
+ /* @__PURE__ */ h(l, { className: "size-4 flex-shrink-0 text-status-warning-text" }),
253
+ /* @__PURE__ */ g("span", {
253
254
  className: "truncate text-body-sm text-text-primary",
254
255
  children: [
255
256
  "Viewing as ",
256
- /* @__PURE__ */ p("span", {
257
+ /* @__PURE__ */ h("span", {
257
258
  className: "font-semibold",
258
259
  children: e.simulation.roleName
259
260
  }),
260
261
  " (simulated)"
261
262
  ]
262
263
  }),
263
- /* @__PURE__ */ p("button", {
264
+ /* @__PURE__ */ h("button", {
264
265
  type: "button",
265
266
  onClick: e.stopSimulation,
266
267
  className: "rounded-full px-2 py-0.5 text-body-sm font-medium text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors",
@@ -271,4 +272,4 @@ function y() {
271
272
  }) : null;
272
273
  }
273
274
  //#endregion
274
- export { y as PersonaSimulationPill, v as PersonaSurfaceControls };
275
+ export { x as PersonaSimulationPill, b as PersonaSurfaceControls };
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSideNav.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSideNav.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAGhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgBpD,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,IAAI,EAAE,SAAS,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,+BAA+B;IAC/B,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,aAAiC,EACjC,aAA0B,GAC3B,EAAE,mBAAmB,2CAiHrB"}
1
+ {"version":3,"file":"ProductSideNav.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSideNav.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAW,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAIhD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAgBpD,MAAM,WAAW,mBAAmB;IAClC,mFAAmF;IACnF,IAAI,EAAE,SAAS,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,MAAM,CAAC;IAChB,yBAAyB;IACzB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACpC,+BAA+B;IAC/B,aAAa,CAAC,EAAE,gBAAgB,EAAE,CAAC;IACnC,0DAA0D;IAC1D,YAAY,CAAC,EAAE,SAAS,CAAC;IACzB,mDAAmD;IACnD,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,kDAAkD;IAClD,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,wBAAgB,cAAc,CAAC,EAC7B,IAAI,EACJ,OAAO,EACP,UAAU,EACV,WAAW,EACX,aAAa,EACb,YAAY,EACZ,aAAa,EACb,aAAa,GACd,EAAE,mBAAmB,2CAoHrB"}
@@ -3,87 +3,88 @@ import { hasMatchingPermission as t, useSafePermissions as n } from "../shared/p
3
3
  import { useShellUi as r } from "../shared/providers/shell/ShellUiProvider.js";
4
4
  import { useSafePersonaSurface as i } from "../shared/providers/shell/PersonaSurfaceProvider.js";
5
5
  import { appendContextToPath as a, useCurrentContextSearchParams as o } from "../shared/hooks/useCurrentContextSearchParams.js";
6
- import { applyNavVisibility as s } from "./sideNavigation/navVisibility.js";
7
- import { SideNavigation as c } from "./SideNavigation.js";
8
- import { NavCustomizeDialog as l } from "./NavCustomizeDialog.js";
9
- import { PersonaSimulationPill as u, PersonaSurfaceControls as d } from "./PersonaSurfaceControls.js";
10
- import { useMemo as f } from "react";
11
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
12
- import { useLocation as g, useNavigate as _ } from "react-router";
6
+ import { useShellLabel as s } from "../shared/providers/shell/useShellLabel.js";
7
+ import { applyNavVisibility as c } from "./sideNavigation/navVisibility.js";
8
+ import { SideNavigation as l } from "./SideNavigation.js";
9
+ import { NavCustomizeDialog as u } from "./NavCustomizeDialog.js";
10
+ import { PersonaSimulationPill as d, PersonaSurfaceControls as f } from "./PersonaSurfaceControls.js";
11
+ import { useMemo as p } from "react";
12
+ import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
+ import { useLocation as _, useNavigate as v } from "react-router";
13
14
  //#region src/chrome/ProductSideNav.tsx
14
- function v({ logo: v, appName: y, groupOrder: b, groupLabels: x, mobileActions: S, customHeader: C, homeAriaLabel: w = "Go to dashboard", collapseLabel: T = "Collapse" }) {
15
- let E = _(), D = g(), { sidebarCollapsed: O, toggleSidebar: k } = r(), A = o(), j = e((e) => e.items), M = n(), N = i(), P = N?.simulation ?? null, F = M?.hasPermission, I = !!M && !M.isLoading && !M.error, L = f(() => {
16
- if (P) {
17
- let e = P.permissionStrings;
15
+ function y({ logo: y, appName: b, groupOrder: x, groupLabels: S, mobileActions: C, customHeader: w, homeAriaLabel: T, collapseLabel: E }) {
16
+ let D = s(), O = T ?? D("nav.goToDashboard", "Go to dashboard"), k = E ?? D("nav.collapse", "Collapse"), A = v(), j = _(), { sidebarCollapsed: M, toggleSidebar: N } = r(), P = o(), F = e((e) => e.items), I = n(), L = i(), R = L?.simulation ?? null, z = I?.hasPermission, B = !!I && !I.isLoading && !I.error, V = p(() => {
17
+ if (R) {
18
+ let e = R.permissionStrings;
18
19
  return (n) => t(e, n);
19
20
  }
20
- if (I && F) return F;
21
+ if (B && z) return z;
21
22
  }, [
22
- P,
23
- I,
24
- F
25
- ]), R = N?.activeSurface ?? null, z = N?.overrides, B = f(() => {
26
- let { items: e } = s(j.filter((e) => e.visible !== !1).sort((e, t) => (e.order ?? 999) - (t.order ?? 999)), {
27
- hasPermission: L,
28
- surfaceVisibleItems: R ? R.visibleItems : null,
29
- labelOverrides: R?.labelOverrides,
30
- overrides: P ? {} : z
23
+ R,
24
+ B,
25
+ z
26
+ ]), H = L?.activeSurface ?? null, U = L?.overrides, W = p(() => {
27
+ let { items: e } = c(F.filter((e) => e.visible !== !1).sort((e, t) => (e.order ?? 999) - (t.order ?? 999)), {
28
+ hasPermission: V,
29
+ surfaceVisibleItems: H ? H.visibleItems : null,
30
+ labelOverrides: H?.labelOverrides,
31
+ overrides: R ? {} : U
31
32
  });
32
33
  return e;
33
34
  }, [
34
- j,
35
- L,
36
- R,
37
- z,
38
- P
39
- ]), V = (e) => {
40
- E(a(e, A));
41
- }, H = () => {
42
- E(a("/", A));
43
- }, U = /* @__PURE__ */ h("div", {
35
+ F,
36
+ V,
37
+ H,
38
+ U,
39
+ R
40
+ ]), G = (e) => {
41
+ A(a(e, P));
42
+ }, K = () => {
43
+ A(a("/", P));
44
+ }, q = /* @__PURE__ */ g("div", {
44
45
  className: "flex items-center gap-icon-gap cursor-pointer",
45
- onClick: H,
46
+ onClick: K,
46
47
  role: "button",
47
48
  tabIndex: 0,
48
49
  onKeyDown: (e) => {
49
- (e.key === "Enter" || e.key === " ") && (e.preventDefault(), H());
50
+ (e.key === "Enter" || e.key === " ") && (e.preventDefault(), K());
50
51
  },
51
- "aria-label": w,
52
- children: [typeof v == "string" ? /* @__PURE__ */ m("div", {
52
+ "aria-label": O,
53
+ children: [typeof y == "string" ? /* @__PURE__ */ h("div", {
53
54
  className: "size-8 bg-action-primary-bg rounded-md flex items-center justify-center flex-shrink-0",
54
- children: /* @__PURE__ */ m("span", {
55
+ children: /* @__PURE__ */ h("span", {
55
56
  className: "text-action-primary-text font-bold text-sm",
56
- children: v
57
+ children: y
57
58
  })
58
- }) : /* @__PURE__ */ m("div", {
59
+ }) : /* @__PURE__ */ h("div", {
59
60
  className: "size-8 flex items-center justify-center flex-shrink-0",
60
- children: v
61
- }), !O && /* @__PURE__ */ m("h1", {
62
- className: "text-heading-h4 font-semibold text-text-primary",
63
61
  children: y
62
+ }), !M && /* @__PURE__ */ h("h1", {
63
+ className: "text-heading-h4 font-semibold text-text-primary",
64
+ children: b
64
65
  })]
65
66
  });
66
- return /* @__PURE__ */ h("div", {
67
+ return /* @__PURE__ */ g("div", {
67
68
  "data-tour": "sidenav",
68
69
  className: "h-full",
69
- children: [/* @__PURE__ */ m(c, {
70
- items: B,
71
- currentPath: D.pathname,
72
- collapsed: O,
73
- groupOrder: b,
74
- groupLabels: x,
75
- onItemClick: V,
76
- onToggleCollapse: k,
77
- collapseLabel: T,
78
- mobileActions: S,
79
- header: C ?? U,
80
- footer: N ? /* @__PURE__ */ m(d, {}) : void 0,
81
- contextSearchParams: A
82
- }, N ? `${R?.id ?? "everything"}:${P?.roleId ?? ""}` : void 0), N && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m(l, {
83
- groupLabels: x,
84
- groupOrder: b
85
- }), /* @__PURE__ */ m(u, {})] })]
70
+ children: [/* @__PURE__ */ h(l, {
71
+ items: W,
72
+ currentPath: j.pathname,
73
+ collapsed: M,
74
+ groupOrder: x,
75
+ groupLabels: S,
76
+ onItemClick: G,
77
+ onToggleCollapse: N,
78
+ collapseLabel: k,
79
+ mobileActions: C,
80
+ header: w ?? q,
81
+ footer: L ? /* @__PURE__ */ h(f, {}) : void 0,
82
+ contextSearchParams: P
83
+ }, L ? `${H?.id ?? "everything"}:${R?.roleId ?? ""}` : void 0), L && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(u, {
84
+ groupLabels: S,
85
+ groupOrder: x
86
+ }), /* @__PURE__ */ h(d, {})] })]
86
87
  });
87
88
  }
88
89
  //#endregion
89
- export { v as ProductSideNav };
90
+ export { y as ProductSideNav };
@@ -1 +1 @@
1
- {"version":3,"file":"ProductSwitcher.d.ts","sourceRoot":"","sources":["../../src/chrome/ProductSwitcher.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAUhC,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gEAAgE;IAChE,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB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