@elevasis/ui 2.30.0 → 2.32.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 (130) hide show
  1. package/dist/api/index.js +2 -2
  2. package/dist/app/index.css +38 -0
  3. package/dist/app/index.d.ts +190 -9
  4. package/dist/app/index.js +7 -6
  5. package/dist/charts/index.js +4 -5
  6. package/dist/{chunk-HXZQWMKE.js → chunk-2RJMVWFJ.js} +1 -6
  7. package/dist/{chunk-4VQ2PXMI.js → chunk-3FV6HBXS.js} +4 -4
  8. package/dist/{chunk-CW3UNAF2.js → chunk-4DYOXEH6.js} +410 -5
  9. package/dist/{chunk-JKTPRYGV.js → chunk-4MFNGNHF.js} +123 -192
  10. package/dist/{chunk-HYLERWRO.js → chunk-4QK76KIF.js} +7 -7
  11. package/dist/chunk-5FJJ72HU.js +13 -0
  12. package/dist/chunk-5J4PDX26.js +112 -0
  13. package/dist/{chunk-4SY6BTVZ.js → chunk-6DWD423K.js} +12 -9
  14. package/dist/{chunk-3GV5NHSS.js → chunk-7KZINJLP.js} +78 -232
  15. package/dist/{chunk-6WXDE5LZ.js → chunk-EPTHX4VZ.js} +1 -1
  16. package/dist/{chunk-6EFVZV6X.js → chunk-GCOQ3TBG.js} +243 -254
  17. package/dist/{chunk-LRZFLK2F.js → chunk-IQHU7O5Y.js} +4 -4
  18. package/dist/{chunk-X2SUMO3P.js → chunk-IZWTVFJ2.js} +16 -3
  19. package/dist/{chunk-IKQ42WHU.js → chunk-JFL3GRD4.js} +1 -1
  20. package/dist/{chunk-4FZYEEPK.js → chunk-LLRXA7D7.js} +5 -6
  21. package/dist/chunk-MOY4VOHF.js +347 -0
  22. package/dist/{chunk-XQQEKWTL.js → chunk-N55DVMAG.js} +6 -2
  23. package/dist/{chunk-7E3FUTND.js → chunk-ND5TDV2J.js} +1 -1
  24. package/dist/{chunk-WF227UBV.js → chunk-QQHOKTJA.js} +4 -4
  25. package/dist/{chunk-A7B7HLDF.js → chunk-QTI3KC7D.js} +5884 -515
  26. package/dist/chunk-QXCDKE2O.js +486 -0
  27. package/dist/chunk-R2XR4FCV.js +48 -0
  28. package/dist/chunk-R66W5UDG.js +26 -0
  29. package/dist/{chunk-T5Z7G2J2.js → chunk-RQA2EVN3.js} +6 -16
  30. package/dist/{chunk-SKXXT3E2.js → chunk-RQTWIXJ5.js} +4 -4
  31. package/dist/chunk-T35FWDAB.js +4342 -0
  32. package/dist/{chunk-DWK2QIAK.js → chunk-TYRUKGGD.js} +1 -1
  33. package/dist/{chunk-CN2HC4D4.js → chunk-UFTM5SZZ.js} +2 -2
  34. package/dist/{chunk-JCGD4GM6.js → chunk-UROTM5OR.js} +14 -1
  35. package/dist/{chunk-6YT4IKJ7.js → chunk-VNAZTCHA.js} +15 -0
  36. package/dist/{chunk-KVJ3LFH2.js → chunk-VNFR57DF.js} +4 -24
  37. package/dist/{chunk-SBCIB5TZ.js → chunk-VRNMNB3O.js} +6 -7
  38. package/dist/chunk-WQPX44YM.js +1626 -0
  39. package/dist/{chunk-T2PAD63Y.js → chunk-XZGSCABI.js} +1 -1
  40. package/dist/chunk-YLQEVSOR.js +299 -0
  41. package/dist/{chunk-P5WYW2GI.js → chunk-ZQOKIGZP.js} +152 -306
  42. package/dist/components/index.css +38 -0
  43. package/dist/components/index.d.ts +334 -38
  44. package/dist/components/index.js +42 -42
  45. package/dist/components/navigation/index.css +38 -0
  46. package/dist/components/navigation/index.js +3 -2
  47. package/dist/execution/index.d.ts +9 -3
  48. package/dist/features/auth/index.css +38 -0
  49. package/dist/features/auth/index.d.ts +212 -14
  50. package/dist/features/auth/index.js +41 -9
  51. package/dist/features/clients/index.css +649 -0
  52. package/dist/features/clients/index.d.ts +86 -0
  53. package/dist/features/clients/index.js +720 -0
  54. package/dist/features/crm/index.css +38 -0
  55. package/dist/features/crm/index.d.ts +228 -20
  56. package/dist/features/crm/index.js +20 -17
  57. package/dist/features/dashboard/index.css +38 -0
  58. package/dist/features/dashboard/index.d.ts +78 -3
  59. package/dist/features/dashboard/index.js +16 -16
  60. package/dist/features/delivery/index.css +38 -0
  61. package/dist/features/delivery/index.d.ts +201 -18
  62. package/dist/features/delivery/index.js +20 -18
  63. package/dist/features/knowledge/index.css +38 -0
  64. package/dist/features/knowledge/index.d.ts +20 -18
  65. package/dist/features/knowledge/index.js +116 -578
  66. package/dist/features/lead-gen/index.css +38 -0
  67. package/dist/features/lead-gen/index.d.ts +59 -51
  68. package/dist/features/lead-gen/index.js +20 -18
  69. package/dist/features/monitoring/index.css +38 -0
  70. package/dist/features/monitoring/index.d.ts +20 -18
  71. package/dist/features/monitoring/index.js +19 -18
  72. package/dist/features/monitoring/requests/index.css +38 -0
  73. package/dist/features/monitoring/requests/index.d.ts +21 -19
  74. package/dist/features/monitoring/requests/index.js +17 -15
  75. package/dist/features/operations/index.css +38 -0
  76. package/dist/features/operations/index.d.ts +945 -45
  77. package/dist/features/operations/index.js +24 -26
  78. package/dist/features/seo/index.d.ts +20 -18
  79. package/dist/features/seo/index.js +1 -1
  80. package/dist/features/settings/index.css +38 -0
  81. package/dist/features/settings/index.d.ts +201 -18
  82. package/dist/features/settings/index.js +18 -16
  83. package/dist/hooks/delivery/index.css +38 -0
  84. package/dist/hooks/delivery/index.d.ts +200 -0
  85. package/dist/hooks/delivery/index.js +2 -2
  86. package/dist/hooks/index.css +38 -0
  87. package/dist/hooks/index.d.ts +825 -47
  88. package/dist/hooks/index.js +14 -13
  89. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +194 -3
  90. package/dist/hooks/published.css +38 -0
  91. package/dist/hooks/published.d.ts +825 -47
  92. package/dist/hooks/published.js +14 -13
  93. package/dist/index.css +38 -0
  94. package/dist/index.d.ts +1506 -1212
  95. package/dist/index.js +15 -14
  96. package/dist/initialization/index.d.ts +181 -0
  97. package/dist/knowledge/index.d.ts +813 -1068
  98. package/dist/knowledge/index.js +7370 -2869
  99. package/dist/{chunk-CLUP5H3C.js → knowledge-search-index-5KYPO746.js} +441 -963
  100. package/dist/layout/index.d.ts +6 -0
  101. package/dist/layout/index.js +4 -5
  102. package/dist/organization/index.css +38 -0
  103. package/dist/profile/index.d.ts +181 -0
  104. package/dist/provider/index.css +38 -0
  105. package/dist/provider/index.d.ts +909 -1156
  106. package/dist/provider/index.js +11 -10
  107. package/dist/provider/published.css +38 -0
  108. package/dist/provider/published.d.ts +906 -1153
  109. package/dist/provider/published.js +7 -6
  110. package/dist/supabase/index.d.ts +349 -0
  111. package/dist/test-utils/index.d.ts +16 -9
  112. package/dist/test-utils/index.js +39 -32
  113. package/dist/test-utils/setup.js +1 -1
  114. package/dist/theme/index.js +3 -3
  115. package/dist/theme/presets/index.js +1 -1
  116. package/dist/types/index.d.ts +378 -5
  117. package/dist/utils/index.d.ts +78 -3
  118. package/dist/utils/index.js +1 -1
  119. package/dist/vite/index.js +2 -2
  120. package/dist/vite-plugin-knowledge/index.js +1 -1
  121. package/package.json +47 -37
  122. package/src/provider/README.md +5 -5
  123. package/dist/chunk-2DIYILF7.js +0 -413
  124. package/dist/chunk-3MDNBHVB.js +0 -3868
  125. package/dist/chunk-6IXOKUBC.js +0 -347
  126. package/dist/chunk-AKOD52HS.js +0 -739
  127. package/dist/chunk-ECNNI3NT.js +0 -6
  128. package/dist/chunk-JDNEWB5F.js +0 -10
  129. package/dist/chunk-NITGGYH2.js +0 -476
  130. package/dist/chunk-OAVTMITG.js +0 -13
