@burdenoff/fe-libs 2026.1119.5 → 2026.1119.7

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 (94) hide show
  1. package/dist/chrome/HeaderThemeSwitcher.js +1 -1
  2. package/dist/chrome/PersonaSurfaceControls.js +82 -189
  3. package/dist/chrome/PersonaViewsList.d.ts +28 -0
  4. package/dist/chrome/PersonaViewsList.js +139 -0
  5. package/dist/chrome/ThemePreferences.js +16 -16
  6. package/dist/chrome/appearance/AppearanceColourSection.d.ts +17 -0
  7. package/dist/chrome/appearance/AppearanceColourSection.js +337 -0
  8. package/dist/chrome/appearance/AppearanceDisplaySection.d.ts +7 -0
  9. package/dist/chrome/appearance/AppearanceDisplaySection.js +137 -0
  10. package/dist/chrome/appearance/AppearanceModeDepth.d.ts +11 -0
  11. package/dist/chrome/appearance/AppearanceModeDepth.js +158 -0
  12. package/dist/chrome/appearance/AppearancePreferences.d.ts +13 -0
  13. package/dist/chrome/appearance/AppearancePreferences.js +308 -0
  14. package/dist/chrome/appearance/AppearancePreview.d.ts +23 -0
  15. package/dist/chrome/appearance/AppearancePreview.js +218 -0
  16. package/dist/chrome/appearance/AppearanceThemeSection.d.ts +14 -0
  17. package/dist/chrome/appearance/AppearanceThemeSection.js +162 -0
  18. package/dist/chrome/appearance/ColourPanel.d.ts +37 -0
  19. package/dist/chrome/appearance/ColourPanel.js +264 -0
  20. package/dist/chrome/appearance/ThemeDialog.d.ts +21 -0
  21. package/dist/chrome/appearance/ThemeDialog.js +378 -0
  22. package/dist/chrome/appearance/appearanceShared.d.ts +24 -0
  23. package/dist/chrome/appearance/appearanceShared.js +46 -0
  24. package/dist/chrome/appearance/appearanceUi.d.ts +49 -0
  25. package/dist/chrome/appearance/appearanceUi.js +98 -0
  26. package/dist/chrome/appearance/useAppearanceLabels.d.ts +181 -0
  27. package/dist/chrome/appearance/useAppearanceLabels.js +259 -0
  28. package/dist/chrome/index.d.ts +1 -0
  29. package/dist/chrome/personaViewOptions.d.ts +8 -0
  30. package/dist/chrome/personaViewOptions.js +14 -0
  31. package/dist/chrome/shell/NewMenu.d.ts +13 -1
  32. package/dist/chrome/shell/NewMenu.js +27 -14
  33. package/dist/chrome/shell/ShellSidebar.js +2 -0
  34. package/dist/chrome/shell/SidebarProfileMenu.d.ts +36 -4
  35. package/dist/chrome/shell/SidebarProfileMenu.js +423 -331
  36. package/dist/chrome/shell/WorkspaceAccountCard.d.ts +22 -0
  37. package/dist/chrome/shell/WorkspaceAccountCard.js +102 -0
  38. package/dist/chrome/shell/pageHost.d.ts +19 -0
  39. package/dist/chrome/shell/pageHost.js +21 -0
  40. package/dist/chrome/shell/pageWidth.d.ts +39 -0
  41. package/dist/chrome/shell/pageWidth.js +18 -0
  42. package/dist/chrome/shellLabelManifest.d.ts +6 -0
  43. package/dist/chrome.js +26 -25
  44. package/dist/platform-pages/AppearanceSettingsPage.d.ts +11 -1
  45. package/dist/platform-pages/AppearanceSettingsPage.js +15 -8
  46. package/dist/shared/assistant/ui/composer/AssistantComposer.js +346 -345
  47. package/dist/shared/backgrounds/BackgroundSettingsSection.d.ts +11 -0
  48. package/dist/shared/backgrounds/BackgroundSettingsSection.js +67 -0
  49. package/dist/shared/backgrounds/backgroundSectionLabels.d.ts +14 -0
  50. package/dist/shared/backgrounds/backgroundSectionLabels.js +36 -0
  51. package/dist/shared/backgrounds/index.d.ts +3 -0
  52. package/dist/shared/backgrounds/useBackgroundColors.js +3 -2
  53. package/dist/shared/backgrounds/useStartPageBackground.d.ts +12 -0
  54. package/dist/shared/backgrounds/useStartPageBackground.js +23 -0
  55. package/dist/shared/providers/AppShellProvider.d.ts +20 -1
  56. package/dist/shared/providers/AppShellProvider.js +230 -222
  57. package/dist/shared/providers/shell/PaletteThemeProvider.d.ts +13 -0
  58. package/dist/shared/providers/shell/PaletteThemeProvider.js +366 -0
  59. package/dist/shared/providers/shell/ThemeProvider.d.ts +9 -76
  60. package/dist/shared/providers/shell/ThemeProvider.js +63 -55
  61. package/dist/shared/providers/shell/appearance/colour.d.ts +29 -0
  62. package/dist/shared/providers/shell/appearance/colour.js +79 -0
  63. package/dist/shared/providers/shell/appearance/contrastFix.d.ts +70 -0
  64. package/dist/shared/providers/shell/appearance/contrastFix.js +117 -0
  65. package/dist/shared/providers/shell/appearance/index.d.ts +9 -0
  66. package/dist/shared/providers/shell/appearance/model.d.ts +68 -0
  67. package/dist/shared/providers/shell/appearance/model.js +92 -0
  68. package/dist/shared/providers/shell/appearance/operations.d.ts +70 -0
  69. package/dist/shared/providers/shell/appearance/operations.js +160 -0
  70. package/dist/shared/providers/shell/appearance/palettes.d.ts +111 -0
  71. package/dist/shared/providers/shell/appearance/palettes.js +460 -0
  72. package/dist/shared/providers/shell/appearance/storage.d.ts +39 -0
  73. package/dist/shared/providers/shell/appearance/storage.js +186 -0
  74. package/dist/shared/providers/shell/appearance/tokens.d.ts +5 -0
  75. package/dist/shared/providers/shell/appearance/tokens.js +43 -0
  76. package/dist/shared/providers/shell/appearance/types.d.ts +80 -0
  77. package/dist/shared/providers/shell/appearance/types.js +28 -0
  78. package/dist/shared/providers/shell/index.d.ts +1 -1
  79. package/dist/shared/providers/shell/responsiveDisplaySettings.d.ts +27 -0
  80. package/dist/shared/providers/shell/responsiveDisplaySettings.js +6 -0
  81. package/dist/shared/providers/shell/themeContext.d.ts +162 -0
  82. package/dist/shared/providers/shell/themeContext.js +4 -0
  83. package/dist/shared-backgrounds.js +4 -1
  84. package/dist/shell-native/system-bars.d.ts +5 -1
  85. package/dist/shell-native/system-bars.js +1 -1
  86. package/dist/ui/dropdown-menu.js +2 -0
  87. package/dist/ui/popover.js +1 -0
  88. package/dist/ui/select.js +1 -0
  89. package/package.json +5 -1
  90. package/src/shared/styles/page-widths.css +38 -0
  91. package/src/shared/tokens/build/brands/healthybowl.css +25 -3
  92. package/src/shared/tokens/build/themes.css +266 -0
  93. package/src/shared/tokens/display-settings.css +569 -0
  94. package/src/shared/tokens/tokens.css +4 -0
