@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,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/modals/CreateDealModal.tsx
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { Button, Input } from "@contractspec/lib.design-system";
|
|
4
|
+
import { useState } from "react";
|
|
5
5
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
6
6
|
"use client";
|
|
7
7
|
var CURRENCIES = ["USD", "EUR", "GBP", "CAD"];
|
|
@@ -60,7 +60,7 @@ function CreateDealModal({
|
|
|
60
60
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ jsxDEV("div", {
|
|
63
|
-
className: "bg-background/80
|
|
63
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
64
64
|
onClick: onClose,
|
|
65
65
|
role: "button",
|
|
66
66
|
tabIndex: 0,
|
|
@@ -71,10 +71,10 @@ function CreateDealModal({
|
|
|
71
71
|
"aria-label": "Close modal"
|
|
72
72
|
}, undefined, false, undefined, this),
|
|
73
73
|
/* @__PURE__ */ jsxDEV("div", {
|
|
74
|
-
className: "
|
|
74
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
77
|
-
className: "mb-4 text-xl
|
|
77
|
+
className: "mb-4 font-semibold text-xl",
|
|
78
78
|
children: "Create New Deal"
|
|
79
79
|
}, undefined, false, undefined, this),
|
|
80
80
|
/* @__PURE__ */ jsxDEV("form", {
|
|
@@ -85,7 +85,7 @@ function CreateDealModal({
|
|
|
85
85
|
children: [
|
|
86
86
|
/* @__PURE__ */ jsxDEV("label", {
|
|
87
87
|
htmlFor: "deal-name",
|
|
88
|
-
className: "
|
|
88
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
89
89
|
children: "Deal Name *"
|
|
90
90
|
}, undefined, false, undefined, this),
|
|
91
91
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -105,7 +105,7 @@ function CreateDealModal({
|
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ jsxDEV("label", {
|
|
107
107
|
htmlFor: "deal-value",
|
|
108
|
-
className: "
|
|
108
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
109
109
|
children: "Value *"
|
|
110
110
|
}, undefined, false, undefined, this),
|
|
111
111
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -125,7 +125,7 @@ function CreateDealModal({
|
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ jsxDEV("label", {
|
|
127
127
|
htmlFor: "deal-currency",
|
|
128
|
-
className: "
|
|
128
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
129
129
|
children: "Currency"
|
|
130
130
|
}, undefined, false, undefined, this),
|
|
131
131
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -133,7 +133,7 @@ function CreateDealModal({
|
|
|
133
133
|
value: currency,
|
|
134
134
|
onChange: (e) => setCurrency(e.target.value),
|
|
135
135
|
disabled: isLoading,
|
|
136
|
-
className: "
|
|
136
|
+
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",
|
|
137
137
|
children: CURRENCIES.map((c) => /* @__PURE__ */ jsxDEV("option", {
|
|
138
138
|
value: c,
|
|
139
139
|
children: c
|
|
@@ -147,7 +147,7 @@ function CreateDealModal({
|
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ jsxDEV("label", {
|
|
149
149
|
htmlFor: "deal-stage",
|
|
150
|
-
className: "
|
|
150
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
151
151
|
children: "Pipeline Stage *"
|
|
152
152
|
}, undefined, false, undefined, this),
|
|
153
153
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -155,7 +155,7 @@ function CreateDealModal({
|
|
|
155
155
|
value: stageId,
|
|
156
156
|
onChange: (e) => setStageId(e.target.value),
|
|
157
157
|
disabled: isLoading,
|
|
158
|
-
className: "
|
|
158
|
+
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",
|
|
159
159
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
160
160
|
value: stage.id,
|
|
161
161
|
children: stage.name
|
|
@@ -167,7 +167,7 @@ function CreateDealModal({
|
|
|
167
167
|
children: [
|
|
168
168
|
/* @__PURE__ */ jsxDEV("label", {
|
|
169
169
|
htmlFor: "deal-close-date",
|
|
170
|
-
className: "
|
|
170
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
171
171
|
children: "Expected Close Date"
|
|
172
172
|
}, undefined, false, undefined, this),
|
|
173
173
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -180,7 +180,7 @@ function CreateDealModal({
|
|
|
180
180
|
]
|
|
181
181
|
}, undefined, true, undefined, this),
|
|
182
182
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
183
|
-
className: "bg-destructive/10
|
|
183
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
184
184
|
children: error
|
|
185
185
|
}, undefined, false, undefined, this),
|
|
186
186
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/modals/DealActionsModal.tsx
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { Button } from "@contractspec/lib.design-system";
|
|
4
|
+
import { useState } from "react";
|
|
5
5
|
import { jsxDEV, Fragment } from "react/jsx-dev-runtime";
|
|
6
6
|
"use client";
|
|
7
7
|
function formatCurrency(value, currency) {
|
|
@@ -102,7 +102,7 @@ function DealActionsModal({
|
|
|
102
102
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
103
103
|
children: [
|
|
104
104
|
/* @__PURE__ */ jsxDEV("div", {
|
|
105
|
-
className: "bg-background/80
|
|
105
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
106
106
|
onClick: handleClose,
|
|
107
107
|
role: "button",
|
|
108
108
|
tabIndex: 0,
|
|
@@ -113,21 +113,21 @@ function DealActionsModal({
|
|
|
113
113
|
"aria-label": "Close modal"
|
|
114
114
|
}, undefined, false, undefined, this),
|
|
115
115
|
/* @__PURE__ */ jsxDEV("div", {
|
|
116
|
-
className: "
|
|
116
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
117
117
|
children: [
|
|
118
118
|
/* @__PURE__ */ jsxDEV("div", {
|
|
119
|
-
className: "
|
|
119
|
+
className: "mb-4 border-border border-b pb-4",
|
|
120
120
|
children: [
|
|
121
121
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
122
|
-
className: "text-xl
|
|
122
|
+
className: "font-semibold text-xl",
|
|
123
123
|
children: deal.name
|
|
124
124
|
}, undefined, false, undefined, this),
|
|
125
125
|
/* @__PURE__ */ jsxDEV("p", {
|
|
126
|
-
className: "
|
|
126
|
+
className: "font-medium text-lg text-primary",
|
|
127
127
|
children: formatCurrency(deal.value, deal.currency)
|
|
128
128
|
}, undefined, false, undefined, this),
|
|
129
129
|
/* @__PURE__ */ jsxDEV("span", {
|
|
130
|
-
className: `mt-2 inline-flex rounded-full px-2 py-0.5 text-xs
|
|
130
|
+
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"}`,
|
|
131
131
|
children: deal.status
|
|
132
132
|
}, undefined, false, undefined, this)
|
|
133
133
|
]
|
|
@@ -179,7 +179,7 @@ function DealActionsModal({
|
|
|
179
179
|
]
|
|
180
180
|
}, undefined, true, undefined, this),
|
|
181
181
|
deal.status !== "OPEN" && /* @__PURE__ */ jsxDEV("p", {
|
|
182
|
-
className: "
|
|
182
|
+
className: "py-4 text-center text-muted-foreground",
|
|
183
183
|
children: [
|
|
184
184
|
"This deal is already ",
|
|
185
185
|
deal.status.toLowerCase(),
|
|
@@ -204,14 +204,14 @@ function DealActionsModal({
|
|
|
204
204
|
children: [
|
|
205
205
|
/* @__PURE__ */ jsxDEV("label", {
|
|
206
206
|
htmlFor: "won-source",
|
|
207
|
-
className: "
|
|
207
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
208
208
|
children: "How did you win this deal?"
|
|
209
209
|
}, undefined, false, undefined, this),
|
|
210
210
|
/* @__PURE__ */ jsxDEV("select", {
|
|
211
211
|
id: "won-source",
|
|
212
212
|
value: wonSource,
|
|
213
213
|
onChange: (e) => setWonSource(e.target.value),
|
|
214
|
-
className: "
|
|
214
|
+
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",
|
|
215
215
|
children: [
|
|
216
216
|
/* @__PURE__ */ jsxDEV("option", {
|
|
217
217
|
value: "",
|
|
@@ -245,7 +245,7 @@ function DealActionsModal({
|
|
|
245
245
|
children: [
|
|
246
246
|
/* @__PURE__ */ jsxDEV("label", {
|
|
247
247
|
htmlFor: "win-notes",
|
|
248
|
-
className: "
|
|
248
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
249
249
|
children: "Notes (optional)"
|
|
250
250
|
}, undefined, false, undefined, this),
|
|
251
251
|
/* @__PURE__ */ jsxDEV("textarea", {
|
|
@@ -254,12 +254,12 @@ function DealActionsModal({
|
|
|
254
254
|
onChange: (e) => setNotes(e.target.value),
|
|
255
255
|
placeholder: "Any additional notes about the win...",
|
|
256
256
|
rows: 3,
|
|
257
|
-
className: "
|
|
257
|
+
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"
|
|
258
258
|
}, undefined, false, undefined, this)
|
|
259
259
|
]
|
|
260
260
|
}, undefined, true, undefined, this),
|
|
261
261
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
262
|
-
className: "bg-destructive/10
|
|
262
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
263
263
|
children: error
|
|
264
264
|
}, undefined, false, undefined, this),
|
|
265
265
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -287,14 +287,14 @@ function DealActionsModal({
|
|
|
287
287
|
children: [
|
|
288
288
|
/* @__PURE__ */ jsxDEV("label", {
|
|
289
289
|
htmlFor: "lost-reason",
|
|
290
|
-
className: "
|
|
290
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
291
291
|
children: "Why was this deal lost? *"
|
|
292
292
|
}, undefined, false, undefined, this),
|
|
293
293
|
/* @__PURE__ */ jsxDEV("select", {
|
|
294
294
|
id: "lost-reason",
|
|
295
295
|
value: lostReason,
|
|
296
296
|
onChange: (e) => setLostReason(e.target.value),
|
|
297
|
-
className: "
|
|
297
|
+
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",
|
|
298
298
|
children: [
|
|
299
299
|
/* @__PURE__ */ jsxDEV("option", {
|
|
300
300
|
value: "",
|
|
@@ -336,7 +336,7 @@ function DealActionsModal({
|
|
|
336
336
|
children: [
|
|
337
337
|
/* @__PURE__ */ jsxDEV("label", {
|
|
338
338
|
htmlFor: "lose-notes",
|
|
339
|
-
className: "
|
|
339
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
340
340
|
children: "Notes (optional)"
|
|
341
341
|
}, undefined, false, undefined, this),
|
|
342
342
|
/* @__PURE__ */ jsxDEV("textarea", {
|
|
@@ -345,12 +345,12 @@ function DealActionsModal({
|
|
|
345
345
|
onChange: (e) => setNotes(e.target.value),
|
|
346
346
|
placeholder: "Any additional details...",
|
|
347
347
|
rows: 3,
|
|
348
|
-
className: "
|
|
348
|
+
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"
|
|
349
349
|
}, undefined, false, undefined, this)
|
|
350
350
|
]
|
|
351
351
|
}, undefined, true, undefined, this),
|
|
352
352
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
353
|
-
className: "bg-destructive/10
|
|
353
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
354
354
|
children: error
|
|
355
355
|
}, undefined, false, undefined, this),
|
|
356
356
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -379,14 +379,14 @@ function DealActionsModal({
|
|
|
379
379
|
children: [
|
|
380
380
|
/* @__PURE__ */ jsxDEV("label", {
|
|
381
381
|
htmlFor: "move-stage",
|
|
382
|
-
className: "
|
|
382
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
383
383
|
children: "Move to Stage"
|
|
384
384
|
}, undefined, false, undefined, this),
|
|
385
385
|
/* @__PURE__ */ jsxDEV("select", {
|
|
386
386
|
id: "move-stage",
|
|
387
387
|
value: selectedStageId,
|
|
388
388
|
onChange: (e) => setSelectedStageId(e.target.value),
|
|
389
|
-
className: "
|
|
389
|
+
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",
|
|
390
390
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
391
391
|
value: stage.id,
|
|
392
392
|
children: [
|
|
@@ -398,7 +398,7 @@ function DealActionsModal({
|
|
|
398
398
|
]
|
|
399
399
|
}, undefined, true, undefined, this),
|
|
400
400
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
401
|
-
className: "bg-destructive/10
|
|
401
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
402
402
|
children: error
|
|
403
403
|
}, undefined, false, undefined, this),
|
|
404
404
|
/* @__PURE__ */ jsxDEV("div", {
|
package/dist/ui/modals/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/modals/CreateDealModal.tsx
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { Button, Input } from "@contractspec/lib.design-system";
|
|
4
|
+
import { useState } from "react";
|
|
5
5
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
6
6
|
"use client";
|
|
7
7
|
var CURRENCIES = ["USD", "EUR", "GBP", "CAD"];
|
|
@@ -60,7 +60,7 @@ function CreateDealModal({
|
|
|
60
60
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
61
61
|
children: [
|
|
62
62
|
/* @__PURE__ */ jsxDEV("div", {
|
|
63
|
-
className: "bg-background/80
|
|
63
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
64
64
|
onClick: onClose,
|
|
65
65
|
role: "button",
|
|
66
66
|
tabIndex: 0,
|
|
@@ -71,10 +71,10 @@ function CreateDealModal({
|
|
|
71
71
|
"aria-label": "Close modal"
|
|
72
72
|
}, undefined, false, undefined, this),
|
|
73
73
|
/* @__PURE__ */ jsxDEV("div", {
|
|
74
|
-
className: "
|
|
74
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
75
75
|
children: [
|
|
76
76
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
77
|
-
className: "mb-4 text-xl
|
|
77
|
+
className: "mb-4 font-semibold text-xl",
|
|
78
78
|
children: "Create New Deal"
|
|
79
79
|
}, undefined, false, undefined, this),
|
|
80
80
|
/* @__PURE__ */ jsxDEV("form", {
|
|
@@ -85,7 +85,7 @@ function CreateDealModal({
|
|
|
85
85
|
children: [
|
|
86
86
|
/* @__PURE__ */ jsxDEV("label", {
|
|
87
87
|
htmlFor: "deal-name",
|
|
88
|
-
className: "
|
|
88
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
89
89
|
children: "Deal Name *"
|
|
90
90
|
}, undefined, false, undefined, this),
|
|
91
91
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -105,7 +105,7 @@ function CreateDealModal({
|
|
|
105
105
|
children: [
|
|
106
106
|
/* @__PURE__ */ jsxDEV("label", {
|
|
107
107
|
htmlFor: "deal-value",
|
|
108
|
-
className: "
|
|
108
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
109
109
|
children: "Value *"
|
|
110
110
|
}, undefined, false, undefined, this),
|
|
111
111
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -125,7 +125,7 @@ function CreateDealModal({
|
|
|
125
125
|
children: [
|
|
126
126
|
/* @__PURE__ */ jsxDEV("label", {
|
|
127
127
|
htmlFor: "deal-currency",
|
|
128
|
-
className: "
|
|
128
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
129
129
|
children: "Currency"
|
|
130
130
|
}, undefined, false, undefined, this),
|
|
131
131
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -133,7 +133,7 @@ function CreateDealModal({
|
|
|
133
133
|
value: currency,
|
|
134
134
|
onChange: (e) => setCurrency(e.target.value),
|
|
135
135
|
disabled: isLoading,
|
|
136
|
-
className: "
|
|
136
|
+
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",
|
|
137
137
|
children: CURRENCIES.map((c) => /* @__PURE__ */ jsxDEV("option", {
|
|
138
138
|
value: c,
|
|
139
139
|
children: c
|
|
@@ -147,7 +147,7 @@ function CreateDealModal({
|
|
|
147
147
|
children: [
|
|
148
148
|
/* @__PURE__ */ jsxDEV("label", {
|
|
149
149
|
htmlFor: "deal-stage",
|
|
150
|
-
className: "
|
|
150
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
151
151
|
children: "Pipeline Stage *"
|
|
152
152
|
}, undefined, false, undefined, this),
|
|
153
153
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -155,7 +155,7 @@ function CreateDealModal({
|
|
|
155
155
|
value: stageId,
|
|
156
156
|
onChange: (e) => setStageId(e.target.value),
|
|
157
157
|
disabled: isLoading,
|
|
158
|
-
className: "
|
|
158
|
+
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",
|
|
159
159
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV("option", {
|
|
160
160
|
value: stage.id,
|
|
161
161
|
children: stage.name
|
|
@@ -167,7 +167,7 @@ function CreateDealModal({
|
|
|
167
167
|
children: [
|
|
168
168
|
/* @__PURE__ */ jsxDEV("label", {
|
|
169
169
|
htmlFor: "deal-close-date",
|
|
170
|
-
className: "
|
|
170
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
171
171
|
children: "Expected Close Date"
|
|
172
172
|
}, undefined, false, undefined, this),
|
|
173
173
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -180,7 +180,7 @@ function CreateDealModal({
|
|
|
180
180
|
]
|
|
181
181
|
}, undefined, true, undefined, this),
|
|
182
182
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
183
|
-
className: "bg-destructive/10
|
|
183
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
184
184
|
children: error
|
|
185
185
|
}, undefined, false, undefined, this),
|
|
186
186
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -209,8 +209,8 @@ function CreateDealModal({
|
|
|
209
209
|
}
|
|
210
210
|
|
|
211
211
|
// src/ui/modals/DealActionsModal.tsx
|
|
212
|
-
import { useState as useState2 } from "react";
|
|
213
212
|
import { Button as Button2 } from "@contractspec/lib.design-system";
|
|
213
|
+
import { useState as useState2 } from "react";
|
|
214
214
|
import { jsxDEV as jsxDEV2, Fragment } from "react/jsx-dev-runtime";
|
|
215
215
|
"use client";
|
|
216
216
|
function formatCurrency(value, currency) {
|
|
@@ -311,7 +311,7 @@ function DealActionsModal({
|
|
|
311
311
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
312
312
|
children: [
|
|
313
313
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
314
|
-
className: "bg-background/80
|
|
314
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
315
315
|
onClick: handleClose,
|
|
316
316
|
role: "button",
|
|
317
317
|
tabIndex: 0,
|
|
@@ -322,21 +322,21 @@ function DealActionsModal({
|
|
|
322
322
|
"aria-label": "Close modal"
|
|
323
323
|
}, undefined, false, undefined, this),
|
|
324
324
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
325
|
-
className: "
|
|
325
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
326
326
|
children: [
|
|
327
327
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
328
|
-
className: "
|
|
328
|
+
className: "mb-4 border-border border-b pb-4",
|
|
329
329
|
children: [
|
|
330
330
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
331
|
-
className: "text-xl
|
|
331
|
+
className: "font-semibold text-xl",
|
|
332
332
|
children: deal.name
|
|
333
333
|
}, undefined, false, undefined, this),
|
|
334
334
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
335
|
-
className: "
|
|
335
|
+
className: "font-medium text-lg text-primary",
|
|
336
336
|
children: formatCurrency(deal.value, deal.currency)
|
|
337
337
|
}, undefined, false, undefined, this),
|
|
338
338
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
339
|
-
className: `mt-2 inline-flex rounded-full px-2 py-0.5 text-xs
|
|
339
|
+
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"}`,
|
|
340
340
|
children: deal.status
|
|
341
341
|
}, undefined, false, undefined, this)
|
|
342
342
|
]
|
|
@@ -388,7 +388,7 @@ function DealActionsModal({
|
|
|
388
388
|
]
|
|
389
389
|
}, undefined, true, undefined, this),
|
|
390
390
|
deal.status !== "OPEN" && /* @__PURE__ */ jsxDEV2("p", {
|
|
391
|
-
className: "
|
|
391
|
+
className: "py-4 text-center text-muted-foreground",
|
|
392
392
|
children: [
|
|
393
393
|
"This deal is already ",
|
|
394
394
|
deal.status.toLowerCase(),
|
|
@@ -413,14 +413,14 @@ function DealActionsModal({
|
|
|
413
413
|
children: [
|
|
414
414
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
415
415
|
htmlFor: "won-source",
|
|
416
|
-
className: "
|
|
416
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
417
417
|
children: "How did you win this deal?"
|
|
418
418
|
}, undefined, false, undefined, this),
|
|
419
419
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
420
420
|
id: "won-source",
|
|
421
421
|
value: wonSource,
|
|
422
422
|
onChange: (e) => setWonSource(e.target.value),
|
|
423
|
-
className: "
|
|
423
|
+
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",
|
|
424
424
|
children: [
|
|
425
425
|
/* @__PURE__ */ jsxDEV2("option", {
|
|
426
426
|
value: "",
|
|
@@ -454,7 +454,7 @@ function DealActionsModal({
|
|
|
454
454
|
children: [
|
|
455
455
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
456
456
|
htmlFor: "win-notes",
|
|
457
|
-
className: "
|
|
457
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
458
458
|
children: "Notes (optional)"
|
|
459
459
|
}, undefined, false, undefined, this),
|
|
460
460
|
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
@@ -463,12 +463,12 @@ function DealActionsModal({
|
|
|
463
463
|
onChange: (e) => setNotes(e.target.value),
|
|
464
464
|
placeholder: "Any additional notes about the win...",
|
|
465
465
|
rows: 3,
|
|
466
|
-
className: "
|
|
466
|
+
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"
|
|
467
467
|
}, undefined, false, undefined, this)
|
|
468
468
|
]
|
|
469
469
|
}, undefined, true, undefined, this),
|
|
470
470
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
471
|
-
className: "bg-destructive/10
|
|
471
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
472
472
|
children: error
|
|
473
473
|
}, undefined, false, undefined, this),
|
|
474
474
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -496,14 +496,14 @@ function DealActionsModal({
|
|
|
496
496
|
children: [
|
|
497
497
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
498
498
|
htmlFor: "lost-reason",
|
|
499
|
-
className: "
|
|
499
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
500
500
|
children: "Why was this deal lost? *"
|
|
501
501
|
}, undefined, false, undefined, this),
|
|
502
502
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
503
503
|
id: "lost-reason",
|
|
504
504
|
value: lostReason,
|
|
505
505
|
onChange: (e) => setLostReason(e.target.value),
|
|
506
|
-
className: "
|
|
506
|
+
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",
|
|
507
507
|
children: [
|
|
508
508
|
/* @__PURE__ */ jsxDEV2("option", {
|
|
509
509
|
value: "",
|
|
@@ -545,7 +545,7 @@ function DealActionsModal({
|
|
|
545
545
|
children: [
|
|
546
546
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
547
547
|
htmlFor: "lose-notes",
|
|
548
|
-
className: "
|
|
548
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
549
549
|
children: "Notes (optional)"
|
|
550
550
|
}, undefined, false, undefined, this),
|
|
551
551
|
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
@@ -554,12 +554,12 @@ function DealActionsModal({
|
|
|
554
554
|
onChange: (e) => setNotes(e.target.value),
|
|
555
555
|
placeholder: "Any additional details...",
|
|
556
556
|
rows: 3,
|
|
557
|
-
className: "
|
|
557
|
+
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"
|
|
558
558
|
}, undefined, false, undefined, this)
|
|
559
559
|
]
|
|
560
560
|
}, undefined, true, undefined, this),
|
|
561
561
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
562
|
-
className: "bg-destructive/10
|
|
562
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
563
563
|
children: error
|
|
564
564
|
}, undefined, false, undefined, this),
|
|
565
565
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -588,14 +588,14 @@ function DealActionsModal({
|
|
|
588
588
|
children: [
|
|
589
589
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
590
590
|
htmlFor: "move-stage",
|
|
591
|
-
className: "
|
|
591
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
592
592
|
children: "Move to Stage"
|
|
593
593
|
}, undefined, false, undefined, this),
|
|
594
594
|
/* @__PURE__ */ jsxDEV2("select", {
|
|
595
595
|
id: "move-stage",
|
|
596
596
|
value: selectedStageId,
|
|
597
597
|
onChange: (e) => setSelectedStageId(e.target.value),
|
|
598
|
-
className: "
|
|
598
|
+
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",
|
|
599
599
|
children: stages.map((stage) => /* @__PURE__ */ jsxDEV2("option", {
|
|
600
600
|
value: stage.id,
|
|
601
601
|
children: [
|
|
@@ -607,7 +607,7 @@ function DealActionsModal({
|
|
|
607
607
|
]
|
|
608
608
|
}, undefined, true, undefined, this),
|
|
609
609
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
610
|
-
className: "bg-destructive/10
|
|
610
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
611
611
|
children: error
|
|
612
612
|
}, undefined, false, undefined, this),
|
|
613
613
|
/* @__PURE__ */ jsxDEV2("div", {
|