@@ -1,14 +1,13 @@
1
1
  import { ZodFormRenderer } from './chunk-3MEXPLWT.js';
2
2
  import { ResourceHealthChart } from './chunk-LGKLC5MG.js';
3
- import { HeroStatsRow } from './chunk-2DIYILF7.js';
4
- import { useCyberColors } from './chunk-CW3UNAF2.js';
3
+ import { useCyberColors, HeroStatsRow } from './chunk-4DYOXEH6.js';
5
4
  import { AppShellCenteredContainer, AppShellLoader } from './chunk-RYTEQBAO.js';
6
5
  import { Graph_module_css_default, useDirectedChainHighlighting, useNodeSelection, useFitViewTrigger } from './chunk-22UVE3RA.js';
7
6
  import { STATUS_COLORS, getStatusIcon, formatDuration, getStatusColors, AGENT_CONSTANTS, shouldAnimateEdge, TIMELINE_CONSTANTS, calculateBarPosition, CONTAINER_CONSTANTS, useExecutionPath, useUnifiedWorkflowLayout, WORKFLOW_CONSTANTS, useReactFlowAgent } from './chunk-E4WQGJNS.js';
8
- import { useExecuteResource, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, useCommandQueue, useScheduledTasks, useResourcesHealth } from './chunk-6EFVZV6X.js';
9
- import { glassBase } from './chunk-T5Z7G2J2.js';
10
- import { GlowDot, CardHeader, EmptyState, PageTitleCaption, TabCountBadge } from './chunk-6WXDE5LZ.js';
11
- import { formatTimeAgo, getTimeRangeDates, formatRelativeTime } from './chunk-HXZQWMKE.js';
7
+ import { useExecuteResource, useDashboardMetrics, useResources, useTimeRangeDates, useUnresolvedErrors, useRecentExecutionsByResource, useCommandQueue, useScheduledTasks, useResourcesHealth } from './chunk-GCOQ3TBG.js';
8
+ import { glassBase } from './chunk-RQA2EVN3.js';
9
+ import { GlowDot, CardHeader, EmptyState, PageTitleCaption, TabCountBadge } from './chunk-EPTHX4VZ.js';
10
+ import { formatTimeAgo, getTimeRangeDates, formatRelativeTime } from './chunk-2RJMVWFJ.js';
12
11
  import { ResourceStatusColors } from './chunk-KRWALB24.js';
