@contractspec/example.crm-pipeline 3.7.6 → 3.7.10
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.
- package/.turbo/turbo-build.log +45 -42
- package/AGENTS.md +51 -33
- package/CHANGELOG.md +36 -0
- package/README.md +67 -148
- package/dist/browser/docs/crm-pipeline.docblock.js +1 -1
- package/dist/browser/docs/index.js +1 -1
- package/dist/browser/events/contact.event.js +1 -1
- package/dist/browser/events/deal.event.js +1 -1
- package/dist/browser/events/index.js +3 -3
- package/dist/browser/events/task.event.js +1 -1
- package/dist/browser/handlers/crm.handlers.js +13 -2
- package/dist/browser/handlers/index.js +13 -2
- package/dist/browser/index.js +680 -447
- package/dist/browser/ui/CrmDashboard.js +574 -352
- package/dist/browser/ui/CrmDealCard.js +5 -5
- package/dist/browser/ui/CrmPipelineBoard.js +13 -13
- package/dist/browser/ui/hooks/index.js +21 -10
- package/dist/browser/ui/hooks/useDealList.js +20 -9
- package/dist/browser/ui/hooks/useDealMutations.js +1 -1
- package/dist/browser/ui/index.js +683 -450
- package/dist/browser/ui/modals/CreateDealModal.js +12 -12
- package/dist/browser/ui/modals/DealActionsModal.js +21 -21
- package/dist/browser/ui/modals/index.js +33 -33
- package/dist/browser/ui/renderers/index.js +140 -118
- package/dist/browser/ui/renderers/pipeline.markdown.js +13 -2
- package/dist/browser/ui/renderers/pipeline.renderer.js +108 -97
- package/dist/browser/ui/tables/DealListTab.js +390 -0
- package/dist/deal/index.d.ts +2 -2
- package/dist/docs/crm-pipeline.docblock.js +1 -1
- package/dist/docs/index.js +1 -1
- package/dist/events/contact.event.js +1 -1
- package/dist/events/deal.event.js +1 -1
- package/dist/events/index.js +3 -3
- package/dist/events/task.event.js +1 -1
- package/dist/handlers/crm.handlers.d.ts +2 -0
- package/dist/handlers/crm.handlers.js +13 -2
- package/dist/handlers/index.d.ts +2 -2
- package/dist/handlers/index.js +13 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +680 -447
- package/dist/node/docs/crm-pipeline.docblock.js +1 -1
- package/dist/node/docs/index.js +1 -1
- package/dist/node/events/contact.event.js +1 -1
- package/dist/node/events/deal.event.js +1 -1
- package/dist/node/events/index.js +3 -3
- package/dist/node/events/task.event.js +1 -1
- package/dist/node/handlers/crm.handlers.js +13 -2
- package/dist/node/handlers/index.js +13 -2
- package/dist/node/index.js +680 -447
- package/dist/node/ui/CrmDashboard.js +574 -352
- package/dist/node/ui/CrmDealCard.js +5 -5
- package/dist/node/ui/CrmPipelineBoard.js +13 -13
- package/dist/node/ui/hooks/index.js +21 -10
- package/dist/node/ui/hooks/useDealList.js +20 -9
- package/dist/node/ui/hooks/useDealMutations.js +1 -1
- package/dist/node/ui/index.js +683 -450
- package/dist/node/ui/modals/CreateDealModal.js +12 -12
- package/dist/node/ui/modals/DealActionsModal.js +21 -21
- package/dist/node/ui/modals/index.js +33 -33
- package/dist/node/ui/renderers/index.js +140 -118
- package/dist/node/ui/renderers/pipeline.markdown.js +13 -2
- package/dist/node/ui/renderers/pipeline.renderer.js +108 -97
- package/dist/node/ui/tables/DealListTab.js +390 -0
- package/dist/operations/index.d.ts +1 -1
- package/dist/ui/CrmDashboard.js +574 -352
- package/dist/ui/CrmDealCard.js +5 -5
- package/dist/ui/CrmPipelineBoard.js +13 -13
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.js +21 -10
- package/dist/ui/hooks/useDealList.d.ts +8 -2
- package/dist/ui/hooks/useDealList.js +20 -9
- package/dist/ui/hooks/useDealMutations.d.ts +9 -0
- package/dist/ui/hooks/useDealMutations.js +1 -1
- package/dist/ui/index.d.ts +3 -3
- package/dist/ui/index.js +683 -450
- package/dist/ui/modals/CreateDealModal.js +12 -12
- package/dist/ui/modals/DealActionsModal.js +21 -21
- package/dist/ui/modals/index.js +33 -33
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +140 -118
- package/dist/ui/renderers/pipeline.markdown.js +13 -2
- package/dist/ui/renderers/pipeline.renderer.d.ts +1 -1
- package/dist/ui/renderers/pipeline.renderer.js +108 -97
- package/dist/ui/tables/DealListTab.d.ts +20 -0
- package/dist/ui/tables/DealListTab.js +391 -0
- package/dist/ui/tables/DealListTab.smoke.test.d.ts +1 -0
- package/package.json +29 -14
- package/src/crm-pipeline.feature.ts +86 -86
- package/src/deal/deal.enum.ts +8 -8
- package/src/deal/deal.operation.ts +255 -255
- package/src/deal/deal.schema.ts +92 -92
- package/src/deal/deal.test-spec.ts +48 -48
- package/src/deal/index.ts +17 -19
- package/src/docs/crm-pipeline.docblock.ts +44 -44
- package/src/entities/company.entity.ts +52 -52
- package/src/entities/contact.entity.ts +67 -67
- package/src/entities/deal.entity.ts +134 -134
- package/src/entities/index.ts +27 -27
- package/src/entities/task.entity.ts +105 -105
- package/src/events/contact.event.ts +22 -22
- package/src/events/deal.event.ts +77 -77
- package/src/events/task.event.ts +19 -19
- package/src/example.ts +32 -32
- package/src/handlers/crm.handlers.ts +375 -357
- package/src/handlers/deal.handlers.ts +179 -179
- package/src/handlers/index.ts +18 -19
- package/src/handlers/mock-data.ts +167 -167
- package/src/index.ts +11 -11
- package/src/operations/index.ts +16 -16
- package/src/presentations/dashboard.presentation.ts +45 -45
- package/src/presentations/pipeline.presentation.ts +90 -90
- package/src/seeders/index.ts +26 -26
- package/src/shared/overlay-types.ts +23 -23
- package/src/ui/CrmDashboard.tsx +210 -279
- package/src/ui/CrmDealCard.tsx +64 -64
- package/src/ui/CrmPipelineBoard.tsx +105 -105
- package/src/ui/hooks/index.ts +3 -3
- package/src/ui/hooks/useDealList.ts +113 -85
- package/src/ui/hooks/useDealMutations.ts +151 -150
- package/src/ui/index.ts +5 -10
- package/src/ui/modals/CreateDealModal.tsx +217 -217
- package/src/ui/modals/DealActionsModal.tsx +390 -390
- package/src/ui/overlays/demo-overlays.ts +43 -43
- package/src/ui/renderers/index.ts +4 -3
- package/src/ui/renderers/pipeline.markdown.ts +165 -165
- package/src/ui/renderers/pipeline.renderer.tsx +17 -16
- package/src/ui/tables/DealListTab.smoke.test.tsx +149 -0
- package/src/ui/tables/DealListTab.tsx +276 -0
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/modals/CreateDealModal.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Button, Input } from "@contractspec/lib.design-system";
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
"use client";
|
|
6
6
|
var CURRENCIES = ["USD", "EUR", "GBP", "CAD"];
|
|
@@ -59,7 +59,7 @@ function CreateDealModal({
|
|
|
59
59
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ jsxDEV("div", {
|
|
62
|
-
className: "bg-background/80
|
|
62
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
63
63
|
onClick: onClose,
|
|
64
64
|
role: "button",
|
|
65
65
|
tabIndex: 0,
|
|
@@ -70,10 +70,10 @@ function CreateDealModal({
|
|
|
70
70
|
"aria-label": "Close modal"
|
|
71
71
|
}, undefined, false, undefined, this),
|
|
72
72
|
/* @__PURE__ */ jsxDEV("div", {
|
|
73
|
-
className: "
|
|
73
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
74
74
|
children: [
|
|
75
75
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
76
|
-
className: "mb-4 text-xl
|
|
76
|
+
className: "mb-4 font-semibold text-xl",
|
|
77
77
|
children: "Create New Deal"
|
|
78
78
|
}, undefined, false, undefined, this),
|
|
79
79
|
/* @__PURE__ */ jsxDEV("form", {
|
|
@@ -84,7 +84,7 @@ function CreateDealModal({
|
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ jsxDEV("label", {
|
|
86
86
|
htmlFor: "deal-name",
|
|
87
|
-
className: "
|
|
87
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
88
88
|
children: "Deal Name *"
|
|
89
89
|
}, undefined, false, undefined, this),
|
|
90
90
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -104,7 +104,7 @@ function CreateDealModal({
|
|
|
104
104
|
children: [
|
|
105
105
|
/* @__PURE__ */ jsxDEV("label", {
|
|
106
106
|
htmlFor: "deal-value",
|
|
107
|
-
className: "
|
|
107
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
108
108
|
children: "Value *"
|
|
109
109
|
}, undefined, false, undefined, this),
|
|
110
110
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -124,7 +124,7 @@ function CreateDealModal({
|
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ jsxDEV("label", {
|
|
126
126
|
htmlFor: "deal-currency",
|
|
127
|
-
className: "
|
|
127
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
128
128
|
children: "Currency"
|
|
129
129
|
}, undefined, false, undefined, this),
|
|
130
130
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -132,7 +132,7 @@ function CreateDealModal({
|
|
|
132
132
|
value: currency,
|
|
133
133
|
onChange: (e) => setCurrency(e.target.value),
|
|
134
134
|
disabled: isLoading,
|
|
135
|
-
className: "
|
|
135
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
136
136
|
children: CURRENCIES.map((c) => /* @__PURE__ */ jsxDEV("option", {
|
|
137
137
|
value: c,
|
|
138
138
|
children: c
|
|
@@ -146,7 +146,7 @@ function CreateDealModal({
|
|
|
146
146
|
children: [
|
|
147
147
|
/* @__PURE__ */ jsxDEV("label", {
|
|
148
148
|
htmlFor: "deal-stage",
|
|
149
|
-
className: "
|
|
149
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
150
150
|
children: "Pipeline Stage *"
|
|
151
151
|
}, undefined, false, undefined, this),
|
|
152
152
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -154,7 +154,7 @@ function CreateDealModal({
|
|
|
154
154
|
value: stageId,
|
|
155
155
|
onChange: (e) => setStageId(e.target.value),
|
|
156
156
|
disabled: isLoading,
|
|
157
|
-
className: "
|
|
157
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
158
158
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
159
159
|
value: stage.id,
|
|
160
160
|
children: stage.name
|
|
@@ -166,7 +166,7 @@ function CreateDealModal({
|
|
|
166
166
|
children: [
|
|
167
167
|
/* @__PURE__ */ jsxDEV("label", {
|
|
168
168
|
htmlFor: "deal-close-date",
|
|
169
|
-
className: "
|
|
169
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
170
170
|
children: "Expected Close Date"
|
|
171
171
|
}, undefined, false, undefined, this),
|
|
172
172
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -179,7 +179,7 @@ function CreateDealModal({
|
|
|
179
179
|
]
|
|
180
180
|
}, undefined, true, undefined, this),
|
|
181
181
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
182
|
-
className: "bg-destructive/10
|
|
182
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
183
183
|
children: error
|
|
184
184
|
}, undefined, false, undefined, this),
|
|
185
185
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/modals/DealActionsModal.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Button } from "@contractspec/lib.design-system";
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
5
5
|
"use client";
|
|
6
6
|
function formatCurrency(value, currency) {
|
|
@@ -101,7 +101,7 @@ function DealActionsModal({
|
|
|
101
101
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
102
102
|
children: [
|
|
103
103
|
/* @__PURE__ */ jsxDEV("div", {
|
|
104
|
-
className: "bg-background/80
|
|
104
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
105
105
|
onClick: handleClose,
|
|
106
106
|
role: "button",
|
|
107
107
|
tabIndex: 0,
|
|
@@ -112,21 +112,21 @@ function DealActionsModal({
|
|
|
112
112
|
"aria-label": "Close modal"
|
|
113
113
|
}, undefined, false, undefined, this),
|
|
114
114
|
/* @__PURE__ */ jsxDEV("div", {
|
|
115
|
-
className: "
|
|
115
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
116
116
|
children: [
|
|
117
117
|
/* @__PURE__ */ jsxDEV("div", {
|
|
118
|
-
className: "
|
|
118
|
+
className: "mb-4 border-border border-b pb-4",
|
|
119
119
|
children: [
|
|
120
120
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
121
|
-
className: "text-xl
|
|
121
|
+
className: "font-semibold text-xl",
|
|
122
122
|
children: deal.name
|
|
123
123
|
}, undefined, false, undefined, this),
|
|
124
124
|
/* @__PURE__ */ jsxDEV("p", {
|
|
125
|
-
className: "
|
|
125
|
+
className: "font-medium text-lg text-primary",
|
|
126
126
|
children: formatCurrency(deal.value, deal.currency)
|
|
127
127
|
}, undefined, false, undefined, this),
|
|
128
128
|
/* @__PURE__ */ jsxDEV("span", {
|
|
129
|
-
className: `mt-2 inline-flex rounded-full px-2 py-0.5 text-xs
|
|
129
|
+
className: `mt-2 inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${deal.status === "WON" ? "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" : deal.status === "LOST" ? "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400" : "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"}`,
|
|
130
130
|
children: deal.status
|
|
131
131
|
}, undefined, false, undefined, this)
|
|
132
132
|
]
|
|
@@ -178,7 +178,7 @@ function DealActionsModal({
|
|
|
178
178
|
]
|
|
179
179
|
}, undefined, true, undefined, this),
|
|
180
180
|
deal.status !== "OPEN" && /* @__PURE__ */ jsxDEV("p", {
|
|
181
|
-
className: "
|
|
181
|
+
className: "py-4 text-center text-muted-foreground",
|
|
182
182
|
children: [
|
|
183
183
|
"This deal is already ",
|
|
184
184
|
deal.status.toLowerCase(),
|
|
@@ -203,14 +203,14 @@ function DealActionsModal({
|
|
|
203
203
|
children: [
|
|
204
204
|
/* @__PURE__ */ jsxDEV("label", {
|
|
205
205
|
htmlFor: "won-source",
|
|
206
|
-
className: "
|
|
206
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
207
207
|
children: "How did you win this deal?"
|
|
208
208
|
}, undefined, false, undefined, this),
|
|
209
209
|
/* @__PURE__ */ jsxDEV("select", {
|
|
210
210
|
id: "won-source",
|
|
211
211
|
value: wonSource,
|
|
212
212
|
onChange: (e) => setWonSource(e.target.value),
|
|
213
|
-
className: "
|
|
213
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
214
214
|
children: [
|
|
215
215
|
/* @__PURE__ */ jsxDEV("option", {
|
|
216
216
|
value: "",
|
|
@@ -244,7 +244,7 @@ function DealActionsModal({
|
|
|
244
244
|
children: [
|
|
245
245
|
/* @__PURE__ */ jsxDEV("label", {
|
|
246
246
|
htmlFor: "win-notes",
|
|
247
|
-
className: "
|
|
247
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
248
248
|
children: "Notes (optional)"
|
|
249
249
|
}, undefined, false, undefined, this),
|
|
250
250
|
/* @__PURE__ */ jsxDEV("textarea", {
|
|
@@ -253,12 +253,12 @@ function DealActionsModal({
|
|
|
253
253
|
onChange: (e) => setNotes(e.target.value),
|
|
254
254
|
placeholder: "Any additional notes about the win...",
|
|
255
255
|
rows: 3,
|
|
256
|
-
className: "
|
|
256
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
257
257
|
}, undefined, false, undefined, this)
|
|
258
258
|
]
|
|
259
259
|
}, undefined, true, undefined, this),
|
|
260
260
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
261
|
-
className: "bg-destructive/10
|
|
261
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
262
262
|
children: error
|
|
263
263
|
}, undefined, false, undefined, this),
|
|
264
264
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -286,14 +286,14 @@ function DealActionsModal({
|
|
|
286
286
|
children: [
|
|
287
287
|
/* @__PURE__ */ jsxDEV("label", {
|
|
288
288
|
htmlFor: "lost-reason",
|
|
289
|
-
className: "
|
|
289
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
290
290
|
children: "Why was this deal lost? *"
|
|
291
291
|
}, undefined, false, undefined, this),
|
|
292
292
|
/* @__PURE__ */ jsxDEV("select", {
|
|
293
293
|
id: "lost-reason",
|
|
294
294
|
value: lostReason,
|
|
295
295
|
onChange: (e) => setLostReason(e.target.value),
|
|
296
|
-
className: "
|
|
296
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
297
297
|
children: [
|
|
298
298
|
/* @__PURE__ */ jsxDEV("option", {
|
|
299
299
|
value: "",
|
|
@@ -335,7 +335,7 @@ function DealActionsModal({
|
|
|
335
335
|
children: [
|
|
336
336
|
/* @__PURE__ */ jsxDEV("label", {
|
|
337
337
|
htmlFor: "lose-notes",
|
|
338
|
-
className: "
|
|
338
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
339
339
|
children: "Notes (optional)"
|
|
340
340
|
}, undefined, false, undefined, this),
|
|
341
341
|
/* @__PURE__ */ jsxDEV("textarea", {
|
|
@@ -344,12 +344,12 @@ function DealActionsModal({
|
|
|
344
344
|
onChange: (e) => setNotes(e.target.value),
|
|
345
345
|
placeholder: "Any additional details...",
|
|
346
346
|
rows: 3,
|
|
347
|
-
className: "
|
|
347
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
348
348
|
}, undefined, false, undefined, this)
|
|
349
349
|
]
|
|
350
350
|
}, undefined, true, undefined, this),
|
|
351
351
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
352
|
-
className: "bg-destructive/10
|
|
352
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
353
353
|
children: error
|
|
354
354
|
}, undefined, false, undefined, this),
|
|
355
355
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -378,14 +378,14 @@ function DealActionsModal({
|
|
|
378
378
|
children: [
|
|
379
379
|
/* @__PURE__ */ jsxDEV("label", {
|
|
380
380
|
htmlFor: "move-stage",
|
|
381
|
-
className: "
|
|
381
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
382
382
|
children: "Move to Stage"
|
|
383
383
|
}, undefined, false, undefined, this),
|
|
384
384
|
/* @__PURE__ */ jsxDEV("select", {
|
|
385
385
|
id: "move-stage",
|
|
386
386
|
value: selectedStageId,
|
|
387
387
|
onChange: (e) => setSelectedStageId(e.target.value),
|
|
388
|
-
className: "
|
|
388
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
389
389
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
390
390
|
value: stage.id,
|
|
391
391
|
children: [
|
|
@@ -397,7 +397,7 @@ function DealActionsModal({
|
|
|
397
397
|
]
|
|
398
398
|
}, undefined, true, undefined, this),
|
|
399
399
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
400
|
-
className: "bg-destructive/10
|
|
400
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
401
401
|
children: error
|
|
402
402
|
}, undefined, false, undefined, this),
|
|
403
403
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/ui/modals/CreateDealModal.tsx
|
|
2
|
-
import { useState } from "react";
|
|
3
2
|
import { Button, Input } from "@contractspec/lib.design-system";
|
|
3
|
+
import { useState } from "react";
|
|
4
4
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
5
5
|
"use client";
|
|
6
6
|
var CURRENCIES = ["USD", "EUR", "GBP", "CAD"];
|
|
@@ -59,7 +59,7 @@ function CreateDealModal({
|
|
|
59
59
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
60
60
|
children: [
|
|
61
61
|
/* @__PURE__ */ jsxDEV("div", {
|
|
62
|
-
className: "bg-background/80
|
|
62
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
63
63
|
onClick: onClose,
|
|
64
64
|
role: "button",
|
|
65
65
|
tabIndex: 0,
|
|
@@ -70,10 +70,10 @@ function CreateDealModal({
|
|
|
70
70
|
"aria-label": "Close modal"
|
|
71
71
|
}, undefined, false, undefined, this),
|
|
72
72
|
/* @__PURE__ */ jsxDEV("div", {
|
|
73
|
-
className: "
|
|
73
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
74
74
|
children: [
|
|
75
75
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
76
|
-
className: "mb-4 text-xl
|
|
76
|
+
className: "mb-4 font-semibold text-xl",
|
|
77
77
|
children: "Create New Deal"
|
|
78
78
|
}, undefined, false, undefined, this),
|
|
79
79
|
/* @__PURE__ */ jsxDEV("form", {
|
|
@@ -84,7 +84,7 @@ function CreateDealModal({
|
|
|
84
84
|
children: [
|
|
85
85
|
/* @__PURE__ */ jsxDEV("label", {
|
|
86
86
|
htmlFor: "deal-name",
|
|
87
|
-
className: "
|
|
87
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
88
88
|
children: "Deal Name *"
|
|
89
89
|
}, undefined, false, undefined, this),
|
|
90
90
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -104,7 +104,7 @@ function CreateDealModal({
|
|
|
104
104
|
children: [
|
|
105
105
|
/* @__PURE__ */ jsxDEV("label", {
|
|
106
106
|
htmlFor: "deal-value",
|
|
107
|
-
className: "
|
|
107
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
108
108
|
children: "Value *"
|
|
109
109
|
}, undefined, false, undefined, this),
|
|
110
110
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -124,7 +124,7 @@ function CreateDealModal({
|
|
|
124
124
|
children: [
|
|
125
125
|
/* @__PURE__ */ jsxDEV("label", {
|
|
126
126
|
htmlFor: "deal-currency",
|
|
127
|
-
className: "
|
|
127
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
128
128
|
children: "Currency"
|
|
129
129
|
}, undefined, false, undefined, this),
|
|
130
130
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -132,7 +132,7 @@ function CreateDealModal({
|
|
|
132
132
|
value: currency,
|
|
133
133
|
onChange: (e) => setCurrency(e.target.value),
|
|
134
134
|
disabled: isLoading,
|
|
135
|
-
className: "
|
|
135
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
136
136
|
children: CURRENCIES.map((c) => /* @__PURE__ */ jsxDEV("option", {
|
|
137
137
|
value: c,
|
|
138
138
|
children: c
|
|
@@ -146,7 +146,7 @@ function CreateDealModal({
|
|
|
146
146
|
children: [
|
|
147
147
|
/* @__PURE__ */ jsxDEV("label", {
|
|
148
148
|
htmlFor: "deal-stage",
|
|
149
|
-
className: "
|
|
149
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
150
150
|
children: "Pipeline Stage *"
|
|
151
151
|
}, undefined, false, undefined, this),
|
|
152
152
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -154,7 +154,7 @@ function CreateDealModal({
|
|
|
154
154
|
value: stageId,
|
|
155
155
|
onChange: (e) => setStageId(e.target.value),
|
|
156
156
|
disabled: isLoading,
|
|
157
|
-
className: "
|
|
157
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring disabled:opacity-50",
|
|
158
158
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
159
159
|
value: stage.id,
|
|
160
160
|
children: stage.name
|
|
@@ -166,7 +166,7 @@ function CreateDealModal({
|
|
|
166
166
|
children: [
|
|
167
167
|
/* @__PURE__ */ jsxDEV("label", {
|
|
168
168
|
htmlFor: "deal-close-date",
|
|
169
|
-
className: "
|
|
169
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
170
170
|
children: "Expected Close Date"
|
|
171
171
|
}, undefined, false, undefined, this),
|
|
172
172
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -179,7 +179,7 @@ function CreateDealModal({
|
|
|
179
179
|
]
|
|
180
180
|
}, undefined, true, undefined, this),
|
|
181
181
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
182
|
-
className: "bg-destructive/10
|
|
182
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
183
183
|
children: error
|
|
184
184
|
}, undefined, false, undefined, this),
|
|
185
185
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -208,8 +208,8 @@ function CreateDealModal({
|
|
|
208
208
|
}
|
|
209
209
|
|
|
210
210
|
// src/ui/modals/DealActionsModal.tsx
|
|
211
|
-
import { useState as useState2 } from "react";
|
|
212
211
|
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
212
|
+
import { useState as useState2 } from "react";
|
|
213
213
|
import { jsxDEV as jsxDEV2, Fragment } from "react/jsx-dev-runtime";
|
|
214
214
|
"use client";
|
|
215
215
|
function formatCurrency(value, currency) {
|
|
@@ -310,7 +310,7 @@ function DealActionsModal({
|
|
|
310
310
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
311
311
|
children: [
|
|
312
312
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
313
|
-
className: "bg-background/80
|
|
313
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
314
314
|
onClick: handleClose,
|
|
315
315
|
role: "button",
|
|
316
316
|
tabIndex: 0,
|
|
@@ -321,21 +321,21 @@ function DealActionsModal({
|
|
|
321
321
|
"aria-label": "Close modal"
|
|
322
322
|
}, undefined, false, undefined, this),
|
|
323
323
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
324
|
-
className: "
|
|
324
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
325
325
|
children: [
|
|
326
326
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
327
|
-
className: "
|
|
327
|
+
className: "mb-4 border-border border-b pb-4",
|
|
328
328
|
children: [
|
|
329
329
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
330
|
-
className: "text-xl
|
|
330
|
+
className: "font-semibold text-xl",
|
|
331
331
|
children: deal.name
|
|
332
332
|
}, undefined, false, undefined, this),
|
|
333
333
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
334
|
-
className: "
|
|
334
|
+
className: "font-medium text-lg text-primary",
|
|
335
335
|
children: formatCurrency(deal.value, deal.currency)
|
|
336
336
|
}, undefined, false, undefined, this),
|
|
337
337
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
338
|
-
className: `mt-2 inline-flex rounded-full px-2 py-0.5 text-xs
|
|
338
|
+
className: `mt-2 inline-flex rounded-full px-2 py-0.5 font-medium text-xs ${deal.status === "WON" ? "bg-green-100 text-green-700 dark:bg-green-900/30 dark:text-green-400" : deal.status === "LOST" ? "bg-red-100 text-red-700 dark:bg-red-900/30 dark:text-red-400" : "bg-blue-100 text-blue-700 dark:bg-blue-900/30 dark:text-blue-400"}`,
|
|
339
339
|
children: deal.status
|
|
340
340
|
}, undefined, false, undefined, this)
|
|
341
341
|
]
|
|
@@ -387,7 +387,7 @@ function DealActionsModal({
|
|
|
387
387
|
]
|
|
388
388
|
}, undefined, true, undefined, this),
|
|
389
389
|
deal.status !== "OPEN" && /* @__PURE__ */ jsxDEV2("p", {
|
|
390
|
-
className: "
|
|
390
|
+
className: "py-4 text-center text-muted-foreground",
|
|
391
391
|
children: [
|
|
392
392
|
"This deal is already ",
|
|
393
393
|
deal.status.toLowerCase(),
|
|
@@ -412,14 +412,14 @@ function DealActionsModal({
|
|
|
412
412
|
children: [
|
|
413
413
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
414
414
|
htmlFor: "won-source",
|
|
415
|
-
className: "
|
|
415
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
416
416
|
children: "How did you win this deal?"
|
|
417
417
|
}, undefined, false, undefined, this),
|
|
418
418
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
419
419
|
id: "won-source",
|
|
420
420
|
value: wonSource,
|
|
421
421
|
onChange: (e) => setWonSource(e.target.value),
|
|
422
|
-
className: "
|
|
422
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
423
423
|
children: [
|
|
424
424
|
/* @__PURE__ */ jsxDEV2("option", {
|
|
425
425
|
value: "",
|
|
@@ -453,7 +453,7 @@ function DealActionsModal({
|
|
|
453
453
|
children: [
|
|
454
454
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
455
455
|
htmlFor: "win-notes",
|
|
456
|
-
className: "
|
|
456
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
457
457
|
children: "Notes (optional)"
|
|
458
458
|
}, undefined, false, undefined, this),
|
|
459
459
|
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
@@ -462,12 +462,12 @@ function DealActionsModal({
|
|
|
462
462
|
onChange: (e) => setNotes(e.target.value),
|
|
463
463
|
placeholder: "Any additional notes about the win...",
|
|
464
464
|
rows: 3,
|
|
465
|
-
className: "
|
|
465
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
466
466
|
}, undefined, false, undefined, this)
|
|
467
467
|
]
|
|
468
468
|
}, undefined, true, undefined, this),
|
|
469
469
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
470
|
-
className: "bg-destructive/10
|
|
470
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
471
471
|
children: error
|
|
472
472
|
}, undefined, false, undefined, this),
|
|
473
473
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -495,14 +495,14 @@ function DealActionsModal({
|
|
|
495
495
|
children: [
|
|
496
496
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
497
497
|
htmlFor: "lost-reason",
|
|
498
|
-
className: "
|
|
498
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
499
499
|
children: "Why was this deal lost? *"
|
|
500
500
|
}, undefined, false, undefined, this),
|
|
501
501
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
502
502
|
id: "lost-reason",
|
|
503
503
|
value: lostReason,
|
|
504
504
|
onChange: (e) => setLostReason(e.target.value),
|
|
505
|
-
className: "
|
|
505
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
506
506
|
children: [
|
|
507
507
|
/* @__PURE__ */ jsxDEV2("option", {
|
|
508
508
|
value: "",
|
|
@@ -544,7 +544,7 @@ function DealActionsModal({
|
|
|
544
544
|
children: [
|
|
545
545
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
546
546
|
htmlFor: "lose-notes",
|
|
547
|
-
className: "
|
|
547
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
548
548
|
children: "Notes (optional)"
|
|
549
549
|
}, undefined, false, undefined, this),
|
|
550
550
|
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
@@ -553,12 +553,12 @@ function DealActionsModal({
|
|
|
553
553
|
onChange: (e) => setNotes(e.target.value),
|
|
554
554
|
placeholder: "Any additional details...",
|
|
555
555
|
rows: 3,
|
|
556
|
-
className: "
|
|
556
|
+
className: "w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring"
|
|
557
557
|
}, undefined, false, undefined, this)
|
|
558
558
|
]
|
|
559
559
|
}, undefined, true, undefined, this),
|
|
560
560
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
561
|
-
className: "bg-destructive/10
|
|
561
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
562
562
|
children: error
|
|
563
563
|
}, undefined, false, undefined, this),
|
|
564
564
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -587,14 +587,14 @@ function DealActionsModal({
|
|
|
587
587
|
children: [
|
|
588
588
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
589
589
|
htmlFor: "move-stage",
|
|
590
|
-
className: "
|
|
590
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
591
591
|
children: "Move to Stage"
|
|
592
592
|
}, undefined, false, undefined, this),
|
|
593
593
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
594
594
|
id: "move-stage",
|
|
595
595
|
value: selectedStageId,
|
|
596
596
|
onChange: (e) => setSelectedStageId(e.target.value),
|
|
597
|
-
className: "
|
|
597
|
+
className: "h-10 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
598
598
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV2("option", {
|
|
599
599
|
value: stage.id,
|
|
600
600
|
children: [
|
|
@@ -606,7 +606,7 @@ function DealActionsModal({
|
|
|
606
606
|
]
|
|
607
607
|
}, undefined, true, undefined, this),
|
|
608
608
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
609
|
-
className: "bg-destructive/10
|
|
609
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
610
610
|
children: error
|
|
611
611
|
}, undefined, false, undefined, this),
|
|
612
612
|
/* @__PURE__ */ jsxDEV2("div", {
|