@contractspec/example.saas-boilerplate 3.8.9 → 3.8.11

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 (156) hide show
  1. package/.turbo/turbo-build.log +155 -155
  2. package/CHANGELOG.md +34 -0
  3. package/dist/billing/billing.entity.js +1 -113
  4. package/dist/billing/billing.enum.js +1 -19
  5. package/dist/billing/billing.event.js +1 -90
  6. package/dist/billing/billing.handler.js +1 -148
  7. package/dist/billing/billing.operations.js +1 -278
  8. package/dist/billing/billing.presentation.js +1 -55
  9. package/dist/billing/billing.schema.js +1 -121
  10. package/dist/billing/index.js +1 -691
  11. package/dist/browser/billing/billing.entity.js +1 -113
  12. package/dist/browser/billing/billing.enum.js +1 -19
  13. package/dist/browser/billing/billing.event.js +1 -90
  14. package/dist/browser/billing/billing.handler.js +1 -148
  15. package/dist/browser/billing/billing.operations.js +1 -278
  16. package/dist/browser/billing/billing.presentation.js +1 -55
  17. package/dist/browser/billing/billing.schema.js +1 -121
  18. package/dist/browser/billing/index.js +1 -691
  19. package/dist/browser/dashboard/dashboard.presentation.js +1 -55
  20. package/dist/browser/dashboard/index.js +1 -55
  21. package/dist/browser/docs/index.js +5 -49
  22. package/dist/browser/docs/saas-boilerplate.docblock.js +5 -49
  23. package/dist/browser/example.js +1 -39
  24. package/dist/browser/handlers/index.js +2 -358
  25. package/dist/browser/handlers/saas.handlers.js +2 -134
  26. package/dist/browser/index.js +9 -3591
  27. package/dist/browser/presentations/index.js +1 -299
  28. package/dist/browser/project/index.js +1 -793
  29. package/dist/browser/project/project.entity.js +1 -77
  30. package/dist/browser/project/project.enum.js +1 -18
  31. package/dist/browser/project/project.event.js +1 -103
  32. package/dist/browser/project/project.handler.js +1 -178
  33. package/dist/browser/project/project.operations.js +1 -372
  34. package/dist/browser/project/project.presentation.js +1 -180
  35. package/dist/browser/project/project.schema.js +1 -134
  36. package/dist/browser/saas-boilerplate.feature.js +1 -304
  37. package/dist/browser/seeders/index.js +2 -20
  38. package/dist/browser/settings/index.js +1 -75
  39. package/dist/browser/settings/settings.entity.js +1 -74
  40. package/dist/browser/settings/settings.enum.js +1 -11
  41. package/dist/browser/shared/mock-data.js +1 -104
  42. package/dist/browser/tests/operations.test-spec.js +1 -112
  43. package/dist/browser/ui/SaasDashboard.js +1 -1239
  44. package/dist/browser/ui/SaasDashboard.visualizations.js +1 -249
  45. package/dist/browser/ui/SaasProjectList.js +1 -162
  46. package/dist/browser/ui/SaasSettingsPanel.js +1 -145
  47. package/dist/browser/ui/hooks/index.js +1 -159
  48. package/dist/browser/ui/hooks/useProjectList.js +1 -66
  49. package/dist/browser/ui/hooks/useProjectMutations.js +1 -91
  50. package/dist/browser/ui/index.js +5 -2077
  51. package/dist/browser/ui/modals/CreateProjectModal.js +1 -153
  52. package/dist/browser/ui/modals/ProjectActionsModal.js +1 -335
  53. package/dist/browser/ui/modals/index.js +1 -487
  54. package/dist/browser/ui/overlays/demo-overlays.js +1 -61
  55. package/dist/browser/ui/overlays/index.js +1 -61
  56. package/dist/browser/ui/renderers/index.js +5 -901
  57. package/dist/browser/ui/renderers/project-list.markdown.js +5 -725
  58. package/dist/browser/ui/renderers/project-list.renderer.js +1 -177
  59. package/dist/browser/visualizations/catalog.js +1 -155
  60. package/dist/browser/visualizations/index.js +1 -217
  61. package/dist/browser/visualizations/selectors.js +1 -210
  62. package/dist/dashboard/dashboard.presentation.js +1 -55
  63. package/dist/dashboard/index.js +1 -55
  64. package/dist/docs/index.js +5 -49
  65. package/dist/docs/saas-boilerplate.docblock.js +5 -49
  66. package/dist/example.js +1 -39
  67. package/dist/handlers/index.js +2 -358
  68. package/dist/handlers/saas.handlers.js +2 -134
  69. package/dist/index.js +9 -3591
  70. package/dist/node/billing/billing.entity.js +1 -113
  71. package/dist/node/billing/billing.enum.js +1 -19
  72. package/dist/node/billing/billing.event.js +1 -90
  73. package/dist/node/billing/billing.handler.js +1 -148
  74. package/dist/node/billing/billing.operations.js +1 -278
  75. package/dist/node/billing/billing.presentation.js +1 -55
  76. package/dist/node/billing/billing.schema.js +1 -121
  77. package/dist/node/billing/index.js +1 -691
  78. package/dist/node/dashboard/dashboard.presentation.js +1 -55
  79. package/dist/node/dashboard/index.js +1 -55
  80. package/dist/node/docs/index.js +5 -49
  81. package/dist/node/docs/saas-boilerplate.docblock.js +5 -49
  82. package/dist/node/example.js +1 -39
  83. package/dist/node/handlers/index.js +2 -358
  84. package/dist/node/handlers/saas.handlers.js +2 -134
  85. package/dist/node/index.js +9 -3591
  86. package/dist/node/presentations/index.js +1 -299
  87. package/dist/node/project/index.js +1 -793
  88. package/dist/node/project/project.entity.js +1 -77
  89. package/dist/node/project/project.enum.js +1 -18
  90. package/dist/node/project/project.event.js +1 -103
  91. package/dist/node/project/project.handler.js +1 -178
  92. package/dist/node/project/project.operations.js +1 -372
  93. package/dist/node/project/project.presentation.js +1 -180
  94. package/dist/node/project/project.schema.js +1 -134
  95. package/dist/node/saas-boilerplate.feature.js +1 -304
  96. package/dist/node/seeders/index.js +2 -20
  97. package/dist/node/settings/index.js +1 -75
  98. package/dist/node/settings/settings.entity.js +1 -74
  99. package/dist/node/settings/settings.enum.js +1 -11
  100. package/dist/node/shared/mock-data.js +1 -104
  101. package/dist/node/tests/operations.test-spec.js +1 -112
  102. package/dist/node/ui/SaasDashboard.js +1 -1239
  103. package/dist/node/ui/SaasDashboard.visualizations.js +1 -249
  104. package/dist/node/ui/SaasProjectList.js +1 -162
  105. package/dist/node/ui/SaasSettingsPanel.js +1 -145
  106. package/dist/node/ui/hooks/index.js +1 -159
  107. package/dist/node/ui/hooks/useProjectList.js +1 -66
  108. package/dist/node/ui/hooks/useProjectMutations.js +1 -91
  109. package/dist/node/ui/index.js +5 -2077
  110. package/dist/node/ui/modals/CreateProjectModal.js +1 -153
  111. package/dist/node/ui/modals/ProjectActionsModal.js +1 -335
  112. package/dist/node/ui/modals/index.js +1 -487
  113. package/dist/node/ui/overlays/demo-overlays.js +1 -61
  114. package/dist/node/ui/overlays/index.js +1 -61
  115. package/dist/node/ui/renderers/index.js +5 -901
  116. package/dist/node/ui/renderers/project-list.markdown.js +5 -725
  117. package/dist/node/ui/renderers/project-list.renderer.js +1 -177
  118. package/dist/node/visualizations/catalog.js +1 -155
  119. package/dist/node/visualizations/index.js +1 -217
  120. package/dist/node/visualizations/selectors.js +1 -210
  121. package/dist/presentations/index.js +1 -299
  122. package/dist/project/index.js +1 -793
  123. package/dist/project/project.entity.js +1 -77
  124. package/dist/project/project.enum.js +1 -18
  125. package/dist/project/project.event.js +1 -103
  126. package/dist/project/project.handler.js +1 -178
  127. package/dist/project/project.operations.js +1 -372
  128. package/dist/project/project.presentation.js +1 -180
  129. package/dist/project/project.schema.js +1 -134
  130. package/dist/saas-boilerplate.feature.js +1 -304
  131. package/dist/seeders/index.js +2 -20
  132. package/dist/settings/index.js +1 -75
  133. package/dist/settings/settings.entity.js +1 -74
  134. package/dist/settings/settings.enum.js +1 -11
  135. package/dist/shared/mock-data.js +1 -104
  136. package/dist/tests/operations.test-spec.js +1 -112
  137. package/dist/ui/SaasDashboard.js +1 -1239
  138. package/dist/ui/SaasDashboard.visualizations.js +1 -249
  139. package/dist/ui/SaasProjectList.js +1 -162
  140. package/dist/ui/SaasSettingsPanel.js +1 -145
  141. package/dist/ui/hooks/index.js +1 -159
  142. package/dist/ui/hooks/useProjectList.js +1 -66
  143. package/dist/ui/hooks/useProjectMutations.js +1 -91
  144. package/dist/ui/index.js +5 -2077
  145. package/dist/ui/modals/CreateProjectModal.js +1 -153
  146. package/dist/ui/modals/ProjectActionsModal.js +1 -335
  147. package/dist/ui/modals/index.js +1 -487
  148. package/dist/ui/overlays/demo-overlays.js +1 -61
  149. package/dist/ui/overlays/index.js +1 -61
  150. package/dist/ui/renderers/index.js +5 -901
  151. package/dist/ui/renderers/project-list.markdown.js +5 -725
  152. package/dist/ui/renderers/project-list.renderer.js +1 -177
  153. package/dist/visualizations/catalog.js +1 -155
  154. package/dist/visualizations/index.js +1 -217
  155. package/dist/visualizations/selectors.js +1 -210
  156. package/package.json +12 -12
