@elevasis/ui 2.30.0 → 2.31.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 (109) hide show
  1. package/dist/{CoreAuthKitInner-QC62UHTZ.js → CoreAuthKitInner-KSEGSB67.js} +1 -1
  2. package/dist/api/index.js +3 -3
  3. package/dist/app/index.d.ts +122 -1
  4. package/dist/app/index.js +7 -7
  5. package/dist/auth/context.js +1 -1
  6. package/dist/auth/index.js +1 -1
  7. package/dist/charts/index.js +4 -4
  8. package/dist/{chunk-T5Z7G2J2.js → chunk-3BAPR3KA.js} +1 -1
  9. package/dist/{chunk-4VQ2PXMI.js → chunk-3FV6HBXS.js} +4 -4
  10. package/dist/{chunk-2DIYILF7.js → chunk-542WPQU2.js} +2 -2
  11. package/dist/{chunk-SBCIB5TZ.js → chunk-5LJAEZMA.js} +5 -5
  12. package/dist/{chunk-T2PAD63Y.js → chunk-7HMCB26R.js} +1 -1
  13. package/dist/chunk-7KC4P3AU.js +357 -0
  14. package/dist/{chunk-AKOD52HS.js → chunk-CQZ3DNQY.js} +4 -3
  15. package/dist/{chunk-I2KLQ2HA.js → chunk-DZTG5IAC.js} +7 -1
  16. package/dist/{chunk-JCGD4GM6.js → chunk-GRDLB6LM.js} +1 -0
  17. package/dist/{chunk-JKTPRYGV.js → chunk-HQGF4ATG.js} +9 -55
  18. package/dist/{chunk-SKXXT3E2.js → chunk-HYNYEBHM.js} +4 -4
  19. package/dist/{chunk-6EFVZV6X.js → chunk-JKSUN5GN.js} +718 -64
  20. package/dist/{chunk-LRZFLK2F.js → chunk-L2NVFLXU.js} +3 -3
  21. package/dist/{chunk-6WXDE5LZ.js → chunk-L3BVJWML.js} +1 -1
  22. package/dist/{chunk-3MDNBHVB.js → chunk-MVFCLZSK.js} +690 -221
  23. package/dist/{chunk-HYLERWRO.js → chunk-ND42LPY4.js} +6 -6
  24. package/dist/{chunk-CLUP5H3C.js → chunk-O2QOPJI5.js} +360 -126
  25. package/dist/{chunk-X2SUMO3P.js → chunk-P55BJZZW.js} +2 -1
  26. package/dist/{chunk-4FZYEEPK.js → chunk-Q6OYNEGR.js} +5 -5
  27. package/dist/{chunk-4SY6BTVZ.js → chunk-QDEETKYT.js} +4 -1
  28. package/dist/{chunk-IKQ42WHU.js → chunk-QHEWXU7I.js} +1 -1
  29. package/dist/chunk-R2XR4FCV.js +48 -0
  30. package/dist/chunk-R66W5UDG.js +26 -0
  31. package/dist/{chunk-3GV5NHSS.js → chunk-SHQXMW4F.js} +39 -211
  32. package/dist/{chunk-A7B7HLDF.js → chunk-T3IPHEYJ.js} +1889 -301
  33. package/dist/{chunk-7E3FUTND.js → chunk-TOIXUWR6.js} +1 -1
  34. package/dist/{chunk-NITGGYH2.js → chunk-TVRQ6AQI.js} +1 -1
  35. package/dist/{chunk-CN2HC4D4.js → chunk-UFTM5SZZ.js} +2 -2
  36. package/dist/{chunk-KVJ3LFH2.js → chunk-VNFR57DF.js} +4 -24
  37. package/dist/{chunk-P5WYW2GI.js → chunk-Y4FWCG7Y.js} +150 -305
  38. package/dist/components/chat/index.js +1 -1
  39. package/dist/components/index.d.ts +205 -11
  40. package/dist/components/index.js +38 -35
  41. package/dist/components/navigation/index.js +1 -1
  42. package/dist/execution/index.d.ts +2 -1
  43. package/dist/execution/index.js +1 -1
  44. package/dist/features/auth/index.d.ts +121 -0
  45. package/dist/features/auth/index.js +1 -1
  46. package/dist/features/clients/index.css +611 -0
  47. package/dist/features/clients/index.d.ts +86 -0
  48. package/dist/features/clients/index.js +719 -0
  49. package/dist/features/crm/index.d.ts +148 -2
  50. package/dist/features/crm/index.js +18 -16
  51. package/dist/features/dashboard/index.d.ts +36 -1
  52. package/dist/features/dashboard/index.js +14 -14
  53. package/dist/features/delivery/index.d.ts +121 -0
  54. package/dist/features/delivery/index.js +18 -16
  55. package/dist/features/knowledge/index.js +43 -20
  56. package/dist/features/lead-gen/index.d.ts +17 -11
  57. package/dist/features/lead-gen/index.js +19 -17
  58. package/dist/features/monitoring/index.js +17 -16
  59. package/dist/features/monitoring/requests/index.js +14 -13
  60. package/dist/features/operations/index.d.ts +38 -2
  61. package/dist/features/operations/index.js +22 -21
  62. package/dist/features/seo/index.js +1 -1
  63. package/dist/features/settings/index.d.ts +121 -0
  64. package/dist/features/settings/index.js +16 -15
  65. package/dist/graph/index.js +1 -1
  66. package/dist/hooks/delivery/index.d.ts +140 -0
  67. package/dist/hooks/delivery/index.js +3 -3
  68. package/dist/hooks/index.d.ts +583 -19
  69. package/dist/hooks/index.js +12 -12
  70. package/dist/hooks/operations/command-view/utils/transformCommandViewData.d.ts +82 -1
  71. package/dist/hooks/operations/command-view/utils/transformCommandViewData.js +1 -1
  72. package/dist/hooks/published.d.ts +583 -19
  73. package/dist/hooks/published.js +12 -12
  74. package/dist/index.d.ts +680 -21
  75. package/dist/index.js +13 -13
  76. package/dist/initialization/index.d.ts +121 -0
  77. package/dist/initialization/index.js +1 -1
  78. package/dist/knowledge/index.d.ts +97 -1
  79. package/dist/knowledge/index.js +1692 -1039
  80. package/dist/layout/index.d.ts +6 -0
  81. package/dist/layout/index.js +4 -4
  82. package/dist/organization/index.js +1 -1
  83. package/dist/profile/index.d.ts +121 -0
  84. package/dist/profile/index.js +1 -1
  85. package/dist/provider/ElevasisServiceContext.js +1 -1
  86. package/dist/provider/index.d.ts +218 -2
  87. package/dist/provider/index.js +10 -10
  88. package/dist/provider/published.d.ts +218 -2
  89. package/dist/provider/published.js +7 -7
  90. package/dist/router/context.js +1 -1
  91. package/dist/router/index.js +1 -1
  92. package/dist/sse/index.js +1 -1
  93. package/dist/supabase/index.d.ts +232 -0
  94. package/dist/supabase/index.js +1 -1
  95. package/dist/test-utils/index.js +3 -3
  96. package/dist/test-utils/setup-integration.js +1 -1
  97. package/dist/test-utils/setup.js +2 -2
  98. package/dist/theme/index.js +4 -4
  99. package/dist/theme/presets/index.js +2 -2
  100. package/dist/typeform/index.js +1 -1
  101. package/dist/typeform/schemas.js +1 -1
  102. package/dist/types/index.d.ts +204 -1
  103. package/dist/utils/index.d.ts +36 -1
  104. package/dist/utils/index.js +2 -2
  105. package/dist/vite/index.js +3 -3
  106. package/dist/vite-plugin-knowledge/index.js +2 -2
  107. package/dist/zustand/index.js +1 -1
  108. package/package.json +13 -4
  109. /package/dist/{chunk-HXZQWMKE.js → chunk-XQHZBA65.js} +0 -0
