@contractspec/example.saas-boilerplate 3.7.5 → 3.7.7
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 +8 -8
- package/AGENTS.md +50 -27
- package/CHANGELOG.md +16 -0
- package/README.md +64 -144
- package/dist/billing/billing.event.js +1 -1
- package/dist/billing/index.d.ts +6 -6
- package/dist/billing/index.js +1 -1
- package/dist/browser/billing/billing.event.js +1 -1
- package/dist/browser/billing/index.js +1 -1
- package/dist/browser/index.js +931 -932
- package/dist/browser/project/index.js +209 -209
- package/dist/browser/project/project.event.js +1 -1
- package/dist/browser/ui/SaasDashboard.js +45 -45
- package/dist/browser/ui/SaasProjectList.js +7 -7
- package/dist/browser/ui/SaasSettingsPanel.js +12 -12
- package/dist/browser/ui/hooks/index.js +2 -2
- package/dist/browser/ui/hooks/useProjectList.js +1 -1
- package/dist/browser/ui/hooks/useProjectMutations.js +1 -1
- package/dist/browser/ui/index.js +483 -484
- package/dist/browser/ui/modals/CreateProjectModal.js +10 -10
- package/dist/browser/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/browser/ui/modals/index.js +23 -23
- package/dist/browser/ui/renderers/index.js +112 -112
- package/dist/browser/ui/renderers/project-list.renderer.js +7 -7
- package/dist/handlers/index.d.ts +2 -2
- package/dist/index.d.ts +4 -4
- package/dist/index.js +931 -932
- package/dist/node/billing/billing.event.js +1 -1
- package/dist/node/billing/index.js +1 -1
- package/dist/node/index.js +931 -932
- package/dist/node/project/index.js +209 -209
- package/dist/node/project/project.event.js +1 -1
- package/dist/node/ui/SaasDashboard.js +45 -45
- package/dist/node/ui/SaasProjectList.js +7 -7
- package/dist/node/ui/SaasSettingsPanel.js +12 -12
- package/dist/node/ui/hooks/index.js +2 -2
- package/dist/node/ui/hooks/useProjectList.js +1 -1
- package/dist/node/ui/hooks/useProjectMutations.js +1 -1
- package/dist/node/ui/index.js +483 -484
- package/dist/node/ui/modals/CreateProjectModal.js +10 -10
- package/dist/node/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/node/ui/modals/index.js +23 -23
- package/dist/node/ui/renderers/index.js +112 -112
- package/dist/node/ui/renderers/project-list.renderer.js +7 -7
- package/dist/presentations/index.d.ts +1 -1
- package/dist/project/index.d.ts +7 -7
- package/dist/project/index.js +209 -209
- package/dist/project/project.event.js +1 -1
- package/dist/settings/index.d.ts +1 -1
- package/dist/ui/SaasDashboard.js +45 -45
- package/dist/ui/SaasProjectList.js +7 -7
- package/dist/ui/SaasSettingsPanel.js +12 -12
- package/dist/ui/hooks/index.d.ts +2 -2
- package/dist/ui/hooks/index.js +2 -2
- package/dist/ui/hooks/useProjectList.d.ts +5 -0
- package/dist/ui/hooks/useProjectList.js +1 -1
- package/dist/ui/hooks/useProjectMutations.d.ts +8 -0
- package/dist/ui/hooks/useProjectMutations.js +1 -1
- package/dist/ui/index.d.ts +4 -4
- package/dist/ui/index.js +483 -484
- package/dist/ui/modals/CreateProjectModal.js +10 -10
- package/dist/ui/modals/ProjectActionsModal.js +13 -13
- package/dist/ui/modals/index.js +23 -23
- package/dist/ui/renderers/index.d.ts +1 -1
- package/dist/ui/renderers/index.js +112 -112
- package/dist/ui/renderers/project-list.renderer.d.ts +1 -1
- package/dist/ui/renderers/project-list.renderer.js +7 -7
- package/package.json +14 -14
- package/src/billing/billing.entity.ts +132 -132
- package/src/billing/billing.enum.ts +9 -9
- package/src/billing/billing.event.ts +71 -71
- package/src/billing/billing.handler.ts +87 -87
- package/src/billing/billing.operations.ts +158 -158
- package/src/billing/billing.presentation.ts +45 -45
- package/src/billing/billing.schema.ts +76 -76
- package/src/billing/index.ts +43 -48
- package/src/dashboard/dashboard.presentation.ts +45 -45
- package/src/dashboard/index.ts +2 -2
- package/src/docs/saas-boilerplate.docblock.ts +43 -43
- package/src/example.ts +32 -32
- package/src/handlers/index.ts +9 -9
- package/src/handlers/saas.handlers.ts +250 -249
- package/src/index.ts +40 -41
- package/src/presentations/index.ts +18 -20
- package/src/project/index.ts +45 -50
- package/src/project/project.entity.ts +68 -68
- package/src/project/project.enum.ts +8 -8
- package/src/project/project.event.ts +79 -79
- package/src/project/project.handler.ts +103 -103
- package/src/project/project.operations.ts +236 -236
- package/src/project/project.presentation.ts +46 -46
- package/src/project/project.schema.ts +90 -90
- package/src/saas-boilerplate.feature.ts +100 -100
- package/src/seeders/index.ts +20 -20
- package/src/settings/index.ts +2 -3
- package/src/settings/settings.entity.ts +65 -65
- package/src/settings/settings.enum.ts +4 -4
- package/src/shared/mock-data.ts +92 -92
- package/src/shared/overlay-types.ts +23 -23
- package/src/tests/operations.test-spec.ts +96 -96
- package/src/ui/SaasDashboard.tsx +270 -270
- package/src/ui/SaasProjectList.tsx +90 -90
- package/src/ui/SaasSettingsPanel.tsx +84 -84
- package/src/ui/hooks/index.ts +3 -3
- package/src/ui/hooks/useProjectList.ts +69 -68
- package/src/ui/hooks/useProjectMutations.ts +144 -143
- package/src/ui/index.ts +8 -12
- package/src/ui/modals/CreateProjectModal.tsx +154 -154
- package/src/ui/modals/ProjectActionsModal.tsx +321 -321
- package/src/ui/overlays/demo-overlays.ts +49 -49
- package/src/ui/renderers/index.ts +5 -4
- package/src/ui/renderers/project-list.markdown.ts +204 -204
- package/src/ui/renderers/project-list.renderer.tsx +14 -13
- package/tsconfig.json +7 -8
- package/tsdown.config.js +7 -3
package/dist/ui/SaasDashboard.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useProjectList.ts
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
5
|
function useProjectList(options = {}) {
|
|
6
6
|
const { handlers, projectId } = useTemplateRuntime();
|
|
7
7
|
const { saas } = handlers;
|
|
@@ -64,8 +64,8 @@ function useProjectList(options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// src/ui/hooks/useProjectMutations.ts
|
|
67
|
-
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
68
67
|
import { useTemplateRuntime as useTemplateRuntime2 } from "@contractspec/lib.example-shared-ui";
|
|
68
|
+
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
69
69
|
function useProjectMutations(options = {}) {
|
|
70
70
|
const { handlers, projectId } = useTemplateRuntime2();
|
|
71
71
|
const { saas } = handlers;
|
|
@@ -153,8 +153,8 @@ function useProjectMutations(options = {}) {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
// src/ui/modals/CreateProjectModal.tsx
|
|
156
|
-
import { useState as useState3 } from "react";
|
|
157
156
|
import { Button, Input } from "@contractspec/lib.design-system";
|
|
157
|
+
import { useState as useState3 } from "react";
|
|
158
158
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
159
159
|
"use client";
|
|
160
160
|
var TIERS = [
|
|
@@ -199,7 +199,7 @@ function CreateProjectModal({
|
|
|
199
199
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
200
200
|
children: [
|
|
201
201
|
/* @__PURE__ */ jsxDEV("div", {
|
|
202
|
-
className: "bg-background/80
|
|
202
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
203
203
|
onClick: onClose,
|
|
204
204
|
role: "button",
|
|
205
205
|
tabIndex: 0,
|
|
@@ -210,10 +210,10 @@ function CreateProjectModal({
|
|
|
210
210
|
"aria-label": "Close modal"
|
|
211
211
|
}, undefined, false, undefined, this),
|
|
212
212
|
/* @__PURE__ */ jsxDEV("div", {
|
|
213
|
-
className: "
|
|
213
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
214
214
|
children: [
|
|
215
215
|
/* @__PURE__ */ jsxDEV("h2", {
|
|
216
|
-
className: "mb-4 text-xl
|
|
216
|
+
className: "mb-4 font-semibold text-xl",
|
|
217
217
|
children: "Create New Project"
|
|
218
218
|
}, undefined, false, undefined, this),
|
|
219
219
|
/* @__PURE__ */ jsxDEV("form", {
|
|
@@ -224,7 +224,7 @@ function CreateProjectModal({
|
|
|
224
224
|
children: [
|
|
225
225
|
/* @__PURE__ */ jsxDEV("label", {
|
|
226
226
|
htmlFor: "project-name",
|
|
227
|
-
className: "
|
|
227
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
228
228
|
children: "Project Name *"
|
|
229
229
|
}, undefined, false, undefined, this),
|
|
230
230
|
/* @__PURE__ */ jsxDEV(Input, {
|
|
@@ -240,7 +240,7 @@ function CreateProjectModal({
|
|
|
240
240
|
children: [
|
|
241
241
|
/* @__PURE__ */ jsxDEV("label", {
|
|
242
242
|
htmlFor: "project-description",
|
|
243
|
-
className: "
|
|
243
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
244
244
|
children: "Description"
|
|
245
245
|
}, undefined, false, undefined, this),
|
|
246
246
|
/* @__PURE__ */ jsxDEV("textarea", {
|
|
@@ -250,7 +250,7 @@ function CreateProjectModal({
|
|
|
250
250
|
placeholder: "Describe what this project is about...",
|
|
251
251
|
rows: 3,
|
|
252
252
|
disabled: isLoading,
|
|
253
|
-
className: "
|
|
253
|
+
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"
|
|
254
254
|
}, undefined, false, undefined, this)
|
|
255
255
|
]
|
|
256
256
|
}, undefined, true, undefined, this),
|
|
@@ -258,7 +258,7 @@ function CreateProjectModal({
|
|
|
258
258
|
children: [
|
|
259
259
|
/* @__PURE__ */ jsxDEV("label", {
|
|
260
260
|
htmlFor: "project-tier",
|
|
261
|
-
className: "
|
|
261
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
262
262
|
children: "Tier"
|
|
263
263
|
}, undefined, false, undefined, this),
|
|
264
264
|
/* @__PURE__ */ jsxDEV("select", {
|
|
@@ -266,7 +266,7 @@ function CreateProjectModal({
|
|
|
266
266
|
value: tier,
|
|
267
267
|
onChange: (e) => setTier(e.target.value),
|
|
268
268
|
disabled: isLoading,
|
|
269
|
-
className: "
|
|
269
|
+
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",
|
|
270
270
|
children: TIERS.map((t) => /* @__PURE__ */ jsxDEV("option", {
|
|
271
271
|
value: t.value,
|
|
272
272
|
children: t.label
|
|
@@ -275,7 +275,7 @@ function CreateProjectModal({
|
|
|
275
275
|
]
|
|
276
276
|
}, undefined, true, undefined, this),
|
|
277
277
|
error && /* @__PURE__ */ jsxDEV("div", {
|
|
278
|
-
className: "bg-destructive/10
|
|
278
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
279
279
|
children: error
|
|
280
280
|
}, undefined, false, undefined, this),
|
|
281
281
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -304,8 +304,8 @@ function CreateProjectModal({
|
|
|
304
304
|
}
|
|
305
305
|
|
|
306
306
|
// src/ui/modals/ProjectActionsModal.tsx
|
|
307
|
-
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
308
307
|
import { Button as Button2, Input as Input2 } from "@contractspec/lib.design-system";
|
|
308
|
+
import { useEffect as useEffect2, useState as useState4 } from "react";
|
|
309
309
|
import { jsxDEV as jsxDEV2 } from "react/jsx-dev-runtime";
|
|
310
310
|
"use client";
|
|
311
311
|
function ProjectActionsModal({
|
|
@@ -398,7 +398,7 @@ function ProjectActionsModal({
|
|
|
398
398
|
className: "fixed inset-0 z-50 flex items-center justify-center",
|
|
399
399
|
children: [
|
|
400
400
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
401
|
-
className: "bg-background/80
|
|
401
|
+
className: "absolute inset-0 bg-background/80 backdrop-blur-sm",
|
|
402
402
|
onClick: handleClose,
|
|
403
403
|
role: "button",
|
|
404
404
|
tabIndex: 0,
|
|
@@ -409,13 +409,13 @@ function ProjectActionsModal({
|
|
|
409
409
|
"aria-label": "Close modal"
|
|
410
410
|
}, undefined, false, undefined, this),
|
|
411
411
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
412
|
-
className: "
|
|
412
|
+
className: "relative z-10 w-full max-w-md rounded-xl border border-border bg-card p-6 shadow-xl",
|
|
413
413
|
children: [
|
|
414
414
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
415
|
-
className: "
|
|
415
|
+
className: "mb-4 border-border border-b pb-4",
|
|
416
416
|
children: [
|
|
417
417
|
/* @__PURE__ */ jsxDEV2("h2", {
|
|
418
|
-
className: "text-xl
|
|
418
|
+
className: "font-semibold text-xl",
|
|
419
419
|
children: project.name
|
|
420
420
|
}, undefined, false, undefined, this),
|
|
421
421
|
/* @__PURE__ */ jsxDEV2("p", {
|
|
@@ -497,7 +497,7 @@ function ProjectActionsModal({
|
|
|
497
497
|
children: [
|
|
498
498
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
499
499
|
htmlFor: "edit-name",
|
|
500
|
-
className: "
|
|
500
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
501
501
|
children: "Project Name *"
|
|
502
502
|
}, undefined, false, undefined, this),
|
|
503
503
|
/* @__PURE__ */ jsxDEV2(Input2, {
|
|
@@ -512,7 +512,7 @@ function ProjectActionsModal({
|
|
|
512
512
|
children: [
|
|
513
513
|
/* @__PURE__ */ jsxDEV2("label", {
|
|
514
514
|
htmlFor: "edit-description",
|
|
515
|
-
className: "
|
|
515
|
+
className: "mb-1 block font-medium text-muted-foreground text-sm",
|
|
516
516
|
children: "Description"
|
|
517
517
|
}, undefined, false, undefined, this),
|
|
518
518
|
/* @__PURE__ */ jsxDEV2("textarea", {
|
|
@@ -521,12 +521,12 @@ function ProjectActionsModal({
|
|
|
521
521
|
onChange: (e) => setDescription(e.target.value),
|
|
522
522
|
rows: 3,
|
|
523
523
|
disabled: isLoading,
|
|
524
|
-
className: "
|
|
524
|
+
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"
|
|
525
525
|
}, undefined, false, undefined, this)
|
|
526
526
|
]
|
|
527
527
|
}, undefined, true, undefined, this),
|
|
528
528
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
529
|
-
className: "bg-destructive/10
|
|
529
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
530
530
|
children: error
|
|
531
531
|
}, undefined, false, undefined, this),
|
|
532
532
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -556,7 +556,7 @@ function ProjectActionsModal({
|
|
|
556
556
|
"Are you sure you want to archive",
|
|
557
557
|
" ",
|
|
558
558
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
559
|
-
className: "text-foreground
|
|
559
|
+
className: "font-medium text-foreground",
|
|
560
560
|
children: project.name
|
|
561
561
|
}, undefined, false, undefined, this),
|
|
562
562
|
"?"
|
|
@@ -567,7 +567,7 @@ function ProjectActionsModal({
|
|
|
567
567
|
children: "Archived projects can be restored later."
|
|
568
568
|
}, undefined, false, undefined, this),
|
|
569
569
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
570
|
-
className: "bg-destructive/10
|
|
570
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
571
571
|
children: error
|
|
572
572
|
}, undefined, false, undefined, this),
|
|
573
573
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -597,7 +597,7 @@ function ProjectActionsModal({
|
|
|
597
597
|
"Are you sure you want to delete",
|
|
598
598
|
" ",
|
|
599
599
|
/* @__PURE__ */ jsxDEV2("span", {
|
|
600
|
-
className: "text-foreground
|
|
600
|
+
className: "font-medium text-foreground",
|
|
601
601
|
children: project.name
|
|
602
602
|
}, undefined, false, undefined, this),
|
|
603
603
|
"?"
|
|
@@ -608,7 +608,7 @@ function ProjectActionsModal({
|
|
|
608
608
|
children: "This action cannot be undone."
|
|
609
609
|
}, undefined, false, undefined, this),
|
|
610
610
|
error && /* @__PURE__ */ jsxDEV2("div", {
|
|
611
|
-
className: "bg-destructive/10
|
|
611
|
+
className: "rounded-md bg-destructive/10 p-3 text-destructive text-sm",
|
|
612
612
|
children: error
|
|
613
613
|
}, undefined, false, undefined, this),
|
|
614
614
|
/* @__PURE__ */ jsxDEV2("div", {
|
|
@@ -637,17 +637,17 @@ function ProjectActionsModal({
|
|
|
637
637
|
}
|
|
638
638
|
|
|
639
639
|
// src/ui/SaasDashboard.tsx
|
|
640
|
-
import { useState as useState5, useCallback as useCallback3 } from "react";
|
|
641
640
|
import {
|
|
642
|
-
|
|
643
|
-
StatCardGroup,
|
|
644
|
-
StatusChip,
|
|
645
|
-
EntityCard,
|
|
641
|
+
Button as Button3,
|
|
646
642
|
EmptyState,
|
|
647
|
-
|
|
643
|
+
EntityCard,
|
|
648
644
|
ErrorState,
|
|
649
|
-
|
|
645
|
+
LoaderBlock,
|
|
646
|
+
StatCard,
|
|
647
|
+
StatCardGroup,
|
|
648
|
+
StatusChip
|
|
650
649
|
} from "@contractspec/lib.design-system";
|
|
650
|
+
import { useCallback as useCallback3, useState as useState5 } from "react";
|
|
651
651
|
import { jsxDEV as jsxDEV3 } from "react/jsx-dev-runtime";
|
|
652
652
|
"use client";
|
|
653
653
|
function getStatusTone(status) {
|
|
@@ -702,7 +702,7 @@ function SaasDashboard() {
|
|
|
702
702
|
className: "flex items-center justify-between",
|
|
703
703
|
children: [
|
|
704
704
|
/* @__PURE__ */ jsxDEV3("h2", {
|
|
705
|
-
className: "text-2xl
|
|
705
|
+
className: "font-bold text-2xl",
|
|
706
706
|
children: "SaaS Dashboard"
|
|
707
707
|
}, undefined, false, undefined, this),
|
|
708
708
|
activeTab === "projects" && /* @__PURE__ */ jsxDEV3(Button3, {
|
|
@@ -739,14 +739,14 @@ function SaasDashboard() {
|
|
|
739
739
|
]
|
|
740
740
|
}, undefined, true, undefined, this),
|
|
741
741
|
/* @__PURE__ */ jsxDEV3("nav", {
|
|
742
|
-
className: "
|
|
742
|
+
className: "flex gap-1 rounded-lg bg-muted p-1",
|
|
743
743
|
role: "tablist",
|
|
744
744
|
children: tabs.map((tab) => /* @__PURE__ */ jsxDEV3("button", {
|
|
745
745
|
type: "button",
|
|
746
746
|
role: "tab",
|
|
747
747
|
"aria-selected": activeTab === tab.id,
|
|
748
748
|
onClick: () => setActiveTab(tab.id),
|
|
749
|
-
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 text-sm
|
|
749
|
+
className: `flex flex-1 items-center justify-center gap-2 rounded-md px-4 py-2 font-medium text-sm transition-colors ${activeTab === tab.id ? "bg-background text-foreground shadow-sm" : "text-muted-foreground hover:text-foreground"}`,
|
|
750
750
|
children: [
|
|
751
751
|
/* @__PURE__ */ jsxDEV3("span", {
|
|
752
752
|
children: tab.icon
|
|
@@ -849,7 +849,7 @@ function BillingTab({ subscription }) {
|
|
|
849
849
|
className: "space-y-6",
|
|
850
850
|
children: [
|
|
851
851
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
852
|
-
className: "border-border bg-card
|
|
852
|
+
className: "rounded-xl border border-border bg-card p-6",
|
|
853
853
|
children: [
|
|
854
854
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
855
855
|
className: "flex items-start justify-between",
|
|
@@ -857,7 +857,7 @@ function BillingTab({ subscription }) {
|
|
|
857
857
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
858
858
|
children: [
|
|
859
859
|
/* @__PURE__ */ jsxDEV3("h3", {
|
|
860
|
-
className: "text-lg
|
|
860
|
+
className: "font-semibold text-lg",
|
|
861
861
|
children: [
|
|
862
862
|
subscription.plan,
|
|
863
863
|
" Plan"
|
|
@@ -907,9 +907,9 @@ function BillingTab({ subscription }) {
|
|
|
907
907
|
]
|
|
908
908
|
}, undefined, true, undefined, this),
|
|
909
909
|
subscription.cancelAtPeriodEnd && /* @__PURE__ */ jsxDEV3("div", {
|
|
910
|
-
className: "border-border bg-destructive/10 text-destructive
|
|
910
|
+
className: "rounded-xl border border-border bg-destructive/10 p-4 text-destructive",
|
|
911
911
|
children: /* @__PURE__ */ jsxDEV3("p", {
|
|
912
|
-
className: "text-sm
|
|
912
|
+
className: "font-medium text-sm",
|
|
913
913
|
children: "\u26A0\uFE0F Your subscription will be cancelled at the end of the current period."
|
|
914
914
|
}, undefined, false, undefined, this)
|
|
915
915
|
}, undefined, false, undefined, this)
|
|
@@ -920,10 +920,10 @@ function SettingsTab() {
|
|
|
920
920
|
return /* @__PURE__ */ jsxDEV3("div", {
|
|
921
921
|
className: "space-y-6",
|
|
922
922
|
children: /* @__PURE__ */ jsxDEV3("div", {
|
|
923
|
-
className: "border-border bg-card
|
|
923
|
+
className: "rounded-xl border border-border bg-card p-6",
|
|
924
924
|
children: [
|
|
925
925
|
/* @__PURE__ */ jsxDEV3("h3", {
|
|
926
|
-
className: "mb-4 text-lg
|
|
926
|
+
className: "mb-4 font-semibold text-lg",
|
|
927
927
|
children: "Organization Settings"
|
|
928
928
|
}, undefined, false, undefined, this),
|
|
929
929
|
/* @__PURE__ */ jsxDEV3("div", {
|
|
@@ -933,14 +933,14 @@ function SettingsTab() {
|
|
|
933
933
|
children: [
|
|
934
934
|
/* @__PURE__ */ jsxDEV3("label", {
|
|
935
935
|
htmlFor: "org-name",
|
|
936
|
-
className: "text-sm
|
|
936
|
+
className: "font-medium text-sm",
|
|
937
937
|
children: "Organization Name"
|
|
938
938
|
}, undefined, false, undefined, this),
|
|
939
939
|
/* @__PURE__ */ jsxDEV3("input", {
|
|
940
940
|
id: "org-name",
|
|
941
941
|
type: "text",
|
|
942
942
|
defaultValue: "Demo Organization",
|
|
943
|
-
className: "
|
|
943
|
+
className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2"
|
|
944
944
|
}, undefined, false, undefined, this)
|
|
945
945
|
]
|
|
946
946
|
}, undefined, true, undefined, this),
|
|
@@ -948,12 +948,12 @@ function SettingsTab() {
|
|
|
948
948
|
children: [
|
|
949
949
|
/* @__PURE__ */ jsxDEV3("label", {
|
|
950
950
|
htmlFor: "timezone",
|
|
951
|
-
className: "text-sm
|
|
951
|
+
className: "font-medium text-sm",
|
|
952
952
|
children: "Default Timezone"
|
|
953
953
|
}, undefined, false, undefined, this),
|
|
954
954
|
/* @__PURE__ */ jsxDEV3("select", {
|
|
955
955
|
id: "timezone",
|
|
956
|
-
className: "
|
|
956
|
+
className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2",
|
|
957
957
|
children: [
|
|
958
958
|
/* @__PURE__ */ jsxDEV3("option", {
|
|
959
959
|
children: "UTC"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useProjectList.ts
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
5
|
function useProjectList(options = {}) {
|
|
6
6
|
const { handlers, projectId } = useTemplateRuntime();
|
|
7
7
|
const { saas } = handlers;
|
|
@@ -65,14 +65,14 @@ function useProjectList(options = {}) {
|
|
|
65
65
|
|
|
66
66
|
// src/ui/SaasProjectList.tsx
|
|
67
67
|
import {
|
|
68
|
-
|
|
69
|
-
StatCardGroup,
|
|
70
|
-
StatusChip,
|
|
71
|
-
EntityCard,
|
|
68
|
+
Button,
|
|
72
69
|
EmptyState,
|
|
73
|
-
|
|
70
|
+
EntityCard,
|
|
74
71
|
ErrorState,
|
|
75
|
-
|
|
72
|
+
LoaderBlock,
|
|
73
|
+
StatCard,
|
|
74
|
+
StatCardGroup,
|
|
75
|
+
StatusChip
|
|
76
76
|
} from "@contractspec/lib.design-system";
|
|
77
77
|
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
78
78
|
"use client";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/SaasSettingsPanel.tsx
|
|
3
|
-
import { useState } from "react";
|
|
4
3
|
import { Button } 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
|
function SaasSettingsPanel() {
|
|
@@ -11,10 +11,10 @@ function SaasSettingsPanel() {
|
|
|
11
11
|
className: "space-y-6",
|
|
12
12
|
children: [
|
|
13
13
|
/* @__PURE__ */ jsxDEV("div", {
|
|
14
|
-
className: "border-border bg-card
|
|
14
|
+
className: "rounded-xl border border-border bg-card p-6",
|
|
15
15
|
children: [
|
|
16
16
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
17
|
-
className: "mb-4 text-lg
|
|
17
|
+
className: "mb-4 font-semibold text-lg",
|
|
18
18
|
children: "Organization Settings"
|
|
19
19
|
}, undefined, false, undefined, this),
|
|
20
20
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -24,7 +24,7 @@ function SaasSettingsPanel() {
|
|
|
24
24
|
children: [
|
|
25
25
|
/* @__PURE__ */ jsxDEV("label", {
|
|
26
26
|
htmlFor: "setting-org-name",
|
|
27
|
-
className: "block text-sm
|
|
27
|
+
className: "block font-medium text-sm",
|
|
28
28
|
children: "Organization Name"
|
|
29
29
|
}, undefined, false, undefined, this),
|
|
30
30
|
/* @__PURE__ */ jsxDEV("input", {
|
|
@@ -32,7 +32,7 @@ function SaasSettingsPanel() {
|
|
|
32
32
|
type: "text",
|
|
33
33
|
value: orgName,
|
|
34
34
|
onChange: (e) => setOrgName(e.target.value),
|
|
35
|
-
className: "
|
|
35
|
+
className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2"
|
|
36
36
|
}, undefined, false, undefined, this)
|
|
37
37
|
]
|
|
38
38
|
}, undefined, true, undefined, this),
|
|
@@ -40,14 +40,14 @@ function SaasSettingsPanel() {
|
|
|
40
40
|
children: [
|
|
41
41
|
/* @__PURE__ */ jsxDEV("label", {
|
|
42
42
|
htmlFor: "setting-timezone",
|
|
43
|
-
className: "block text-sm
|
|
43
|
+
className: "block font-medium text-sm",
|
|
44
44
|
children: "Default Timezone"
|
|
45
45
|
}, undefined, false, undefined, this),
|
|
46
46
|
/* @__PURE__ */ jsxDEV("select", {
|
|
47
47
|
id: "setting-timezone",
|
|
48
48
|
value: timezone,
|
|
49
49
|
onChange: (e) => setTimezone(e.target.value),
|
|
50
|
-
className: "
|
|
50
|
+
className: "mt-1 block w-full rounded-md border border-input bg-background px-3 py-2",
|
|
51
51
|
children: [
|
|
52
52
|
/* @__PURE__ */ jsxDEV("option", {
|
|
53
53
|
value: "UTC",
|
|
@@ -81,10 +81,10 @@ function SaasSettingsPanel() {
|
|
|
81
81
|
]
|
|
82
82
|
}, undefined, true, undefined, this),
|
|
83
83
|
/* @__PURE__ */ jsxDEV("div", {
|
|
84
|
-
className: "border-border bg-card
|
|
84
|
+
className: "rounded-xl border border-border bg-card p-6",
|
|
85
85
|
children: [
|
|
86
86
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
87
|
-
className: "mb-4 text-lg
|
|
87
|
+
className: "mb-4 font-semibold text-lg",
|
|
88
88
|
children: "Notifications"
|
|
89
89
|
}, undefined, false, undefined, this),
|
|
90
90
|
/* @__PURE__ */ jsxDEV("div", {
|
|
@@ -99,7 +99,7 @@ function SaasSettingsPanel() {
|
|
|
99
99
|
/* @__PURE__ */ jsxDEV("input", {
|
|
100
100
|
type: "checkbox",
|
|
101
101
|
defaultChecked: item.defaultChecked,
|
|
102
|
-
className: "
|
|
102
|
+
className: "h-4 w-4 rounded border-input"
|
|
103
103
|
}, undefined, false, undefined, this),
|
|
104
104
|
/* @__PURE__ */ jsxDEV("span", {
|
|
105
105
|
className: "text-sm",
|
|
@@ -114,11 +114,11 @@ function SaasSettingsPanel() {
|
|
|
114
114
|
className: "rounded-xl border border-red-200 bg-red-50 p-6 dark:border-red-900 dark:bg-red-950/20",
|
|
115
115
|
children: [
|
|
116
116
|
/* @__PURE__ */ jsxDEV("h3", {
|
|
117
|
-
className: "mb-2
|
|
117
|
+
className: "mb-2 font-semibold text-lg text-red-700 dark:text-red-400",
|
|
118
118
|
children: "Danger Zone"
|
|
119
119
|
}, undefined, false, undefined, this),
|
|
120
120
|
/* @__PURE__ */ jsxDEV("p", {
|
|
121
|
-
className: "mb-4 text-
|
|
121
|
+
className: "mb-4 text-red-600 text-sm dark:text-red-300",
|
|
122
122
|
children: "These actions are irreversible. Please proceed with caution."
|
|
123
123
|
}, undefined, false, undefined, this),
|
|
124
124
|
/* @__PURE__ */ jsxDEV("div", {
|
package/dist/ui/hooks/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
2
|
-
export {
|
|
1
|
+
export { type UseProjectListOptions, useProjectList } from './useProjectList';
|
|
2
|
+
export { type UseProjectMutationsOptions, useProjectMutations, } from './useProjectMutations';
|
package/dist/ui/hooks/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useProjectList.ts
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
5
|
function useProjectList(options = {}) {
|
|
6
6
|
const { handlers, projectId } = useTemplateRuntime();
|
|
7
7
|
const { saas } = handlers;
|
|
@@ -64,8 +64,8 @@ function useProjectList(options = {}) {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
// src/ui/hooks/useProjectMutations.ts
|
|
67
|
-
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
68
67
|
import { useTemplateRuntime as useTemplateRuntime2 } from "@contractspec/lib.example-shared-ui";
|
|
68
|
+
import { useCallback as useCallback2, useState as useState2 } from "react";
|
|
69
69
|
function useProjectMutations(options = {}) {
|
|
70
70
|
const { handlers, projectId } = useTemplateRuntime2();
|
|
71
71
|
const { saas } = handlers;
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for fetching and managing project list data
|
|
3
|
+
*
|
|
4
|
+
* Uses runtime-local database-backed handlers.
|
|
5
|
+
*/
|
|
1
6
|
import type { Project as RuntimeProject, Subscription as RuntimeSubscription } from '../../handlers/saas.handlers';
|
|
2
7
|
export type Project = RuntimeProject;
|
|
3
8
|
export type Subscription = RuntimeSubscription;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useProjectList.ts
|
|
3
|
-
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useEffect, useMemo, useState } from "react";
|
|
5
5
|
function useProjectList(options = {}) {
|
|
6
6
|
const { handlers, projectId } = useTemplateRuntime();
|
|
7
7
|
const { saas } = handlers;
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Hook for SaaS project mutations (commands)
|
|
3
|
+
*
|
|
4
|
+
* Uses runtime-local database-backed handlers for:
|
|
5
|
+
* - CreateProjectContract
|
|
6
|
+
* - UpdateProjectContract
|
|
7
|
+
* - DeleteProjectContract
|
|
8
|
+
*/
|
|
1
9
|
import type { CreateProjectInput, Project, UpdateProjectInput } from '../../handlers/saas.handlers';
|
|
2
10
|
export interface MutationState<T> {
|
|
3
11
|
loading: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @bun
|
|
2
2
|
// src/ui/hooks/useProjectMutations.ts
|
|
3
|
-
import { useCallback, useState } from "react";
|
|
4
3
|
import { useTemplateRuntime } from "@contractspec/lib.example-shared-ui";
|
|
4
|
+
import { useCallback, useState } from "react";
|
|
5
5
|
function useProjectMutations(options = {}) {
|
|
6
6
|
const { handlers, projectId } = useTemplateRuntime();
|
|
7
7
|
const { saas } = handlers;
|
package/dist/ui/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
export * from './hooks';
|
|
2
|
+
export * from './modals';
|
|
3
|
+
export * from './overlays';
|
|
4
|
+
export * from './renderers';
|
|
1
5
|
export * from './SaasDashboard';
|
|
2
6
|
export * from './SaasProjectList';
|
|
3
7
|
export * from './SaasSettingsPanel';
|
|
4
|
-
export * from './modals';
|
|
5
|
-
export * from './hooks';
|
|
6
|
-
export * from './renderers';
|
|
7
|
-
export * from './overlays';
|