@@ -1,8 +1,8 @@
1
1
  import { useThemeOptionLabels as e } from "./useThemeOptionLabels.js";
2
2
  import { useTheme as t } from "../shared/providers/shell/ThemeProvider.js";
3
3
  import { DropdownMenu as n, DropdownMenuContent as r, DropdownMenuItem as i, DropdownMenuLabel as a, DropdownMenuSeparator as o, DropdownMenuTrigger as s } from "../ui/dropdown-menu.js";
4
- import "../utils/index.js";
5
4
  import { cn as c } from "../utils/cn.js";
5
+ import "../utils/index.js";
6
6
  import { useExclusiveMenu as l } from "../shared/hooks/useExclusiveMenu.js";
7
7
  import { useShellLabel as u } from "../shared/providers/shell/useShellLabel.js";
8
8
  import { useCallback as d, useState as f } from "react";
@@ -2,31 +2,22 @@ import { interpolateShellLabel as e } from "../shared/providers/shell/interpolat
2
2
  import { useSafePersonaSurface as t } from "../shared/providers/shell/PersonaSurfaceProvider.js";
3
3
  import { useShellUi as n } from "../shared/providers/shell/ShellUiProvider.js";
4
4
  import { useShellLabel as r } from "../shared/providers/shell/useShellLabel.js";
5
- import { useCallback as i, useEffect as a, useRef as o, useState as s } from "react";
6
- import { Check as c, ChevronsUpDown as l, Eye as u, Plus as d, Search as f, SlidersHorizontal as p, X as m } from "lucide-react";
7
- import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
8
- import { createPortal as ee } from "react-dom";
5
+ import { PersonaViewsList as i } from "./PersonaViewsList.js";
6
+ import { buildViewOptions as a } from "./personaViewOptions.js";
7
+ import { useCallback as o, useEffect as s, useRef as c, useState as l } from "react";
8
+ import { Check as u, ChevronsUpDown as d, Eye as f, SlidersHorizontal as p } from "lucide-react";
9
+ import { jsx as m, jsxs as h } from "react/jsx-runtime";
10
+ import { createPortal as g } from "react-dom";
9
11
  // src/chrome/PersonaSurfaceControls.tsx