@@ -1,4 +1,4 @@
1
- import { APIClientError } from './chunk-HXZQWMKE.js';
1
+ import { APIClientError } from './chunk-XQHZBA65.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,4 +1,4 @@
1
- import { DisplayMetadataSchema, ModelIdSchema, DescriptionSchema, LEAD_GEN_STAGE_CATALOG } from './chunk-AKOD52HS.js';
1
+ import { DisplayMetadataSchema, ModelIdSchema, DescriptionSchema, LEAD_GEN_STAGE_CATALOG } from './chunk-CQZ3DNQY.js';
2
2
  import { z } from 'zod';
3
3
 
4
4
  var ProspectingLifecycleStageSchema = DisplayMetadataSchema.extend({
@@ -25,11 +25,11 @@ function detectLayout(viteRoot) {
25
25
  return {
26
26
  mode: "monorepo",
27
27
  projectRoot,
28
- omSourcePath: resolve(projectRoot, "packages/elevasis-core/src/organization-model.ts"),
28
+ omSourcePath: resolve(projectRoot, "packages/elevasis-core/src/organization-model/index.ts"),
29
29
  // monorepo mode does not consume mdxNodesDir; field kept for type uniformity
30
30
  mdxNodesDir: resolve(projectRoot, "packages/elevasis-core/knowledge-nodes-unused"),
31
31
  generatedDir: resolve(projectRoot, "packages/ui/src/knowledge/_generated"),
32
- watchPaths: [resolve(projectRoot, "packages/elevasis-core/src/organization-model.ts")]
32
+ watchPaths: [resolve(projectRoot, "packages/elevasis-core/src/organization-model")]
33
33
  };
34
34
  }
35
35
  const parent = resolve(dir, "..");
@@ -1,28 +1,8 @@
1
- import { Modal, Center, Space, Text, Button, Title, TextInput } from '@mantine/core';
2
- import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
1
+ import { CustomModal } from './chunk-R66W5UDG.js';
3
2
  import { cloneElement } from 'react';
3
+ import { Center, Space, Text, Button, Title, TextInput } from '@mantine/core';
4
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
4
5
 
5
- // src/components/modal/CustomModal.tsx
6
- var FULL_SIZE = "80%";
7
- var CustomModal = ({ children, opened, onClose, loading, style, size }) => {
8
- const canClose = loading === true ? false : true;
9
- const resolvedSize = size === "full" ? FULL_SIZE : size;
10
- return /* @__PURE__ */ jsx(
11
- Modal,
12
- {
13
- opened,
14
- onClose,
15
- padding: "xs",
16
- withCloseButton: false,
17
- closeOnClickOutside: canClose,
18
- closeOnEscape: canClose,
19
- centered: true,
20
- style,
21
- size: resolvedSize,
22
- children
23
- }
24
- );
25
- };
26
6
  var ConfirmationModal = ({
27
7
  opened,
28
8
  onClose,
@@ -104,4 +84,4 @@ var ConfirmationInputModal = ({
104
84
  ] });
105
85
  };
106
86
 
107
- export { ConfirmationInputModal, ConfirmationModal, CustomModal };
87
+ export { ConfirmationInputModal, ConfirmationModal };
@@ -1,21 +1,20 @@
1
+ import { SalesSidebar, CrmSidebarMiddle } from './chunk-7KC4P3AU.js';
2
+ import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
1
3
  import { PageContainer } from './chunk-BZZCNLT6.js';
2
4
  import { TableSelectionToolbar, SortableHeader } from './chunk-TUMSNGTX.js';
3
- import { SubshellNavItem } from './chunk-X4WBGKJQ.js';
4
- import { SubshellSidebarSection } from './chunk-IIMU5YAJ.js';
5
5
  import { FilterBar } from './chunk-PDHTXPSF.js';
6
- import { CustomModal } from './chunk-KVJ3LFH2.js';
7
- import { useDealTasksDue, useDealsLookup, useCreateDealTask, useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useExecuteAction } from './chunk-6EFVZV6X.js';
8
- import { showApiErrorNotification, showSuccessNotification } from './chunk-T2PAD63Y.js';
9
- import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-6WXDE5LZ.js';
10
- import { CRM_PIPELINE_DEFINITION, useCrmActions, DEFAULT_CRM_PRIORITY_RULE_CONFIG, deriveActions, CRM_PRIORITY_BUCKETS } from './chunk-AKOD52HS.js';
6
+ import { CustomModal } from './chunk-R66W5UDG.js';
7
+ import { useDealsSummary, useDeleteDeal, usePaginationState, useDeals, useTableSort, sortData, useTableSelection, useDealDetail, useCompany, dealKeys, useContact, useExecuteAction } from './chunk-JKSUN5GN.js';
8
+ import { showApiErrorNotification, showSuccessNotification } from './chunk-7HMCB26R.js';
9
+ import { CenteredErrorState, CardHeader, StatCard, PageTitleCaption, EmptyState, ActivityTimeline } from './chunk-L3BVJWML.js';
10
+ import { CRM_PIPELINE_DEFINITION, useCrmActions, DEFAULT_CRM_PRIORITY_RULE_CONFIG, deriveActions, CRM_PRIORITY_BUCKETS } from './chunk-CQZ3DNQY.js';
11
11
  import { SubshellContentContainer } from './chunk-TKAYX2SP.js';
12
- import { useRouterContext } from './chunk-Q7DJKLEN.js';
13
- import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-HXZQWMKE.js';
12
+ import { PAGE_SIZE_DEFAULT, formatTimeAgo } from './chunk-XQHZBA65.js';
14
13
  import { useElevasisServices } from './chunk-KJ3QUBNU.js';
15
- import { Box, Stack, Group, Text, Badge, Center, Loader, UnstyledButton, Button, Modal, Title, Select, TextInput, Textarea, Paper, Alert, Table, SimpleGrid, Tabs, Checkbox, Tooltip, Pagination, Code, Card, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, CopyButton, Divider } from '@mantine/core';
16
- import { IconLayoutGrid, IconColumns, IconFileInvoice, IconAddressBook, IconTrophy, IconClockExclamation, IconUser, IconPlus, IconChecklist, IconHistory, IconAlertCircle, IconCurrencyDollar, IconChartBar, IconBriefcase, IconSearch, IconTargetArrow, IconAlertTriangle, IconMessages, IconArrowLeft, IconFileText, IconInbox, IconBolt, IconBuilding, IconSettings, IconRestore, IconInfoCircle, IconMailForward, IconCheckbox, IconCalendar, IconMail, IconPhone, IconArrowRight, IconNote, IconCheck, IconCopy } from '@tabler/icons-react';
14
+ import { Stack, Paper, Center, Loader, Group, Box, Text, Alert, Table, SimpleGrid, Button, Select, TextInput, Tabs, Checkbox, Badge, Tooltip, Pagination, Title, Code, Card, Switch, NumberInput, ColorSwatch, Popover, ActionIcon, Anchor, CopyButton, Divider, Textarea } from '@mantine/core';
15
+ import { IconAddressBook, IconColumns, IconHistory, IconAlertCircle, IconCurrencyDollar, IconChartBar, IconBriefcase, IconTrophy, IconSearch, IconTargetArrow, IconAlertTriangle, IconMessages, IconArrowLeft, IconFileText, IconInbox, IconUser, IconBolt, IconBuilding, IconSettings, IconRestore, IconInfoCircle, IconMailForward, IconPlus, IconArrowRight, IconNote, IconCheck, IconCopy } from '@tabler/icons-react';
17
16
  import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
18
- import { useState, useMemo, useEffect } from 'react';
17
+ import { useMemo, useState, useEffect } from 'react';
19
18
  import { useQuery, useQueryClient, useMutation } from '@tanstack/react-query';
20
19
  import { useNavigate } from '@tanstack/react-router';
21
20
  import { useForm } from '@mantine/form';
@@ -24,29 +23,6 @@ var CrmSidebarTop = () => {
24
23
  return /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconAddressBook, label: "CRM" });
25
24
  };
