@declarion/react 0.66.1 → 0.80.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 (66) hide show
  1. package/README.md +1 -1
  2. package/dist-lib/api/auth.js +24 -14
  3. package/dist-lib/app.js +28 -23
  4. package/dist-lib/components/chrome/AssociationTabs.js +35 -38
  5. package/dist-lib/components/chrome/HighlightsStrip.js +2 -1
  6. package/dist-lib/components/chrome/RecordHeader.js +33 -38
  7. package/dist-lib/components/detail-layout/AssociatedBlock.js +10 -21
  8. package/dist-lib/components/detail-layout/ChildrenBlock.js +1 -8
  9. package/dist-lib/components/detail-layout/ChildrenCards.js +1 -8
  10. package/dist-lib/components/detail-layout/ChildrenList.js +1 -8
  11. package/dist-lib/components/detail-layout/ChildrenTable.js +1 -8
  12. package/dist-lib/components/detail-layout/ChildrenTimeline.js +1 -8
  13. package/dist-lib/components/detail-layout/DetailAuditStrip.js +33 -29
  14. package/dist-lib/components/detail-layout/DetailHighlights.js +7 -2
  15. package/dist-lib/components/detail-layout/FieldsBlock.js +12 -9
  16. package/dist-lib/components/detail-layout/LayoutRenderer.js +10 -10
  17. package/dist-lib/components/detail-layout/LayoutTabs.js +49 -48
  18. package/dist-lib/components/detail-layout/SectionBlock.js +20 -28
  19. package/dist-lib/components/detail-layout/visibility.js +28 -0
  20. package/dist-lib/components/fields/IntArrayField.js +37 -33
  21. package/dist-lib/components/fields/NumberField.js +28 -55
  22. package/dist-lib/components/fields/RichTextField.js +1 -1
  23. package/dist-lib/components/fields/TimestampField.js +50 -89
  24. package/dist-lib/components/fields/cells/factories/date.js +13 -14
  25. package/dist-lib/components/fields/cells/factories/money.js +1 -1
  26. package/dist-lib/components/fields/cells/factories/number.js +4 -4
  27. package/dist-lib/components/file-widgets/DocumentCard.js +1 -1
  28. package/dist-lib/components/file-widgets/Grid.js +153 -152
  29. package/dist-lib/components/file-widgets/ImageWidget.js +90 -91
  30. package/dist-lib/components/file-widgets/LabeledSlots.js +1 -0
  31. package/dist-lib/components/file-widgets/helpers.js +15 -19
  32. package/dist-lib/components/file-widgets/host.js +33 -32
  33. package/dist-lib/components/file-widgets/upload.js +10 -6
  34. package/dist-lib/components/layout/Layout.js +125 -123
  35. package/dist-lib/components/pages/NoScreensPage.impl.js +14 -0
  36. package/dist-lib/components/pages/NoScreensPage.js +12 -0
  37. package/dist-lib/components/pages/SmartDetailPage.impl.js +451 -451
  38. package/dist-lib/components/pages/auth/AuthShell.js +62 -61
  39. package/dist-lib/components/pages/auth/CodeInput.js +63 -0
  40. package/dist-lib/components/pages/auth/SignIn.js +12 -4
  41. package/dist-lib/components/pages/auth/SignUp.impl.js +80 -103
  42. package/dist-lib/components/pages/auth/SignUpCode.js +122 -0
  43. package/dist-lib/components/pages/auth/TwoFA.impl.js +9 -55
  44. package/dist-lib/components/pages/list/cardProjection.js +135 -122
  45. package/dist-lib/components/pages/list/columns.js +58 -43
  46. package/dist-lib/components/pages/profile/Profile.impl.js +87 -104
  47. package/dist-lib/components/pages/tenant-params/TenantParamsPage.impl.js +1 -1
  48. package/dist-lib/components/params/ParamsBlock.js +6 -17
  49. package/dist-lib/components/params/param-editors.js +14 -10
  50. package/dist-lib/components/primitives/Fields.js +314 -236
  51. package/dist-lib/components/shared/MarkdownRenderer.js +44 -43
  52. package/dist-lib/declarion-react.css +1 -1
  53. package/dist-lib/hooks/useActiveTabFollowsRoute.js +49 -0
  54. package/dist-lib/hooks/useAuth.js +44 -37
  55. package/dist-lib/hooks/useDocumentTitle.js +20 -0
  56. package/dist-lib/hooks/useFollowAgentOpen.js +1 -0
  57. package/dist-lib/hooks/useTabTitle.js +1 -1
  58. package/dist-lib/index.d.ts +21 -7
  59. package/dist-lib/lib/date-text.js +57 -0
  60. package/dist-lib/lib/number-text.js +9 -0
  61. package/dist-lib/lib/timestamp.js +29 -29
  62. package/dist-lib/stores/tabs.js +7 -5
  63. package/dist-lib/testing.d.ts +1 -1
  64. package/dist-lib/testing.js +1 -0
  65. package/dist-lib/{useResponsiveMode-DmrpMbZX.d.ts → useResponsiveMode-D3SKz5z4.d.ts} +20 -9
  66. package/package.json +11 -11