10
- function v(e, t) {
11
- let { surfaces: n, availableSurfaceIds: r, roleSurfaceId: i } = e, a = (e) => e === "everything" ? t : n.find((t) => t.id === e)?.label ?? e, o = [...r];
12
- return o.sort((e, t) => {
13
- let n = (e) => e === i ? 0 : e === "everything" ? 2 : 1;
14
- return n(e) - n(t);
15
- }), o.map((e) => ({
16
- id: e,
17
- label: a(e),
18
- isOwnRole: e === i
19
- }));
20
- }
21
- var y = 300;
22
- function b({ everythingLabel: e, onOpenCustomize: n }) {
23
- let p = r(), b = t(), [x, S] = s(!1), [C, w] = s(""), [T, E] = s(null), D = o(null), O = o(null), k = o(null), A = o(null), j = i(() => {
24
- S(!1), w("");
25
- }, []), M = i(() => {
26
- let e = O.current?.getBoundingClientRect();
12
+ var _ = 300;
13
+ function v({ everythingLabel: e, onOpenCustomize: n }) {
14
+ let p = r(), v = t(), [y, b] = l(!1), [x, S] = l(""), [C, w] = l(null), T = c(null), E = c(null), D = c(null), O = c(null), k = o(() => {
15
+ b(!1), S("");
16
+ }, []), A = o(() => {
17
+ let e = E.current?.getBoundingClientRect();
27
18
  if (!e) return;
28
- let t = window.innerWidth, n = Math.min(Math.max(e.width, y), t - 16), r = Math.min(Math.max(8, e.left), t - n - 8);
29
- E((t) => {
19
+ let t = window.innerWidth, n = Math.min(Math.max(e.width, _), t - 16), r = Math.min(Math.max(8, e.left), t - n - 8);
20
+ w((t) => {
30
21
  let i = window.innerHeight - e.top + 8;
31
22
  return t && t.left === r && t.bottom === i && t.width === n ? t : {
32
23
  left: r,
@@ -35,226 +26,128 @@ function b({ everythingLabel: e, onOpenCustomize: n }) {
35
26
  };
36
27
  });
37
28
  }, []);
38
- if (a(() => {
39
- if (!x) {
40
- E(null);
29
+ if (s(() => {
30
+ if (!y) {
31
+ w(null);
41
32
  return;
42
33
  }
43
- M(), window.addEventListener("resize", M), window.addEventListener("scroll", M, !0);
44
- let e = typeof ResizeObserver < "u" && O.current ? new ResizeObserver(M) : null;
45
- return e && O.current && e.observe(O.current), () => {
46
- window.removeEventListener("resize", M), window.removeEventListener("scroll", M, !0), e?.disconnect();
34
+ A(), window.addEventListener("resize", A), window.addEventListener("scroll", A, !0);
35
+ let e = typeof ResizeObserver < "u" && E.current ? new ResizeObserver(A) : null;
36
+ return e && E.current && e.observe(E.current), () => {
37
+ window.removeEventListener("resize", A), window.removeEventListener("scroll", A, !0), e?.disconnect();
47
38
  };
48
- }, [x, M]), a(() => {
49
- if (!x) return;
39
+ }, [y, A]), s(() => {
40
+ if (!y) return;
50
41
  let e = (e) => {
51
42
  let t = e.target;
52
- !D.current?.contains(t) && !k.current?.contains(t) && j();
43
+ !T.current?.contains(t) && !D.current?.contains(t) && k();
53
44
  };
54
45
  return document.addEventListener("mousedown", e), document.addEventListener("touchstart", e), () => {
55
46
  document.removeEventListener("mousedown", e), document.removeEventListener("touchstart", e);
56
47
  };
57
- }, [x, j]), a(() => {
58
- x && A.current?.focus();
59
- }, [x]), !b) return null;
60
- let { activeSurfaceId: N, surfaces: P, resolvedSurfaceId: F, setSurfaceId: I, canSimulate: L, simulation: R, startSimulation: te, stopSimulation: z, simulatableRoles: B, simulatableRolesLoading: V, loadSimulatableRoles: ne, customViews: H, canManageViews: U } = b, W = v(b, e), G = C.trim().toLowerCase(), K = G ? W.filter((e) => e.label.toLowerCase().includes(G)) : W, q = G ? H.filter((e) => e.name.toLowerCase().includes(G)) : H, J = G ? B.filter((e) => e.name.toLowerCase().includes(G)) : B, Y = R ? R.roleName : W.find((e) => e.id === N)?.label ?? P.find((e) => e.id === N)?.label ?? H.find((e) => e.id === N)?.name ?? e, re = () => {
61
- x ? j() : (L && ne(), S(!0));
62
- }, X = (e) => {
63
- e.key === "Escape" && x && (e.preventDefault(), e.stopPropagation(), j());
64
- }, Z = (e) => {
65
- R && z(), I(e === F ? null : e), j();
66
- }, Q = "flex w-full min-h-9 items-center gap-2 rounded-button px-2.5 py-1.5 text-start 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";
67
- return /* @__PURE__ */ _("div", {
68
- ref: D,
48
+ }, [y, k]), s(() => {
49
+ y && O.current?.focus();
50
+ }, [y]), !v) return null;
51
+ let { activeSurfaceId: j, surfaces: M, canSimulate: N, simulation: P, loadSimulatableRoles: F, customViews: I } = v, L = a(v, e), R = P ? P.roleName : L.find((e) => e.id === j)?.label ?? M.find((e) => e.id === j)?.label ?? I.find((e) => e.id === j)?.name ?? e, z = () => {
52
+ y ? k() : (N && F(), b(!0));
53
+ }, B = (e) => {
54
+ e.key === "Escape" && y && (e.preventDefault(), e.stopPropagation(), k());
55
+ }, V = "flex w-full min-h-9 items-center gap-2 rounded-button px-2.5 py-1.5 text-start text-body-sm text-text-primary hover:bg-bg-sunken transition-colors";
56
+ return /* @__PURE__ */ h("div", {
57
+ ref: T,
69
58
  className: "relative min-w-0 flex-1",
70
- onKeyDown: X,
71
- children: [x && T && typeof document < "u" && ee(/* @__PURE__ */ _("div", {
72
- ref: k,
59
+ onKeyDown: B,
60
+ children: [y && C && typeof document < "u" && g(/* @__PURE__ */ m("div", {
61
+ ref: D,
73
62
  style: {
74
- left: T.left,
75
- bottom: T.bottom,
76
- width: T.width
63
+ left: C.left,
64
+ bottom: C.bottom,
65
+ width: C.width
77
66
  },
78
67
  className: "fixed z-[130] flex max-h-80 flex-col overflow-hidden rounded-card border border-border-subtle bg-bg-canvas shadow-lg",
79
68
  role: "listbox",
80
69
  "data-testid": "persona-view-panel",
81
- onKeyDown: X,
82
- children: [/* @__PURE__ */ _("div", {
83
- className: "flex items-center gap-2 border-b border-border-subtle px-2.5 py-2",
84
- children: [/* @__PURE__ */ g(f, { className: "size-4 flex-shrink-0 text-text-muted" }), /* @__PURE__ */ g("input", {
85
- ref: A,
86
- value: C,
87
- onChange: (e) => w(e.target.value),
88
- placeholder: p("nav.searchViewsRoles", "Search views & roles"),
89
- className: "w-full bg-transparent text-body-sm text-text-primary outline-none placeholder:text-text-muted",
90
- "data-testid": "persona-view-search"
91
- })]
92
- }), /* @__PURE__ */ _("div", {
93
- className: "overflow-y-auto py-1",
94
- children: [
95
- K.length > 0 && /* @__PURE__ */ g("p", {
96
- className: $,
97
- children: p("nav.views", "Views")
98
- }),
99
- K.map((e) => {
100
- let t = !R && e.id === N;
101
- return /* @__PURE__ */ _("button", {
102
- type: "button",
103
- onClick: () => Z(e.id),
104
- className: Q,
105
- "data-testid": `persona-view-${e.id}`,
106
- children: [
107
- /* @__PURE__ */ g(c, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }),
108
- /* @__PURE__ */ g("span", {
109
- className: "truncate",
110
- children: e.label
111
- }),
112
- e.isOwnRole && /* @__PURE__ */ g("span", {
113
- className: "ms-auto flex-shrink-0 rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
114
- children: p("nav.yourRole", "Your role")
115
- })
116
- ]
117
- }, e.id);
118
- }),
119
- (q.length > 0 || U && !G) && /* @__PURE__ */ _(h, { children: [
120
- /* @__PURE__ */ g("p", {
121
- className: $,
122
- children: p("nav.myViews", "My views")
123
- }),
124
- q.map((e) => {
125
- let t = !R && e.id === N;
126
- return /* @__PURE__ */ _("button", {
127
- type: "button",
128
- onClick: () => Z(e.id),
129
- className: Q,
130
- "data-testid": `persona-view-${e.id}`,
131
- children: [/* @__PURE__ */ g(c, { className: `size-4 flex-shrink-0 ${t ? "text-text-primary" : "invisible"}` }), /* @__PURE__ */ g("span", {
132
- className: "truncate",
133
- children: e.name
134
- })]
135
- }, e.id);
136
- }),
137
- U && !G && /* @__PURE__ */ _("button", {
138
- type: "button",
139
- onClick: () => {
140
- j(), n();
141
- },
142
- className: `${Q} text-text-secondary`,
143
- "data-testid": "persona-view-create",
144
- children: [/* @__PURE__ */ g(d, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ g("span", { children: p("nav.newViewFromCurrent", "New view from current…") })]
145
- })
146
- ] }),
147
- L && /* @__PURE__ */ _(h, { children: [
148
- /* @__PURE__ */ g("p", {
149
- className: $,
150
- children: p("nav.previewARole", "Preview a role")
151
- }),
152
- R && /* @__PURE__ */ _("button", {
153
- type: "button",
154
- onClick: () => {
155
- z(), j();
156
- },
157
- className: `${Q} text-status-warning-text`,
158
- "data-testid": "persona-view-exit-preview",
159
- children: [/* @__PURE__ */ g(m, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ g("span", { children: p("nav.exitPreview", "Exit preview") })]
160
- }),
161
- V && /* @__PURE__ */ g("p", {
162
- className: "px-2.5 py-1.5 text-body-sm text-text-muted",
163
- children: p("inviteMemberDialog.loadingRoles", "Loading roles…")
164
- }),
165
- J.map((e) => {
166
- let t = R?.roleId === e.id;
167
- return /* @__PURE__ */ _("button", {
168
- type: "button",
169
- onClick: () => {
170
- te(e), j();
171
- },
172
- className: Q,
173
- "data-testid": `persona-preview-${e.id}`,
174
- children: [
175
- /* @__PURE__ */ g(u, { className: `size-4 flex-shrink-0 ${t ? "text-status-warning-text" : "text-text-muted"}` }),
176
- /* @__PURE__ */ g("span", {
177
- className: "truncate",
178
- children: e.name
179
- }),
180
- t && /* @__PURE__ */ g(c, { className: "ms-auto size-4 flex-shrink-0" })
181
- ]
182
- }, e.id);
183
- }),
184
- !V && J.length === 0 && G && /* @__PURE__ */ g("p", {
185
- className: "px-2.5 py-1.5 text-body-sm text-text-muted",
186
- children: p("nav.noMatchingRoles", "No matching roles")
187
- })
188
- ] }),
189
- K.length === 0 && (!L || J.length === 0) && G && /* @__PURE__ */ g("p", {
190
- className: "px-2.5 py-1.5 text-body-sm text-text-muted",
191
- children: p("conversations.empty.search.title", "No matches")
192
- })
193
- ]
194
- })]
195
- }), document.body), /* @__PURE__ */ _("button", {
196
- ref: O,
70
+ onKeyDown: B,
71
+ children: /* @__PURE__ */ m(i, {
72
+ persona: v,
73
+ everythingLabel: e,
74
+ query: x,
75
+ onQueryChange: S,
76
+ close: k,
77
+ onOpenCustomize: n,
78
+ searchRef: O,
79
+ sectionClass: "px-2.5 pb-1 pt-2.5 text-[11px] font-medium uppercase tracking-wider text-text-muted",
80
+ renderRow: ({ testId: e, onSelect: t, tone: n = "default", children: r }) => /* @__PURE__ */ m("button", {
81
+ type: "button",
82
+ onClick: t,
83
+ className: n === "muted" ? `${V} text-text-secondary` : n === "warning" ? `${V} text-status-warning-text` : V,
84
+ "data-testid": e,
85
+ children: r
86
+ }, e)
87
+ })
88
+ }), document.body), /* @__PURE__ */ h("button", {
89
+ ref: E,
197
90
  type: "button",
198
- onClick: re,
199
- "aria-expanded": x,
91
+ onClick: z,
92
+ "aria-expanded": y,
200
93
  "aria-haspopup": "listbox",
201
- 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 ${R ? "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"}`,
94
+ 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 ${P ? "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"}`,
202
95
  "data-testid": "persona-view-trigger",
203
96
  children: [
204
- R ? /* @__PURE__ */ g(u, { className: "size-4 flex-shrink-0 text-status-warning-text" }) : /* @__PURE__ */ g(c, { className: "size-4 flex-shrink-0 text-text-muted" }),
205
- /* @__PURE__ */ g("span", {
97
+ P ? /* @__PURE__ */ m(f, { className: "size-4 flex-shrink-0 text-status-warning-text" }) : /* @__PURE__ */ m(u, { className: "size-4 flex-shrink-0 text-text-muted" }),
98
+ /* @__PURE__ */ m("span", {
206
99
  className: "min-w-0 flex-1 truncate text-start",
207
- children: R ? p("nav.previewNamedView", "Preview: {{name}}", { name: Y }) : Y
100
+ children: P ? p("nav.previewNamedView", "Preview: {{name}}", { name: R }) : R
208
101
  }),
209
- /* @__PURE__ */ g(l, { className: "size-4 flex-shrink-0 text-text-muted" })
102
+ /* @__PURE__ */ m(d, { className: "size-4 flex-shrink-0 text-text-muted" })
210
103
  ]
211
104
  })]
212
105
  });
213
106
  }
214
- function x({ everythingLabel: e, customizeLabel: i }) {
107
+ function y({ everythingLabel: e, customizeLabel: i }) {
215
108
  let a = t(), { sidebarCollapsed: o, toggleSidebar: s } = n(), c = r(), l = e ?? c("nav.everything", "Everything"), u = i ?? c("nav.customizeMenu", "Customize menu");
216
109
  if (!a) return null;
217
110
  let { setCustomizeOpen: d } = a, f = () => {
218
111
  typeof window < "u" && window.innerWidth < 768 && !o && s(), d(!0);
219
- }, m = /* @__PURE__ */ g("button", {
112
+ }, g = /* @__PURE__ */ m("button", {
220
113
  type: "button",
221
114
  onClick: f,
222
115
  className: "p-2 rounded-button text-text-secondary hover:bg-bg-sunken hover:text-text-primary transition-colors flex-shrink-0",
223
116
  "aria-label": u,
224
117
  title: u,
225
118
  "data-testid": "persona-customize-trigger",
226
- children: /* @__PURE__ */ g(p, { className: "size-4" })
119
+ children: /* @__PURE__ */ m(p, { className: "size-4" })
227
120
  });
228
- return o ? /* @__PURE__ */ g("div", {
121
+ return o ? /* @__PURE__ */ m("div", {
229
122
  className: "hidden md:flex justify-center",
230
123
  "data-testid": "persona-controls-collapsed",
231
- children: m
232
- }) : /* @__PURE__ */ _("div", {
124
+ children: g
125
+ }) : /* @__PURE__ */ h("div", {
233
126
  className: "flex items-center gap-1",
234
127
  "data-testid": "persona-controls",
235
- children: [/* @__PURE__ */ g(b, {
128
+ children: [/* @__PURE__ */ m(v, {
236
129
  everythingLabel: l,
237
130
  onOpenCustomize: f
238
- }), m]
131
+ }), g]
239
132
  });
240
133
  }
241
- function S() {
134
+ function b() {
242
135
  let n = r(), i = t();
243
- return i?.simulation ? /* @__PURE__ */ _("div", {
136
+ return i?.simulation ? /* @__PURE__ */ h("div", {
244
137
  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",
245
138
  style: { marginBottom: "env(safe-area-inset-bottom)" },
246
139
  role: "status",
247
140
  "data-testid": "persona-simulation-pill",
248
141
  children: [
249
- /* @__PURE__ */ g(u, { className: "size-4 flex-shrink-0 text-status-warning-text" }),
250
- /* @__PURE__ */ g("span", {
142
+ /* @__PURE__ */ m(f, { className: "size-4 flex-shrink-0 text-status-warning-text" }),
143
+ /* @__PURE__ */ m("span", {
251
144
  className: "truncate text-body-sm text-text-primary",
252
- children: e(n("nav.simulationSummary", "Viewing as {{role}} (simulated)"), { role: /* @__PURE__ */ g("span", {
145
+ children: e(n("nav.simulationSummary", "Viewing as {{role}} (simulated)"), { role: /* @__PURE__ */ m("span", {
253
146
  className: "font-semibold",
254
147
  children: i.simulation.roleName
255
148
  }) })
256
149
  }),
257
- /* @__PURE__ */ g("button", {
150
+ /* @__PURE__ */ m("button", {
258
151
  type: "button",
259
152
  onClick: i.stopSimulation,
260
153
  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",
@@ -264,4 +157,4 @@ function S() {
264
157
  ]
265
158
  }) : null;
266
159
  }
267
- export { S as PersonaSimulationPill, x as PersonaSurfaceControls };
160
+ export { b as PersonaSimulationPill, y as PersonaSurfaceControls };
@@ -0,0 +1,28 @@
1
+ import { KeyboardEvent as ReactKeyboardEvent, ReactElement, ReactNode, RefObject } from 'react';
2
+ import { PersonaSurfaceContextValue } from '../shared/providers/shell/PersonaSurfaceProvider';
3
+ /** How the caller draws one row. `tone` is the row's text colour; `children` its content. */
4
+ export interface PersonaRowProps {
5
+ testId: string;
6
+ onSelect: () => void;
7
+ tone?: 'default' | 'muted' | 'warning';
8
+ children: ReactNode;
9
+ }
10
+ export type PersonaRowRenderer = (row: PersonaRowProps) => ReactElement;
11
+ export interface PersonaViewsListProps {
12
+ persona: PersonaSurfaceContextValue;
13
+ everythingLabel: string;
14
+ query: string;
15
+ onQueryChange: (query: string) => void;
16
+ /** Called after a row acts (the caller closes its container and clears the query). */
17
+ close: () => void;
18
+ /** "New view from current…": the caller opens the customize dialog. */
19
+ onOpenCustomize: () => void;
20
+ renderRow: PersonaRowRenderer;
21
+ searchRef?: RefObject<HTMLInputElement | null>;
22
+ /** Escape in the search box, so the caller can consume it. */
23
+ onSearchKeyDown?: (event: ReactKeyboardEvent<HTMLInputElement>) => void;
24
+ /** The section caption classes of the caller's surface. */
25
+ sectionClass: string;
26
+ }
27
+ /** The search row and the scrolling list, as two siblings for the caller's container. */
28
+ export declare function PersonaViewsList({ persona, everythingLabel, query, onQueryChange, close, onOpenCustomize, renderRow, searchRef, onSearchKeyDown, sectionClass, }: PersonaViewsListProps): import('react').JSX.Element;
@@ -0,0 +1,139 @@
1
+ import { useShellLabel as e } from "../shared/providers/shell/useShellLabel.js";
2
+ import { buildViewOptions as t } from "./personaViewOptions.js";
3
+ import { Check as n, Eye as r, Plus as i, Search as a, X as o } from "lucide-react";
4
+ import { Fragment as s, jsx as c, jsxs as l } from "react/jsx-runtime";
5
+ // src/chrome/PersonaViewsList.tsx
6
+ var u = (e, t) => !t || e.toLowerCase().includes(t);
7
+ function d({ selected: e }) {
8
+ return /* @__PURE__ */ c(n, { className: `size-4 flex-shrink-0 ${e ? "text-text-primary" : "invisible"}` });
9
+ }
10
+ function f({ persona: n, everythingLabel: r, q: i, sectionClass: a, renderRow: o, pickView: f }) {
11
+ let p = e(), { activeSurfaceId: m, simulation: h } = n, g = t(n, r).filter((e) => u(e.label, i));
12
+ return /* @__PURE__ */ l(s, { children: [g.length > 0 && /* @__PURE__ */ c("p", {
13
+ className: a,
14
+ children: p("nav.views", "Views")
15
+ }), g.map((e) => o({
16
+ testId: `persona-view-${e.id}`,
17
+ onSelect: () => f(e.id),
18
+ children: /* @__PURE__ */ l(s, { children: [
19
+ /* @__PURE__ */ c(d, { selected: !h && e.id === m }),
20
+ /* @__PURE__ */ c("span", {
21
+ className: "truncate",
22
+ children: e.label
23
+ }),
24
+ e.isOwnRole && /* @__PURE__ */ c("span", {
25
+ className: "ms-auto flex-shrink-0 rounded-full bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
26
+ children: p("nav.yourRole", "Your role")
27
+ })
28
+ ] })
29
+ }))] });
30
+ }
31
+ function p({ persona: t, q: n, sectionClass: r, renderRow: a, pickView: o, close: f, onOpenCustomize: p }) {
32
+ let m = e(), { activeSurfaceId: h, simulation: g, customViews: _, canManageViews: v } = t, y = _.filter((e) => u(e.name, n)), b = v && !n;
33
+ return y.length === 0 && !b ? null : /* @__PURE__ */ l(s, { children: [
34
+ /* @__PURE__ */ c("p", {
35
+ className: r,
36
+ children: m("nav.myViews", "My views")
37
+ }),
38
+ y.map((e) => a({
39
+ testId: `persona-view-${e.id}`,
40
+ onSelect: () => o(e.id),
41
+ children: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(d, { selected: !g && e.id === h }), /* @__PURE__ */ c("span", {
42
+ className: "truncate",
43
+ children: e.name
44
+ })] })
45
+ })),
46
+ b && a({
47
+ testId: "persona-view-create",
48
+ tone: "muted",
49
+ onSelect: () => {
50
+ f(), p();
51
+ },
52
+ children: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(i, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ c("span", { children: m("nav.newViewFromCurrent", "New view from current…") })] })
53
+ })
54
+ ] });
55
+ }
56
+ function m({ persona: t, q: i, sectionClass: a, renderRow: d, close: f }) {
57
+ let p = e(), { simulation: m, stopSimulation: h, startSimulation: g, simulatableRoles: _, simulatableRolesLoading: v } = t, y = _.filter((e) => u(e.name, i));
58
+ return /* @__PURE__ */ l(s, { children: [
59
+ /* @__PURE__ */ c("p", {
60
+ className: a,
61
+ children: p("nav.previewARole", "Preview a role")
62
+ }),
63
+ m && d({
64
+ testId: "persona-view-exit-preview",
65
+ tone: "warning",
66
+ onSelect: () => {
67
+ h(), f();
68
+ },
69
+ children: /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ c(o, { className: "size-4 flex-shrink-0" }), /* @__PURE__ */ c("span", { children: p("nav.exitPreview", "Exit preview") })] })
70
+ }),
71
+ v && /* @__PURE__ */ c("p", {
72
+ className: "px-2.5 py-1.5 text-body-sm text-text-muted",
73
+ children: p("inviteMemberDialog.loadingRoles", "Loading roles…")
74
+ }),
75
+ y.map((e) => {
76
+ let t = m?.roleId === e.id;
77
+ return d({
78
+ testId: `persona-preview-${e.id}`,
79
+ onSelect: () => {
80
+ g(e), f();
81
+ },
82
+ children: /* @__PURE__ */ l(s, { children: [
83
+ /* @__PURE__ */ c(r, { className: `size-4 flex-shrink-0 ${t ? "text-status-warning-text" : "text-text-muted"}` }),
84
+ /* @__PURE__ */ c("span", {
85
+ className: "truncate",
86
+ children: e.name
87
+ }),
88
+ t && /* @__PURE__ */ c(n, { className: "ms-auto size-4 flex-shrink-0" })
89
+ ] })
90
+ });
91
+ }),
92
+ !v && y.length === 0 && i && /* @__PURE__ */ c("p", {
93
+ className: "px-2.5 py-1.5 text-body-sm text-text-muted",
94
+ children: p("nav.noMatchingRoles", "No matching roles")
95
+ })
96
+ ] });
97
+ }
98
+ function h({ persona: n, everythingLabel: r, query: i, onQueryChange: o, close: d, onOpenCustomize: h, renderRow: g, searchRef: _, onSearchKeyDown: v, sectionClass: y }) {
99
+ let b = e(), { resolvedSurfaceId: x, setSurfaceId: S, canSimulate: C, simulation: w, stopSimulation: T } = n, E = i.trim().toLowerCase(), D = {
100
+ persona: n,
101
+ q: E,
102
+ sectionClass: y,
103
+ renderRow: g,
104
+ pickView: (e) => {
105
+ w && T(), S(e === x ? null : e), d();
106
+ },
107
+ close: d
108
+ }, O = E !== "" && t(n, r).every((e) => !u(e.label, E)), k = !C || n.simulatableRoles.every((e) => !u(e.name, E)), A = n.customViews.every((e) => !u(e.name, E));
109
+ return /* @__PURE__ */ l(s, { children: [/* @__PURE__ */ l("div", {
110
+ className: "flex items-center gap-2 border-b border-border-subtle px-2.5 py-2",
111
+ children: [/* @__PURE__ */ c(a, { className: "size-4 flex-shrink-0 text-text-muted" }), /* @__PURE__ */ c("input", {
112
+ ref: _,
113
+ value: i,
114
+ onChange: (e) => o(e.target.value),
115
+ onKeyDown: v,
116
+ placeholder: b("nav.searchViewsRoles", "Search views & roles"),
117
+ className: "w-full bg-transparent text-body-sm text-text-primary outline-none placeholder:text-text-muted",
118
+ "data-testid": "persona-view-search"
119
+ })]
120
+ }), /* @__PURE__ */ l("div", {
121
+ className: "overflow-y-auto py-1",
122
+ children: [
123
+ /* @__PURE__ */ c(f, {
124
+ ...D,
125
+ everythingLabel: r
126
+ }),
127
+ /* @__PURE__ */ c(p, {
128
+ ...D,
129
+ onOpenCustomize: h
130
+ }),
131
+ C && /* @__PURE__ */ c(m, { ...D }),
132
+ O && k && A && /* @__PURE__ */ c("p", {
133
+ className: "px-2.5 py-1.5 text-body-sm text-text-muted",
134
+ children: b("conversations.empty.search.title", "No matches")
135
+ })
136
+ ]
137
+ })] });
138
+ }
139
+ export { h as PersonaViewsList };
@@ -7,8 +7,8 @@ import { Input as ee } from "../ui/input.js";
7
7
  import { Label as u } from "../ui/label.js";
8
8
  import { Switch as d } from "../ui/switch.js";
9
9
  import { Select as f, SelectContent as p, SelectItem as m, SelectTrigger as h, SelectValue as g } from "../ui/select.js";
10
- import { Badge as _ } from "../ui/badge.js";
11
- import { cn as v } from "../utils/cn.js";
10
+ import { cn as _ } from "../utils/cn.js";
11
+ import { Badge as v } from "../ui/badge.js";
12
12
  import "../utils/index.js";
13
13
  import { useCallback as y, useId as b, useMemo as x, useState as S } from "react";
14
14
  import { Check as C, Palette as w, Pencil as te, Plus as ne, Trash2 as T, X as E } from "lucide-react";
@@ -125,7 +125,7 @@ function j({ className: f, showCustomThemes: p = !0 }) {
125
125
  j
126
126
  ]);
127
127
  return /* @__PURE__ */ O("div", {
128
- className: v("flex flex-col gap-6", f),
128
+ className: _("flex flex-col gap-6", f),
129
129
  children: [
130
130
  p && /* @__PURE__ */ O(a, { children: [/* @__PURE__ */ O(c, { children: [/* @__PURE__ */ O(l, {
131
131
  className: "flex items-center gap-2",
@@ -280,7 +280,7 @@ function j({ className: f, showCustomThemes: p = !0 }) {
280
280
  className: "h-8 w-44"
281
281
  }) : /* @__PURE__ */ O("span", {
282
282
  className: "flex flex-1 items-center gap-2 text-sm text-text-primary",
283
- children: [e.name, t && /* @__PURE__ */ O(_, {
283
+ children: [e.name, t && /* @__PURE__ */ O(v, {
284
284
  variant: "success",
285
285
  className: "gap-1",
286
286
  children: [/* @__PURE__ */ D(C, {
@@ -333,7 +333,7 @@ function j({ className: f, showCustomThemes: p = !0 }) {
333
333
  "data-density": $.density,
334
334
  "data-typography": $.typography,
335
335
  "data-glass": $.glass,
336
- className: v("flex flex-col gap-4 rounded-card border border-border-seam p-4", A(n.find((e) => e.value === $.theme)?.family ?? "light")),
336
+ className: _("flex flex-col gap-4 rounded-card border border-border-seam p-4", A(n.find((e) => e.value === $.theme)?.family ?? "light")),
337
337
  children: [
338
338
  /* @__PURE__ */ O("div", {
339
339
  className: "flex flex-wrap items-center gap-2",
@@ -383,20 +383,20 @@ function j({ className: f, showCustomThemes: p = !0 }) {
383
383
  /* @__PURE__ */ O("div", {
384
384
  className: "flex flex-wrap items-center gap-2",
385
385
  children: [
386
- /* @__PURE__ */ D(_, { children: m("themeSwitcher.default", "Default") }),
387
- /* @__PURE__ */ D(_, {
386
+ /* @__PURE__ */ D(v, { children: m("themeSwitcher.default", "Default") }),
387
+ /* @__PURE__ */ D(v, {
388
388
  variant: "secondary",
389
389
  children: m("notifications.actionStyle.secondary", "Secondary")
390
390
  }),
391
- /* @__PURE__ */ D(_, {
391
+ /* @__PURE__ */ D(v, {
392
392
  variant: "success",
393
393
  children: m("common.success", "Success")
394
394
  }),
395
- /* @__PURE__ */ D(_, {
395
+ /* @__PURE__ */ D(v, {
396
396
  variant: "warning",
397
397
  children: m("themeSwitcher.warning", "Warning")
398
398
  }),
399
- /* @__PURE__ */ D(_, {
399
+ /* @__PURE__ */ D(v, {
400
400
  variant: "destructive",
401
401
  children: m("common.errorPage.title", "Error")
402
402
  })
@@ -424,9 +424,9 @@ function M({ label: e, family: t, accent: n, active: r, onSelect: i }) {
424
424
  role: "radio",
425
425
  "aria-checked": r,
426
426
  onClick: i,
427
- className: v("group relative flex flex-col gap-2 rounded-card border p-2 text-start transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", r ? "border-border-focus bg-[var(--color-accent-soft)]" : "border-border-default bg-bg-surface hover:border-border-strong hover:bg-bg-sunken"),
427
+ className: _("group relative flex flex-col gap-2 rounded-card border p-2 text-start transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", r ? "border-border-focus bg-[var(--color-accent-soft)]" : "border-border-default bg-bg-surface hover:border-border-strong hover:bg-bg-sunken"),
428
428
  children: [/* @__PURE__ */ D("span", {
429
- className: v("relative flex h-12 w-full items-end overflow-hidden rounded-button border border-border-seam", A(t)),
429
+ className: _("relative flex h-12 w-full items-end overflow-hidden rounded-button border border-border-seam", A(t)),
430
430
  "aria-hidden": "true",
431
431
  children: /* @__PURE__ */ D("span", {
432
432
  className: "m-1.5 size-3 rounded-full shadow-elevation-1",
@@ -457,13 +457,13 @@ function N({ title: e, description: t, value: n, options: r, onChange: i }) {
457
457
  role: "radio",
458
458
  "aria-checked": t,
459
459
  onClick: () => i(e.value),
460
- className: v("flex-1 rounded-button px-4 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "bg-bg-surface text-text-primary shadow-elevation-1" : "text-text-secondary hover:text-text-primary"),
460
+ className: _("flex-1 rounded-button px-4 py-1.5 text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "bg-bg-surface text-text-primary shadow-elevation-1" : "text-text-secondary hover:text-text-primary"),
461
461
  children: e.label
462
462
  }, e.value);
463
463
  })
464
464
  }) })] });
465
465
  }
466
- function P({ name: n, base: r, accent: f, density: p, typography: m, glass: h, reduceMotion: g, onName: _, onBase: y, onAccent: x, onDensity: S, onTypography: w, onGlass: te, onReduceMotion: ne, onSave: T, onCancel: k }) {
466
+ function P({ name: n, base: r, accent: f, density: p, typography: m, glass: h, reduceMotion: g, onName: v, onBase: y, onAccent: x, onDensity: S, onTypography: w, onGlass: te, onReduceMotion: ne, onSave: T, onCancel: k }) {
467
467
  let A = t(), j = e(), M = b(), N = b(), P = b();
468
468
  return /* @__PURE__ */ O(a, { children: [/* @__PURE__ */ O(c, {
469
469
  className: "flex-row items-start justify-between gap-4 space-y-0",
@@ -492,7 +492,7 @@ function P({ name: n, base: r, accent: f, density: p, typography: m, glass: h, r
492
492
  }), /* @__PURE__ */ D(ee, {
493
493
  id: M,
494
494
  value: n,
495
- onChange: (e) => _(e.target.value),
495
+ onChange: (e) => v(e.target.value),
496
496
  placeholder: A("themeSwitcher.myTheme", "My theme")
497
497
  })]
498
498
  }),
@@ -513,7 +513,7 @@ function P({ name: n, base: r, accent: f, density: p, typography: m, glass: h, r
513
513
  role: "radio",
514
514
  "aria-checked": t,
515
515
  onClick: () => y(e),
516
- className: v("flex-1 rounded-button px-4 py-1.5 text-sm font-medium capitalize transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "bg-bg-surface text-text-primary shadow-elevation-1" : "text-text-secondary hover:text-text-primary"),
516
+ className: _("flex-1 rounded-button px-4 py-1.5 text-sm font-medium capitalize transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[var(--color-focus-ring)]", t ? "bg-bg-surface text-text-primary shadow-elevation-1" : "text-text-secondary hover:text-text-primary"),
517
517
  children: e === "light" ? A("themeSwitcher.lightBase", "light") : A("themeSwitcher.darkBase", "dark")
518
518
  }, e);
519
519
  })