26
25
 
27
- // src/features/crm/workbench/constants.ts
28
- var SAVED_VIEW_PRESETS = [
29
- {
30
- id: "my-deals",
31
- label: "My Deals",
32
- iconName: "IconUser",
33
- target: "/crm/deals"
34
- },
35
- {
36
- id: "overdue",
37
- label: "Overdue",
38
- iconName: "IconClockExclamation",
39
- target: "/crm/deals"
40
- },
41
- {
42
- id: "won-this-month",
43
- label: "Won this month",
44
- iconName: "IconTrophy",
45
- target: "/crm/deals",
46
- urlFilters: { stage: "closed_won" }
47
- }
48
- ];
49
-
50
26
  // src/lib/crm/pipeline.ts
51
27
  function getCrmStageOptions() {
52
28
  return CRM_PIPELINE_DEFINITION.stages.map((stage) => ({
@@ -152,274 +128,6 @@ function buildBookingUrl(opts = {}) {
152
128
  if (opts.contactId) params.set("contactId", opts.contactId);
153
129
  return params.size > 0 ? `${BOOKING_PAGE_URL}?${params.toString()}` : BOOKING_PAGE_URL;
154
130
  }
155
- var KIND_ICONS = {
156
- call: IconPhone,
157
- email: IconMail,
158
- meeting: IconCalendar,
159
- other: IconCheckbox
160
- };
161
- function formatDueLabel(dueAt) {
162
- if (!dueAt) return "";
163
- const date = new Date(dueAt);
164
- const now = /* @__PURE__ */ new Date();
165
- const today = new Date(now.getFullYear(), now.getMonth(), now.getDate());
166
- const dueDay = new Date(date.getFullYear(), date.getMonth(), date.getDate());
167
- const diffDays = Math.round((dueDay.getTime() - today.getTime()) / 864e5);
168
- if (diffDays < 0) return `${Math.abs(diffDays)}d overdue`;
169
- if (diffDays === 0) {
170
- return date.toLocaleTimeString([], { hour: "2-digit", minute: "2-digit" });
171
- }
172
- return `in ${diffDays}d`;
173
- }
174
- function TaskRow({ task, onClick }) {
175
- const KindIcon = KIND_ICONS[task.kind];
176
- const dueLabel = formatDueLabel(task.dueAt);
177
- const isOverdue = task.dueAt !== null && new Date(task.dueAt) < /* @__PURE__ */ new Date();
178
- return /* @__PURE__ */ jsx(
179
- UnstyledButton,
180
- {
181
- onClick,
182
- style: {
183
- display: "block",
184
- width: "100%",
185
- padding: "4px 6px",
186
- borderRadius: "var(--mantine-radius-sm)",
187
- transition: `background-color var(--duration-fast) var(--easing)`
188
- },
189
- onMouseEnter: (e) => {
190
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
191
- },
192
- onMouseLeave: (e) => {
193
- e.currentTarget.style.backgroundColor = "transparent";
194
- },
195
- children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
196
- /* @__PURE__ */ jsx(KindIcon, { size: 14, style: { color: "var(--color-text-dimmed)", flexShrink: 0 } }),
197
- /* @__PURE__ */ jsx(Text, { size: "xs", truncate: true, style: { flex: 1, minWidth: 0 }, children: task.title }),
198
- dueLabel && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", color: isOverdue ? "red" : "gray", style: { flexShrink: 0 }, children: dueLabel })
199
- ] })
200
- }
201
- );
202
- }
203
- function MyTasksPanel({
204
- onTaskClick,
205
- onSeeAll,
206
- footer,
207
- showSectionLabel = true
208
- }) {
209
- const { data, isLoading, isError } = useDealTasksDue({ window: "today_and_overdue" });
210
- const tasks = data ?? [];
211
- const total = tasks.length;
212
- const visible = tasks.slice(0, 5);
213
- return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
214
- showSectionLabel && /* @__PURE__ */ jsxs(Group, { justify: "space-between", mb: 4, children: [
215
- /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, children: "My Tasks" }),
216
- total > 0 && /* @__PURE__ */ jsx(Badge, { size: "xs", variant: "light", children: total })
217
- ] }),
218
- isLoading && /* @__PURE__ */ jsx(Center, { py: 4, children: /* @__PURE__ */ jsx(Loader, { size: "xs" }) }),
219
- isError && /* @__PURE__ */ jsx(Text, { size: "xs", c: "red", children: "Failed to load tasks" }),
220
- !isLoading && !isError && visible.length === 0 && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "No tasks due - you're caught up." }),
221
- !isLoading && !isError && visible.map((task) => /* @__PURE__ */ jsx(TaskRow, { task, onClick: () => onTaskClick(task.dealId) }, task.id)),
222
- 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: [
223
- "See all (",
224
- total,
225
- ")"
226
- ] }) }),
227
- footer
228
- ] }) });
229
- }
230
- var ICON_MAP = {
231
- IconUser,
232
- IconClockExclamation,
233
- IconTrophy
234
- };
235
- function SavedViewsPanel({ onViewClick, showSectionLabel = true }) {
236
- return /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
237
- showSectionLabel && /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, mb: 4, children: "Saved Views" }),
238
- SAVED_VIEW_PRESETS.map((preset) => {
239
- const Icon = ICON_MAP[preset.iconName];
240
- return /* @__PURE__ */ jsx(
241
- UnstyledButton,
242
- {
243
- onClick: () => onViewClick(preset),
244
- style: {
245
- display: "block",
246
- width: "100%",
247
- padding: "4px 6px",
248
- borderRadius: "var(--mantine-radius-sm)",
249
- transition: `background-color var(--duration-fast) var(--easing)`
250
- },
251
- onMouseEnter: (e) => {
252
- e.currentTarget.style.backgroundColor = "var(--color-surface-hover)";
253
- },
254
- onMouseLeave: (e) => {
255
- e.currentTarget.style.backgroundColor = "transparent";
256
- },
257
- children: /* @__PURE__ */ jsxs(Group, { gap: "xs", wrap: "nowrap", children: [
258
- /* @__PURE__ */ jsx(Icon, { size: 14, style: { color: "var(--color-text-dimmed)", flexShrink: 0 } }),
259
- /* @__PURE__ */ jsx(Text, { size: "xs", children: preset.label })
260
- ] })
261
- },
262
- preset.id
263
- );
264
- })
265
- ] }) });
266
- }
267
- var KIND_OPTIONS = [
268
- { value: "call", label: "Call" },
269
- { value: "email", label: "Email" },
270
- { value: "meeting", label: "Meeting" },
271
- { value: "other", label: "Other" }
272
- ];
273
- function QuickCreateActions({ showSectionLabel = true }) {
274
- const [open, setOpen] = useState(false);
275
- const [dealId, setDealId] = useState(null);
276
- const [dealSearch, setDealSearch] = useState("");
277
- const [title, setTitle] = useState("");
278
- const [description, setDescription] = useState("");
279
- const [kind, setKind] = useState("other");
280
- const [dueAt, setDueAt] = useState("");
281
- const { data: deals, isLoading: isLoadingDeals } = useDealsLookup(
282
- {
283
- search: dealSearch || void 0,
284
- limit: 25
285
- },
286
- { enabled: open }
287
- );
288
- const createTask = useCreateDealTask();
289
- const dealOptions = (deals ?? []).map((deal) => ({
290
- value: deal.id,
291
- label: deal.displayLabel
292
- }));
293
- function resetForm() {
294
- setDealId(null);
295
- setDealSearch("");
296
- setTitle("");
297
- setDescription("");
298
- setKind("other");
299
- setDueAt("");
300
- }
301
- function handleClose() {
302
- setOpen(false);
303
- resetForm();
304
- }
305
- async function handleSubmit() {
306
- if (!dealId || !title) return;
307
- await createTask.mutateAsync({
308
- dealId,
309
- title,
310
- description: description || null,
311
- kind,
312
- dueAt: dueAt ? new Date(dueAt).toISOString() : null
313
- });
314
- handleClose();
315
- }
316
- const isSubmitDisabled = !dealId || !title || createTask.isPending;
317
- return /* @__PURE__ */ jsxs(Fragment, { children: [
318
- /* @__PURE__ */ jsxs(Stack, { gap: 4, children: [
319
- showSectionLabel && /* @__PURE__ */ jsx(Text, { fz: "xs", tt: "uppercase", c: "dimmed", fw: 600, children: "TASKS" }),
320
- /* @__PURE__ */ jsx(Button, { variant: "light", size: "xs", leftSection: /* @__PURE__ */ jsx(IconPlus, { size: 14 }), fullWidth: true, onClick: () => setOpen(true), children: "New Task" })
321
- ] }),
322
- /* @__PURE__ */ jsxs(Modal, { opened: open, onClose: handleClose, size: "md", children: [
323
- /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
324
- /* @__PURE__ */ jsx(Title, { order: 3, children: "New Task" }),
325
- /* @__PURE__ */ jsx(
326
- Select,
327
- {
328
- label: "Deal",
329
- placeholder: "Search deals",
330
- data: dealOptions,
331
- value: dealId,
332
- onChange: setDealId,
333
- searchValue: dealSearch,
334
- onSearchChange: setDealSearch,
335
- searchable: true,
336
- nothingFoundMessage: dealSearch ? "No matching deals" : "No deals available",
337
- disabled: isLoadingDeals,
338
- required: true
339
- }
340
- ),
341
- /* @__PURE__ */ jsx(
342
- TextInput,
343
- {
344
- label: "Title",
345
- placeholder: "Task title",
346
- value: title,
347
- onChange: (e) => setTitle(e.currentTarget.value),
348
- required: true
349
- }
350
- ),
351
- /* @__PURE__ */ jsx(
352
- Textarea,
353
- {
354
- label: "Description",
355
- placeholder: "Optional description",
356
- value: description,
357
- onChange: (e) => setDescription(e.currentTarget.value),
358
- autosize: true,
359
- minRows: 2,
360
- maxRows: 5
361
- }
362
- ),
363
- /* @__PURE__ */ jsx(
364
- Select,
365
- {
366
- label: "Kind",
367
- data: KIND_OPTIONS,
368
- value: kind,
369
- onChange: (v) => setKind(v ?? "other")
370
- }
371
- ),
372
- /* @__PURE__ */ jsx(
373
- TextInput,
374
- {
375
- type: "datetime-local",
376
- label: "Due At",
377
- value: dueAt,
378
- onChange: (e) => setDueAt(e.currentTarget.value)
379
- }
380
- )
381
- ] }),
382
- /* @__PURE__ */ jsxs(Group, { justify: "flex-end", mt: "md", children: [
383
- /* @__PURE__ */ jsx(Button, { variant: "default", onClick: handleClose, children: "Cancel" }),
384
- /* @__PURE__ */ jsx(Button, { onClick: handleSubmit, loading: createTask.isPending, disabled: isSubmitDisabled, children: "Create" })
385
- ] })
386
- ] })
387
- ] });
388
- }
389
- var CRM_ITEMS = [
390
- { label: "Overview", to: "/crm", icon: IconLayoutGrid, exact: true },
391
- { label: "Pipeline", to: "/crm/pipeline", icon: IconColumns, exact: false },
392
- { label: "Deals", to: "/crm/deals", icon: IconFileInvoice, exact: false }
393
- ];
394
- var CrmSidebarMiddle = ({ items = CRM_ITEMS } = {}) => {
395
- const { currentPath, navigate } = useRouterContext();
396
- return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { flex: 1, overflowY: "auto" }, children: [
397
- /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: items.map((item) => {
398
- const isActive = item.exact ? currentPath === item.to || currentPath === `${item.to}/` : currentPath.startsWith(item.to);
399
- return /* @__PURE__ */ jsx(
400
- SubshellNavItem,
401
- {
402
- icon: item.icon,
403
- label: item.label,
404
- isActive,
405
- href: item.to,
406
- onClick: () => navigate(item.to)
407
- },
408
- item.to
409
- );
410
- }) }),
411
- /* @__PURE__ */ jsx(SubshellSidebarSection, { icon: IconChecklist, label: "My Tasks", withTopBorder: true }),
412
- /* @__PURE__ */ jsx(Stack, { gap: 0, p: "sm", children: /* @__PURE__ */ jsx(
413
- MyTasksPanel,
414
- {
415
- onTaskClick: (dealId) => navigate(`/crm/deals/${dealId}`),
416
- onSeeAll: () => navigate("/crm/deals"),
417
- showSectionLabel: false,
418
- footer: /* @__PURE__ */ jsx(QuickCreateActions, { showSectionLabel: false })
419
- }
420
- ) })
421
- ] });
422
- };
423
131
  var CrmSidebar = ({ children } = {}) => {
424
132
  return /* @__PURE__ */ jsxs(Stack, { gap: 0, style: { height: "100%", display: "flex", flexDirection: "column" }, children: [
425
133
  /* @__PURE__ */ jsx(CrmSidebarTop, {}),
@@ -695,7 +403,7 @@ var crmManifest = {
695
403
  featureId: "sales.crm",
696
404
  capabilityIds: ["crm.pipeline.manage"],
697
405
  icon: IconAddressBook,
698
- sidebar: CrmSidebar
406
+ sidebar: SalesSidebar
699
407
  };
700
408
  var sortAccessors = {
701
409
  company: (deal) => deal.contact?.company?.name || deal.discovery_data?.company || deal.contact_email?.split("@")[1] || "",
@@ -1663,6 +1371,10 @@ function CompanyDetailPage({ companyId }) {
1663
1371
  company.foundedYear != null && /* @__PURE__ */ jsxs(Group, { children: [
1664
1372
  /* @__PURE__ */ jsx(Text, { fw: 500, children: "Founded:" }),
1665
1373
  /* @__PURE__ */ jsx(Text, { children: company.foundedYear })
1374
+ ] }),
1375
+ company.contactCount != null && /* @__PURE__ */ jsxs(Group, { children: [
1376
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: "Contacts:" }),
1377
+ /* @__PURE__ */ jsx(Text, { children: company.contactCount })
1666
1378
  ] })
1667
1379
  ] })
1668
1380
  ] }) }),
