@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
@@ -3,20 +3,21 @@ import { useAnchoredTooltip as t } from "../primitives/Tooltip.js";
3
3
  import { useText as n } from "../../hooks/useText.js";
4
4
  import { DynamicIcon as r } from "../shared/DynamicIcon.js";
5
5
  import { isValidLogoUrl as i } from "../../lib/branding.js";
6
- import { useRef as a, useState as o } from "react";
7
- import { jsx as s, jsxs as c } from "react/jsx-runtime";
6
+ import { shortcutLabel as a } from "../../lib/shortcut.js";
7
+ import { useRef as o, useState as s } from "react";
8
+ import { jsx as c, jsxs as l } from "react/jsx-runtime";
8
9
  //#region src/components/layout/Rail.tsx
9
- var l = 32;
10
- function u(e, t) {
10
+ var u = 32;
11
+ function d(e, t) {
11
12
  return !t || t.length === 0 ? [] : t.map((t) => ({
12
13
  id: t.code,
13
14
  icon: t.icon || void 0,
14
15
  label: e(t.name) || t.code
15
16
  }));
16
17
  }
17
- function d({ activeArea: t, onPick: r, onToggleAI: a, aiOpen: o, onCmdK: d, areas: m, branding: h }) {
18
- let g = n(), _ = u(g, m), v = h?.app_name ?? "", y = i(h?.app_logo) ? h?.app_logo : void 0;
19
- return /* @__PURE__ */ c("div", {
18
+ function f({ activeArea: t, onPick: r, onToggleAI: o, aiOpen: s, onCmdK: f, areas: h, branding: g }) {
19
+ let _ = n(), v = d(_, h), y = g?.app_name ?? "", b = i(g?.app_logo) ? g?.app_logo : void 0;
20
+ return /* @__PURE__ */ l("div", {
20
21
  style: {
21
22
  gridArea: "rail",
22
23
  background: "var(--rail)",
@@ -28,66 +29,66 @@ function d({ activeArea: t, onPick: r, onToggleAI: a, aiOpen: o, onCmdK: d, area
28
29
  gap: 2
29
30
  },
30
31
  children: [
31
- /* @__PURE__ */ s("div", {
32
+ /* @__PURE__ */ c("div", {
32
33
  style: {
33
- width: l,
34
- height: l,
34
+ width: u,
35
+ height: u,
35
36
  borderRadius: "var(--radius-md)",
36
- background: y ? "transparent" : "linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%)",
37
+ background: b ? "transparent" : "linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%)",
37
38
  display: "flex",
38
39
  alignItems: "center",
39
40
  justifyContent: "center",
40
41
  marginBottom: 8,
41
- boxShadow: y ? "none" : "var(--shadow-sm)",
42
+ boxShadow: b ? "none" : "var(--shadow-sm)",
42
43
  overflow: "hidden"
43
44
  },
44
- title: v ? g("shell.rail.home_named", "{brand} — home", { brand: v }) : g("shell.rail.home", "home"),
45
- children: y ? /* @__PURE__ */ s("img", {
46
- src: y,
47
- alt: v,
48
- width: l,
49
- height: l,
45
+ title: y ? _("shell.rail.home_named", "{brand} — home", { brand: y }) : _("shell.rail.home", "home"),
46
+ children: b ? /* @__PURE__ */ c("img", {
47
+ src: b,
48
+ alt: y,
49
+ width: u,
50
+ height: u,
50
51
  style: {
51
52
  display: "block",
52
53
  objectFit: "contain"
53
54
  }
54
- }) : v ? /* @__PURE__ */ s("span", {
55
+ }) : y ? /* @__PURE__ */ c("span", {
55
56
  style: {
56
57
  fontSize: 11,
57
58
  fontWeight: 700,
58
59
  letterSpacing: "0.04em"
59
60
  },
60
- children: v.charAt(0).toUpperCase()
61
+ children: y.charAt(0).toUpperCase()
61
62
  }) : null
62
63
  }),
63
- _.map((e) => /* @__PURE__ */ s(f, {
64
+ v.map((e) => /* @__PURE__ */ c(p, {
64
65
  item: e,
65
66
  active: t === e.id,
66
67
  onPick: r
67
68
  }, e.id)),
68
- /* @__PURE__ */ s("div", { style: { flex: 1 } }),
69
- /* @__PURE__ */ s("button", {
70
- onClick: d,
71
- title: g("shell.palette.open", "Command Palette (⌘K)"),
72
- style: p(!1),
73
- children: e.command && /* @__PURE__ */ s(e.command, { size: 16 })
69
+ /* @__PURE__ */ c("div", { style: { flex: 1 } }),
70
+ /* @__PURE__ */ c("button", {
71
+ onClick: f,
72
+ title: _("shell.palette.open", "Command Palette ({keys})", { keys: a("K") }),
73
+ style: m(!1),
74
+ children: e.command && /* @__PURE__ */ c(e.command, { size: 16 })
74
75
  }),
75
- /* @__PURE__ */ s("button", {
76
- onClick: a,
77
- title: g("shell.ai_assistant", "AI Assistant"),
76
+ /* @__PURE__ */ c("button", {
77
+ onClick: o,
78
+ title: _("shell.ai_assistant", "AI Assistant"),
78
79
  style: {
79
- ...p(!1),
80
- background: o ? "var(--accent)" : "transparent",
81
- color: o ? "var(--rail-fg)" : "var(--rail-muted)"
80
+ ...m(!1),
81
+ background: s ? "var(--accent)" : "transparent",
82
+ color: s ? "var(--rail-fg)" : "var(--rail-muted)"
82
83
  },
83
- children: e.sparkle && /* @__PURE__ */ s(e.sparkle, { size: 16 })
84
+ children: e.sparkle && /* @__PURE__ */ c(e.sparkle, { size: 16 })
84
85
  })
85
86
  ]
86
87
  });
87
88
  }
88
- function f({ item: e, active: n, onPick: i }) {
89
- let [l, u] = o(!1), d = a(null), f = t(d, e.label), p = n ? "var(--rail-active)" : l ? "var(--rail-hover)" : "transparent", m = n || l ? "var(--rail-fg)" : "var(--rail-muted)";
90
- return /* @__PURE__ */ c("button", {
89
+ function p({ item: e, active: n, onPick: i }) {
90
+ let [a, u] = s(!1), d = o(null), f = t(d, e.label), p = n ? "var(--rail-active)" : a ? "var(--rail-hover)" : "transparent", m = n || a ? "var(--rail-fg)" : "var(--rail-muted)";
91
+ return /* @__PURE__ */ l("button", {
91
92
  ref: d,
92
93
  onClick: () => i(e.id),
93
94
  "aria-label": e.label,
@@ -114,11 +115,11 @@ function f({ item: e, active: n, onPick: i }) {
114
115
  position: "relative"
115
116
  },
116
117
  children: [
117
- e.icon ? /* @__PURE__ */ s(r, {
118
+ e.icon ? /* @__PURE__ */ c(r, {
118
119
  name: e.icon,
119
120
  size: 16
120
121
  }) : null,
121
- n && /* @__PURE__ */ s("span", { style: {
122
+ n && /* @__PURE__ */ c("span", { style: {
122
123
  position: "absolute",
123
124
  left: -1,
124
125
  top: 8,
@@ -131,7 +132,7 @@ function f({ item: e, active: n, onPick: i }) {
131
132
  ]
132
133
  });
133
134
  }
134
- function p(e) {
135
+ function m(e) {
135
136
  return {
136
137
  width: 36,
137
138
  height: 36,
@@ -146,4 +147,4 @@ function p(e) {
146
147
  };
147
148
  }
148
149
  //#endregion
149
- export { d as Rail };
150
+ export { f as Rail };
@@ -1,33 +1,38 @@
1
- import { useSchema as e } from "../../hooks/useSchema.js";
2
- import { Icon as t } from "../primitives/Icons.js";
3
- import { Kbd as n } from "../primitives/Kbd.js";
4
- import { useText as r } from "../../hooks/useText.js";
5
- import { DynamicIcon as i } from "../shared/DynamicIcon.js";
6
- import { BrandLogo as a } from "../primitives/BrandLogo.js";
7
- import { useBrandingIdentity as o } from "../../hooks/useBranding.js";
8
- import { usePreferencesStore as s } from "../../stores/preferences.js";
9
- import { isModifiedClick as c } from "../../lib/utils.js";
10
- import { useTabNavigate as l } from "../../hooks/useTabNavigate.js";
11
- import { useIntentPrefetch as u } from "../../hooks/useIntentPrefetch.js";
12
- import { useMemo as d, useState as f } from "react";
13
- import { Fragment as p, jsx as m, jsxs as h } from "react/jsx-runtime";
14
- import { useLocation as g } from "react-router";
1
+ import { usePreferencesStore as e } from "../../stores/preferences.js";
2
+ import { useSchema as t } from "../../hooks/useSchema.js";
3
+ import { Icon as n } from "../primitives/Icons.js";
4
+ import { Kbd as r } from "../primitives/Kbd.js";
5
+ import { useText as i } from "../../hooks/useText.js";
6
+ import { useUiPreferences as a } from "../../hooks/useUiPreferences.js";
7
+ import { DynamicIcon as o } from "../shared/DynamicIcon.js";
8
+ import { shortcutLabel as s } from "../../lib/shortcut.js";
9
+ import { BrandLogo as c } from "../primitives/BrandLogo.js";
10
+ import { useBrandingIdentity as l } from "../../hooks/useBranding.js";
11
+ import { isModifiedClick as u } from "../../lib/utils.js";
12
+ import { useTabNavigate as d } from "../../hooks/useTabNavigate.js";
13
+ import { findNavMatch as f } from "../../lib/schema-routing.js";
14
+ import { useIntentPrefetch as p } from "../../hooks/useIntentPrefetch.js";
15
+ import { useMemo as m, useState as h } from "react";
16
+ import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
17
+ import { useLocation as y } from "react-router";
15
18
  //#region src/components/layout/Sidebar.tsx
16
- function _({ activeArea: i }) {
17
- let c = r(), { data: u } = e(), _ = g(), y = l(), x = s((e) => e.sidebar), S = s((e) => e.set), C = x === "collapsed", [w, T] = f({}), E = o(), D = E?.app_name ?? "", O = E?.app_logo, k = E?.version_label ?? "", A = d(() => v(c, u?.navigation ?? [], i), [
18
- c,
19
- u?.navigation,
20
- i
21
- ]), j = (e) => e ? _.pathname === e || _.pathname.startsWith(e + "/") : !1, M = (e, t) => {
19
+ function b({ activeArea: o }) {
20
+ let u = i(), { data: p } = t(), b = y(), S = d(), w = e((e) => e.sidebar), { set: T } = a(), E = w === "collapsed", [D, O] = h({}), k = l(), A = k?.app_name ?? "", j = k?.app_logo, M = k?.version_label ?? "", N = m(() => x(u, p?.navigation ?? [], o), [
21
+ u,
22
+ p?.navigation,
23
+ o
24
+ ]), P = m(() => {
25
+ if (p) return f(p.navigation, p.screens, b.pathname)?.chain.at(-1)?.screen;
26
+ }, [p, b.pathname]), F = (e, t) => {
22
27
  if (!e.screen) return;
23
- let n = u?.screens[e.screen];
24
- n && y(n.route, {
25
- title: c(e.name),
28
+ let n = p?.screens[e.screen];
29
+ n && S(n.route, {
30
+ title: u(e.name),
26
31
  icon: e.icon,
27
32
  topLevel: !0
28
33
  });
29
34
  };
30
- return /* @__PURE__ */ h("aside", {
35
+ return /* @__PURE__ */ v("aside", {
31
36
  style: {
32
37
  gridArea: "sidebar",
33
38
  background: "var(--sidebar)",
@@ -37,41 +42,47 @@ function _({ activeArea: i }) {
37
42
  overflow: "hidden"
38
43
  },
39
44
  children: [
40
- /* @__PURE__ */ m("div", {
45
+ /* @__PURE__ */ _("div", {
41
46
  style: {
42
47
  height: 44,
43
48
  display: "flex",
44
49
  alignItems: "center",
45
- padding: C ? 0 : "0 12px",
46
- justifyContent: C ? "center" : "flex-start",
50
+ padding: E ? 0 : "0 12px",
51
+ justifyContent: E ? "center" : "flex-start",
47
52
  borderBottom: "1px solid var(--divider)",
48
53
  gap: 8
49
54
  },
50
- children: C ? O ? /* @__PURE__ */ m(a, {
51
- appLogo: O,
55
+ children: E ? j ? /* @__PURE__ */ _(c, {
56
+ appLogo: j,
52
57
  size: 18
53
- }) : D ? /* @__PURE__ */ m("span", {
58
+ }) : A ? /* @__PURE__ */ _("span", {
54
59
  style: {
55
60
  fontSize: 11,
56
61
  fontWeight: 700,
57
62
  color: "var(--accent-text)"
58
63
  },
59
- children: D.charAt(0)
60
- }) : null : /* @__PURE__ */ h(p, { children: [
61
- /* @__PURE__ */ m(a, {
62
- appLogo: O,
64
+ children: A.charAt(0)
65
+ }) : null : /* @__PURE__ */ v(g, { children: [
66
+ /* @__PURE__ */ _(c, {
67
+ appLogo: j,
63
68
  size: 20
64
69
  }),
65
- /* @__PURE__ */ m("div", {
70
+ /* @__PURE__ */ _("div", {
71
+ title: A,
66
72
  style: {
67
73
  fontSize: 13,
68
74
  fontWeight: 600,
69
75
  letterSpacing: "-0.01em",
70
- color: "var(--text)"
76
+ color: "var(--text)",
77
+ minWidth: 0,
78
+ overflow: "hidden",
79
+ textOverflow: "ellipsis",
80
+ whiteSpace: "nowrap"
71
81
  },
72
- children: D
82
+ children: A
73
83
  }),
74
- k && /* @__PURE__ */ m("span", {
84
+ M && /* @__PURE__ */ _("span", {
85
+ title: M,
75
86
  style: {
76
87
  padding: "1px 6px",
77
88
  background: "var(--accent-soft)",
@@ -80,21 +91,25 @@ function _({ activeArea: i }) {
80
91
  fontWeight: 600,
81
92
  borderRadius: "var(--radius-xs)",
82
93
  letterSpacing: "0.04em",
83
- textTransform: "uppercase"
94
+ flexShrink: 0,
95
+ maxWidth: 96,
96
+ overflow: "hidden",
97
+ textOverflow: "ellipsis",
98
+ whiteSpace: "nowrap"
84
99
  },
85
- children: k
100
+ children: M
86
101
  })
87
102
  ] })
88
103
  }),
89
- /* @__PURE__ */ m("nav", {
104
+ /* @__PURE__ */ _("nav", {
90
105
  style: {
91
106
  flex: 1,
92
107
  overflowY: "auto",
93
- padding: C ? "8px 4px" : "8px 6px"
108
+ padding: E ? "8px 4px" : "8px 6px"
94
109
  },
95
- children: A.map((e, t) => /* @__PURE__ */ h("div", {
110
+ children: N.map((e, t) => /* @__PURE__ */ v("div", {
96
111
  style: { marginBottom: 12 },
97
- children: [!C && e.title && /* @__PURE__ */ m("div", {
112
+ children: [!E && e.title && /* @__PURE__ */ _("div", {
98
113
  style: {
99
114
  fontSize: 9.5,
100
115
  fontWeight: 700,
@@ -105,24 +120,24 @@ function _({ activeArea: i }) {
105
120
  },
106
121
  children: e.title
107
122
  }), e.items.map((e, n) => {
108
- let r = `${t}-${n}-${e.screen || c(e.name)}`, i = e.screen ? u?.screens[e.screen] : void 0, a = j(i?.route), o = !!(e.children && e.children.length > 0), s = !!w[r];
109
- return /* @__PURE__ */ m(b, {
123
+ let r = `${t}-${n}-${e.screen || u(e.name)}`, i = e.screen ? p?.screens[e.screen] : void 0, a = !!e.screen && e.screen === P, o = !!(e.children && e.children.length > 0), s = !!D[r];
124
+ return /* @__PURE__ */ _(C, {
110
125
  item: e,
111
126
  href: i?.route,
112
- collapsed: C,
127
+ collapsed: E,
113
128
  active: a,
114
129
  hasKids: o,
115
130
  expanded: s,
116
- onToggleExpand: () => T((e) => ({
131
+ onToggleExpand: () => O((e) => ({
117
132
  ...e,
118
133
  [r]: !e[r]
119
134
  })),
120
- onPick: (t) => M(e, t),
121
- resolveChild: (e) => e.screen ? u?.screens[e.screen] : void 0,
135
+ onPick: (t) => F(e, t),
136
+ resolveChild: (e) => e.screen ? p?.screens[e.screen] : void 0,
122
137
  onPickChild: (e) => {
123
- let t = e.screen ? u?.screens[e.screen] : void 0;
124
- t && y(t.route, {
125
- title: c(e.name),
138
+ let t = e.screen ? p?.screens[e.screen] : void 0;
139
+ t && S(t.route, {
140
+ title: u(e.name),
126
141
  icon: e.icon,
127
142
  topLevel: !0
128
143
  });
@@ -131,18 +146,18 @@ function _({ activeArea: i }) {
131
146
  })]
132
147
  }, t))
133
148
  }),
134
- /* @__PURE__ */ h("div", {
149
+ /* @__PURE__ */ v("div", {
135
150
  style: {
136
151
  padding: "6px 8px",
137
152
  borderTop: "1px solid var(--divider)",
138
153
  display: "flex",
139
154
  alignItems: "center",
140
155
  gap: 6,
141
- justifyContent: C ? "center" : "space-between"
156
+ justifyContent: E ? "center" : "space-between"
142
157
  },
143
- children: [/* @__PURE__ */ m("button", {
144
- onClick: () => S("sidebar", C ? "wide" : "collapsed"),
145
- title: C ? c("shell.sidebar.expand", "Expand sidebar (⌘B)") : c("shell.sidebar.collapse", "Collapse sidebar (⌘B)"),
158
+ children: [/* @__PURE__ */ _("button", {
159
+ onClick: () => void T("sidebar", E ? "wide" : "collapsed"),
160
+ title: E ? u("shell.sidebar.expand", "Expand sidebar ({keys})", { keys: s("B") }) : u("shell.sidebar.collapse", "Collapse sidebar ({keys})", { keys: s("B") }),
146
161
  style: {
147
162
  display: "flex",
148
163
  alignItems: "center",
@@ -155,22 +170,22 @@ function _({ activeArea: i }) {
155
170
  color: "var(--text-3)",
156
171
  cursor: "pointer"
157
172
  },
158
- children: m(C ? t.right : t.left, { size: 14 })
159
- }), !C && /* @__PURE__ */ h(p, { children: [/* @__PURE__ */ m("span", {
173
+ children: _(E ? n.right : n.left, { size: 14 })
174
+ }), !E && /* @__PURE__ */ v(g, { children: [/* @__PURE__ */ _("span", {
160
175
  style: {
161
176
  flex: 1,
162
177
  fontSize: 11,
163
178
  color: "var(--text-3)"
164
179
  },
165
- children: c("shell.sidebar.footer", "Docs · API · Help")
166
- }), /* @__PURE__ */ m(n, { children: "?" })] })]
180
+ children: u("shell.sidebar.footer", "Docs · API · Help")
181
+ }), /* @__PURE__ */ _(r, { children: "?" })] })]
167
182
  })
168
183
  ]
169
184
  });
170
185
  }
171
- function v(e, t, n) {
186
+ function x(e, t, n) {
172
187
  let r = [];
173
- for (let i of t) if (y(i, n)) {
188
+ for (let i of t) if (S(i, n)) {
174
189
  if (i.items && i.items.length > 0) r.push({
175
190
  title: e(i.name) || "",
176
191
  items: i.items
@@ -185,13 +200,13 @@ function v(e, t, n) {
185
200
  }
186
201
  return r;
187
202
  }
188
- function y(e, t) {
203
+ function S(e, t) {
189
204
  return (e.area || "default") === t;
190
205
  }
191
- function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l, onToggleExpand: d, onPick: g, onPickChild: _, resolveChild: v }) {
192
- let y = r(), [b, S] = f(!1), C = u(n), w = !!e.icon, T = y(e.name) || e.screen || "";
193
- if (a) {
194
- let t = {
206
+ function C({ item: e, href: t, collapsed: r, active: a, hasKids: s, expanded: c, onToggleExpand: l, onPick: d, onPickChild: f, resolveChild: m }) {
207
+ let y = i(), [b, x] = h(!1), S = p(t), C = !!e.icon, T = y(e.name) || e.screen || "";
208
+ if (r) {
209
+ let n = {
195
210
  width: 40,
196
211
  height: 32,
197
212
  margin: "2px auto",
@@ -201,32 +216,32 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
201
216
  display: "flex",
202
217
  alignItems: "center",
203
218
  justifyContent: "center",
204
- background: o ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
205
- color: o ? "var(--accent)" : "var(--text-3)",
219
+ background: a ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
220
+ color: a ? "var(--accent)" : "var(--text-3)",
206
221
  textDecoration: "none"
207
222
  };
208
- return n ? /* @__PURE__ */ m("a", {
209
- href: n,
223
+ return t ? /* @__PURE__ */ _("a", {
224
+ href: t,
210
225
  "data-declarion-native-link": "",
211
- ...C,
226
+ ...S,
212
227
  onClick: (e) => {
213
- c(e) || (e.preventDefault(), g());
228
+ u(e) || (e.preventDefault(), d());
214
229
  },
215
230
  title: T,
216
- onMouseEnter: () => S(!0),
217
- onMouseLeave: () => S(!1),
218
- style: t,
219
- children: w && /* @__PURE__ */ m(i, {
231
+ onMouseEnter: () => x(!0),
232
+ onMouseLeave: () => x(!1),
233
+ style: n,
234
+ children: C && /* @__PURE__ */ _(o, {
220
235
  name: e.icon,
221
236
  size: 14
222
237
  })
223
- }) : /* @__PURE__ */ m("button", {
224
- onClick: () => g(),
238
+ }) : /* @__PURE__ */ _("button", {
239
+ onClick: () => d(),
225
240
  title: T,
226
- onMouseEnter: () => S(!0),
227
- onMouseLeave: () => S(!1),
228
- style: t,
229
- children: w && /* @__PURE__ */ m(i, {
241
+ onMouseEnter: () => x(!0),
242
+ onMouseLeave: () => x(!1),
243
+ style: n,
244
+ children: C && /* @__PURE__ */ _(o, {
230
245
  name: e.icon,
231
246
  size: 14
232
247
  })
@@ -243,21 +258,21 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
243
258
  border: 0,
244
259
  cursor: "pointer",
245
260
  textAlign: "left",
246
- background: o ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
247
- color: o ? "var(--accent)" : "var(--text-2)",
261
+ background: a ? "var(--sidebar-active)" : b ? "var(--sidebar-hover)" : "transparent",
262
+ color: a ? "var(--accent)" : "var(--text-2)",
248
263
  fontSize: 12.5,
249
- fontWeight: o ? 600 : 500,
264
+ fontWeight: a ? 600 : 500,
250
265
  textDecoration: "none"
251
- }, D = /* @__PURE__ */ h(p, { children: [
252
- w && /* @__PURE__ */ m(i, {
266
+ }, D = /* @__PURE__ */ v(g, { children: [
267
+ C && /* @__PURE__ */ _(o, {
253
268
  name: e.icon,
254
269
  size: 14
255
270
  }),
256
- /* @__PURE__ */ m("span", {
271
+ /* @__PURE__ */ _("span", {
257
272
  style: { flex: 1 },
258
273
  children: T
259
274
  }),
260
- e.badge && /* @__PURE__ */ m("span", {
275
+ e.badge && /* @__PURE__ */ _("span", {
261
276
  style: {
262
277
  padding: "1px 5px",
263
278
  background: "var(--surface-3)",
@@ -268,65 +283,65 @@ function b({ item: e, href: n, collapsed: a, active: o, hasKids: s, expanded: l,
268
283
  },
269
284
  children: e.badge
270
285
  }),
271
- s && /* @__PURE__ */ m("span", {
286
+ s && /* @__PURE__ */ _("span", {
272
287
  role: "button",
273
- "aria-label": l ? y("shell.sidebar.collapse_item", "Collapse") : y("shell.sidebar.expand_item", "Expand"),
288
+ "aria-label": c ? y("shell.sidebar.collapse_item", "Collapse") : y("shell.sidebar.expand_item", "Expand"),
274
289
  onClick: (e) => {
275
- e.stopPropagation(), e.preventDefault(), d();
290
+ e.stopPropagation(), e.preventDefault(), l();
276
291
  },
277
292
  style: {
278
293
  display: "inline-flex",
279
294
  padding: 2,
280
295
  cursor: "pointer"
281
296
  },
282
- children: /* @__PURE__ */ m(t.down, {
297
+ children: /* @__PURE__ */ _(n.down, {
283
298
  size: 11,
284
299
  style: {
285
- transform: l ? "rotate(0)" : "rotate(-90deg)",
300
+ transform: c ? "rotate(0)" : "rotate(-90deg)",
286
301
  transition: "transform .15s",
287
302
  color: "var(--text-3)"
288
303
  }
289
304
  })
290
305
  })
291
306
  ] });
292
- return /* @__PURE__ */ h("div", { children: [n ? /* @__PURE__ */ m("a", {
293
- href: n,
307
+ return /* @__PURE__ */ v("div", { children: [t ? /* @__PURE__ */ _("a", {
308
+ href: t,
294
309
  "data-declarion-native-link": "",
295
- ...C,
310
+ ...S,
296
311
  onClick: (e) => {
297
- c(e) || (e.preventDefault(), g());
312
+ u(e) || (e.preventDefault(), d());
298
313
  },
299
- onMouseEnter: () => S(!0),
300
- onMouseLeave: () => S(!1),
314
+ onMouseEnter: () => x(!0),
315
+ onMouseLeave: () => x(!1),
301
316
  style: E,
302
317
  children: D
303
- }) : /* @__PURE__ */ m("button", {
318
+ }) : /* @__PURE__ */ _("button", {
304
319
  onClick: () => {
305
- s && d();
320
+ s && l();
306
321
  },
307
- onMouseEnter: () => S(!0),
308
- onMouseLeave: () => S(!1),
322
+ onMouseEnter: () => x(!0),
323
+ onMouseLeave: () => x(!1),
309
324
  style: E,
310
325
  children: D
311
- }), s && l && /* @__PURE__ */ m("div", {
326
+ }), s && c && /* @__PURE__ */ _("div", {
312
327
  style: {
313
328
  marginLeft: 22,
314
329
  borderLeft: "1px solid var(--divider)",
315
330
  paddingLeft: 6
316
331
  },
317
332
  children: (e.children || []).map((e, t) => {
318
- let n = v(e), r = e.screen || `${t}`;
319
- return /* @__PURE__ */ m(x, {
333
+ let n = m(e), r = e.screen || `${t}`;
334
+ return /* @__PURE__ */ _(w, {
320
335
  label: y(e.name) || e.screen || "",
321
336
  href: n?.route,
322
337
  enabled: !!n,
323
- onPick: () => _(e)
338
+ onPick: () => f(e)
324
339
  }, r);
325
340
  })
326
341
  })] });
327
342
  }
328
- function x({ label: e, href: t, enabled: n, onPick: r }) {
329
- let [i, a] = f(!1), o = u(n ? t : void 0), s = {
343
+ function w({ label: e, href: t, enabled: n, onPick: r }) {
344
+ let [i, a] = h(!1), o = p(n ? t : void 0), s = {
330
345
  width: "100%",
331
346
  display: "block",
332
347
  padding: "4px 8px",
@@ -339,18 +354,18 @@ function x({ label: e, href: t, enabled: n, onPick: r }) {
339
354
  color: "var(--text-3)",
340
355
  textDecoration: "none"
341
356
  };
342
- return n && t ? /* @__PURE__ */ m("a", {
357
+ return n && t ? /* @__PURE__ */ _("a", {
343
358
  href: t,
344
359
  "data-declarion-native-link": "",
345
360
  ...o,
346
361
  onClick: (e) => {
347
- c(e) || (e.preventDefault(), r());
362
+ u(e) || (e.preventDefault(), r());
348
363
  },
349
364
  onMouseEnter: () => a(!0),
350
365
  onMouseLeave: () => a(!1),
351
366
  style: s,
352
367
  children: e
353
- }) : /* @__PURE__ */ m("button", {
368
+ }) : /* @__PURE__ */ _("button", {
354
369
  onClick: () => n && r(),
355
370
  onMouseEnter: () => a(!0),
356
371
  onMouseLeave: () => a(!1),
@@ -359,4 +374,4 @@ function x({ label: e, href: t, enabled: n, onPick: r }) {
359
374
  });
360
375
  }
361
376
  //#endregion
362
- export { _ as Sidebar, v as buildSections };
377
+ export { b as Sidebar, x as buildSections };