13
12
  import { useInitialization } from './chunk-533DUEQY.js';
14
13
  import { memo, useMemo, useEffect, useState, useCallback, Fragment } from 'react';
@@ -0,0 +1,347 @@
1
+ import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
2
+ import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
3
+ import { useDealsLookup, useCreateDealTask, useDealTasksDue } from './chunk-GCOQ3TBG.js';
4
+ import { useRouterContext } from './chunk-Q7DJKLEN.js';
5
+ import { Box, Stack, Text, UnstyledButton, Group, Button, Modal, Title, Select, TextInput, Textarea, Badge, Center, Loader } from '@mantine/core';
6
+ import { IconLayoutGrid, IconColumns, IconFileInvoice, IconList, IconBuilding, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconTarget, IconCheckbox, IconCalendar, IconMail, IconPhone } from '@tabler/icons-react';
7
+ import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
8
+ import { useState } from 'react';
9
+
10
+ // src/features/crm/workbench/constants.ts
11
+ var SAVED_VIEW_PRESETS = [
12
+ {
13
+ id: "my-deals",
14
+ label: "My Deals",
15
+ iconName: "IconUser",
16
+ target: "/crm/deals"
17
+ },
18
+ {
19
+ id: "overdue",
20
+ label: "Overdue",
21
+ iconName: "IconClockExclamation",
22
+ target: "/crm/deals"
23
+ },
24
+ {
25
+ id: "won-this-month",
26
+ label: "Won this month",
27
+ iconName: "IconTrophy",
28
+ target: "/crm/deals",
29
+ urlFilters: { stage: "closed_won" }
30
+ }
31
+ ];
32
+ var ICON_MAP = {
33
+ IconUser,
34
+ IconClockExclamation,
35
+ IconTrophy
36
+ };
37
+ function SavedViewsPanel({ onViewClick, showSectionLabel = true }) {
38
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
39
+ showSectionLabel && /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, mb: 4, children: "Saved Views" }),
40
+ SAVED_VIEW_PRESETS.map((preset) => {
41
+ const Icon = ICON_MAP[preset.iconName];
42
+ return /* @__PURE__ */ jsx(
43
+ UnstyledButton,
44
+ {
45
+ onClick: () => onViewClick(preset),
46
+ style: {
47
+ display: "block",
48
+ width: "100%",
49
+ padding: "4px 6px",
50
+ borderRadius: "var(--mantine-radius-sm)",
51
+ transition: `background-color var(--duration-fast) var(--easing)`
52
+ },
53
+ onMouseEnter: (e) => {
54
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
55
+ },
56
+ onMouseLeave: (e) => {
57
+ e.currentTarget.style.backgroundColor = "transparent";
58
+ },
59
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
60
+ /* @__PURE__ */ jsx(Icon, { size: 14, style: { color: "var(--color-text-dimmed)", flexShrink: 0 } }),
61
+ /* @__PURE__ */ jsx(Text, { size: "xs", children: preset.label })
62
+ ] })
63
+ },
64
+ preset.id
65
+ );
66
+ })
67
+ ] }) });
68
+ }
69
+ var KIND_OPTIONS = [
70
+ { value: "call", label: "Call" },
71
+ { value: "email", label: "Email" },
72
+ { value: "meeting", label: "Meeting" },
73
+ { value: "other", label: "Other" }
74
+ ];
75
+ function QuickCreateActions({ showSectionLabel = true }) {
76
+ const [open, setOpen] = useState(false);
77
+ const [dealId, setDealId] = useState(null);
78
+ const [dealSearch, setDealSearch] = useState("");
79
+ const [title, setTitle] = useState("");
80
+ const [description, setDescription] = useState("");
81
+ const [kind, setKind] = useState("other");
82
+ const [dueAt, setDueAt] = useState("");
83
+ const { data: deals, isLoading: isLoadingDeals } = useDealsLookup(
84
+ {
85
+ search: dealSearch || void 0,
86
+ limit: 25
87
+ },
88
+ { enabled: open }
89
+ );
90
+ const createTask = useCreateDealTask();
91
+ const dealOptions = (deals ?? []).map((deal) => ({
92
+ value: deal.id,
93
+ label: deal.displayLabel
94
+ }));
95
+ function resetForm() {
96
+ setDealId(null);
97
+ setDealSearch("");
98
+ setTitle("");
99
+ setDescription("");
100
+ setKind("other");
101
+ setDueAt("");
102
+ }
103
+ function handleClose() {
104
+ setOpen(false);
105
+ resetForm();
106
+ }
107
+ async function handleSubmit() {
108
+ if (!dealId || !title) return;
109
+ await createTask.mutateAsync({
110
+ dealId,
111
+ title,
112
+ description: description || null,
113
+ kind,
114
+ dueAt: dueAt ? new Date(dueAt).toISOString() : null
115
+ });
116
+ handleClose();
117
+ }
118
+ const isSubmitDisabled = !dealId || !title || createTask.isPending;
119
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
120
+ /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
121
+ showSectionLabel && /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, children: "TASKS" }),
122
+ /* @__PURE__ */ jsx(Button, { variant: "light", size: "xs", leftSection: /* @__PURE__ */ jsx(IconPlus, { size: 14 }), fullWidth: true, onClick: () => setOpen(true), children: "New Task" })
123
+ ] }),
124
+ /* @__PURE__ */ jsxs(Modal, { opened: open, onClose: handleClose, size: "md", children: [
125
+ /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
126
+ /* @__PURE__ */ jsx(Title, { order: 3, children: "New Task" }),
127
+ /* @__PURE__ */ jsx(
128
+ Select,
129
+ {
130
+ label: "Deal",
131
+ placeholder: "Search deals",
132
+ data: dealOptions,
133
+ value: dealId,
134
+ onChange: setDealId,
135
+ searchValue: dealSearch,
136
+ onSearchChange: setDealSearch,
137
+ searchable: true,
138
+ nothingFoundMessage: dealSearch ? "No matching deals" : "No deals available",
139
+ disabled: isLoadingDeals,
140
+ required: true
141
+ }
142
+ ),
143
+ /* @__PURE__ */ jsx(
144
+ TextInput,
145
+ {
146
+ label: "Title",
147
+ placeholder: "Task title",
148
+ value: title,
149
+ onChange: (e) => setTitle(e.currentTarget.value),
150
+ required: true
151
+ }
152
+ ),
153
+ /* @__PURE__ */ jsx(
154
+ Textarea,
155
+ {
156
+ label: "Description",
157
+ placeholder: "Optional description",
158
+ value: description,
159
+ onChange: (e) => setDescription(e.currentTarget.value),
160
+ autosize: true,
161
+ minRows: 2,
162
+ maxRows: 5
163
+ }
164
+ ),
165
+ /* @__PURE__ */ jsx(
166
+ Select,
167
+ {
168
+ label: "Kind",
169
+ data: KIND_OPTIONS,
170
+ value: kind,
171
+ onChange: (v) => setKind(v ?? "other")
172
+ }
173
+ ),
174
+ /* @__PURE__ */ jsx(
175
+ TextInput,
176
+ {
177
+ type: "datetime-local",
178
+ label: "Due At",
179
+ value: dueAt,
180
+ onChange: (e) => setDueAt(e.currentTarget.value)
181
+ }
182
+ )
183
+ ] }),
184
+ /* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
185
+ /* @__PURE__ */ jsx(Button, { variant: "default", onClick: handleClose, children: "Cancel" }),
186
+ /* @__PURE__ */ jsx(Button, { onClick: handleSubmit, loading: createTask.isPending, disabled: isSubmitDisabled, children: "Create" })
187
+ ] })
188
+ ] })
189
+ ] });
190
+ }
191
+ var CRM_ITEMS = [
192
+ { label: "Overview", to: "/crm", icon: IconLayoutGrid, exact: true },
193
+ { label: "Pipeline", to: "/crm/pipeline", icon: IconColumns, exact: false },
194
+ { label: "Deals", to: "/crm/deals", icon: IconFileInvoice, exact: false }
195
+ ];
196
+ var CrmSidebarMiddle = ({ items = CRM_ITEMS } = {}) => {
197
+ const { currentPath, navigate } = useRouterContext();
198
+ return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: [
199
+ /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: items.map((item) => {
200
+ const isActive = item.exact ? currentPath === item.to || currentPath === `${item.to}/` : currentPath.startsWith(item.to);
201
+ return /* @__PURE__ */ jsx(
202
+ SubshellNavItem,
203
+ {
204
+ icon: item.icon,
205
+ label: item.label,
206
+ isActive,
207
+ href: item.to,
208
+ onClick: () => navigate(item.to)
209
+ },
210
+ item.to
211
+ );
212
+ }) }),
213
+ /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconChecklist, label: "My Tasks", withTopBorder: true }),
214
+ /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: /* @__PURE__ */ jsx(
215
+ MyTasksPanel,
216
+ {
217
+ onTaskClick: (dealId) => navigate(`/crm/deals/${dealId}`),
218
+ onSeeAll: () => navigate("/crm/deals"),
219
+ showSectionLabel: false,
220
+ footer: /* @__PURE__ */ jsx(QuickCreateActions, { showSectionLabel: false })
221
+ }
222
+ ) })
223
+ ] });
224
+ };
225
+ var LEAD_GEN_ITEMS = [
226
+ { label: "Overview", to: "/lead-gen", icon: IconLayoutGrid, exact: true },
227
+ { label: "Lists", to: "/lead-gen/lists", icon: IconList, exact: false },
228
+ { label: "Companies", to: "/lead-gen/companies", icon: IconBuilding, exact: false },
229
+ { label: "Contacts", to: "/lead-gen/contacts", icon: IconAddressBook, exact: false }
230
+ ];
231
+ var LeadGenSidebarMiddle = ({ items = LEAD_GEN_ITEMS } = {}) => {
232
+ const { currentPath, navigate } = useRouterContext();
233
+ return /* @__PURE__ */ jsx(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: items.map((item) => {
234
+ const isActive = item.exact ? currentPath === item.to || currentPath === `${item.to}/` : currentPath.startsWith(item.to);
235
+ return /* @__PURE__ */ jsx(
236
+ SubshellNavItem,
237
+ {
238
+ icon: item.icon,
239
+ label: item.label,
240
+ isActive,
241
+ href: item.to,
242
+ onClick: () => navigate(item.to)
243
+ },
244
+ item.to
245
+ );
246
+ }) }) });
247
+ };
248
+ var renderItems = (items, currentPath, navigate) => items.map((item) => {
249
+ const isActive = item.exact ? currentPath === item.to || currentPath === `${item.to}/` : currentPath.startsWith(item.to);
250
+ return /* @__PURE__ */ jsx(
251
+ SubshellNavItem,
252
+ {
253
+ icon: item.icon,
254
+ label: item.label,
255
+ isActive,
256
+ href: item.to,
257
+ onClick: () => navigate(item.to)
258
+ },
259
+ item.to
260
+ );
261
+ });
262
+ var SalesSidebar = () => {
263
+ const { currentPath, navigate } = useRouterContext();
264
+ return /* @__PURE__ */ jsx(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: [
265
+ /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconTarget, label: "Lead Gen" }),
266
+ /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: renderItems(LEAD_GEN_ITEMS, currentPath, navigate) }),
267
+ /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconAddressBook, label: "CRM", withTopBorder: true }),
268
+ /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: renderItems(CRM_ITEMS, currentPath, navigate) })
269
+ ] }) });
270
+ };
271
+ var KIND_ICONS = {
272
+ call: IconPhone,
273
+ email: IconMail,
274
+ meeting: IconCalendar,
275
+ other: IconCheckbox
276
+ };
277
+ function formatDueLabel(dueAt) {
278
+ if (!dueAt) return "";
279
+ const date = new Date(dueAt);
280
+ const now = /* @__PURE__ */ new Date();
281
+ const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
282
+ const dueDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());
283
+ const diffDays = Math.round((dueDay.getTime() - today.getTime()) / 864e5);
284
+ if (diffDays < 0) return `${Math.abs(diffDays)}d overdue`;
285
+ if (diffDays === 0) {
286
+ return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
287
+ }
288
+ return `in ${diffDays}d`;
289
+ }
290
+ function TaskRow({ task, onClick }) {
291
+ const KindIcon = KIND_ICONS[task.kind];
292
+ const dueLabel = formatDueLabel(task.dueAt);
293
+ const isOverdue = task.dueAt !== null && new Date(task.dueAt) < /* @__PURE__ */ new Date();
294
+ return /* @__PURE__ */ jsx(
295
+ UnstyledButton,
296
+ {
297
+ onClick,
298
+ style: {
299
+ display: "block",
300
+ width: "100%",
301
+ padding: "4px 6px",
302
+ borderRadius: "var(--mantine-radius-sm)",
303
+ transition: `background-color var(--duration-fast) var(--easing)`
304
+ },
305
+ onMouseEnter: (e) => {
306
+ e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
307
+ },
308
+ onMouseLeave: (e) => {
309
+ e.currentTarget.style.backgroundColor = "transparent";
310
+ },
311
+ children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
312
+ /* @__PURE__ */ jsx(KindIcon, { size: 14, style: { color: "var(--color-text-dimmed)", flexShrink: 0 } }),
313
+ /* @__PURE__ */ jsx(Text, { size: "xs", truncate: true, style: { flex: 1, minWidth: 0 }, children: task.title }),
314
+ dueLabel && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: isOverdue ? "red" : "gray", style: { flexShrink: 0 }, children: dueLabel })
315
+ ] })
316
+ }
317
+ );
318
+ }
319
+ function MyTasksPanel({
320
+ onTaskClick,
321
+ onSeeAll,
322
+ footer,
323
+ showSectionLabel = true
324
+ }) {
325
+ const { data, isLoading, isError } = useDealTasksDue({ window: "today_and_overdue" });
326
+ const tasks = data ?? [];
327
+ const total = tasks.length;
328
+ const visible = tasks.slice(0, 5);
329
+ return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
330
+ showSectionLabel && /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: 4, children: [
331
+ /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, children: "My Tasks" }),
332
+ total > 0 && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: total })
333
+ ] }),
334
+ isLoading && /* @__PURE__ */ jsx(Center, { py: 4, children: /* @__PURE__ */ jsx(Loader, { size: "xs" }) }),
335
+ isError && /* @__PURE__ */ jsx(Text, { size: "xs", c: "red", children: "Failed to load tasks" }),
336
+ !isLoading && !isError && visible.length === 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No tasks due - you're caught up." }),
337
+ !isLoading && !isError && visible.map((task) => /* @__PURE__ */ jsx(TaskRow, { task, onClick: () => onTaskClick(task.dealId) }, task.id)),
338
+ onSeeAll && total > 5 && /* @__PURE__ */ jsx(UnstyledButton, { onClick: onSeeAll, mt: 2, style: { display: "inline-block" }, children: /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", style: { textDecoration: "underline" }, children: [
339
+ "See all (",
340
+ total,
341
+ ")"
342
+ ] }) }),
343
+ footer
344
+ ] }) });
345
+ }
346
+
347
+ export { CRM_ITEMS, CrmSidebarMiddle, LEAD_GEN_ITEMS, LeadGenSidebarMiddle, MyTasksPanel, QuickCreateActions, SAVED_VIEW_PRESETS, SalesSidebar, SavedViewsPanel };
@@ -1,10 +1,14 @@
1
1
  import { useAppearance } from './chunk-E565XMTQ.js';