@@ -1702,6 +1414,10 @@ function CompanyDetailPage({ companyId }) {
1702
1414
  company.verticalResearch && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1703
1415
  /* @__PURE__ */ jsx(Title, { order: 4, children: "Vertical Research" }),
1704
1416
  /* @__PURE__ */ jsx(Text, { size: "sm", style: { whiteSpace: "pre-wrap" }, children: company.verticalResearch })
1417
+ ] }) }),
1418
+ company.enrichmentData && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1419
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Enrichment Data" }),
1420
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", style: { whiteSpace: "pre-wrap" }, children: JSON.stringify(company.enrichmentData, null, 2) })
1705
1421
  ] }) })
1706
1422
  ] }) })
1707
1423
  ] }) });
@@ -2014,5 +1730,134 @@ function CrmSettingsPage() {
2014
1730
  ] }) })
2015
1731
  ] }) }) });
2016
1732
  }
1733
+ function ContactDetailPage({ contactId }) {
1734
+ const navigate = useNavigate();
1735
+ const { data: contact, isLoading, error } = useContact(contactId);
1736
+ const fullName = contact ? [contact.firstName, contact.lastName].filter(Boolean).join(" ") || contact.email : "Contact Detail";
1737
+ const title = contact ? fullName : "Contact Detail";
1738
+ const headerActions = /* @__PURE__ */ jsx(
1739
+ Button,
1740
+ {
1741
+ variant: "light",
1742
+ size: "sm",
1743
+ leftSection: /* @__PURE__ */ jsx(IconArrowLeft, { size: 16 }),
1744
+ onClick: () => navigate({ to: "/crm" }),
1745
+ children: "CRM"
1746
+ }
1747
+ );
1748
+ if (isLoading) {
1749
+ return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
1750
+ /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Loading contact details...", rightSection: headerActions }) }),
1751
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(Center, { p: "xl", children: /* @__PURE__ */ jsx(Loader, {}) }) })
1752
+ ] }) });
1753
+ }
1754
+ if (error) {
1755
+ return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
1756
+ /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Unable to load contact details", rightSection: headerActions }) }),
1757
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(CenteredErrorState, { error, title: "Failed to load contact" }) })
1758
+ ] }) });
1759
+ }
1760
+ if (!contact) {
1761
+ return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
1762
+ /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title, caption: "Contact not found", rightSection: headerActions }) }),
1763
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsx(
1764
+ EmptyState,
1765
+ {
1766
+ icon: IconUser,
1767
+ title: "Contact not found",
1768
+ description: "The selected contact no longer exists."
1769
+ }
1770
+ ) })
1771
+ ] }) });
1772
+ }
1773
+ const liData = contact.enrichmentData;
1774
+ const caption = [contact.title, contact.email].filter(Boolean).join(" \xB7 ") || [contact.company?.name].filter(Boolean).join("") || "Contact";
1775
+ return /* @__PURE__ */ jsx(SubshellContentContainer, { children: /* @__PURE__ */ jsxs(PageContainer, { children: [
1776
+ /* @__PURE__ */ jsx(Stack, { children: /* @__PURE__ */ jsx(PageTitleCaption, { title: fullName, caption, rightSection: headerActions }) }),
1777
+ /* @__PURE__ */ jsx(Paper, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "md", p: "md", children: [
1778
+ /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1779
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Overview" }),
1780
+ /* @__PURE__ */ jsxs(Group, { gap: "xs", children: [
1781
+ /* @__PURE__ */ jsx(Badge, { variant: "light", color: "blue", children: contact.status }),
1782
+ contact.openingLine && /* @__PURE__ */ jsx(Badge, { variant: "light", color: "green", children: "Personalized" })
1783
+ ] }),
1784
+ /* @__PURE__ */ jsxs(SimpleGrid, { cols: { base: 1, sm: 2 }, spacing: "sm", children: [
1785
+ /* @__PURE__ */ jsxs(Group, { children: [
1786
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: "Email:" }),
1787
+ /* @__PURE__ */ jsx(Text, { children: contact.email })
1788
+ ] }),
1789
+ contact.title && /* @__PURE__ */ jsxs(Group, { children: [
1790
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: "Title:" }),
1791
+ /* @__PURE__ */ jsx(Text, { children: contact.title })
1792
+ ] }),
1793
+ contact.headline && /* @__PURE__ */ jsxs(Group, { children: [
1794
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: "Headline:" }),
1795
+ /* @__PURE__ */ jsx(Text, { children: contact.headline })
1796
+ ] }),
1797
+ contact.linkedinUrl && /* @__PURE__ */ jsxs(Group, { children: [
1798
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: "LinkedIn:" }),
1799
+ /* @__PURE__ */ jsx(Anchor, { href: contact.linkedinUrl, target: "_blank", size: "sm", children: "View Profile" })
1800
+ ] })
1801
+ ] }),
1802
+ /* @__PURE__ */ jsxs(Text, { size: "xs", c: "dimmed", children: [
1803
+ "Created: ",
1804
+ new Date(contact.createdAt).toLocaleDateString(),
1805
+ contact.updatedAt && ` | Updated: ${new Date(contact.updatedAt).toLocaleDateString()}`
1806
+ ] })
1807
+ ] }) }),
1808
+ contact.company && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1809
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Company" }),
1810
+ /* @__PURE__ */ jsxs(
1811
+ Card,
1812
+ {
1813
+ withBorder: true,
1814
+ style: { cursor: "pointer" },
1815
+ onClick: () => navigate({
1816
+ to: "/crm/companies/$companyId",
1817
+ params: { companyId: contact.company.id }
1818
+ }),
1819
+ children: [
1820
+ /* @__PURE__ */ jsx(Text, { fw: 500, children: contact.company.name }),
1821
+ contact.company.domain && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: contact.company.domain })
1822
+ ]
1823
+ }
1824
+ )
1825
+ ] }) }),
1826
+ (liData?.linkedin?.summary || liData?.linkedin?.pastExperience || liData?.linkedin?.education) && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1827
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "LinkedIn Data" }),
1828
+ liData.linkedin?.summary && /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1829
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Summary" }),
1830
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: liData.linkedin.summary })
1831
+ ] }),
1832
+ liData.linkedin?.pastExperience && /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1833
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Past Experience" }),
1834
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: liData.linkedin.pastExperience })
1835
+ ] }),
1836
+ liData.linkedin?.education && /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1837
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Education" }),
1838
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: liData.linkedin.education })
1839
+ ] })
1840
+ ] }) }),
1841
+ liData?.linkedin?.activity && liData.linkedin.activity.length > 0 && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1842
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Recent Activity" }),
1843
+ /* @__PURE__ */ jsx(Stack, { gap: "xs", children: liData.linkedin.activity.slice(0, 3).map((activity, i) => /* @__PURE__ */ jsxs(Card, { withBorder: true, children: [
1844
+ activity.date && /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: activity.date }),
1845
+ activity.content && /* @__PURE__ */ jsx(Text, { size: "sm", children: activity.content })
1846
+ ] }, i)) })
1847
+ ] }) }),
1848
+ contact.openingLine && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1849
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Personalization" }),
1850
+ /* @__PURE__ */ jsxs(Stack, { gap: "xs", children: [
1851
+ /* @__PURE__ */ jsx(Text, { size: "xs", c: "dimmed", children: "Opening Line" }),
1852
+ /* @__PURE__ */ jsx(Text, { size: "sm", children: contact.openingLine })
1853
+ ] })
1854
+ ] }) }),
1855
+ contact.filterReason && /* @__PURE__ */ jsx(Card, { withBorder: true, children: /* @__PURE__ */ jsxs(Stack, { gap: "sm", children: [
1856
+ /* @__PURE__ */ jsx(Title, { order: 4, children: "Qualification" }),
1857
+ /* @__PURE__ */ jsx(Text, { size: "sm", c: "red", children: contact.filterReason })
1858
+ ] }) })
1859
+ ] }) })
1860
+ ] }) });
1861
+ }
2017
1862
 
