@contractspec/bundle.marketing 3.8.8 → 3.8.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 +73 -29
- package/CHANGELOG.md +63 -0
- package/dist/browser/components/templates/TemplateCard.js +83 -0
- package/dist/browser/components/templates/TemplateCommandDialog.js +110 -0
- package/dist/browser/components/templates/TemplatePreviewContent.js +96 -0
- package/dist/browser/components/templates/TemplatesBrowseControls.js +130 -0
- package/dist/browser/components/templates/TemplatesCatalogSection.js +307 -0
- package/dist/browser/components/templates/TemplatesClientPage.js +1020 -917
- package/dist/browser/components/templates/TemplatesHeroSection.js +87 -0
- package/dist/browser/components/templates/TemplatesNextStepsSection.js +126 -0
- package/dist/browser/components/templates/TemplatesOverlays.js +2874 -0
- package/dist/browser/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/browser/components/templates/index.js +1055 -952
- package/dist/browser/components/templates/template-catalog.js +83 -0
- package/dist/browser/components/templates/template-filters.js +99 -0
- package/dist/browser/components/templates/template-new.js +23 -0
- package/dist/browser/components/templates/template-preview.js +43 -0
- package/dist/browser/components/templates/template-source.js +19 -0
- package/dist/browser/components/templates/template-tag-visibility.js +40 -0
- package/dist/browser/components/templates/useTemplateBrowseState.js +191 -0
- package/dist/browser/index.js +1055 -952
- package/dist/components/templates/TemplateCard.d.ts +12 -0
- package/dist/components/templates/TemplateCard.js +78 -0
- package/dist/components/templates/TemplateCommandDialog.d.ts +6 -0
- package/dist/components/templates/TemplateCommandDialog.js +105 -0
- package/dist/components/templates/TemplatePreviewContent.d.ts +5 -0
- package/dist/components/templates/TemplatePreviewContent.js +91 -0
- package/dist/components/templates/TemplatesBrowseControls.d.ts +18 -0
- package/dist/components/templates/TemplatesBrowseControls.js +125 -0
- package/dist/components/templates/TemplatesCatalogSection.d.ts +17 -0
- package/dist/components/templates/TemplatesCatalogSection.js +302 -0
- package/dist/components/templates/TemplatesClientPage.js +1020 -917
- package/dist/components/templates/TemplatesHeroSection.d.ts +5 -0
- package/dist/components/templates/TemplatesHeroSection.js +82 -0
- package/dist/components/templates/TemplatesNextStepsSection.d.ts +1 -0
- package/dist/components/templates/TemplatesNextStepsSection.js +121 -0
- package/dist/components/templates/TemplatesOverlays.d.ts +10 -0
- package/dist/components/templates/TemplatesOverlays.js +2869 -0
- package/dist/components/templates/TemplatesPreviewModal.d.ts +3 -4
- package/dist/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/components/templates/index.js +1055 -952
- package/dist/components/templates/template-catalog.d.ts +28 -0
- package/dist/components/templates/template-catalog.js +78 -0
- package/dist/components/templates/template-catalog.test.d.ts +1 -0
- package/dist/components/templates/template-filters.d.ts +12 -0
- package/dist/components/templates/template-filters.js +94 -0
- package/dist/components/templates/template-new.d.ts +2 -0
- package/dist/components/templates/template-new.js +18 -0
- package/dist/components/templates/template-preview.d.ts +18 -0
- package/dist/components/templates/template-preview.js +38 -0
- package/dist/components/templates/template-source.d.ts +3 -0
- package/dist/components/templates/template-source.js +14 -0
- package/dist/components/templates/template-tag-visibility.d.ts +10 -0
- package/dist/components/templates/template-tag-visibility.js +35 -0
- package/dist/components/templates/useTemplateBrowseState.d.ts +22 -0
- package/dist/components/templates/useTemplateBrowseState.js +186 -0
- package/dist/index.js +1055 -952
- package/dist/node/components/templates/TemplateCard.js +78 -0
- package/dist/node/components/templates/TemplateCommandDialog.js +105 -0
- package/dist/node/components/templates/TemplatePreviewContent.js +91 -0
- package/dist/node/components/templates/TemplatesBrowseControls.js +125 -0
- package/dist/node/components/templates/TemplatesCatalogSection.js +302 -0
- package/dist/node/components/templates/TemplatesClientPage.js +1020 -917
- package/dist/node/components/templates/TemplatesHeroSection.js +82 -0
- package/dist/node/components/templates/TemplatesNextStepsSection.js +121 -0
- package/dist/node/components/templates/TemplatesOverlays.js +2869 -0
- package/dist/node/components/templates/TemplatesPreviewModal.js +136 -126
- package/dist/node/components/templates/index.js +1055 -952
- package/dist/node/components/templates/template-catalog.js +78 -0
- package/dist/node/components/templates/template-filters.js +94 -0
- package/dist/node/components/templates/template-new.js +18 -0
- package/dist/node/components/templates/template-preview.js +38 -0
- package/dist/node/components/templates/template-source.js +14 -0
- package/dist/node/components/templates/template-tag-visibility.js +35 -0
- package/dist/node/components/templates/useTemplateBrowseState.js +186 -0
- package/dist/node/index.js +1055 -952
- package/package.json +237 -26
- package/src/components/templates/TemplateCard.tsx +74 -0
- package/src/components/templates/TemplateCommandDialog.tsx +92 -0
- package/src/components/templates/TemplatePreviewContent.tsx +182 -0
- package/src/components/templates/TemplatesBrowseControls.tsx +144 -0
- package/src/components/templates/TemplatesCatalogSection.tsx +191 -0
- package/src/components/templates/TemplatesClientPage.tsx +85 -773
- package/src/components/templates/TemplatesHeroSection.tsx +41 -0
- package/src/components/templates/TemplatesNextStepsSection.tsx +80 -0
- package/src/components/templates/TemplatesOverlays.tsx +65 -0
- package/src/components/templates/TemplatesPreviewModal.tsx +19 -294
- package/src/components/templates/template-catalog.test.ts +162 -0
- package/src/components/templates/template-catalog.ts +140 -0
- package/src/components/templates/template-filters.ts +57 -0
- package/src/components/templates/template-new.ts +12 -0
- package/src/components/templates/template-preview.ts +57 -0
- package/src/components/templates/template-source.ts +13 -0
- package/src/components/templates/template-tag-visibility.ts +58 -0
- package/src/components/templates/useTemplateBrowseState.ts +101 -0
- package/.turbo/turbo-prebuild.log +0 -1
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/components/templates/TemplateCard.tsx
|
|
5
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
6
|
+
"use client";
|
|
7
|
+
function TemplateCard({
|
|
8
|
+
title,
|
|
9
|
+
description,
|
|
10
|
+
metaBadges,
|
|
11
|
+
tags,
|
|
12
|
+
featureList = [],
|
|
13
|
+
isNew = false,
|
|
14
|
+
previewAction,
|
|
15
|
+
useAction
|
|
16
|
+
}) {
|
|
17
|
+
return /* @__PURE__ */ jsxDEV("div", {
|
|
18
|
+
className: "editorial-panel relative flex flex-col space-y-4 transition-colors hover:border-[color:rgb(162_79_42_/_0.55)]",
|
|
19
|
+
children: [
|
|
20
|
+
isNew ? /* @__PURE__ */ jsxDEV("span", {
|
|
21
|
+
className: "absolute top-4 right-4 rounded-full bg-[color:var(--success)] px-2.5 py-1 font-medium text-[11px] text-white uppercase",
|
|
22
|
+
children: "New"
|
|
23
|
+
}, undefined, false, undefined, this) : null,
|
|
24
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
25
|
+
children: [
|
|
26
|
+
/* @__PURE__ */ jsxDEV("h3", {
|
|
27
|
+
className: "font-serif text-2xl tracking-[-0.03em]",
|
|
28
|
+
children: title
|
|
29
|
+
}, undefined, false, undefined, this),
|
|
30
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
31
|
+
className: "mt-1 text-muted-foreground text-sm",
|
|
32
|
+
children: description
|
|
33
|
+
}, undefined, false, undefined, this)
|
|
34
|
+
]
|
|
35
|
+
}, undefined, true, undefined, this),
|
|
36
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
37
|
+
className: "flex-1 space-y-3",
|
|
38
|
+
children: [
|
|
39
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
40
|
+
className: "flex flex-wrap gap-2",
|
|
41
|
+
children: metaBadges.map((badge) => /* @__PURE__ */ jsxDEV("span", {
|
|
42
|
+
className: "rounded-full border border-border bg-background px-3 py-1 text-[11px] text-foreground",
|
|
43
|
+
children: badge
|
|
44
|
+
}, badge, false, undefined, this))
|
|
45
|
+
}, undefined, false, undefined, this),
|
|
46
|
+
featureList.length > 0 ? /* @__PURE__ */ jsxDEV("p", {
|
|
47
|
+
className: "text-muted-foreground text-xs",
|
|
48
|
+
children: [
|
|
49
|
+
/* @__PURE__ */ jsxDEV("span", {
|
|
50
|
+
className: "font-medium text-foreground",
|
|
51
|
+
children: "Features:"
|
|
52
|
+
}, undefined, false, undefined, this),
|
|
53
|
+
" ",
|
|
54
|
+
featureList.join(", ")
|
|
55
|
+
]
|
|
56
|
+
}, undefined, true, undefined, this) : null,
|
|
57
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
58
|
+
className: "flex flex-wrap gap-1",
|
|
59
|
+
children: tags.map((tag) => /* @__PURE__ */ jsxDEV("span", {
|
|
60
|
+
className: "rounded-full border border-border bg-muted px-3 py-1 text-[11px] text-muted-foreground",
|
|
61
|
+
children: tag
|
|
62
|
+
}, tag, false, undefined, this))
|
|
63
|
+
}, undefined, false, undefined, this)
|
|
64
|
+
]
|
|
65
|
+
}, undefined, true, undefined, this),
|
|
66
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
67
|
+
className: "flex gap-2 pt-4",
|
|
68
|
+
children: [
|
|
69
|
+
previewAction,
|
|
70
|
+
useAction
|
|
71
|
+
]
|
|
72
|
+
}, undefined, true, undefined, this)
|
|
73
|
+
]
|
|
74
|
+
}, undefined, true, undefined, this);
|
|
75
|
+
}
|
|
76
|
+
export {
|
|
77
|
+
TemplateCard
|
|
78
|
+
};
|
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/components/templates/TemplateCommandDialog.tsx
|
|
5
|
+
import {
|
|
6
|
+
analyticsEventNames,
|
|
7
|
+
captureAnalyticsEvent
|
|
8
|
+
} from "@contractspec/bundle.library/libs/posthog/client";
|
|
9
|
+
import {
|
|
10
|
+
Dialog,
|
|
11
|
+
DialogContent,
|
|
12
|
+
DialogDescription,
|
|
13
|
+
DialogHeader,
|
|
14
|
+
DialogTitle
|
|
15
|
+
} from "@contractspec/lib.ui-kit-web/ui/dialog";
|
|
16
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
17
|
+
"use client";
|
|
18
|
+
function TemplateCommandDialog({
|
|
19
|
+
templateId,
|
|
20
|
+
onClose,
|
|
21
|
+
onDeployStudio
|
|
22
|
+
}) {
|
|
23
|
+
const command = templateId ? `npx contractspec init --template ${templateId}` : "";
|
|
24
|
+
return /* @__PURE__ */ jsxDEV(Dialog, {
|
|
25
|
+
open: !!templateId,
|
|
26
|
+
onOpenChange: (open) => !open && onClose(),
|
|
27
|
+
children: /* @__PURE__ */ jsxDEV(DialogContent, {
|
|
28
|
+
className: "max-w-md",
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ jsxDEV(DialogHeader, {
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxDEV(DialogTitle, {
|
|
33
|
+
children: "Use this template"
|
|
34
|
+
}, undefined, false, undefined, this),
|
|
35
|
+
/* @__PURE__ */ jsxDEV(DialogDescription, {
|
|
36
|
+
children: "Initialize a new project with this template using the CLI."
|
|
37
|
+
}, undefined, false, undefined, this)
|
|
38
|
+
]
|
|
39
|
+
}, undefined, true, undefined, this),
|
|
40
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
41
|
+
className: "space-y-4 pt-4",
|
|
42
|
+
children: [
|
|
43
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
44
|
+
className: "rounded-md border border-zinc-800 bg-zinc-950 p-4 font-mono text-sm text-zinc-50",
|
|
45
|
+
children: command
|
|
46
|
+
}, undefined, false, undefined, this),
|
|
47
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
48
|
+
className: "flex gap-2",
|
|
49
|
+
children: /* @__PURE__ */ jsxDEV("button", {
|
|
50
|
+
className: "btn-secondary w-full",
|
|
51
|
+
onClick: () => {
|
|
52
|
+
if (!templateId) {
|
|
53
|
+
return;
|
|
54
|
+
}
|
|
55
|
+
navigator.clipboard.writeText(command);
|
|
56
|
+
captureAnalyticsEvent(analyticsEventNames.COPY_COMMAND_CLICK, {
|
|
57
|
+
surface: "templates",
|
|
58
|
+
templateId,
|
|
59
|
+
filename: "templates-cli"
|
|
60
|
+
});
|
|
61
|
+
},
|
|
62
|
+
children: "Copy Command"
|
|
63
|
+
}, undefined, false, undefined, this)
|
|
64
|
+
}, undefined, false, undefined, this),
|
|
65
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
66
|
+
className: "relative",
|
|
67
|
+
children: [
|
|
68
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
69
|
+
className: "absolute inset-0 flex items-center",
|
|
70
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
71
|
+
className: "w-full border-border border-t"
|
|
72
|
+
}, undefined, false, undefined, this)
|
|
73
|
+
}, undefined, false, undefined, this),
|
|
74
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
75
|
+
className: "relative flex justify-center text-xs uppercase",
|
|
76
|
+
children: /* @__PURE__ */ jsxDEV("span", {
|
|
77
|
+
className: "bg-background px-2 text-muted-foreground",
|
|
78
|
+
children: "Or"
|
|
79
|
+
}, undefined, false, undefined, this)
|
|
80
|
+
}, undefined, false, undefined, this)
|
|
81
|
+
]
|
|
82
|
+
}, undefined, true, undefined, this),
|
|
83
|
+
/* @__PURE__ */ jsxDEV("button", {
|
|
84
|
+
className: "btn-ghost w-full text-sm",
|
|
85
|
+
onClick: () => {
|
|
86
|
+
if (!templateId) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
captureAnalyticsEvent(analyticsEventNames.CTA_STUDIO_CLICK, {
|
|
90
|
+
surface: "templates",
|
|
91
|
+
templateId
|
|
92
|
+
});
|
|
93
|
+
onDeployStudio();
|
|
94
|
+
},
|
|
95
|
+
children: "Deploy to Studio"
|
|
96
|
+
}, undefined, false, undefined, this)
|
|
97
|
+
]
|
|
98
|
+
}, undefined, true, undefined, this)
|
|
99
|
+
]
|
|
100
|
+
}, undefined, true, undefined, this)
|
|
101
|
+
}, undefined, false, undefined, this);
|
|
102
|
+
}
|
|
103
|
+
export {
|
|
104
|
+
TemplateCommandDialog
|
|
105
|
+
};
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/components/templates/TemplatePreviewContent.tsx
|
|
5
|
+
import {
|
|
6
|
+
TemplateShell
|
|
7
|
+
} from "@contractspec/lib.example-shared-ui";
|
|
8
|
+
import { LoadingSpinner } from "@contractspec/lib.ui-kit-web/ui/atoms/LoadingSpinner";
|
|
9
|
+
import dynamic from "next/dynamic";
|
|
10
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
11
|
+
"use client";
|
|
12
|
+
var SaasDashboard = dynamic(() => import("@contractspec/example.saas-boilerplate").then((module) => module.SaasDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
13
|
+
var CrmDashboard = dynamic(() => import("@contractspec/example.crm-pipeline").then((module) => module.CrmDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
14
|
+
var DataGridShowcase = dynamic(() => import("@contractspec/example.data-grid-showcase/ui").then((module) => module.DataGridShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
15
|
+
var VisualizationShowcase = dynamic(() => import("@contractspec/example.visualization-showcase/ui").then((module) => module.VisualizationShowcase), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
16
|
+
var AgentDashboard = dynamic(() => import("@contractspec/example.agent-console/ui").then((module) => module.AgentDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
17
|
+
var AiChatAssistantDashboard = dynamic(() => import("@contractspec/example.ai-chat-assistant").then((module) => module.AiChatAssistantDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
18
|
+
var WorkflowDashboard = dynamic(() => import("@contractspec/example.workflow-system/ui").then((module) => module.WorkflowDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
19
|
+
var MarketplaceDashboard = dynamic(() => import("@contractspec/example.marketplace/ui").then((module) => module.MarketplaceDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
20
|
+
var IntegrationDashboard = dynamic(() => import("@contractspec/example.integration-hub/ui").then((module) => module.IntegrationDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
21
|
+
var AnalyticsDashboard = dynamic(() => import("@contractspec/example.analytics-dashboard").then((module) => module.AnalyticsDashboard), { ssr: false, loading: () => /* @__PURE__ */ jsxDEV(LoadingSpinner, {}, undefined, false, undefined, this) });
|
|
22
|
+
var PREVIEW_DEFINITIONS = {
|
|
23
|
+
"saas-boilerplate": {
|
|
24
|
+
title: "SaaS Boilerplate",
|
|
25
|
+
description: "Multi-tenant organizations, projects, settings, and billing usage tracking.",
|
|
26
|
+
component: SaasDashboard
|
|
27
|
+
},
|
|
28
|
+
"crm-pipeline": {
|
|
29
|
+
title: "CRM Pipeline",
|
|
30
|
+
description: "Sales CRM with contacts, companies, deals, and pipeline stages.",
|
|
31
|
+
component: CrmDashboard
|
|
32
|
+
},
|
|
33
|
+
"data-grid-showcase": {
|
|
34
|
+
title: "Data Grid Showcase",
|
|
35
|
+
description: "Shared ContractSpec table primitives with client, server, and DataView-driven lanes.",
|
|
36
|
+
component: DataGridShowcase
|
|
37
|
+
},
|
|
38
|
+
"visualization-showcase": {
|
|
39
|
+
title: "Visualization Showcase",
|
|
40
|
+
description: "ContractSpec-owned chart primitives rendered through shared visualization contracts and design-system wrappers.",
|
|
41
|
+
component: VisualizationShowcase
|
|
42
|
+
},
|
|
43
|
+
"agent-console": {
|
|
44
|
+
title: "AI Agent Console",
|
|
45
|
+
description: "AI agent orchestration with tools, agents, runs, and execution logs.",
|
|
46
|
+
component: AgentDashboard
|
|
47
|
+
},
|
|
48
|
+
"ai-chat-assistant": {
|
|
49
|
+
title: "AI Chat Assistant",
|
|
50
|
+
description: "Focused assistant surface with reasoning, sources, suggestions, and MCP-aware tools.",
|
|
51
|
+
component: AiChatAssistantDashboard
|
|
52
|
+
},
|
|
53
|
+
"workflow-system": {
|
|
54
|
+
title: "Workflow System",
|
|
55
|
+
description: "Multi-step workflows with role-based approvals.",
|
|
56
|
+
component: WorkflowDashboard
|
|
57
|
+
},
|
|
58
|
+
marketplace: {
|
|
59
|
+
title: "Marketplace",
|
|
60
|
+
description: "Two-sided marketplace with stores, products, orders, and payouts.",
|
|
61
|
+
component: MarketplaceDashboard
|
|
62
|
+
},
|
|
63
|
+
"integration-hub": {
|
|
64
|
+
title: "Integration Hub",
|
|
65
|
+
description: "Third-party integrations with connections, sync configs, and field mapping.",
|
|
66
|
+
component: IntegrationDashboard
|
|
67
|
+
},
|
|
68
|
+
"analytics-dashboard": {
|
|
69
|
+
title: "Analytics Dashboard",
|
|
70
|
+
description: "Custom dashboards with widgets and queries.",
|
|
71
|
+
component: AnalyticsDashboard
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
function TemplatePreviewContent({
|
|
75
|
+
templateId
|
|
76
|
+
}) {
|
|
77
|
+
const preview = PREVIEW_DEFINITIONS[templateId];
|
|
78
|
+
if (!preview) {
|
|
79
|
+
return null;
|
|
80
|
+
}
|
|
81
|
+
const PreviewComponent = preview.component;
|
|
82
|
+
return /* @__PURE__ */ jsxDEV(TemplateShell, {
|
|
83
|
+
title: preview.title,
|
|
84
|
+
description: preview.description,
|
|
85
|
+
showSaveAction: false,
|
|
86
|
+
children: /* @__PURE__ */ jsxDEV(PreviewComponent, {}, undefined, false, undefined, this)
|
|
87
|
+
}, undefined, false, undefined, this);
|
|
88
|
+
}
|
|
89
|
+
export {
|
|
90
|
+
TemplatePreviewContent
|
|
91
|
+
};
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/components/templates/TemplatesBrowseControls.tsx
|
|
5
|
+
import { cn } from "@contractspec/lib.ui-kit-core/utils";
|
|
6
|
+
import { Search } from "lucide-react";
|
|
7
|
+
import { jsxDEV } from "react/jsx-dev-runtime";
|
|
8
|
+
"use client";
|
|
9
|
+
function TemplatesBrowseControls({
|
|
10
|
+
registryConfigured,
|
|
11
|
+
availableSources,
|
|
12
|
+
source,
|
|
13
|
+
onSourceChange,
|
|
14
|
+
search,
|
|
15
|
+
onSearchChange,
|
|
16
|
+
selectedTag,
|
|
17
|
+
onTagChange,
|
|
18
|
+
showTagFilters,
|
|
19
|
+
visibleTagFacets,
|
|
20
|
+
hiddenTagFacets,
|
|
21
|
+
showAllTags,
|
|
22
|
+
onShowAllTagsChange
|
|
23
|
+
}) {
|
|
24
|
+
return /* @__PURE__ */ jsxDEV("section", {
|
|
25
|
+
className: "editorial-section",
|
|
26
|
+
children: /* @__PURE__ */ jsxDEV("div", {
|
|
27
|
+
className: "editorial-shell space-y-6",
|
|
28
|
+
children: [
|
|
29
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
30
|
+
className: "flex flex-col gap-6 lg:flex-row lg:items-end lg:justify-between",
|
|
31
|
+
children: [
|
|
32
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
33
|
+
className: "max-w-3xl space-y-3",
|
|
34
|
+
children: [
|
|
35
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
36
|
+
className: "editorial-kicker",
|
|
37
|
+
children: "Browse by source"
|
|
38
|
+
}, undefined, false, undefined, this),
|
|
39
|
+
/* @__PURE__ */ jsxDEV("h2", {
|
|
40
|
+
className: "font-serif text-4xl tracking-[-0.04em]",
|
|
41
|
+
children: "Use local scenarios for core proof, then scan the community."
|
|
42
|
+
}, undefined, false, undefined, this),
|
|
43
|
+
/* @__PURE__ */ jsxDEV("p", {
|
|
44
|
+
className: "text-muted-foreground text-sm leading-7",
|
|
45
|
+
children: registryConfigured ? "Local templates show the official adoption path. Community templates show where the ecosystem is pushing the system next." : "Local templates show the official adoption path. Community browsing appears automatically when a registry URL is configured."
|
|
46
|
+
}, undefined, false, undefined, this)
|
|
47
|
+
]
|
|
48
|
+
}, undefined, true, undefined, this),
|
|
49
|
+
registryConfigured ? /* @__PURE__ */ jsxDEV("div", {
|
|
50
|
+
className: "flex gap-2",
|
|
51
|
+
children: availableSources.map((option) => /* @__PURE__ */ jsxDEV("button", {
|
|
52
|
+
onClick: () => onSourceChange(option),
|
|
53
|
+
className: cn("rounded-full px-4 py-2 font-medium text-sm transition-colors", {
|
|
54
|
+
"bg-primary text-primary-foreground": source === option,
|
|
55
|
+
"border border-border bg-card hover:bg-card/80": source !== option
|
|
56
|
+
}),
|
|
57
|
+
"aria-pressed": source === option,
|
|
58
|
+
children: option === "local" ? "Local" : "Community"
|
|
59
|
+
}, option, false, undefined, this))
|
|
60
|
+
}, undefined, false, undefined, this) : null
|
|
61
|
+
]
|
|
62
|
+
}, undefined, true, undefined, this),
|
|
63
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
64
|
+
className: "editorial-panel space-y-5",
|
|
65
|
+
children: [
|
|
66
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
67
|
+
className: "relative",
|
|
68
|
+
children: [
|
|
69
|
+
/* @__PURE__ */ jsxDEV(Search, {
|
|
70
|
+
className: "absolute top-3.5 left-4 text-muted-foreground",
|
|
71
|
+
size: 18
|
|
72
|
+
}, undefined, false, undefined, this),
|
|
73
|
+
/* @__PURE__ */ jsxDEV("input", {
|
|
74
|
+
type: "text",
|
|
75
|
+
placeholder: "Search scenarios, industries, or tags",
|
|
76
|
+
value: search,
|
|
77
|
+
onChange: (event) => onSearchChange(event.target.value),
|
|
78
|
+
className: "w-full rounded-full border border-border bg-background px-12 py-3 text-sm focus:outline-none focus:ring-2 focus:ring-ring",
|
|
79
|
+
"aria-label": "Search templates"
|
|
80
|
+
}, undefined, false, undefined, this)
|
|
81
|
+
]
|
|
82
|
+
}, undefined, true, undefined, this),
|
|
83
|
+
showTagFilters ? /* @__PURE__ */ jsxDEV("div", {
|
|
84
|
+
className: "space-y-3",
|
|
85
|
+
children: [
|
|
86
|
+
/* @__PURE__ */ jsxDEV("div", {
|
|
87
|
+
className: "flex flex-wrap gap-2",
|
|
88
|
+
children: [
|
|
89
|
+
/* @__PURE__ */ jsxDEV("button", {
|
|
90
|
+
onClick: () => onTagChange(null),
|
|
91
|
+
className: cn("rounded-full px-4 py-2 font-medium text-sm transition-colors", {
|
|
92
|
+
"bg-primary text-primary-foreground": selectedTag === null,
|
|
93
|
+
"border border-border bg-card hover:bg-card/80": selectedTag !== null
|
|
94
|
+
}),
|
|
95
|
+
"aria-pressed": selectedTag === null,
|
|
96
|
+
children: "All"
|
|
97
|
+
}, undefined, false, undefined, this),
|
|
98
|
+
visibleTagFacets.map((facet) => /* @__PURE__ */ jsxDEV("button", {
|
|
99
|
+
onClick: () => onTagChange(facet.tag),
|
|
100
|
+
className: cn("rounded-full px-4 py-2 font-medium text-sm transition-colors", {
|
|
101
|
+
"bg-primary text-primary-foreground": selectedTag === facet.tag,
|
|
102
|
+
"border border-border bg-card hover:bg-card/80": selectedTag !== facet.tag
|
|
103
|
+
}),
|
|
104
|
+
"aria-pressed": selectedTag === facet.tag,
|
|
105
|
+
children: facet.tag
|
|
106
|
+
}, facet.tag, false, undefined, this))
|
|
107
|
+
]
|
|
108
|
+
}, undefined, true, undefined, this),
|
|
109
|
+
hiddenTagFacets.length > 0 || showAllTags ? /* @__PURE__ */ jsxDEV("button", {
|
|
110
|
+
type: "button",
|
|
111
|
+
onClick: () => onShowAllTagsChange(!showAllTags),
|
|
112
|
+
className: "text-muted-foreground text-sm transition-colors hover:text-foreground",
|
|
113
|
+
children: showAllTags ? "Show fewer" : "More tags"
|
|
114
|
+
}, undefined, false, undefined, this) : null
|
|
115
|
+
]
|
|
116
|
+
}, undefined, true, undefined, this) : null
|
|
117
|
+
]
|
|
118
|
+
}, undefined, true, undefined, this)
|
|
119
|
+
]
|
|
120
|
+
}, undefined, true, undefined, this)
|
|
121
|
+
}, undefined, false, undefined, this);
|
|
122
|
+
}
|
|
123
|
+
export {
|
|
124
|
+
TemplatesBrowseControls
|
|
125
|
+
};
|