@declarion/react 0.87.0 → 0.89.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (90) hide show
  1. package/dist-lib/app.js +28 -28
  2. package/dist-lib/components/actions/ActionButton.js +86 -85
  3. package/dist-lib/components/actions/ActionResultDialog.impl.js +47 -47
  4. package/dist-lib/components/actions/ActionRunner.js +47 -47
  5. package/dist-lib/components/actions/ObjectActionBar.js +9 -9
  6. package/dist-lib/components/actions/RowActionsKebab.js +19 -19
  7. package/dist-lib/components/agents/AgentChatPanel.impl.js +53 -53
  8. package/dist-lib/components/chrome/AssociationTabs.js +21 -21
  9. package/dist-lib/components/chrome/RecordHeader.js +33 -40
  10. package/dist-lib/components/detail-layout/AssociatedBlock.js +387 -381
  11. package/dist-lib/components/detail-layout/ChildrenBlock.js +12 -13
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +198 -198
  13. package/dist-lib/components/detail-layout/DraggableChildrenTable.js +114 -114
  14. package/dist-lib/components/detail-layout/EditableChildrenTable.js +160 -160
  15. package/dist-lib/components/detail-layout/EvidenceBlock.js +20 -21
  16. package/dist-lib/components/detail-layout/PropertiesBlock.js +45 -39
  17. package/dist-lib/components/detail-layout/QuickAddForm.js +9 -9
  18. package/dist-lib/components/detail-layout/TimelineComposer.js +87 -89
  19. package/dist-lib/components/detail-layout/widgets/EntityScorecardWidget.js +100 -99
  20. package/dist-lib/components/fields/FileReferenceField.js +9 -9
  21. package/dist-lib/components/fields/StructureField.js +57 -47
  22. package/dist-lib/components/fields/TimestampField.js +59 -54
  23. package/dist-lib/components/fields/cells/factories/money.js +14 -23
  24. package/dist-lib/components/fields/cells/factories/nextRun.js +1 -1
  25. package/dist-lib/components/fields/cells/factories/text.js +18 -3
  26. package/dist-lib/components/fields/cells/factories/timestamp.js +24 -12
  27. package/dist-lib/components/file-widgets/DocumentCard.js +108 -106
  28. package/dist-lib/components/layout/Layout.js +306 -361
  29. package/dist-lib/components/layout/Rail.js +42 -41
  30. package/dist-lib/components/layout/Sidebar.js +132 -117
  31. package/dist-lib/components/layout/TabStrip.js +116 -115
  32. package/dist-lib/components/layout/TenantChip.js +47 -54
  33. package/dist-lib/components/layout/TopBar.js +108 -105
  34. package/dist-lib/components/list/InlineEditCell.js +23 -23
  35. package/dist-lib/components/list/QuickPeek.js +65 -66
  36. package/dist-lib/components/pages/DocumentsMenu.js +42 -42
  37. package/dist-lib/components/pages/ExportMenu.js +25 -25
  38. package/dist-lib/components/pages/RecordDocumentsPanel.js +35 -35
  39. package/dist-lib/components/pages/RecordNotesPanel.js +94 -93
  40. package/dist-lib/components/pages/SmartDetailPage.impl.js +421 -417
  41. package/dist-lib/components/pages/SmartListPage.impl.js +293 -295
  42. package/dist-lib/components/pages/SmartRecordListPage.impl.js +310 -310
  43. package/dist-lib/components/pages/auth/AuthShell.js +73 -73
  44. package/dist-lib/components/pages/auth/SignIn.js +32 -32
  45. package/dist-lib/components/pages/auth/SignUp.impl.js +3 -3
  46. package/dist-lib/components/pages/auth/SignUpCode.js +9 -9
  47. package/dist-lib/components/pages/list/ListFloatbar.js +12 -12
  48. package/dist-lib/components/pages/list/ListHeader.js +19 -19
  49. package/dist-lib/components/pages/list/ListNoRows.js +15 -15
  50. package/dist-lib/components/pages/list/ListToolbar.js +145 -145
  51. package/dist-lib/components/pages/list/useActiveView.js +14 -5
  52. package/dist-lib/components/pages/list/useListQuery.js +121 -81
  53. package/dist-lib/components/pages/list/useListRowInteraction.js +70 -70
  54. package/dist-lib/components/pages/list/useRowMenu.js +7 -7
  55. package/dist-lib/components/pages/profile/Preferences.impl.js +81 -78
  56. package/dist-lib/components/pages/profile/Profile.impl.js +191 -189
  57. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +166 -158
  58. package/dist-lib/components/shared/ChangePasswordDialog.impl.js +23 -23
  59. package/dist-lib/components/shared/MarkdownRenderer.js +9 -9
  60. package/dist-lib/hooks/useAuth.js +11 -11
  61. package/dist-lib/hooks/useBranding.js +4 -4
  62. package/dist-lib/hooks/useDisplayTimeZone.js +8 -0
  63. package/dist-lib/hooks/useFollowAgentOpen.js +24 -24
  64. package/dist-lib/hooks/useImpersonation.js +6 -6
  65. package/dist-lib/hooks/useMutations.js +23 -23
  66. package/dist-lib/hooks/useObjectStatus.js +5 -5
  67. package/dist-lib/hooks/useParams.js +59 -51
  68. package/dist-lib/hooks/useProperties.js +8 -8
  69. package/dist-lib/hooks/useRowTenant.js +18 -6
  70. package/dist-lib/hooks/useText.js +9 -7
  71. package/dist-lib/hooks/useUiPreferences.js +71 -0
  72. package/dist-lib/index.d.ts +22 -6
  73. package/dist-lib/index.js +127 -126
  74. package/dist-lib/lib/actions.js +116 -84
  75. package/dist-lib/lib/child-config.js +10 -1
  76. package/dist-lib/lib/format-count.js +16 -1
  77. package/dist-lib/lib/language.js +23 -21
  78. package/dist-lib/lib/money-text.js +29 -0
  79. package/dist-lib/lib/profile.js +4 -0
  80. package/dist-lib/lib/role-label.js +8 -0
  81. package/dist-lib/lib/schema-routing.js +34 -14
  82. package/dist-lib/lib/shortcut.js +10 -0
  83. package/dist-lib/lib/timestamp.js +93 -31
  84. package/dist-lib/stores/auth.js +9 -8
  85. package/dist-lib/stores/preferences.js +56 -17
  86. package/dist-lib/testing.d.ts +1 -1
  87. package/dist-lib/testing.js +25 -28
  88. package/dist-lib/types/schema.js +33 -27
  89. package/dist-lib/{useResponsiveMode-D3SKz5z4.d.ts → useResponsiveMode-9_eJT18k.d.ts} +5 -5
  90. package/package.json +1 -1