@@ -20,7 +20,7 @@ import { useTabNavigate as ie } from "../../hooks/useTabNavigate.js";
20
20
  import { Sidebar as ae, buildSections as h } from "./Sidebar.js";
21
21
  import { useImpersonation as oe } from "../../hooks/useImpersonation.js";
22
22
  import { TopBar as se } from "./TopBar.js";
23
- import { useTabTitle as g } from "../../hooks/useTabTitle.js";
23
+ import { builtInPageTitle as g, useTabTitle as _ } from "../../hooks/useTabTitle.js";
24
24
  import { TabStrip as ce } from "./TabStrip.js";
25
25
  import { DirtyTabsCloseDialog as le } from "./DirtyTabsCloseDialog.js";
26
26
  import { ImpersonationBanner as ue } from "./ImpersonationBanner.js";
@@ -35,75 +35,72 @@ import { usePageStateRuntime as be } from "../../hooks/usePageStateRuntime.js";
35
35
  import { AgentOpenFollower as xe } from "../agents/AgentOpenFollower.js";
36
36
  import { useCurrentLocation as Se } from "../../hooks/useCurrentLocation.js";
37
37
  import { useBrandingShell as Ce } from "../../hooks/useBrandingChrome.js";
38
- import { useCallback as _, useEffect as v, useMemo as we, useRef as y, useState as b } from "react";
39
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
40
- import { Outlet as Te, useLocation as Ee, useNavigate as De } from "react-router";
38
+ import { useActiveTabFollowsRoute as we } from "../../hooks/useActiveTabFollowsRoute.js";
39
+ import { useDocumentTitle as Te } from "../../hooks/useDocumentTitle.js";
40
+ import { useCallback as v, useEffect as y, useMemo as Ee, useRef as b, useState as x } from "react";
41
+ import { Fragment as S, jsx as C, jsxs as w } from "react/jsx-runtime";
42
+ import { Outlet as De, useLocation as Oe, useNavigate as ke } from "react-router";
41
43
  //#region src/components/layout/Layout.tsx