@@ -1,488 +1,2 @@
1
1
  // @bun
2
- // src/ui/modals/CreateProjectModal.tsx
3
- import { Button, Input } from "@contractspec/lib.design-system";
4
- import { useState } from "react";
5
- import { jsxDEV } from "react/jsx-dev-runtime";
6
- "use client";
7
- var TIERS = [
8
- { value: "FREE", label: "Free" },
9
- { value: "PRO", label: "Pro" },
10
- { value: "ENTERPRISE", label: "Enterprise" }
11
- ];
12
- function CreateProjectModal({
13
- isOpen,
14
- onClose,
15
- onSubmit,
16
- isLoading = false
17
- }) {
18
- const [name, setName] = useState("");
19
- const [description, setDescription] = useState("");
20
- const [tier, setTier] = useState("FREE");
21
- const [error, setError] = useState(null);
22
- const handleSubmit = async (e) => {
23
- e.preventDefault();
24
- setError(null);
25
- if (!name.trim()) {
26
- setError("Project name is required");
27
- return;
28
- }
29
- try {
30
- await onSubmit({
31
- name: name.trim(),
32
- description: description.trim() || undefined,
33
- tier
34
- });
35
- setName("");
36
- setDescription("");
37
- setTier("FREE");
38
- onClose();
39
- } catch (err) {
40
- setError(err instanceof Error ? err.message : "Failed to create project");
41
- }
42
- };
43
- if (!isOpen)
44
- return null;
45
- return /* @__PURE__ */ jsxDEV("div", {
46
- className: "fixed inset-0 z-50 flex items-center justify-center",
47
- children: [
48
- /* @__PURE__ */ jsxDEV("div", {
49
- className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
50
- onClick: onClose,
51
- role: "button",
52
- tabIndex: 0,
53
- onKeyDown: (e) => {
54
- if (e.key === "Enter" || e.key === " ")
55
- onClose();
56
- },
57
- "aria-label": "Close modal"
58
- }, undefined, false, undefined, this),
59
- /* @__PURE__ */ jsxDEV("div", {
60
- className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
61
- children: [
62
- /* @__PURE__ */ jsxDEV("h2", {
63
- className: "mb-4 font-semibold text-xl",
64
- children: "Create New Project"
65
- }, undefined, false, undefined, this),
66
- /* @__PURE__ */ jsxDEV("form", {
67
- onSubmit: handleSubmit,
68
- className: "space-y-4",
69
- children: [
70
- /* @__PURE__ */ jsxDEV("div", {
71
- children: [
72
- /* @__PURE__ */ jsxDEV("label", {
73
- htmlFor: "project-name",
74
- className: "mb-1 block font-medium text-muted-foreground text-sm",
75
- children: "Project Name *"
76
- }, undefined, false, undefined, this),
77
- /* @__PURE__ */ jsxDEV(Input, {
78
- id: "project-name",
79
- value: name,
80
- onChange: (e) => setName(e.target.value),
81
- placeholder: "e.g., My Awesome Project",
82
- disabled: isLoading
83
- }, undefined, false, undefined, this)
84
- ]
85
- }, undefined, true, undefined, this),
86
- /* @__PURE__ */ jsxDEV("div", {
87
- children: [
88
- /* @__PURE__ */ jsxDEV("label", {
89
- htmlFor: "project-description",
90
- className: "mb-1 block font-medium text-muted-foreground text-sm",
91
- children: "Description"
92
- }, undefined, false, undefined, this),
93
- /* @__PURE__ */ jsxDEV("textarea", {
94
- id: "project-description",
95
- value: description,
96
- onChange: (e) => setDescription(e.target.value),
97
- placeholder: "Describe what this project is about...",
98
- rows: 3,
99
- disabled: isLoading,
100
- 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 disabled:opacity-50"
101
- }, undefined, false, undefined, this)
102
- ]
103
- }, undefined, true, undefined, this),
104
- /* @__PURE__ */ jsxDEV("div", {
105
- children: [
106
- /* @__PURE__ */ jsxDEV("label", {
107
- htmlFor: "project-tier",
108
- className: "mb-1 block font-medium text-muted-foreground text-sm",
109
- children: "Tier"
110
- }, undefined, false, undefined, this),
111
- /* @__PURE__ */ jsxDEV("select", {
112
- id: "project-tier",
113
- value: tier,
114
- onChange: (e) => setTier(e.target.value),
115
- disabled: isLoading,
116
- 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",
117
- children: TIERS.map((t) => /* @__PURE__ */ jsxDEV("option", {
118
- value: t.value,
119
- children: t.label
120
- }, t.value, false, undefined, this))
121
- }, undefined, false, undefined, this)
122
- ]
123
- }, undefined, true, undefined, this),
124
- error && /* @__PURE__ */ jsxDEV("div", {
125
- className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
126
- children: error
127
- }, undefined, false, undefined, this),
128
- /* @__PURE__ */ jsxDEV("div", {
129
- className: "flex justify-end gap-3 pt-2",
130
- children: [
131
- /* @__PURE__ */ jsxDEV(Button, {
132
- type: "button",
133
- variant: "ghost",
134
- onPress: onClose,
135
- disabled: isLoading,
136
- children: "Cancel"
137
- }, undefined, false, undefined, this),
138
- /* @__PURE__ */ jsxDEV(Button, {
139
- type: "submit",
140
- disabled: isLoading,
141
- children: isLoading ? "Creating..." : "Create Project"
142
- }, undefined, false, undefined, this)
143
- ]
144
- }, undefined, true, undefined, this)
145
- ]
146
- }, undefined, true, undefined, this)
147
- ]
148
- }, undefined, true, undefined, this)
149
- ]
150
- }, undefined, true, undefined, this);
151
- }
152
-
153
- // src/ui/modals/ProjectActionsModal.tsx
154
- import { Button as Button2, Input as Input2 } from "@contractspec/lib.design-system";
155
- import { useEffect, useState as useState2 } from "react";
156
- import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
157
- "use client";
158
- function ProjectActionsModal({
159
- isOpen,
160
- project,
161
- onClose,
162
- onUpdate,
163
- onArchive,
164
- onActivate,
165
- onDelete,
166
- isLoading = false
167
- }) {
168
- const [mode, setMode] = useState2("menu");
169
- const [name, setName] = useState2("");
170
- const [description, setDescription] = useState2("");
171
- const [error, setError] = useState2(null);
172
- const resetForm = () => {
173
- setMode("menu");
174
- setError(null);
175
- if (project) {
176
- setName(project.name);
177
- setDescription(project.description ?? "");
178
- }
179
- };
180
- const handleClose = () => {
181
- resetForm();
182
- onClose();
183
- };
184
- useEffect(() => {
185
- if (project) {
186
- setName(project.name);
187
- setDescription(project.description ?? "");
188
- }
189
- }, [project]);
190
- const handleEdit = async () => {
191
- if (!project)
192
- return;
193
- setError(null);
194
- if (!name.trim()) {
195
- setError("Project name is required");
196
- return;
197
- }
198
- try {
199
- await onUpdate({
200
- id: project.id,
201
- name: name.trim(),
202
- description: description.trim() || undefined
203
- });
204
- handleClose();
205
- } catch (err) {
206
- setError(err instanceof Error ? err.message : "Failed to update project");
207
- }
208
- };
209
- const handleArchive = async () => {
210
- if (!project)
211
- return;
212
- setError(null);
213
- try {
214
- await onArchive(project.id);
215
- handleClose();
216
- } catch (err) {
217
- setError(err instanceof Error ? err.message : "Failed to archive project");
218
- }
219
- };
220
- const handleActivate = async () => {
221
- if (!project)
222
- return;
223
- setError(null);
224
- try {
225
- await onActivate(project.id);
226
- handleClose();
227
- } catch (err) {
228
- setError(err instanceof Error ? err.message : "Failed to activate project");
229
- }
230
- };
231
- const handleDelete = async () => {
232
- if (!project)
233
- return;
234
- setError(null);
235
- try {
236
- await onDelete(project.id);
237
- handleClose();
238
- } catch (err) {
239
- setError(err instanceof Error ? err.message : "Failed to delete project");
240
- }
241
- };
242
- if (!isOpen || !project)
243
- return null;
244
- return /* @__PURE__ */ jsxDEV2("div", {
245
- className: "fixed inset-0 z-50 flex items-center justify-center",
246
- children: [
247
- /* @__PURE__ */ jsxDEV2("div", {
248
- className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
249
- onClick: handleClose,
250
- role: "button",
251
- tabIndex: 0,
252
- onKeyDown: (e) => {
253
- if (e.key === "Enter" || e.key === " ")
254
- handleClose();
255
- },
256
- "aria-label": "Close modal"
257
- }, undefined, false, undefined, this),
258
- /* @__PURE__ */ jsxDEV2("div", {
259
- className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
260
- children: [
261
- /* @__PURE__ */ jsxDEV2("div", {
262
- className: "mb-4 border-border border-b pb-4",
263
- children: [
264
- /* @__PURE__ */ jsxDEV2("h2", {
265
- className: "font-semibold text-xl",
266
- children: project.name
267
- }, undefined, false, undefined, this),
268
- /* @__PURE__ */ jsxDEV2("p", {
269
- className: "text-muted-foreground text-sm",
270
- children: [
271
- project.tier,
272
- " \xB7 ",
273
- project.status
274
- ]
275
- }, undefined, true, undefined, this)
276
- ]
277
- }, undefined, true, undefined, this),
278
- mode === "menu" && /* @__PURE__ */ jsxDEV2("div", {
279
- className: "space-y-3",
280
- children: [
281
- /* @__PURE__ */ jsxDEV2(Button2, {
282
- className: "w-full justify-start",
283
- variant: "ghost",
284
- onPress: () => setMode("edit"),
285
- children: [
286
- /* @__PURE__ */ jsxDEV2("span", {
287
- className: "mr-2",
288
- children: "\u270F\uFE0F"
289
- }, undefined, false, undefined, this),
290
- " Edit Project"
291
- ]
292
- }, undefined, true, undefined, this),
293
- project.status === "ACTIVE" || project.status === "DRAFT" ? /* @__PURE__ */ jsxDEV2(Button2, {
294
- className: "w-full justify-start",
295
- variant: "ghost",
296
- onPress: () => setMode("archive"),
297
- children: [
298
- /* @__PURE__ */ jsxDEV2("span", {
299
- className: "mr-2",
300
- children: "\uD83D\uDCE6"
301
- }, undefined, false, undefined, this),
302
- " Archive Project"
303
- ]
304
- }, undefined, true, undefined, this) : project.status === "ARCHIVED" ? /* @__PURE__ */ jsxDEV2(Button2, {
305
- className: "w-full justify-start",
306
- variant: "ghost",
307
- onPress: handleActivate,
308
- disabled: isLoading,
309
- children: [
310
- /* @__PURE__ */ jsxDEV2("span", {
311
- className: "mr-2",
312
- children: "\uD83D\uDD04"
313
- }, undefined, false, undefined, this),
314
- " Restore Project"
315
- ]
316
- }, undefined, true, undefined, this) : null,
317
- /* @__PURE__ */ jsxDEV2(Button2, {
318
- className: "w-full justify-start text-red-500 hover:text-red-600",
319
- variant: "ghost",
320
- onPress: () => setMode("delete"),
321
- children: [
322
- /* @__PURE__ */ jsxDEV2("span", {
323
- className: "mr-2",
324
- children: "\uD83D\uDDD1\uFE0F"
325
- }, undefined, false, undefined, this),
326
- " Delete Project"
327
- ]
328
- }, undefined, true, undefined, this),
329
- /* @__PURE__ */ jsxDEV2("div", {
330
- className: "border-border border-t pt-3",
331
- children: /* @__PURE__ */ jsxDEV2(Button2, {
332
- className: "w-full",
333
- variant: "outline",
334
- onPress: handleClose,
335
- children: "Close"
336
- }, undefined, false, undefined, this)
337
- }, undefined, false, undefined, this)
338
- ]
339
- }, undefined, true, undefined, this),
340
- mode === "edit" && /* @__PURE__ */ jsxDEV2("div", {
341
- className: "space-y-4",
342
- children: [
343
- /* @__PURE__ */ jsxDEV2("div", {
344
- children: [
345
- /* @__PURE__ */ jsxDEV2("label", {
346
- htmlFor: "edit-name",
347
- className: "mb-1 block font-medium text-muted-foreground text-sm",
348
- children: "Project Name *"
349
- }, undefined, false, undefined, this),
350
- /* @__PURE__ */ jsxDEV2(Input2, {
351
- id: "edit-name",
352
- value: name,
353
- onChange: (e) => setName(e.target.value),
354
- disabled: isLoading
355
- }, undefined, false, undefined, this)
356
- ]
357
- }, undefined, true, undefined, this),
358
- /* @__PURE__ */ jsxDEV2("div", {
359
- children: [
360
- /* @__PURE__ */ jsxDEV2("label", {
361
- htmlFor: "edit-description",
362
- className: "mb-1 block font-medium text-muted-foreground text-sm",
363
- children: "Description"
364
- }, undefined, false, undefined, this),
365
- /* @__PURE__ */ jsxDEV2("textarea", {
366
- id: "edit-description",
367
- value: description,
368
- onChange: (e) => setDescription(e.target.value),
369
- rows: 3,
370
- disabled: isLoading,
371
- 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 disabled:opacity-50"
372
- }, undefined, false, undefined, this)
373
- ]
374
- }, undefined, true, undefined, this),
375
- error && /* @__PURE__ */ jsxDEV2("div", {
376
- className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
377
- children: error
378
- }, undefined, false, undefined, this),
379
- /* @__PURE__ */ jsxDEV2("div", {
380
- className: "flex justify-end gap-3 pt-2",
381
- children: [
382
- /* @__PURE__ */ jsxDEV2(Button2, {
383
- variant: "ghost",
384
- onPress: () => setMode("menu"),
385
- disabled: isLoading,
386
- children: "Back"
387
- }, undefined, false, undefined, this),
388
- /* @__PURE__ */ jsxDEV2(Button2, {
389
- onPress: handleEdit,
390
- disabled: isLoading,
391
- children: isLoading ? "Saving..." : "Save Changes"
392
- }, undefined, false, undefined, this)
393
- ]
394
- }, undefined, true, undefined, this)
395
- ]
396
- }, undefined, true, undefined, this),
397
- mode === "archive" && /* @__PURE__ */ jsxDEV2("div", {
398
- className: "space-y-4",
399
- children: [
400
- /* @__PURE__ */ jsxDEV2("p", {
401
- className: "text-muted-foreground",
402
- children: [
403
- "Are you sure you want to archive",
404
- " ",
405
- /* @__PURE__ */ jsxDEV2("span", {
406
- className: "font-medium text-foreground",
407
- children: project.name
408
- }, undefined, false, undefined, this),
409
- "?"
410
- ]
411
- }, undefined, true, undefined, this),
412
- /* @__PURE__ */ jsxDEV2("p", {
413
- className: "text-muted-foreground text-sm",
414
- children: "Archived projects can be restored later."
415
- }, undefined, false, undefined, this),
416
- error && /* @__PURE__ */ jsxDEV2("div", {
417
- className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
418
- children: error
419
- }, undefined, false, undefined, this),
420
- /* @__PURE__ */ jsxDEV2("div", {
421
- className: "flex justify-end gap-3 pt-2",
422
- children: [
423
- /* @__PURE__ */ jsxDEV2(Button2, {
424
- variant: "ghost",
425
- onPress: () => setMode("menu"),
426
- disabled: isLoading,
427
- children: "Cancel"
428
- }, undefined, false, undefined, this),
429
- /* @__PURE__ */ jsxDEV2(Button2, {
430
- onPress: handleArchive,
431
- disabled: isLoading,
432
- children: isLoading ? "Archiving..." : "\uD83D\uDCE6 Archive"
433
- }, undefined, false, undefined, this)
434
- ]
435
- }, undefined, true, undefined, this)
436
- ]
437
- }, undefined, true, undefined, this),
438
- mode === "delete" && /* @__PURE__ */ jsxDEV2("div", {
439
- className: "space-y-4",
440
- children: [
441
- /* @__PURE__ */ jsxDEV2("p", {
442
- className: "text-muted-foreground",
443
- children: [
444
- "Are you sure you want to delete",
445
- " ",
446
- /* @__PURE__ */ jsxDEV2("span", {
447
- className: "font-medium text-foreground",
448
- children: project.name
449
- }, undefined, false, undefined, this),
450
- "?"
451
- ]
452
- }, undefined, true, undefined, this),
453
- /* @__PURE__ */ jsxDEV2("p", {
454
- className: "text-destructive text-sm",
455
- children: "This action cannot be undone."
456
- }, undefined, false, undefined, this),
457
- error && /* @__PURE__ */ jsxDEV2("div", {
458
- className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
459
- children: error
460
- }, undefined, false, undefined, this),
461
- /* @__PURE__ */ jsxDEV2("div", {
462
- className: "flex justify-end gap-3 pt-2",
463
- children: [
464
- /* @__PURE__ */ jsxDEV2(Button2, {
465
- variant: "ghost",
466
- onPress: () => setMode("menu"),
467
- disabled: isLoading,
468
- children: "Cancel"
469
- }, undefined, false, undefined, this),
470
- /* @__PURE__ */ jsxDEV2(Button2, {
471
- variant: "destructive",
472
- onPress: handleDelete,
473
- disabled: isLoading,
474
- children: isLoading ? "Deleting..." : "\uD83D\uDDD1\uFE0F Delete"
475
- }, undefined, false, undefined, this)
476
- ]
477
- }, undefined, true, undefined, this)
478
- ]
479
- }, undefined, true, undefined, this)
480
- ]
481
- }, undefined, true, undefined, this)
482
- ]
483
- }, undefined, true, undefined, this);
484
- }
485
- export {
486
- ProjectActionsModal,
487
- CreateProjectModal
488
- };
2
+ import{Button as f,Input as S}from"@contractspec/lib.design-system";import{useState as I}from"react";import{jsx as W,jsxs as V}from"react/jsx-runtime";var B=[{value:"FREE",label:"Free"},{value:"PRO",label:"Pro"},{value:"ENTERPRISE",label:"Enterprise"}];function h({isOpen:T,onClose:q,onSubmit:b,isLoading:$=!1}){let[F,R]=I(""),[U,Q]=I(""),[w,Y]=I("FREE"),[k,z]=I(null),y=async(K)=>{if(K.preventDefault(),z(null),!F.trim()){z("Project name is required");return}try{await b({name:F.trim(),description:U.trim()||void 0,tier:w}),R(""),Q(""),Y("FREE"),q()}catch(_){z(_ instanceof Error?_.message:"Failed to create project")}};if(!T)return null;return V("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[W("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:q,role:"button",tabIndex:0,onKeyDown:(K)=>{if(K.key==="Enter"||K.key===" ")q()},"aria-label":"Close modal"}),V("div",{className:"relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",children:[W("h2",{className:"mb-4 font-semibold text-xl",children:"Create New Project"}),V("form",{onSubmit:y,className:"space-y-4",children:[V("div",{children:[W("label",{htmlFor:"project-name",className:"mb-1 block font-medium text-muted-foreground text-sm",children:"Project Name *"}),W(S,{id:"project-name",value:F,onChange:(K)=>R(K.target.value),placeholder:"e.g., My Awesome Project",disabled:$})]}),V("div",{children:[W("label",{htmlFor:"project-description",className:"mb-1 block font-medium text-muted-foreground text-sm",children:"Description"}),W("textarea",{id:"project-description",value:U,onChange:(K)=>Q(K.target.value),placeholder:"Describe what this project is about...",rows:3,disabled:$,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 disabled:opacity-50"})]}),V("div",{children:[W("label",{htmlFor:"project-tier",className:"mb-1 block font-medium text-muted-foreground text-sm",children:"Tier"}),W("select",{id:"project-tier",value:w,onChange:(K)=>Y(K.target.value),disabled:$,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",children:B.map((K)=>W("option",{value:K.value,children:K.label},K.value))})]}),k&&W("div",{className:"rounded-md bg-destructive/10 p-3 text-destructive text-sm",children:k}),V("div",{className:"flex justify-end gap-3 pt-2",children:[W(f,{type:"button",variant:"ghost",onPress:q,disabled:$,children:"Cancel"}),W(f,{type:"submit",disabled:$,children:$?"Creating...":"Create Project"})]})]})]})]})}import{Button as X,Input as C}from"@contractspec/lib.design-system";import{useEffect as E,useState as O}from"react";import{jsx as G,jsxs as J}from"react/jsx-runtime";function m({isOpen:T,project:q,onClose:b,onUpdate:$,onArchive:F,onActivate:R,onDelete:U,isLoading:Q=!1}){let[w,Y]=O("menu"),[k,z]=O(""),[y,K]=O(""),[_,Z]=O(null),N=()=>{if(Y("menu"),Z(null),q)z(q.name),K(q.description??"")},H=()=>{N(),b()};E(()=>{if(q)z(q.name),K(q.description??"")},[q]);let v=async()=>{if(!q)return;if(Z(null),!k.trim()){Z("Project name is required");return}try{await $({id:q.id,name:k.trim(),description:y.trim()||void 0}),H()}catch(P){Z(P instanceof Error?P.message:"Failed to update project")}},A=async()=>{if(!q)return;Z(null);try{await F(q.id),H()}catch(P){Z(P instanceof Error?P.message:"Failed to archive project")}},D=async()=>{if(!q)return;Z(null);try{await R(q.id),H()}catch(P){Z(P instanceof Error?P.message:"Failed to activate project")}},M=async()=>{if(!q)return;Z(null);try{await U(q.id),H()}catch(P){Z(P instanceof Error?P.message:"Failed to delete project")}};if(!T||!q)return null;return J("div",{className:"fixed inset-0 z-50 flex items-center justify-center",children:[G("div",{className:"absolute inset-0 bg-background/80 backdrop-blur-sm",onClick:H,role:"button",tabIndex:0,onKeyDown:(P)=>{if(P.key==="Enter"||P.key===" ")H()},"aria-label":"Close modal"}),J("div",{className:"relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",children:[J("div",{className:"mb-4 border-border border-b pb-4",children:[G("h2",{className:"font-semibold text-xl",children:q.name}),J("p",{className:"text-muted-foreground text-sm",children:[q.tier," \xB7 ",q.status]})]}),w==="menu"&&J("div",{className:"space-y-3",children:[J(X,{className:"w-full justify-start",variant:"ghost",onPress:()=>Y("edit"),children:[G("span",{className:"mr-2",children:"\u270F\uFE0F"})," Edit Project"]}),q.status==="ACTIVE"||q.status==="DRAFT"?J(X,{className:"w-full justify-start",variant:"ghost",onPress:()=>Y("archive"),children:[G("span",{className:"mr-2",children:"\uD83D\uDCE6"})," Archive Project"]}):q.status==="ARCHIVED"?J(X,{className:"w-full justify-start",variant:"ghost",onPress:D,disabled:Q,children:[G("span",{className:"mr-2",children:"\uD83D\uDD04"})," Restore Project"]}):null,J(X,{className:"w-full justify-start text-red-500 hover:text-red-600",variant:"ghost",onPress:()=>Y("delete"),children:[G("span",{className:"mr-2",children:"\uD83D\uDDD1\uFE0F"})," Delete Project"]}),G("div",{className:"border-border border-t pt-3",children:G(X,{className:"w-full",variant:"outline",onPress:H,children:"Close"})})]}),w==="edit"&&J("div",{className:"space-y-4",children:[J("div",{children:[G("label",{htmlFor:"edit-name",className:"mb-1 block font-medium text-muted-foreground text-sm",children:"Project Name *"}),G(C,{id:"edit-name",value:k,onChange:(P)=>z(P.target.value),disabled:Q})]}),J("div",{children:[G("label",{htmlFor:"edit-description",className:"mb-1 block font-medium text-muted-foreground text-sm",children:"Description"}),G("textarea",{id:"edit-description",value:y,onChange:(P)=>K(P.target.value),rows:3,disabled:Q,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 disabled:opacity-50"})]}),_&&G("div",{className:"rounded-md bg-destructive/10 p-3 text-destructive text-sm",children:_}),J("div",{className:"flex justify-end gap-3 pt-2",children:[G(X,{variant:"ghost",onPress:()=>Y("menu"),disabled:Q,children:"Back"}),G(X,{onPress:v,disabled:Q,children:Q?"Saving...":"Save Changes"})]})]}),w==="archive"&&J("div",{className:"space-y-4",children:[J("p",{className:"text-muted-foreground",children:["Are you sure you want to archive"," ",G("span",{className:"font-medium text-foreground",children:q.name}),"?"]}),G("p",{className:"text-muted-foreground text-sm",children:"Archived projects can be restored later."}),_&&G("div",{className:"rounded-md bg-destructive/10 p-3 text-destructive text-sm",children:_}),J("div",{className:"flex justify-end gap-3 pt-2",children:[G(X,{variant:"ghost",onPress:()=>Y("menu"),disabled:Q,children:"Cancel"}),G(X,{onPress:A,disabled:Q,children:Q?"Archiving...":"\uD83D\uDCE6 Archive"})]})]}),w==="delete"&&J("div",{className:"space-y-4",children:[J("p",{className:"text-muted-foreground",children:["Are you sure you want to delete"," ",G("span",{className:"font-medium text-foreground",children:q.name}),"?"]}),G("p",{className:"text-destructive text-sm",children:"This action cannot be undone."}),_&&G("div",{className:"rounded-md bg-destructive/10 p-3 text-destructive text-sm",children:_}),J("div",{className:"flex justify-end gap-3 pt-2",children:[G(X,{variant:"ghost",onPress:()=>Y("menu"),disabled:Q,children:"Cancel"}),G(X,{variant:"destructive",onPress:M,disabled:Q,children:Q?"Deleting...":"\uD83D\uDDD1\uFE0F Delete"})]})]})]})]})}export{m as ProjectActionsModal,h as CreateProjectModal};
@@ -1,62 +1,2 @@
1
1
  // @bun
2
- // src/ui/overlays/demo-overlays.ts
3
- var saasFreeUserOverlay = {
4
- overlayId: "saas-boilerplate.free-tier",
5
- version: "1.0.0",
6
- description: "Shows limitations for free tier users",
7
- appliesTo: {
8
- feature: "saas-boilerplate",
9
- tier: "free"
10
- },
11
- modifications: [
12
- {
13
- type: "setLimit",
14
- field: "projects",
15
- max: 3,
16
- message: "Upgrade to create more projects"
17
- },
18
- { type: "hideField", field: "advancedSettings", reason: "Pro feature" },
19
- {
20
- type: "addBadge",
21
- position: "header",
22
- label: "Free Plan",
23
- variant: "default"
24
- }
25
- ]
26
- };
27
- var saasDemoOverlay = {
28
- overlayId: "saas-boilerplate.demo-user",
29
- version: "1.0.0",
30
- description: "Demo mode for SaaS boilerplate",
31
- appliesTo: {
32
- feature: "saas-boilerplate",
33
- role: "demo"
34
- },
35
- modifications: [
36
- {
37
- type: "hideField",
38
- field: "billingSection",
39
- reason: "Demo users cannot access billing"
40
- },
41
- {
42
- type: "hideField",
43
- field: "deleteAccount",
44
- reason: "Not available in demo"
45
- },
46
- {
47
- type: "addBadge",
48
- position: "header",
49
- label: "Demo Mode",
50
- variant: "warning"
51
- }
52
- ]
53
- };
54
- var saasOverlays = [
55
- saasFreeUserOverlay,
56
- saasDemoOverlay
57
- ];
58
- export {
59
- saasOverlays,
60
- saasFreeUserOverlay,
61
- saasDemoOverlay
62
- };
2
+ var c={overlayId:"saas-boilerplate.free-tier",version:"1.0.0",description:"Shows limitations for free tier users",appliesTo:{feature:"saas-boilerplate",tier:"free"},modifications:[{type:"setLimit",field:"projects",max:3,message:"Upgrade to create more projects"},{type:"hideField",field:"advancedSettings",reason:"Pro feature"},{type:"addBadge",position:"header",label:"Free Plan",variant:"default"}]},d={overlayId:"saas-boilerplate.demo-user",version:"1.0.0",description:"Demo mode for SaaS boilerplate",appliesTo:{feature:"saas-boilerplate",role:"demo"},modifications:[{type:"hideField",field:"billingSection",reason:"Demo users cannot access billing"},{type:"hideField",field:"deleteAccount",reason:"Not available in demo"},{type:"addBadge",position:"header",label:"Demo Mode",variant:"warning"}]},g=[c,d];export{g as saasOverlays,c as saasFreeUserOverlay,d as saasDemoOverlay};
@@ -1,62 +1,2 @@
1
1
  // @bun
2
- // src/ui/overlays/demo-overlays.ts
3
- var saasFreeUserOverlay = {
4
- overlayId: "saas-boilerplate.free-tier",
5
- version: "1.0.0",
6
- description: "Shows limitations for free tier users",
7
- appliesTo: {
8
- feature: "saas-boilerplate",
9
- tier: "free"
10
- },
11
- modifications: [
12
- {
13
- type: "setLimit",
14
- field: "projects",
15
- max: 3,
16
- message: "Upgrade to create more projects"
17
- },
18
- { type: "hideField", field: "advancedSettings", reason: "Pro feature" },
19
- {
20
- type: "addBadge",
21
- position: "header",
22
- label: "Free Plan",
23
- variant: "default"
24
- }
25
- ]
26
- };
27
- var saasDemoOverlay = {
28
- overlayId: "saas-boilerplate.demo-user",
29
- version: "1.0.0",
30
- description: "Demo mode for SaaS boilerplate",
31
- appliesTo: {
32
- feature: "saas-boilerplate",
33
- role: "demo"
34
- },
35
- modifications: [
36
- {
37
- type: "hideField",
38
- field: "billingSection",
39
- reason: "Demo users cannot access billing"
40
- },
41
- {
42
- type: "hideField",
43
- field: "deleteAccount",
44
- reason: "Not available in demo"
45
- },
46
- {
47
- type: "addBadge",
48
- position: "header",
49
- label: "Demo Mode",
50
- variant: "warning"
51
- }
52
- ]
53
- };
54
- var saasOverlays = [
55
- saasFreeUserOverlay,
56
- saasDemoOverlay
57
- ];
58
- export {
59
- saasOverlays,
60
- saasFreeUserOverlay,
61
- saasDemoOverlay
62
- };
2
+ var x={overlayId:"saas-boilerplate.free-tier",version:"1.0.0",description:"Shows limitations for free tier users",appliesTo:{feature:"saas-boilerplate",tier:"free"},modifications:[{type:"setLimit",field:"projects",max:3,message:"Upgrade to create more projects"},{type:"hideField",field:"advancedSettings",reason:"Pro feature"},{type:"addBadge",position:"header",label:"Free Plan",variant:"default"}]},c={overlayId:"saas-boilerplate.demo-user",version:"1.0.0",description:"Demo mode for SaaS boilerplate",appliesTo:{feature:"saas-boilerplate",role:"demo"},modifications:[{type:"hideField",field:"billingSection",reason:"Demo users cannot access billing"},{type:"hideField",field:"deleteAccount",reason:"Not available in demo"},{type:"addBadge",position:"header",label:"Demo Mode",variant:"warning"}]},d=[x,c];export{d as saasOverlays,x as saasFreeUserOverlay,c as saasDemoOverlay};