2
- import { Box, Center } from '@mantine/core';
2
+ import { Center, Box } from '@mantine/core';
3
3
  import { jsx } from 'react/jsx-runtime';
4
4
 
5
+ function SubshellLoader() {
6
+ const { loader } = useAppearance();
7
+ return /* @__PURE__ */ jsx(Center, { mih: "calc(100vh - 70px)", children: loader });
8
+ }
5
9
  function SubshellSidebarLoader({ padding = "sm" }) {
6
10
  const { loader } = useAppearance();
7
11
  return /* @__PURE__ */ jsx(Box, { style: { flex: 1, minHeight: 0, display: "flex" }, children: /* @__PURE__ */ jsx(Center, { p: padding, style: { flex: 1, minHeight: 0 }, children: loader }) });
8
12
  }
9
13
 
10
- export { SubshellSidebarLoader };
14
+ export { SubshellLoader, SubshellSidebarLoader };
@@ -1,4 +1,4 @@
1
- import { APIClientError } from './chunk-HXZQWMKE.js';
1
+ import { APIClientError } from './chunk-2RJMVWFJ.js';
2
2
  import { OrganizationContext } from './chunk-DD3CCMCZ.js';
3
3
  import { createContext, useContext, useMemo, useCallback } from 'react';
4
4
  import { jsx } from 'react/jsx-runtime';