42
- var w = "default";
43
- function T() {
44
+ var T = "default";
45
+ function E() {
44
46
  let i = o();
45
47
  te(), be();
46
- let { isAuthenticated: a, isLoading: h, user: g, activeTenant: x } = n(), T = t(), E = De(), D = ie(), O = _((e) => D(e, { topLevel: !0 }), [D]), k = Ee(), { data: A } = r(), Fe = s(), j = d((e) => e.sidebar), Ie = d((e) => e.tabsPosition), M = d((e) => e.aiSurface), Le = d((e) => e.colorScheme), N = d((e) => e.set), Re = d((e) => e.hydrateFromBranding), { branding: ze } = l(), P = Ce(), F = f((e) => e.tabs), Be = f((e) => e.activeTabId), Ve = f((e) => e.closeTabs), He = f((e) => e.switchTab), Ue = f((e) => e.setScope), We = f((e) => e.hydrate), [I, L] = b(w), [Ge, R] = b(!1), [Ke, qe] = b("default"), [z, B] = b(!1), [Je, V] = b(), [Ye, H] = b(!1), [Xe, U] = b(!1), Ze = y(null), Qe = y(null), [W, G] = b(null), K = M !== "off" && P.isVisible("show_command_palette"), q = M === "panel" || M === "both", $e = M === "command" || M === "both", et = u(), tt = et?.ai_name?.trim() ?? "", J = Fe.category === "phone" || Fe.category === "tablet", Y = P.isVisible("show_topbar"), nt = !J && P.isVisible("show_rail"), rt = !J && P.isVisible("show_sidebar"), it = !J && P.isVisible("show_tabs"), at = J && P.isVisible("show_sidebar"), ot = J && P.isVisible("show_tabs"), st = Oe(!J && q && z), ct = P.isVisible("show_tenant_switcher"), lt = P.isVisible("show_breadcrumbs"), ut = P.isVisible("show_theme_toggle"), X = _((e = "default") => {
48
+ let { isAuthenticated: a, isLoading: h, user: g, activeTenant: _ } = n(), S = t(), E = ke(), D = ie(), O = v((e) => D(e, { topLevel: !0 }), [D]), k = Oe(), { data: A } = r(), Le = s(), j = d((e) => e.sidebar), Re = d((e) => e.tabsPosition), M = d((e) => e.aiSurface), ze = d((e) => e.colorScheme), N = d((e) => e.set), Be = d((e) => e.hydrateFromBranding), { branding: Ve } = l(), P = Ce(), F = f((e) => e.tabs), He = f((e) => e.activeTabId), Ue = f((e) => e.closeTabs), We = f((e) => e.switchTab), [I, L] = x(T), [Ge, R] = x(!1), [Ke, qe] = x("default"), [z, B] = x(!1), [Je, V] = x(), [Ye, H] = x(!1), [Xe, U] = x(!1), Ze = b(null), Qe = b(null), [W, G] = x(null), K = M !== "off" && P.isVisible("show_command_palette"), q = M === "panel" || M === "both", $e = M === "command" || M === "both", et = u(), tt = et?.ai_name?.trim() ?? "", J = Le.category === "phone" || Le.category === "tablet", Y = P.isVisible("show_topbar"), nt = !J && P.isVisible("show_rail"), rt = !J && P.isVisible("show_sidebar"), it = !J && P.isVisible("show_tabs"), at = J && P.isVisible("show_sidebar"), ot = J && P.isVisible("show_tabs"), st = Ae(!J && q && z), ct = P.isVisible("show_tenant_switcher"), lt = P.isVisible("show_breadcrumbs"), ut = P.isVisible("show_theme_toggle"), X = v((e = "default") => {
47
49
  K && (qe(e), R(!0));
48
- }, [K]), Z = _((e) => {
50
+ }, [K]), Z = v((e) => {
49
51
  if (e.length === 0) return;
50
- let t = f.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = Ve(e);
52
+ let t = f.getState(), n = !t.activeTabId || e.includes(t.activeTabId), r = Ue(e);
51
53
  if (!n) return;
52
54
  let i = pe(r);
53
55
  E({
54
56
  pathname: i.pathname,
55
57
  search: i.search
56
58
  }, { replace: i.replace });
57
- }, [Ve, E]), Q = _((e, t) => {
59
+ }, [Ue, E]), Q = v((e, t) => {
58
60
  let n = f.getState(), r = fe(n.tabs, n.activeTabId, e, t);
59
61
  r && (r.dirtyTabs.length > 0 ? G(r) : Z(r.ids));
60
- }, [Z]), dt = _(() => {
62
+ }, [Z]), dt = v(() => {
61
63
  G(null);
62
- }, []), ft = _(() => {
64
+ }, []), ft = v(() => {
63
65
  W && (G(null), Z(W.cleanIds));
64
- }, [W, Z]), pt = _(() => {
66
+ }, [W, Z]), pt = v(() => {
65
67
  W && (G(null), Z(W.ids));
66
68
  }, [W, Z]);
67
69
  ge();
68
70
  let mt = Se(), { isImpersonating: $ } = oe();
69
- v(() => {
70
- T.enabled || !h && !a && E(e(`${k.pathname}${k.search}${k.hash}`), { replace: !0 });
71
+ y(() => {
72
+ S.enabled || !h && !a && E(e(`${k.pathname}${k.search}${k.hash}`), { replace: !0 });
71
73
  }, [
72
- T.enabled,
74
+ S.enabled,
73
75
  h,
74
76
  a,
75
77
  E,
76
78
  k.hash,
77
79
  k.pathname,
78
80
  k.search
79
- ]), v(() => {
80
- let e = g?.id || null, t = x?.id || null;
81
- Ue(t, e), ye.getState().setScope(t, e), e && t && (We(), ye.getState().hydrate(), ve());
82
- }, [
83
- g?.id,
84
- x?.id,
85
- Ue,
86
- We
87
- ]), v(() => {
88
- Re(ze?.preferences);
89
- }, [ze, Re]), v(() => {
81
+ ]), y(() => {
82
+ let e = g?.id || null, t = _?.id || null;
83
+ f.getState().setScope(t, e), ye.getState().setScope(t, e), e && t && (f.getState().hydrate(), ye.getState().hydrate(), ve());
84
+ }, [g?.id, _?.id]), we(), Te(), y(() => {
85
+ Be(Ve?.preferences);
86
+ }, [Ve, Be]), y(() => {
90
87
  if (!A) return;
91
- let e = Ne(A.navigation, A.screens, k.pathname);
88
+ let e = Fe(A.navigation, A.screens, k.pathname);
92
89
  if (e) {
93
90
  L(e);
94
91
  return;
95
92
  }
96
93
  let t = I;
97
- if ((A.navigation ?? []).some((e) => (e.area || w) === t)) return;
98
- let n = (A.navigation ?? [])[0]?.area || w;
94
+ if ((A.navigation ?? []).some((e) => (e.area || T) === t)) return;
95
+ let n = (A.navigation ?? [])[0]?.area || T;
99
96
  n !== t && L(n);
100
97
  }, [
101
98
  A,
102
99
  k.pathname,
103
100
  I
104
- ]), v(() => {
101
+ ]), y(() => {
105
102
  H(!1), U(!1);
106
- }, [k.pathname, k.search]), v(() => {
103
+ }, [k.pathname, k.search]), y(() => {
107
104
  let e = (e) => {
108
105
  let t = document.activeElement, n = !!t && (t.tagName === "INPUT" || t.tagName === "TEXTAREA" || t.isContentEditable), r = e.metaKey || e.ctrlKey;
109
106
  r && e.key.toLowerCase() === "k" ? (e.preventDefault(), X("default")) : r && e.key.toLowerCase() === "t" ? (e.preventDefault(), X("new")) : r && e.key.toLowerCase() === "b" ? (e.preventDefault(), N("sidebar", j === "collapsed" ? "wide" : "collapsed")) : r && e.key.toLowerCase() === "w" ? (e.preventDefault(), Q("current")) : r && e.key === "/" ? (e.preventDefault(), q && B((e) => !e)) : e.key === "/" && !n ? (e.preventDefault(), X("default")) : e.key === "Escape" && R(!1);
@@ -116,14 +113,14 @@ function T() {
116
113
  j,
117
114
  q
118
115
  ]);
119
- let ht = we(() => A ? Pe(i, A.navigation, A.screens, k.pathname, F, O) : [], [
116
+ let ht = Ee(() => A ? Ie(i, A.navigation, A.screens, k.pathname, F, O) : [], [
120
117
  i,
121
118
  A,
122
119
  k.pathname,
123
120
  F,
124
121
  O
125
122
  ]);
126
- if (h) return /* @__PURE__ */ S("div", {
123
+ if (h) return /* @__PURE__ */ C("div", {
127
124
  style: {
128
125
  display: "flex",
129
126
  height: "var(--app-height)",
@@ -137,7 +134,7 @@ function T() {
137
134
  if (!a) return null;
138
135
  let gt = (e) => {
139
136
  L(e);
140
- let t = Me(e, A);
137
+ let t = Pe(e, A);
141
138
  t && O(t);
142
139
  }, _t = (e) => {
143
140
  switch (e.type) {
@@ -157,28 +154,28 @@ function T() {
157
154
  q && (V(void 0), B(!0));
158
155
  break;
159
156
  case "theme":
160
- N("colorScheme", Le === "dark" ? "light" : "dark");
157
+ N("colorScheme", ze === "dark" ? "light" : "dark");
161
158
  break;
162
159
  case "tab-close": e.tabCloseScope && Q(e.tabCloseScope);
163
160
  }
164
161
  };
165
- return T.enabled ? /* @__PURE__ */ C(_e, { children: [
166
- /* @__PURE__ */ S(ne, {}),
167
- /* @__PURE__ */ S(m, {}),
168
- /* @__PURE__ */ S(re, {}),
169
- /* @__PURE__ */ S(ee, {}),
170
- /* @__PURE__ */ S(p, {}),
171
- /* @__PURE__ */ S("div", {
162
+ return S.enabled ? /* @__PURE__ */ w(_e, { children: [
163
+ /* @__PURE__ */ C(ne, {}),
164
+ /* @__PURE__ */ C(m, {}),
165
+ /* @__PURE__ */ C(re, {}),
166
+ /* @__PURE__ */ C(ee, {}),
167
+ /* @__PURE__ */ C(p, {}),
168
+ /* @__PURE__ */ C("div", {
172
169
  id: "app-embed",
173
170
  className: "flex min-h-0 flex-col overflow-auto",
174
171
  style: { height: "var(--app-height)" },
175
- children: /* @__PURE__ */ S(Te, {})
172
+ children: /* @__PURE__ */ C(De, {})
176
173
  })
177
- ] }) : /* @__PURE__ */ S(_e, { children: /* @__PURE__ */ C("div", {
174
+ ] }) : /* @__PURE__ */ C(_e, { children: /* @__PURE__ */ w("div", {
178
175
  id: "app",
179
176
  "data-sidebar": j,
180
177
  "data-mobile-shell": J ? "true" : void 0,
181
- style: ke({
178
+ style: je({
182
179
  mobileShell: J,
183
180
  showBanner: $,
184
181
  showTopbar: Y,
@@ -188,9 +185,9 @@ function T() {
188
185
  showAssistant: st
189
186
  }),
190
187
  children: [
191
- $ && /* @__PURE__ */ S(ue, {}),
192
- /* @__PURE__ */ S(de, {}),
193
- Y && /* @__PURE__ */ S(se, {
188
+ $ && /* @__PURE__ */ C(ue, {}),
189
+ /* @__PURE__ */ C(de, {}),
190
+ Y && /* @__PURE__ */ C(se, {
194
191
  breadcrumbs: ht,
195
192
  onCrumbClick: (e) => e.onClick && e.onClick(),
196
193
  showNavButton: at,
@@ -209,7 +206,7 @@ function T() {
209
206
  showBreadcrumbs: lt,
210
207
  showThemeToggle: ut
211
208
  }),
212
- nt && /* @__PURE__ */ S(c, {
209
+ nt && /* @__PURE__ */ C(c, {
213
210
  activeArea: I,
214
211
  onPick: gt,
215
212
  onToggleAI: () => q && B((e) => !e),
@@ -218,8 +215,8 @@ function T() {
218
215
  areas: A?.areas,
219
216
  branding: et
220
217
  }),
221
- rt && /* @__PURE__ */ S(ae, { activeArea: I }),
222
- /* @__PURE__ */ C("main", {
218
+ rt && /* @__PURE__ */ C(ae, { activeArea: I }),
219
+ /* @__PURE__ */ w("main", {
223
220
  style: {
224
221
  gridArea: "main",
225
222
  overflow: "hidden",
@@ -228,11 +225,11 @@ function T() {
228
225
  minWidth: 0
229
226
  },
230
227
  children: [
231
- it && Ie === "top" && /* @__PURE__ */ S(ce, {
228
+ it && Re === "top" && /* @__PURE__ */ C(ce, {
232
229
  onNew: () => X("new"),
233
230
  onCloseRequest: Q
234
231
  }),
235
- /* @__PURE__ */ S("div", {
232
+ /* @__PURE__ */ C("div", {
236
233
  style: {
237
234
  flex: 1,
238
235
  overflow: "auto",
@@ -240,15 +237,15 @@ function T() {
240
237
  display: "flex",
241
238
  flexDirection: "column"
242
239
  },
243
- children: /* @__PURE__ */ S(Te, {})
240
+ children: /* @__PURE__ */ C(De, {})
244
241
  }),
245
- it && Ie === "bottom" && /* @__PURE__ */ S(ce, {
242
+ it && Re === "bottom" && /* @__PURE__ */ C(ce, {
246
243
  onNew: () => X("new"),
247
244
  onCloseRequest: Q
248
245
  })
249
246
  ]
250
247
  }),
251
- K && /* @__PURE__ */ S(me, {
248
+ K && /* @__PURE__ */ C(me, {
252
249
  open: Ge,
253
250
  mode: Ke,
254
251
  onClose: () => R(!1),
@@ -258,8 +255,8 @@ function T() {
258
255
  includeAI: $e,
259
256
  aiName: tt
260
257
  }),
261
- /* @__PURE__ */ S(xe, {}),
262
- q && z && /* @__PURE__ */ S(he, {
258
+ /* @__PURE__ */ C(xe, {}),
259
+ q && z && /* @__PURE__ */ C(he, {
263
260
  open: z,
264
261
  docked: st,
265
262
  onClose: () => {
@@ -269,7 +266,7 @@ function T() {
269
266
  askOnOpen: Je,
270
267
  context: mt ?? void 0
271
268
  }),
272
- at && /* @__PURE__ */ S(Ae, {
269
+ at && /* @__PURE__ */ C(Me, {
273
270
  open: Ye,
274
271
  activeArea: I,
275
272
  schema: A,
@@ -277,21 +274,21 @@ function T() {
277
274
  onClose: () => H(!1),
278
275
  onNavigate: O
279
276
  }),
280
- ot && /* @__PURE__ */ S(je, {
277
+ ot && /* @__PURE__ */ C(Ne, {
281
278
  open: Xe,
282
279
  tabs: F,
283
- activeTabId: Be,
280
+ activeTabId: He,
284
281
  returnFocusRef: Qe,
285
282
  onClose: () => U(!1),
286
283
  onSwitch: (e) => {
287
- He(e.id), E({
284
+ We(e.id), E({
288
285
  pathname: e.pathname,
289
286
  search: e.search
290
287
  }, { replace: !1 }), U(!1);
291
288
  },
292
289
  onCloseTab: (e) => Q("current", e)
293
290
  }),
294
- /* @__PURE__ */ S(le, {
291
+ /* @__PURE__ */ C(le, {
295
292
  pending: W,
296
293
  onCancel: dt,
297
294
  onCloseClean: ft,
@@ -300,15 +297,15 @@ function T() {
300
297
  ]
301
298
  }) });
302
299
  }
303
- function Oe(e) {
304
- return v(() => {
300
+ function Ae(e) {
301
+ return y(() => {
305
302
  let t = document.documentElement.style;
306
303
  return t.setProperty("--assistant-open-w", e ? "var(--assistant-w)" : "0px"), () => {
307
304
  t.removeProperty("--assistant-open-w");
308
305
  };
309
306
  }, [e]), e;
310
307
  }
311
- function ke({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSidebar: i, sidebarMode: a, showAssistant: o }) {
308
+ function je({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSidebar: i, sidebarMode: a, showAssistant: o }) {
312
309
  let s = [
313
310
  ...t ? ["auto"] : [],
314
311
  ...n ? ["var(--topbar-h)"] : [],
@@ -339,7 +336,7 @@ function ke({ mobileShell: e, showBanner: t, showTopbar: n, showRail: r, showSid
339
336
  overflow: "hidden"
340
337
  };
341
338
  }
342
- var E = [
339
+ var D = [
343
340
  "a[href]",
344
341
  "button:not([disabled])",
345
342
  "input:not([disabled])",
@@ -347,14 +344,14 @@ var E = [
347
344
  "textarea:not([disabled])",
348
345
  "[tabindex]:not([tabindex='-1'])"
349
346
  ].join(",");
350
- function D(e) {
351
- return e ? Array.from(e.querySelectorAll(E)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
352
- }
353
347
  function O(e) {
354
- D(e)[0]?.focus();
348
+ return e ? Array.from(e.querySelectorAll(D)).filter((e) => !e.hasAttribute("disabled") && e.getAttribute("aria-hidden") !== "true") : [];
355
349
  }
356
- function k(e, t) {
357
- let n = D(e);
350
+ function k(e) {
351
+ O(e)[0]?.focus();
352
+ }
353
+ function A(e, t) {
354
+ let n = O(e);
358
355
  if (n.length === 0) {
359
356
  t.preventDefault();
360
357
  return;
@@ -362,16 +359,16 @@ function k(e, t) {
362
359
  let r = n[0], i = n[n.length - 1], a = document.activeElement;
363
360
  t.shiftKey && a === r ? (t.preventDefault(), i.focus()) : !t.shiftKey && a === i && (t.preventDefault(), r.focus());
364
361
  }
365
- function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s, onNavigate: c }) {
366
- let l = o(), [u, d] = b(t), f = y(null);
367
- if (v(() => {
362
+ function Me({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s, onNavigate: c }) {
363
+ let l = o(), [u, d] = x(t), f = b(null);
364
+ if (y(() => {
368
365
  e && d(t);
369
- }, [e, t]), v(() => {
366
+ }, [e, t]), y(() => {
370
367
  if (!e) return;
371
368
  let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
372
- requestAnimationFrame(() => O(f.current));
369
+ requestAnimationFrame(() => k(f.current));
373
370
  let i = (e) => {
374
- e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && k(f.current, e);
371
+ e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
375
372
  };
376
373
  return window.addEventListener("keydown", i), () => {
377
374
  window.removeEventListener("keydown", i), (n ?? t)?.focus();
@@ -381,20 +378,20 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
381
378
  s,
382
379
  r
383
380
  ]), !e || !n) return null;
384
- let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area || w)));
385
- p.length === 0 && p.push(w);
381
+ let p = Array.from(new Set((n.navigation ?? []).map((e) => e.area || T)));
382
+ p.length === 0 && p.push(T);
386
383
  let ee = (e) => {
387
384
  let t = n.areas?.find((t) => t.code === e);
388
- return l(t?.name) || (e === w ? l("shell.nav.title", "Navigation") : e);
385
+ return l(t?.name) || (e === T ? l("shell.nav.title", "Navigation") : e);
389
386
  }, m = (e, t) => {
390
387
  let r = e.screen ? n.screens[e.screen] : void 0, i = [...e.items ?? [], ...e.children ?? []], a = l(e.name) || (r ? l(r.display?.name) : "");
391
- return /* @__PURE__ */ C("div", {
388
+ return /* @__PURE__ */ w("div", {
392
389
  style: {
393
390
  display: "flex",
394
391
  flexDirection: "column",
395
392
  gap: 2
396
393
  },
397
- children: [r?.route ? /* @__PURE__ */ C("button", {
394
+ children: [r?.route ? /* @__PURE__ */ w("button", {
398
395
  type: "button",
399
396
  onClick: () => {
400
397
  c(r.route), s();
@@ -413,7 +410,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
413
410
  textAlign: "left",
414
411
  cursor: "pointer"
415
412
  },
416
- children: [/* @__PURE__ */ S("span", { style: { width: 12 } }), /* @__PURE__ */ S("span", {
413
+ children: [/* @__PURE__ */ C("span", { style: { width: 12 } }), /* @__PURE__ */ C("span", {
417
414
  style: {
418
415
  minWidth: 0,
419
416
  overflow: "hidden",
@@ -422,7 +419,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
422
419
  },
423
420
  children: a || r.route
424
421
  })]
425
- }) : a ? /* @__PURE__ */ S("div", {
422
+ }) : a ? /* @__PURE__ */ C("div", {
426
423
  style: {
427
424
  padding: `7px 10px 5px ${10 + t * 14}px`,
428
425
  color: "var(--text-3)",
@@ -435,7 +432,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
435
432
  }) : null, i.map((e) => m(e, t + 1))]
436
433
  }, `${t}-${e.screen ?? a}`);
437
434
  };
438
- return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
435
+ return /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
439
436
  "data-testid": "mobile-nav-backdrop",
440
437
  onClick: s,
441
438
  style: {
@@ -444,7 +441,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
444
441
  background: "var(--scrim-lite)",
445
442
  zIndex: 120
446
443
  }
447
- }), /* @__PURE__ */ C("aside", {
444
+ }), /* @__PURE__ */ w("aside", {
448
445
  ref: f,
449
446
  role: "dialog",
450
447
  "aria-modal": "true",
@@ -468,7 +465,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
468
465
  boxSizing: "border-box",
469
466
  overflow: "hidden"
470
467
  },
471
- children: [/* @__PURE__ */ C("div", {
468
+ children: [/* @__PURE__ */ w("div", {
472
469
  style: {
473
470
  display: "flex",
474
471
  alignItems: "center",
@@ -476,18 +473,18 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
476
473
  minHeight: 36,
477
474
  padding: "0 2px 8px"
478
475
  },
479
- children: [/* @__PURE__ */ S("strong", {
476
+ children: [/* @__PURE__ */ C("strong", {
480
477
  style: {
481
478
  fontSize: 13,
482
479
  flex: 1
483
480
  },
484
481
  children: l("shell.nav.title", "Navigation")
485
- }), /* @__PURE__ */ S(a, {
486
- icon: /* @__PURE__ */ S(i.x, { size: 15 }),
482
+ }), /* @__PURE__ */ C(a, {
483
+ icon: /* @__PURE__ */ C(i.x, { size: 15 }),
487
484
  title: l("shell.nav.close", "Close navigation"),
488
485
  onClick: s
489
486
  })]
490
- }), /* @__PURE__ */ S("nav", {
487
+ }), /* @__PURE__ */ C("nav", {
491
488
  style: {
492
489
  overflowY: "auto",
493
490
  overscrollBehavior: "contain",
@@ -497,7 +494,7 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
497
494
  },
498
495
  children: p.map((e) => {
499
496
  let r = u === e, a = h(l, n.navigation ?? [], e);
500
- return /* @__PURE__ */ C("section", { children: [/* @__PURE__ */ C("button", {
497
+ return /* @__PURE__ */ w("section", { children: [/* @__PURE__ */ w("button", {
501
498
  type: "button",
502
499
  onClick: () => d(r ? "" : e),
503
500
  style: {
@@ -516,16 +513,16 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
516
513
  cursor: "pointer"
517
514
  },
518
515
  "aria-expanded": r,
519
- children: [/* @__PURE__ */ S("span", {
516
+ children: [/* @__PURE__ */ C("span", {
520
517
  style: {
521
518
  flex: 1,
522
519
  textAlign: "left"
523
520
  },
524
521
  children: ee(e)
525
- }), S(r ? i.down : i.right, { size: 13 })]
526
- }), r && /* @__PURE__ */ S("div", {
522
+ }), C(r ? i.down : i.right, { size: 13 })]
523
+ }), r && /* @__PURE__ */ C("div", {
527
524
  style: { padding: "6px 0 4px" },
528
- children: a.flatMap((t) => [t.title ? /* @__PURE__ */ S("div", {
525
+ children: a.flatMap((t) => [t.title ? /* @__PURE__ */ C("div", {
529
526
  style: {
530
527
  padding: "8px 10px 4px",
531
528
  color: "var(--text-3)",
@@ -541,14 +538,14 @@ function Ae({ open: e, activeArea: t, schema: n, returnFocusRef: r, onClose: s,
541
538
  })]
542
539
  })] });
543
540
  }
544
- function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, onSwitch: c, onCloseTab: l }) {
545
- let u = o(), d = g(), f = y(null);
546
- return v(() => {
541
+ function Ne({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, onSwitch: c, onCloseTab: l }) {
542
+ let u = o(), d = _(), f = b(null);
543
+ return y(() => {
547
544
  if (!e) return;
548
545
  let t = document.activeElement instanceof HTMLElement ? document.activeElement : null, n = r.current;
549
- requestAnimationFrame(() => O(f.current));
546
+ requestAnimationFrame(() => k(f.current));
550
547
  let i = (e) => {
551
- e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && k(f.current, e);
548
+ e.key === "Escape" ? (e.preventDefault(), s()) : e.key === "Tab" && A(f.current, e);
552
549
  };
553
550
  return window.addEventListener("keydown", i), () => {
554
551
  window.removeEventListener("keydown", i), (n ?? t)?.focus();
@@ -557,7 +554,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
557
554
  e,
558
555
  s,
559
556
  r
560
- ]), e ? /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S("div", {
557
+ ]), e ? /* @__PURE__ */ w(S, { children: [/* @__PURE__ */ C("div", {
561
558
  "data-testid": "mobile-tabs-backdrop",
562
559
  onClick: s,
563
560
  style: {
@@ -566,7 +563,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
566
563
  background: "var(--scrim-lite)",
567
564
  zIndex: 122
568
565
  }
569
- }), /* @__PURE__ */ C("section", {
566
+ }), /* @__PURE__ */ w("section", {
570
567
  ref: f,
571
568
  role: "dialog",
572
569
  "aria-modal": "true",
@@ -589,32 +586,32 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
589
586
  padding: 6,
590
587
  boxSizing: "border-box"
591
588
  },
592
- children: [/* @__PURE__ */ C("div", {
589
+ children: [/* @__PURE__ */ w("div", {
593
590
  style: {
594
591
  display: "flex",
595
592
  alignItems: "center",
596
593
  gap: 8,
597
594
  padding: "4px 4px 8px"
598
595
  },
599
- children: [/* @__PURE__ */ S("strong", {
596
+ children: [/* @__PURE__ */ C("strong", {
600
597
  style: {
601
598
  flex: 1,
602
599
  fontSize: 13
603
600
  },
604
601
  children: u("shell.tabs.open_tabs", "Open tabs")
605
- }), /* @__PURE__ */ S(a, {
606
- icon: /* @__PURE__ */ S(i.x, { size: 14 }),
602
+ }), /* @__PURE__ */ C(a, {
603
+ icon: /* @__PURE__ */ C(i.x, { size: 14 }),
607
604
  title: u("shell.tabs.close_menu", "Close tabs menu"),
608
605
  onClick: s
609
606
  })]
610
- }), t.length === 0 ? /* @__PURE__ */ S("div", {
607
+ }), t.length === 0 ? /* @__PURE__ */ C("div", {
611
608
  style: {
612
609
  padding: 10,
613
610
  color: "var(--text-3)",
614
611
  fontSize: 12
615
612
  },
616
613
  children: u("shell.tabs.none_open", "No open tabs")
617
- }) : t.map((e) => /* @__PURE__ */ C("div", {
614
+ }) : t.map((e) => /* @__PURE__ */ w("div", {
618
615
  style: {
619
616
  display: "grid",
620
617
  gridTemplateColumns: "minmax(0, 1fr) auto",
@@ -623,7 +620,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
623
620
  borderRadius: "var(--radius-md)",
624
621
  background: e.id === n ? "var(--surface-3)" : "transparent"
625
622
  },
626
- children: [/* @__PURE__ */ C("button", {
623
+ children: [/* @__PURE__ */ w("button", {
627
624
  type: "button",
628
625
  onClick: () => c(e),
629
626
  style: {
@@ -639,7 +636,7 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
639
636
  textAlign: "left",
640
637
  cursor: "pointer"
641
638
  },
642
- children: [/* @__PURE__ */ S(i.layers, { size: 13 }), /* @__PURE__ */ S("span", {
639
+ children: [/* @__PURE__ */ C(i.layers, { size: 13 }), /* @__PURE__ */ C("span", {
643
640
  style: {
644
641
  overflow: "hidden",
645
642
  textOverflow: "ellipsis",
@@ -647,15 +644,15 @@ function je({ open: e, tabs: t, activeTabId: n, returnFocusRef: r, onClose: s, o
647
644
  },
648
645
  children: d(e)
649
646
  })]
650
- }), e.closable && /* @__PURE__ */ S(a, {
651
- icon: /* @__PURE__ */ S(i.x, { size: 12 }),
647
+ }), e.closable && /* @__PURE__ */ C(a, {
648
+ icon: /* @__PURE__ */ C(i.x, { size: 12 }),
652
649
  title: u("shell.tabs.close_named", "Close {title}", { title: d(e) }),
653
650
  onClick: () => l(e.id)
654
651
  })]
655
652
  }, e.id))]
656
653
  })] }) : null;
657
654
  }
658
- function Me(e, t) {
655
+ function Pe(e, t) {
659
656
  if (!t) return;
660
657
  let n = t.areas?.find((t) => t.code === e);
661
658
  if (n?.home_screen) {
@@ -677,12 +674,12 @@ function Me(e, t) {
677
674
  }
678
675
  };
679
676
  for (let n of t.navigation ?? []) {
680
- if ((n.area || w) !== e) continue;
677
+ if ((n.area || T) !== e) continue;
681
678
  let t = r(n);
682
679
  if (t) return t;
683
680
  }
684
681
  }
685
- function Ne(e, t, n) {
682
+ function Fe(e, t, n) {
686
683
  let r = (e) => {
687
684
  if (!e.screen) return !1;
688
685
  let r = t[e.screen];
@@ -699,11 +696,11 @@ function Ne(e, t, n) {
699
696
  }
700
697
  };
701
698
  for (let t of e ?? []) {
702
- let e = i(t, t.area || w);
699
+ let e = i(t, t.area || T);
703
700
  if (e) return e;
704
701
  }
705
702
  }
706
- function Pe(e, t, n, r, i, a) {
703
+ function Ie(e, t, n, r, i, a) {
707
704
  let o = (e, t) => {
708
705
  if (e.screen) {
709
706
  let i = n[e.screen];
@@ -722,10 +719,15 @@ function Pe(e, t, n, r, i, a) {
722
719
  for (let e of t ?? []) if (s = o(e, []), s) break;
723
720
  if (!s || s.length === 0) {
724
721
  let t = Object.values(n).find((e) => e.route === r);
725
- return t?.display?.name ? [{
722
+ if (t?.display?.name) return [{
726
723
  label: e(t.display.name),
727
724
  icon: t.display.icon,
728
725
  isLast: !0
726
+ }];
727
+ let i = g(e, r);
728
+ return i ? [{
729
+ label: i,
730
+ isLast: !0
729
731
  }] : [];
730
732
  }
731
733
  let c = [];
@@ -752,4 +754,4 @@ function Pe(e, t, n, r, i, a) {
752
754
  return c;
753
755
  }
754
756
  //#endregion
755
- export { T as Layout, Pe as buildCrumbs };
757
+ export { E as Layout, Ie as buildCrumbs };
@@ -0,0 +1,14 @@
1
+ import { useText as e } from "../../hooks/useText.js";
2
+ import { EmptyState as t } from "../shared/EmptyState.js";
3
+ import { jsx as n } from "react/jsx-runtime";
4
+ //#region src/components/pages/NoScreensPage.impl.tsx
5
+ function r() {
6
+ let r = e();
7
+ return /* @__PURE__ */ n(t, {
8
+ icon: "lock",
9
+ title: r("page.no_screens.title", "No screens are open to you in this tenant"),
10
+ description: r("page.no_screens.description", "Ask an administrator of this tenant to grant you a role.")
11
+ });
12
+ }
13
+ //#endregion
14
+ export { r as NoScreensPage };
@@ -0,0 +1,12 @@
1
+ import { Suspense as e, lazy as t } from "react";
2
+ import { jsx as n } from "react/jsx-runtime";
3
+ //#region src/components/pages/NoScreensPage.tsx
4
+ var r = t(() => import("./NoScreensPage.impl.js").then((e) => ({ default: e.NoScreensPage })));
5
+ function i() {
6
+ return /* @__PURE__ */ n(e, {
7
+ fallback: null,
8
+ children: /* @__PURE__ */ n(r, {})
9
+ });
10
+ }
11
+ //#endregion
12
+ export { i as NoScreensPage };