@@ -1,77 +1,78 @@
1
- import { pluralText as e } from "../../lib/language.js";
2
- import { Icon as t } from "../primitives/Icons.js";
3
- import { Dropdown as n } from "../primitives/Dropdown.js";
4
- import { useText as r } from "../../hooks/useText.js";
5
- import { MenuItem as i } from "../primitives/MenuItem.js";
6
- import { DynamicIcon as a } from "../shared/DynamicIcon.js";
7
- import { usePreferencesStore as o } from "../../stores/preferences.js";
8
- import { tabIdsForCloseScope as s, useTabStore as c } from "../../stores/tabs.js";
9
- import { pageInsetX as l } from "../../lib/page-inset.js";
10
- import { useTabTitle as u } from "../../hooks/useTabTitle.js";
11
- import { useCallback as d, useEffect as f, useRef as p, useState as m } from "react";
12
- import { jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { useNavigate as _ } from "react-router";
1
+ import { usePreferencesStore as e } from "../../stores/preferences.js";
2
+ import { pluralText as t } from "../../lib/language.js";
3
+ import { Icon as n } from "../primitives/Icons.js";
4
+ import { Dropdown as r } from "../primitives/Dropdown.js";
5
+ import { useText as i } from "../../hooks/useText.js";
6
+ import { MenuItem as a } from "../primitives/MenuItem.js";
7
+ import { DynamicIcon as o } from "../shared/DynamicIcon.js";
8
+ import { shortcutLabel as s } from "../../lib/shortcut.js";
9
+ import { tabIdsForCloseScope as c, useTabStore as l } from "../../stores/tabs.js";
10
+ import { pageInsetX as u } from "../../lib/page-inset.js";
11
+ import { useTabTitle as d } from "../../hooks/useTabTitle.js";
12
+ import { useCallback as f, useEffect as p, useRef as m, useState as h } from "react";
13
+ import { jsx as g, jsxs as _ } from "react/jsx-runtime";
14
+ import { useNavigate as v } from "react-router";
14
15
  //#region src/components/layout/TabStrip.tsx
15
- function v({ onNew: n, onCloseRequest: i } = {}) {
16
- let v = r(), b = u(), x = _(), S = p(null), C = p(null), w = p(null), T = p(!1), [E, D] = m(!1), O = c((e) => e.tabs), k = c((e) => e.activeTabId), A = o((e) => e.tabsMaxOpen), j = c((e) => e.switchTab), M = c((e) => e.closeTab), N = O.findIndex((e) => e.id === k);
17
- f(() => {
18
- let e = N === O.length - 1 ? w.current : C.current;
16
+ function y({ onNew: r, onCloseRequest: a } = {}) {
17
+ let y = i(), x = d(), S = v(), C = m(null), w = m(null), T = m(null), E = m(!1), [D, O] = h(!1), k = l((e) => e.tabs), A = l((e) => e.activeTabId), j = e((e) => e.tabsMaxOpen), M = l((e) => e.switchTab), N = l((e) => e.closeTab), P = k.findIndex((e) => e.id === A);
18
+ p(() => {
19
+ let e = P === k.length - 1 ? T.current : w.current;
19
20
  e && (e.scrollIntoView({
20
21
  block: "nearest",
21
22
  inline: "nearest",
22
- behavior: T.current ? "smooth" : "auto"
23
- }), T.current = !0);
23
+ behavior: E.current ? "smooth" : "auto"
24
+ }), E.current = !0);
24
25
  }, [
25
- k,
26
- N,
27
- O.length
26
+ A,
27
+ P,
28
+ k.length
28
29
  ]);
29
- let P = d((e, t) => {
30
- let n = O[e];
31
- n && (j(n.id), x({
30
+ let F = f((e, t) => {
31
+ let n = k[e];
32
+ n && (M(n.id), S({
32
33
  pathname: n.pathname,
33
34
  search: n.search || void 0
34
35
  }));
35
36
  }, [
36
- O,
37
- j,
38
- x
39
- ]), F = d((e) => {
40
- let t = O[e];
37
+ k,
38
+ M,
39
+ S
40
+ ]), I = f((e) => {
41
+ let t = k[e];
41
42
  if (!t) return;
42
- if (i) {
43
- i("current", t.id);
43
+ if (a) {
44
+ a("current", t.id);
44
45
  return;
45
46
  }
46
- let n = t.id === k;
47
- if (M(t.id), n) {
48
- let n = O.filter((e) => e.id !== t.id);
47
+ let n = t.id === A;
48
+ if (N(t.id), n) {
49
+ let n = k.filter((e) => e.id !== t.id);
49
50
  if (n.length > 0) {
50
51
  let t = n[e < n.length ? e : n.length - 1];
51
- x({
52
+ S({
52
53
  pathname: t.pathname,
53
54
  search: t.search || void 0
54
55
  });
55
56
  }
56
57
  }
57
58
  }, [
58
- O,
59
59
  k,
60
- M,
61
- x,
62
- i
63
- ]), I = d((e) => {
64
- D(!1), i ? i(e) : e === "current" && N >= 0 && F(N);
65
- }, [
60
+ A,
66
61
  N,
67
- F,
68
- i
69
- ]), L = d(() => {
70
- n ? n() : x("/");
71
- }, [n, x]);
72
- if (O.length === 0) return null;
73
- let R = N >= 0 && O.length > 1 && O[N]?.closable !== !1, z = s(O, k, "others").length > 0, B = s(O, k, "right").length > 0, V = O.length >= A ? "danger" : O.length >= Math.ceil(A * .8) ? "warning" : "normal", H = V === "danger" ? "var(--danger)" : V === "warning" ? "var(--warn)" : "var(--text-3)";
74
- return /* @__PURE__ */ g("div", {
62
+ S,
63
+ a
64
+ ]), L = f((e) => {
65
+ O(!1), a ? a(e) : e === "current" && P >= 0 && I(P);
66
+ }, [
67
+ P,
68
+ I,
69
+ a
70
+ ]), R = f(() => {
71
+ r ? r() : S("/");
72
+ }, [r, S]);
73
+ if (k.length === 0) return null;
74
+ let z = P >= 0 && k.length > 1 && k[P]?.closable !== !1, B = c(k, A, "others").length > 0, V = c(k, A, "right").length > 0, H = k.length >= j ? "danger" : k.length >= Math.ceil(j * .8) ? "warning" : "normal", U = H === "danger" ? "var(--danger)" : H === "warning" ? "var(--warn)" : "var(--text-3)";
75
+ return /* @__PURE__ */ _("div", {
75
76
  style: {
76
77
  display: "flex",
77
78
  alignItems: "stretch",
@@ -81,7 +82,7 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
81
82
  overflow: "hidden",
82
83
  flexShrink: 0
83
84
  },
84
- children: [/* @__PURE__ */ g("div", {
85
+ children: [/* @__PURE__ */ _("div", {
85
86
  className: "scrollbar-none",
86
87
  style: {
87
88
  display: "flex",
@@ -90,22 +91,22 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
90
91
  flex: 1,
91
92
  gap: 0
92
93
  },
93
- children: [O.map((e, n) => {
94
- let r = n === N, i = O.length > 1 && e.closable !== !1;
95
- return /* @__PURE__ */ g("div", {
94
+ children: [k.map((e, t) => {
95
+ let r = t === P, i = k.length > 1 && e.closable !== !1;
96
+ return /* @__PURE__ */ _("div", {
96
97
  "data-testid": "tabstrip-tab",
97
- ref: r ? C : void 0,
98
- onClick: (e) => P(n, { newTab: e.metaKey || e.ctrlKey }),
98
+ ref: r ? w : void 0,
99
+ onClick: (e) => F(t, { newTab: e.metaKey || e.ctrlKey }),
99
100
  onAuxClick: (e) => {
100
- e.button === 1 && (e.preventDefault(), F(n));
101
+ e.button === 1 && (e.preventDefault(), I(t));
101
102
  },
102
- title: b(e),
103
+ title: x(e),
103
104
  style: {
104
105
  display: "flex",
105
106
  alignItems: "center",
106
107
  gap: 6,
107
108
  height: "100%",
108
- ...l(11),
109
+ ...u(11),
109
110
  background: r ? "var(--surface)" : "transparent",
110
111
  borderRight: "1px solid var(--border)",
111
112
  borderTop: r ? "2px solid var(--accent)" : "2px solid transparent",
@@ -120,26 +121,26 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
120
121
  fontWeight: r ? 500 : 400
121
122
  },
122
123
  children: [
123
- e.icon && /* @__PURE__ */ h("span", {
124
+ e.icon && /* @__PURE__ */ g("span", {
124
125
  style: {
125
126
  color: r ? "var(--accent)" : "var(--text-4)",
126
127
  display: "flex"
127
128
  },
128
- children: /* @__PURE__ */ h(a, {
129
+ children: /* @__PURE__ */ g(o, {
129
130
  name: e.icon,
130
131
  size: 12
131
132
  })
132
133
  }),
133
- /* @__PURE__ */ h("span", {
134
+ /* @__PURE__ */ g("span", {
134
135
  style: {
135
136
  flex: 1,
136
137
  whiteSpace: "nowrap",
137
138
  overflow: "hidden",
138
139
  textOverflow: "ellipsis"
139
140
  },
140
- children: b(e)
141
+ children: x(e)
141
142
  }),
142
- e.dirty && /* @__PURE__ */ h("span", {
143
+ e.dirty && /* @__PURE__ */ g("span", {
143
144
  style: {
144
145
  width: 6,
145
146
  height: 6,
@@ -147,14 +148,14 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
147
148
  background: "var(--warn)",
148
149
  flexShrink: 0
149
150
  },
150
- title: v("shell.tabs.unsaved", "Unsaved changes")
151
+ title: y("shell.tabs.unsaved", "Unsaved changes")
151
152
  }),
152
- i && /* @__PURE__ */ h("button", {
153
+ i && /* @__PURE__ */ g("button", {
153
154
  onClick: (e) => {
154
- e.stopPropagation(), F(n);
155
+ e.stopPropagation(), I(t);
155
156
  },
156
- "aria-label": v("shell.tabs.close_named", "Close {title}", { title: b(e) }),
157
- title: v("shell.tabs.close_tab", "Close tab"),
157
+ "aria-label": y("shell.tabs.close_named", "Close {title}", { title: x(e) }),
158
+ title: y("shell.tabs.close_tab", "Close tab"),
158
159
  style: {
159
160
  display: "flex",
160
161
  background: "transparent",
@@ -171,14 +172,14 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
171
172
  onMouseLeave: (e) => {
172
173
  e.currentTarget.style.background = "transparent", e.currentTarget.style.color = "var(--text-4)";
173
174
  },
174
- children: /* @__PURE__ */ h(t.x, { size: 11 })
175
+ children: /* @__PURE__ */ g(n.x, { size: 11 })
175
176
  })
176
177
  ]
177
178
  }, e.id);
178
- }), /* @__PURE__ */ h("button", {
179
- ref: w,
180
- onClick: L,
181
- title: v("shell.tabs.new", "New tab (⌘T)"),
179
+ }), /* @__PURE__ */ g("button", {
180
+ ref: T,
181
+ onClick: R,
182
+ title: y("shell.tabs.new", "New tab ({keys})", { keys: s("T") }),
182
183
  style: {
183
184
  width: 32,
184
185
  background: "transparent",
@@ -190,12 +191,12 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
190
191
  alignItems: "center",
191
192
  justifyContent: "center"
192
193
  },
193
- children: /* @__PURE__ */ h(t.plus, { size: 13 })
194
+ children: /* @__PURE__ */ g(n.plus, { size: 13 })
194
195
  })]
195
- }), /* @__PURE__ */ g("div", {
196
+ }), /* @__PURE__ */ _("div", {
196
197
  className: "tabstrip-utility",
197
198
  style: {
198
- ...l(10),
199
+ ...u(10),
199
200
  fontSize: 11,
200
201
  color: "var(--text-4)",
201
202
  display: "flex",
@@ -205,32 +206,32 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
205
206
  flexShrink: 0
206
207
  },
207
208
  children: [
208
- /* @__PURE__ */ g("span", {
209
+ /* @__PURE__ */ _("span", {
209
210
  "data-testid": "tabstrip-tab-count",
210
211
  style: {
211
212
  display: "flex",
212
213
  alignItems: "center",
213
214
  gap: 3,
214
- color: H,
215
- fontWeight: V === "normal" ? 400 : 600
215
+ color: U,
216
+ fontWeight: H === "normal" ? 400 : 600
216
217
  },
217
- children: [/* @__PURE__ */ g("span", {
218
+ children: [/* @__PURE__ */ _("span", {
218
219
  className: "mono num",
219
220
  children: [
220
- O.length,
221
+ k.length,
221
222
  "/",
222
- A
223
+ j
223
224
  ]
224
- }), /* @__PURE__ */ h("span", {
225
+ }), /* @__PURE__ */ g("span", {
225
226
  className: "tabstrip-tabs-label",
226
227
  style: { color: "var(--text-3)" },
227
- children: e(v, "shell.tabs.count_label", A, {
228
+ children: t(y, "shell.tabs.count_label", j, {
228
229
  one: "tab",
229
230
  other: "tabs"
230
231
  })
231
232
  })]
232
233
  }),
233
- /* @__PURE__ */ h("span", {
234
+ /* @__PURE__ */ g("span", {
234
235
  className: "tabstrip-utility-divider",
235
236
  style: {
236
237
  width: 1,
@@ -238,11 +239,11 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
238
239
  background: "var(--border)"
239
240
  }
240
241
  }),
241
- /* @__PURE__ */ h("button", {
242
- ref: S,
243
- onClick: () => D(!0),
244
- title: v("shell.tabs.actions", "Tab actions"),
245
- "aria-label": v("shell.tabs.actions", "Tab actions"),
242
+ /* @__PURE__ */ g("button", {
243
+ ref: C,
244
+ onClick: () => O(!0),
245
+ title: y("shell.tabs.actions", "Tab actions"),
246
+ "aria-label": y("shell.tabs.actions", "Tab actions"),
246
247
  "data-testid": "tabstrip-actions-button",
247
248
  style: {
248
249
  width: 24,
@@ -262,54 +263,54 @@ function v({ onNew: n, onCloseRequest: i } = {}) {
262
263
  onMouseLeave: (e) => {
263
264
  e.currentTarget.style.background = "transparent";
264
265
  },
265
- children: /* @__PURE__ */ h(t.more, { size: 13 })
266
+ children: /* @__PURE__ */ g(n.more, { size: 13 })
266
267
  }),
267
- /* @__PURE__ */ h(y, {
268
- open: E,
269
- anchor: S.current,
270
- onClose: () => D(!1),
271
- canCloseCurrent: R,
272
- canCloseOthers: z,
273
- canCloseRight: B,
274
- onAction: I
268
+ /* @__PURE__ */ g(b, {
269
+ open: D,
270
+ anchor: C.current,
271
+ onClose: () => O(!1),
272
+ canCloseCurrent: z,
273
+ canCloseOthers: B,
274
+ canCloseRight: V,
275
+ onAction: L
275
276
  })
276
277
  ]
277
278
  })]
278
279
  });
279
280
  }
280
- function y({ open: e, anchor: a, onClose: o, canCloseCurrent: s, canCloseOthers: c, canCloseRight: l, onAction: u }) {
281
- let d = r();
282
- return /* @__PURE__ */ g(n, {
281
+ function b({ open: e, anchor: t, onClose: o, canCloseCurrent: s, canCloseOthers: c, canCloseRight: l, onAction: u }) {
282
+ let d = i();
283
+ return /* @__PURE__ */ _(r, {
283
284
  open: e,
284
285
  onClose: o,
285
- anchor: a,
286
+ anchor: t,
286
287
  align: "end",
287
288
  width: 230,
288
289
  children: [
289
- /* @__PURE__ */ h(i, {
290
- icon: /* @__PURE__ */ h(t.x, { size: 13 }),
290
+ /* @__PURE__ */ g(a, {
291
+ icon: /* @__PURE__ */ g(n.x, { size: 13 }),
291
292
  disabled: !s,
292
293
  title: s ? void 0 : d("shell.tabs.none_closable", "No current tab can be closed"),
293
294
  onClick: () => u("current"),
294
295
  children: d("shell.tabs.close_current", "Close current tab")
295
296
  }),
296
- /* @__PURE__ */ h(i, {
297
- icon: /* @__PURE__ */ h(t.x, { size: 13 }),
297
+ /* @__PURE__ */ g(a, {
298
+ icon: /* @__PURE__ */ g(n.x, { size: 13 }),
298
299
  disabled: !c,
299
300
  title: c ? void 0 : d("shell.tabs.no_others", "No other tabs"),
300
301
  onClick: () => u("others"),
301
302
  children: d("shell.tabs.close_others", "Close others")
302
303
  }),
303
- /* @__PURE__ */ h(i, {
304
- icon: /* @__PURE__ */ h(t.x, { size: 13 }),
304
+ /* @__PURE__ */ g(a, {
305
+ icon: /* @__PURE__ */ g(n.x, { size: 13 }),
305
306
  disabled: !l,
306
307
  title: l ? void 0 : d("shell.tabs.none_right", "No tabs to the right"),
307
308
  onClick: () => u("right"),
308
309
  children: d("shell.tabs.close_right", "Close tabs to the right")
309
310
  }),
310
- /* @__PURE__ */ h(i, { divider: !0 }),
311
- /* @__PURE__ */ h(i, {
312
- icon: /* @__PURE__ */ h(t.trash, { size: 13 }),
311
+ /* @__PURE__ */ g(a, { divider: !0 }),
312
+ /* @__PURE__ */ g(a, {
313
+ icon: /* @__PURE__ */ g(n.trash, { size: 13 }),
313
314
  danger: !0,
314
315
  onClick: () => u("all"),
315
316
  children: d("shell.tabs.close_all", "Close all tabs")
@@ -318,4 +319,4 @@ function y({ open: e, anchor: a, onClose: o, canCloseCurrent: s, canCloseOthers:
318
319
  });
319
320
  }
320
321
  //#endregion
321
- export { v as TabStrip };
322
+ export { y as TabStrip };
@@ -33,38 +33,38 @@ var f = {
33
33
  function m(e) {
34
34
  return e ? f[e] ?? p : f.production;
35
35
  }
36
- function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _, lockedReason: v }) {
37
- let y = r(), [b, x] = o(!1), [S, C] = o(""), w = a(null), T = s?.env, E = m(T), D = s?.name || "—", O = s?.role || "—", k = i(() => d.filter((e) => e.is_member !== !1), [d]), A = i(() => d.filter((e) => e.is_member === !1), [d]), j = d.length >= u, M = (e) => {
38
- if (!S) return !0;
39
- let t = S.toLowerCase();
36
+ function h({ tenant: s, tenants: d, role: f, onSwitch: p, busy: h, compact: _, locked: v, lockedReason: y }) {
37
+ let b = r(), x = f ?? b("profile.role.none", "No role"), [S, C] = o(!1), [w, T] = o(""), E = a(null), D = s?.env, O = m(D), k = s?.name || "—", A = i(() => d.filter((e) => e.is_member !== !1), [d]), j = i(() => d.filter((e) => e.is_member === !1), [d]), M = d.length >= u, N = (e) => {
38
+ if (!w) return !0;
39
+ let t = w.toLowerCase();
40
40
  return e.name.toLowerCase().includes(t) || e.code.toLowerCase().includes(t);
41
- }, N = k.filter(M), P = A.filter(M), F = S !== "" && N.length === 0 && P.length === 0;
41
+ }, P = A.filter(N), F = j.filter(N), I = w !== "" && P.length === 0 && F.length === 0;
42
42
  return /* @__PURE__ */ l("div", {
43
43
  style: { position: "relative" },
44
44
  children: [/* @__PURE__ */ l("button", {
45
- ref: w,
46
- onClick: () => !_ && x((e) => !e),
45
+ ref: E,
46
+ onClick: () => !v && C((e) => !e),
47
47
  "data-testid": "tenant-chip",
48
- "data-locked": _ ? "true" : void 0,
48
+ "data-locked": v ? "true" : void 0,
49
49
  style: {
50
50
  display: "flex",
51
51
  alignItems: "center",
52
52
  gap: 8,
53
53
  height: 28,
54
54
  padding: "0 8px 0 8px",
55
- maxWidth: h ? "100%" : void 0,
55
+ maxWidth: _ ? "100%" : void 0,
56
56
  minWidth: 0,
57
57
  background: "var(--surface-2)",
58
58
  border: "1px solid var(--border)",
59
59
  borderRadius: "var(--radius-md)",
60
- cursor: _ ? "not-allowed" : "pointer",
60
+ cursor: v ? "not-allowed" : "pointer",
61
61
  color: "var(--text)",
62
62
  fontSize: 12.5,
63
63
  fontWeight: 500,
64
- opacity: _ ? .6 : 1
64
+ opacity: v ? .6 : 1
65
65
  },
66
- title: _ ? v || y("shell.tenant.switch_disabled", "Tenant switching is disabled") : y("shell.tenant.current", "Current tenant / environment"),
67
- disabled: p || _,
66
+ title: v ? y || b("shell.tenant.switch_disabled", "Tenant switching is disabled") : b("shell.tenant.current", "Current tenant / environment"),
67
+ disabled: h || v,
68
68
  children: [
69
69
  /* @__PURE__ */ c(t.tenant, {
70
70
  size: 13,
@@ -77,13 +77,13 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
77
77
  style: {
78
78
  fontWeight: 600,
79
79
  minWidth: 0,
80
- overflow: h ? "hidden" : void 0,
81
- textOverflow: h ? "ellipsis" : void 0,
82
- whiteSpace: h ? "nowrap" : void 0
80
+ overflow: _ ? "hidden" : void 0,
81
+ textOverflow: _ ? "ellipsis" : void 0,
82
+ whiteSpace: _ ? "nowrap" : void 0
83
83
  },
84
- children: D
84
+ children: k
85
85
  }),
86
- T && /* @__PURE__ */ c("span", {
86
+ D && /* @__PURE__ */ c("span", {
87
87
  className: "mono",
88
88
  style: {
89
89
  padding: "2px 6px",
@@ -92,12 +92,12 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
92
92
  fontWeight: 700,
93
93
  letterSpacing: "0.06em",
94
94
  textTransform: "uppercase",
95
- background: E.bg,
96
- color: E.fg,
97
- border: `1px solid ${E.border}`,
95
+ background: O.bg,
96
+ color: O.fg,
97
+ border: `1px solid ${O.border}`,
98
98
  flex: "none"
99
99
  },
100
- children: T
100
+ children: D
101
101
  }),
102
102
  /* @__PURE__ */ c(t.down, {
103
103
  size: 11,
@@ -108,9 +108,9 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
108
108
  })
109
109
  ]
110
110
  }), /* @__PURE__ */ l(n, {
111
- open: b,
112
- anchor: w.current,
113
- onClose: () => x(!1),
111
+ open: S,
112
+ anchor: E.current,
113
+ onClose: () => C(!1),
114
114
  width: 300,
115
115
  align: "start",
116
116
  children: [
@@ -128,7 +128,7 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
128
128
  fontWeight: 700,
129
129
  textTransform: "uppercase"
130
130
  },
131
- children: y("shell.tenant.active_scope", "Active scope")
131
+ children: b("shell.tenant.active_scope", "Active scope")
132
132
  }),
133
133
  /* @__PURE__ */ l("div", {
134
134
  style: {
@@ -147,9 +147,9 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
147
147
  fontSize: 13,
148
148
  fontWeight: 600
149
149
  },
150
- children: D
150
+ children: k
151
151
  }),
152
- T && /* @__PURE__ */ c("span", {
152
+ D && /* @__PURE__ */ c("span", {
153
153
  className: "mono",
154
154
  style: {
155
155
  marginLeft: "auto",
@@ -157,10 +157,10 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
157
157
  borderRadius: "var(--radius-xs)",
158
158
  fontSize: 10,
159
159
  fontWeight: 700,
160
- background: E.bg,
161
- color: E.fg
160
+ background: O.bg,
161
+ color: O.fg
162
162
  },
163
- children: T
163
+ children: D
164
164
  })
165
165
  ]
166
166
  }),
@@ -170,26 +170,26 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
170
170
  fontSize: 11,
171
171
  color: "var(--text-3)"
172
172
  },
173
- children: e(y("shell.tenant.role", "Role: {role}"), { role: /* @__PURE__ */ c("span", {
173
+ children: e(b("shell.tenant.role", "Role: {role}"), { role: /* @__PURE__ */ c("span", {
174
174
  style: {
175
175
  color: "var(--text-2)",
176
176
  fontWeight: 500
177
177
  },
178
- children: O
178
+ children: x
179
179
  }) })
180
180
  })
181
181
  ]
182
182
  }),
183
- j && /* @__PURE__ */ c("div", {
183
+ M && /* @__PURE__ */ c("div", {
184
184
  style: {
185
185
  padding: "8px 10px 4px",
186
186
  borderBottom: "1px solid var(--divider)"
187
187
  },
188
188
  children: /* @__PURE__ */ c("input", {
189
189
  type: "text",
190
- value: S,
191
- onChange: (e) => C(e.target.value),
192
- placeholder: y("shell.tenant.search", "Search tenants…"),
190
+ value: w,
191
+ onChange: (e) => T(e.target.value),
192
+ placeholder: b("shell.tenant.search", "Search tenants…"),
193
193
  autoFocus: !0,
194
194
  "data-testid": "tenant-switch-search",
195
195
  style: {
@@ -212,29 +212,29 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
212
212
  },
213
213
  children: [
214
214
  /* @__PURE__ */ c(g, {
215
- label: A.length > 0 ? y("shell.tenant.yours", "Your tenants") : y("shell.tenant.switch", "Switch tenant"),
216
- tenants: N,
215
+ label: j.length > 0 ? b("shell.tenant.yours", "Your tenants") : b("shell.tenant.switch", "Switch tenant"),
216
+ tenants: P,
217
217
  activeID: s?.id,
218
218
  onPick: (e) => {
219
- x(!1), f(e);
219
+ C(!1), p(e);
220
220
  }
221
221
  }),
222
- P.length > 0 && /* @__PURE__ */ c(g, {
223
- label: y("shell.tenant.all_admin", "All tenants (admin)"),
224
- tenants: P,
222
+ F.length > 0 && /* @__PURE__ */ c(g, {
223
+ label: b("shell.tenant.all_admin", "All tenants (admin)"),
224
+ tenants: F,
225
225
  activeID: s?.id,
226
226
  onPick: (e) => {
227
- x(!1), f(e);
227
+ C(!1), p(e);
228
228
  }
229
229
  }),
230
- F && /* @__PURE__ */ c("div", {
230
+ I && /* @__PURE__ */ c("div", {
231
231
  style: {
232
232
  padding: "12px 12px",
233
233
  fontSize: 12,
234
234
  color: "var(--text-3)",
235
235
  textAlign: "center"
236
236
  },
237
- children: y("shell.tenant.no_matches", "No tenants match “{query}”.", { query: S })
237
+ children: b("shell.tenant.no_matches", "No tenants match “{query}”.", { query: w })
238
238
  })
239
239
  ]
240
240
  }),
@@ -254,7 +254,7 @@ function h({ tenant: s, tenants: d, onSwitch: f, busy: p, compact: h, locked: _,
254
254
  marginTop: 2,
255
255
  flexShrink: 0
256
256
  }
257
- }), /* @__PURE__ */ c("span", { children: y("shell.tenant.switch_hint", "Switching tenant reloads all data. Unsaved changes in open tabs will prompt.") })]
257
+ }), /* @__PURE__ */ c("span", { children: b("shell.tenant.switch_hint", "Switching tenant reloads all data. Unsaved changes in open tabs will prompt.") })]
258
258
  })
259
259
  ]
260
260
  })]
@@ -334,13 +334,6 @@ function _({ tenant: e, tone: n, active: i, onPick: a }) {
334
334
  children: e.env
335
335
  }) : null,
336
336
  /* @__PURE__ */ c("span", { style: { flex: 1 } }),
337
- e.role && /* @__PURE__ */ c("span", {
338
- style: {
339
- fontSize: 10.5,
340
- color: "var(--text-3)"
341
- },
342
- children: e.role
343
- }),
344
337
  i && /* @__PURE__ */ c(t.check, {
345
338
  size: 12,
346
339
  style: {