2018
- export { ActivityFeedWidget, CRM_ITEMS, CompanyDetailPage, ConversationThread, CrmOverview, CrmSettingsPage, CrmSidebar, CrmSidebarMiddle, CrmSidebarTop, DEAL_STAGE_COLORS, DEAL_STAGE_OPTIONS, DealDetailPage, DealsListPage, MetricsStrip, MyTasksPanel, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, QuickCreateActions, SAVED_VIEW_PRESETS, SavedViewsPanel, compareDealsByPriority, crmManifest, crmPrioritySettingsKeys, formatDealStageLabel, setDealReferrer, useCrmPipelineSummary, useCrmPrioritySettings, useCrmQuickMetrics, useRecentCrmActivity, useResetCrmPrioritySettings, useUpdateCrmPrioritySettings };
1863
+ export { ActivityFeedWidget, CompanyDetailPage, ContactDetailPage, ConversationThread, CrmOverview, CrmSettingsPage, CrmSidebar, CrmSidebarTop, DEAL_STAGE_COLORS, DEAL_STAGE_OPTIONS, DealDetailPage, DealsListPage, MetricsStrip, PIPELINE_FUNNEL_ORDER, PipelineFunnelWidget, compareDealsByPriority, crmManifest, crmPrioritySettingsKeys, formatDealStageLabel, setDealReferrer, useCrmPipelineSummary, useCrmPrioritySettings, useCrmQuickMetrics, useRecentCrmActivity, useResetCrmPrioritySettings, useUpdateCrmPrioritySettings };
@@ -1,3 +1,3 @@
1
1
  export { ChatHeader, ChatInputArea, ChatInterface, ChatSidebar, MessageBubble, ProcessingIndicator } from '../../chunk-CXY7FMUM.js';
2
2
  import '../../chunk-3KMDHCAR.js';
3
- import '../../chunk-I2KLQ2HA.js';
3
+ import '../../chunk-DZTG5IAC.js';