@@ -1,13 +1,13 @@
1
- import { useOptionalElevasisFeatures } from './chunk-6IXOKUBC.js';
1
+ import { useOptionalElevasisSystems } from './chunk-QXCDKE2O.js';
2
2
  import { useRouterContext } from './chunk-Q7DJKLEN.js';
3
3
  import { useMemo } from 'react';
4
4
 
5
5
  var useBreadcrumbs = (options = {}) => {
6
6
  const { currentPath } = useRouterContext();
7
- const featureContext = useOptionalElevasisFeatures();
7
+ const systemContext = useOptionalElevasisSystems();
8
8
  const { labelsByPath = {} } = options;
9
9
  return useMemo(() => {
10
- const shellModel = featureContext?.shellModel;
10
+ const shellModel = systemContext?.shellModel;
11
11
  const overriddenLabel = labelsByPath[currentPath];
12
12
  if (overriddenLabel) {
13
13
  return [{ label: overriddenLabel, isActive: true }];
@@ -39,7 +39,7 @@ var useBreadcrumbs = (options = {}) => {
39
39
  });
40
40
  }
41
41
  return breadcrumbs;
42
- }, [currentPath, featureContext, labelsByPath]);
42
+ }, [currentPath, systemContext, labelsByPath]);
43
43
  };
44
44
  function formatSegmentLabel(segment) {
45
45
  return segment.split("-").map((word) => word.charAt(0).toUpperCase() + word.slice(1)).join(" ");