@contractspec/bundle.library 3.8.12 → 3.9.0
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 +290 -282
- package/CHANGELOG.md +46 -0
- package/dist/application/index.js +11 -11
- package/dist/application/mcp/cliMcp.js +6 -6
- package/dist/application/mcp/cliMcp.onboarding.d.ts +4 -0
- package/dist/application/mcp/cliMcp.onboarding.js +2 -0
- package/dist/application/mcp/cliMcp.test.d.ts +1 -0
- package/dist/application/mcp/contractsMcp.js +2 -2
- package/dist/application/mcp/contractsMcp.test.d.ts +1 -0
- package/dist/application/mcp/contractsMcpAdoptionTools.d.ts +3 -0
- package/dist/application/mcp/contractsMcpAdoptionTools.js +2 -0
- package/dist/application/mcp/contractsMcpResources.js +1 -1
- package/dist/application/mcp/contractsMcpTools.js +1 -1
- package/dist/application/mcp/contractsMcpTypes.d.ts +16 -0
- package/dist/application/mcp/index.js +11 -11
- package/dist/components/docs/DocsIndexPage.js +1 -1
- package/dist/components/docs/docsManifest.js +1 -1
- package/dist/components/docs/examples/DocsExamplesPage.js +1 -17
- package/dist/components/docs/examples/ExampleShowcasePage.d.ts +1 -1
- package/dist/components/docs/examples/ExampleShowcasePage.js +2 -17
- package/dist/components/docs/examples/exampleShowcaseData.d.ts +2 -2
- package/dist/components/docs/examples/exampleShowcaseData.js +2 -17
- package/dist/components/docs/examples/exampleShowcaseData.test.d.ts +1 -0
- package/dist/components/docs/examples/index.js +2 -17
- package/dist/components/docs/getting-started/CLIPage.js +5 -4
- package/dist/components/docs/getting-started/DataViewTutorialPage.js +44 -67
- package/dist/components/docs/getting-started/StartHerePage.js +4 -2
- package/dist/components/docs/getting-started/index.js +56 -76
- package/dist/components/docs/guides/GuideConnectInRepoPage.js +29 -4
- package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
- package/dist/components/docs/guides/GuideReleaseCapsulesPage.d.ts +1 -0
- package/dist/components/docs/guides/GuideReleaseCapsulesPage.js +16 -0
- package/dist/components/docs/guides/GuidesIndexPage.js +1 -1
- package/dist/components/docs/guides/index.d.ts +1 -0
- package/dist/components/docs/guides/index.js +93 -39
- package/dist/components/docs/index.js +572 -421
- package/dist/components/docs/libraries/LibrariesContractsPage.js +43 -18
- package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
- package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/components/docs/libraries/LibrariesUIKitPage.js +42 -16
- package/dist/components/docs/libraries/LibrariesUIKitWebPage.d.ts +1 -0
- package/dist/components/docs/libraries/LibrariesUIKitWebPage.js +47 -0
- package/dist/components/docs/libraries/index.d.ts +1 -0
- package/dist/components/docs/libraries/index.js +221 -113
- package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
- package/dist/components/docs/specs/SpecsConnectPage.js +4 -2
- package/dist/components/docs/specs/SpecsDataViewsPage.js +39 -32
- package/dist/components/docs/specs/index.js +65 -41
- package/dist/index.js +583 -432
- package/dist/node/application/index.js +11 -11
- package/dist/node/application/mcp/cliMcp.js +6 -6
- package/dist/node/application/mcp/cliMcp.onboarding.js +1 -0
- package/dist/node/application/mcp/contractsMcp.js +2 -2
- package/dist/node/application/mcp/contractsMcpAdoptionTools.js +1 -0
- package/dist/node/application/mcp/contractsMcpResources.js +1 -1
- package/dist/node/application/mcp/contractsMcpTools.js +1 -1
- package/dist/node/application/mcp/index.js +11 -11
- package/dist/node/components/docs/DocsIndexPage.js +1 -1
- package/dist/node/components/docs/docsManifest.js +1 -1
- package/dist/node/components/docs/examples/DocsExamplesPage.js +1 -17
- package/dist/node/components/docs/examples/ExampleShowcasePage.js +2 -17
- package/dist/node/components/docs/examples/exampleShowcaseData.js +2 -17
- package/dist/node/components/docs/examples/index.js +2 -17
- package/dist/node/components/docs/getting-started/CLIPage.js +5 -4
- package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +44 -67
- package/dist/node/components/docs/getting-started/StartHerePage.js +4 -2
- package/dist/node/components/docs/getting-started/index.js +56 -76
- package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +29 -4
- package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
- package/dist/node/components/docs/guides/GuideReleaseCapsulesPage.js +15 -0
- package/dist/node/components/docs/guides/GuidesIndexPage.js +1 -1
- package/dist/node/components/docs/guides/index.js +93 -39
- package/dist/node/components/docs/index.js +572 -421
- package/dist/node/components/docs/libraries/LibrariesContractsPage.js +43 -18
- package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
- package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +42 -16
- package/dist/node/components/docs/libraries/LibrariesUIKitWebPage.js +46 -0
- package/dist/node/components/docs/libraries/index.js +221 -113
- package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
- package/dist/node/components/docs/specs/SpecsConnectPage.js +4 -2
- package/dist/node/components/docs/specs/SpecsDataViewsPage.js +39 -32
- package/dist/node/components/docs/specs/index.js +65 -41
- package/dist/node/index.js +583 -432
- package/package.json +65 -16
- package/src/application/mcp/cliMcp.onboarding.ts +297 -0
- package/src/application/mcp/cliMcp.test.ts +99 -0
- package/src/application/mcp/cliMcp.ts +30 -3
- package/src/application/mcp/contractsMcp.test.ts +65 -0
- package/src/application/mcp/contractsMcpAdoptionTools.ts +131 -0
- package/src/application/mcp/contractsMcpResources.ts +49 -0
- package/src/application/mcp/contractsMcpTools.ts +2 -0
- package/src/application/mcp/contractsMcpTypes.ts +16 -0
- package/src/components/docs/docsManifest.ts +12 -0
- package/src/components/docs/examples/DocsExamplesPage.tsx +6 -14
- package/src/components/docs/examples/ExampleShowcasePage.tsx +22 -18
- package/src/components/docs/examples/exampleShowcaseData.test.ts +22 -0
- package/src/components/docs/examples/exampleShowcaseData.ts +75 -50
- package/src/components/docs/generated/docs-index._common.json +2008 -1691
- package/src/components/docs/generated/docs-index.agent-console.json +377 -377
- package/src/components/docs/generated/docs-index.ai-chat-assistant.json +17 -17
- package/src/components/docs/generated/docs-index.ai-chat.json +105 -105
- package/src/components/docs/generated/docs-index.ai-support-bot.json +9 -9
- package/src/components/docs/generated/docs-index.analytics-dashboard.json +169 -169
- package/src/components/docs/generated/docs-index.app-config.json +137 -137
- package/src/components/docs/generated/docs-index.artisan-knowledge-product.json +17 -17
- package/src/components/docs/generated/docs-index.artisan-payments-stripe.json +33 -33
- package/src/components/docs/generated/docs-index.audit-trail.json +49 -49
- package/src/components/docs/generated/docs-index.calendar-google.json +9 -9
- package/src/components/docs/generated/docs-index.content-generation.json +9 -9
- package/src/components/docs/generated/docs-index.control-plane.json +17 -17
- package/src/components/docs/generated/docs-index.crm-pipeline.json +161 -161
- package/src/components/docs/generated/docs-index.data-grid-showcase.json +25 -17
- package/src/components/docs/generated/docs-index.defineExample.json +9 -9
- package/src/components/docs/generated/docs-index.email-gmail.json +9 -9
- package/src/components/docs/generated/docs-index.feature-flags.json +217 -217
- package/src/components/docs/generated/docs-index.files.json +177 -177
- package/src/components/docs/generated/docs-index.generated.ts +20 -20
- package/src/components/docs/generated/docs-index.harness-lab.json +9 -9
- package/src/components/docs/generated/docs-index.health.json +97 -97
- package/src/components/docs/generated/docs-index.identity-rbac.json +313 -313
- package/src/components/docs/generated/docs-index.in-app-docs.json +9 -9
- package/src/components/docs/generated/docs-index.integration-hub.json +265 -265
- package/src/components/docs/generated/docs-index.integration-posthog.json +9 -9
- package/src/components/docs/generated/docs-index.integration-stripe.json +9 -9
- package/src/components/docs/generated/docs-index.integration-supabase.json +9 -9
- package/src/components/docs/generated/docs-index.jobs.json +137 -137
- package/src/components/docs/generated/docs-index.kb-update-pipeline.json +129 -129
- package/src/components/docs/generated/docs-index.knowledge-canon.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-ambient-coach.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +49 -49
- package/src/components/docs/generated/docs-index.learning-journey-duo-drills.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +49 -49
- package/src/components/docs/generated/docs-index.learning-journey-quest-challenges.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-registry.json +33 -33
- package/src/components/docs/generated/docs-index.learning-journey-studio-onboarding.json +49 -49
- package/src/components/docs/generated/docs-index.learning-journey-ui-coaching.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-ui-gamified.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-ui-onboarding.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey-ui-shared.json +9 -9
- package/src/components/docs/generated/docs-index.learning-journey.json +241 -217
- package/src/components/docs/generated/docs-index.learning-patterns.json +9 -9
- package/src/components/docs/generated/docs-index.lifecycle-cli.json +9 -9
- package/src/components/docs/generated/docs-index.lifecycle-dashboard.json +9 -9
- package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +65 -57
- package/src/components/docs/generated/docs-index.manifest.json +432 -432
- package/src/components/docs/generated/docs-index.marketplace.json +337 -337
- package/src/components/docs/generated/docs-index.meeting-recorder-providers.json +9 -9
- package/src/components/docs/generated/docs-index.meeting-recorder.json +49 -49
- package/src/components/docs/generated/docs-index.messaging-agent-actions.json +17 -17
- package/src/components/docs/generated/docs-index.metrics.json +201 -201
- package/src/components/docs/generated/docs-index.minimal.json +17 -17
- package/src/components/docs/generated/docs-index.mobile-demo-tasks.json +33 -33
- package/src/components/docs/generated/docs-index.notifications.json +65 -65
- package/src/components/docs/generated/docs-index.openbanking-powens.json +9 -9
- package/src/components/docs/generated/docs-index.openbanking.json +65 -65
- package/src/components/docs/generated/docs-index.opencode-cli.json +17 -17
- package/src/components/docs/generated/docs-index.personalization.json +9 -9
- package/src/components/docs/generated/docs-index.platform-acp.json +137 -137
- package/src/components/docs/generated/docs-index.platform-agent.json +201 -185
- package/src/components/docs/generated/docs-index.platform-context.json +121 -105
- package/src/components/docs/generated/docs-index.platform-control-plane.json +321 -321
- package/src/components/docs/generated/docs-index.platform-database.json +89 -89
- package/src/components/docs/generated/docs-index.platform-docs.json +161 -153
- package/src/components/docs/generated/docs-index.platform-harness.json +177 -177
- package/src/components/docs/generated/docs-index.platform-integrations.json +329 -329
- package/src/components/docs/generated/docs-index.platform-knowledge.json +57 -57
- package/src/components/docs/generated/docs-index.platform-provider-ranking.json +217 -185
- package/src/components/docs/generated/docs-index.pocket-family-office.json +129 -129
- package/src/components/docs/generated/docs-index.policy-safe-knowledge-assistant.json +9 -9
- package/src/components/docs/generated/docs-index.product-intent.json +9 -9
- package/src/components/docs/generated/docs-index.project-management-sync.json +9 -9
- package/src/components/docs/generated/docs-index.saas-boilerplate.json +209 -209
- package/src/components/docs/generated/docs-index.service-business-os.json +193 -193
- package/src/components/docs/generated/docs-index.team-hub.json +185 -185
- package/src/components/docs/generated/docs-index.unknown.json +521 -521
- package/src/components/docs/generated/docs-index.versioned-knowledge-base.json +81 -81
- package/src/components/docs/generated/docs-index.video-api-showcase.json +33 -33
- package/src/components/docs/generated/docs-index.video-docs-terminal.json +9 -9
- package/src/components/docs/generated/docs-index.video-marketing-clip.json +9 -9
- package/src/components/docs/generated/docs-index.visualization-showcase.json +17 -17
- package/src/components/docs/generated/docs-index.voice-providers.json +9 -9
- package/src/components/docs/generated/docs-index.wealth-snapshot.json +153 -153
- package/src/components/docs/generated/docs-index.workflow-system.json +433 -433
- package/src/components/docs/generated/docs-index.workspace-cli.json +9 -9
- package/src/components/docs/getting-started/CLIPage.tsx +10 -2
- package/src/components/docs/getting-started/DataViewTutorialPage.tsx +63 -70
- package/src/components/docs/getting-started/StartHerePage.tsx +10 -9
- package/src/components/docs/guides/GuideConnectInRepoPage.tsx +52 -3
- package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +55 -6
- package/src/components/docs/guides/GuideReleaseCapsulesPage.tsx +147 -0
- package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
- package/src/components/docs/guides/index.ts +1 -0
- package/src/components/docs/libraries/LibrariesContractsPage.tsx +72 -27
- package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +67 -61
- package/src/components/docs/libraries/LibrariesOverviewPage.tsx +7 -1
- package/src/components/docs/libraries/LibrariesUIKitPage.tsx +63 -25
- package/src/components/docs/libraries/LibrariesUIKitWebPage.tsx +115 -0
- package/src/components/docs/libraries/index.ts +1 -0
- package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +58 -3
- package/src/components/docs/specs/SpecsConnectPage.tsx +30 -0
- package/src/components/docs/specs/SpecsDataViewsPage.tsx +63 -42
|
@@ -1,24 +1,49 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{CodeBlock as o,InstallCommand as i}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as r}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";
|
|
3
|
-
import {
|
|
2
|
+
import{CodeBlock as o,InstallCommand as i}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as r}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var c=`import { defineDataView } from '@contractspec/lib.contracts-spec/data-views';
|
|
3
|
+
import { ListDataGridShowcaseRowsQuery } from '@contractspec/example.data-grid-showcase/contracts/data-grid-showcase.operation';
|
|
4
4
|
|
|
5
|
-
const
|
|
6
|
-
name: 'CreateUserInput',
|
|
7
|
-
fields: {
|
|
8
|
-
email: { type: ScalarTypeEnum.Email(), isOptional: false },
|
|
9
|
-
name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
|
|
10
|
-
},
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
export const CreateUser = defineCommand({
|
|
5
|
+
export const DataGridShowcaseDataView = defineDataView({
|
|
14
6
|
meta: {
|
|
15
|
-
key: '
|
|
7
|
+
key: 'examples.data-grid-showcase.table',
|
|
16
8
|
version: '1.0.0',
|
|
17
|
-
|
|
9
|
+
entity: 'account',
|
|
10
|
+
title: 'Data Grid Showcase Table',
|
|
11
|
+
description:
|
|
12
|
+
'Declarative DataViewSpec for the ContractSpec table showcase.',
|
|
13
|
+
domain: 'examples',
|
|
14
|
+
owners: ['@platform.core'],
|
|
15
|
+
tags: ['examples', 'table', 'data-grid'],
|
|
16
|
+
stability: 'experimental',
|
|
17
|
+
},
|
|
18
|
+
source: {
|
|
19
|
+
primary: {
|
|
20
|
+
key: ListDataGridShowcaseRowsQuery.meta.key,
|
|
21
|
+
version: ListDataGridShowcaseRowsQuery.meta.version,
|
|
22
|
+
},
|
|
18
23
|
},
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
24
|
+
view: {
|
|
25
|
+
kind: 'table',
|
|
26
|
+
executionMode: 'client',
|
|
27
|
+
selection: 'multiple',
|
|
28
|
+
columnVisibility: true,
|
|
29
|
+
columnResizing: true,
|
|
30
|
+
columnPinning: true,
|
|
31
|
+
rowExpansion: {
|
|
32
|
+
fields: ['notes', 'renewalDate', 'lastActivityAt'],
|
|
33
|
+
},
|
|
34
|
+
initialState: {
|
|
35
|
+
pageSize: 4,
|
|
36
|
+
hiddenColumns: ['notes'],
|
|
37
|
+
pinnedColumns: {
|
|
38
|
+
left: ['account'],
|
|
39
|
+
},
|
|
40
|
+
sorting: [{ field: 'arr', desc: true }],
|
|
41
|
+
},
|
|
42
|
+
fields: [
|
|
43
|
+
{ key: 'account', label: 'Account', dataPath: 'account', sortable: true },
|
|
44
|
+
{ key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
|
|
45
|
+
{ key: 'status', label: 'Status', dataPath: 'status', sortable: true },
|
|
46
|
+
{ key: 'notes', label: 'Notes', dataPath: 'notes' },
|
|
47
|
+
],
|
|
22
48
|
},
|
|
23
|
-
|
|
24
|
-
});`})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Core Concepts"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"OperationSpec"}),": Immutable description of an operation (Command or Query). Defines I/O, policy, and metadata."]}),t("li",{children:[e("strong",{children:"OperationSpecRegistry"}),": Registry of specs + handlers. Use ",e("code",{className:"font-mono text-xs",children:"installOp"})," ","to attach a handler."]}),t("li",{children:[e("strong",{children:"CapabilitySpec"}),": Canonical capability declaration (requires/provides)."]}),t("li",{children:[e("strong",{children:"PolicySpec"}),": Declarative policy rules (ABAC/ReBAC, rate limits)."]}),t("li",{children:[e("strong",{children:"TelemetrySpec"}),": Analytics definitions and privacy levels."]}),t("li",{children:[e("strong",{children:"PresentationSpec (V2)"}),": Describes how data is rendered (Web Components, Markdown, Data)."]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Lifecycle"}),t("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"Define"})," the spec (I/O via SchemaModel or Zod)."]}),t("li",{children:[e("strong",{children:"Register"})," it:"," ",e("code",{className:"font-mono text-xs",children:"installOp(registry, spec, handler)"}),"."]}),t("li",{children:[e("strong",{children:"Expose"})," it via an adapter (REST, GraphQL, MCP)."]}),t("li",{children:[e("strong",{children:"Validate"})," at runtime automatically."]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Adapters"}),t("ul",{className:"space-y-2 text-muted-foreground",children:[t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/rest-next-app"}),": Next.js App Router adapter"]}),t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/provider-mcp"}),": Model Context Protocol (MCP) for AI agents"]}),t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/graphql-pothos"}),": GraphQL schema generator"]})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(a,{href:"/docs/libraries/schema",className:"btn-primary",children:["Next: Schema ",e(r,{size:16})]}),e(a,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Core Concepts"})]})]})}export{s as LibrariesContractsPage};
|
|
49
|
+
});`;function d(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.contracts-spec"}),e("p",{className:"text-lg text-muted-foreground",children:"The core library for defining what your application can do. Unified specifications for Operations, Events, Presentations, and Features."})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(i,{package:["@contractspec/lib.contracts-spec","@contractspec/lib.schema"]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"What lives where"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"@contractspec/lib.contracts-spec"})," (root): The core contracts definitions (OperationSpec, PresentationSpec, Registry)."]}),t("li",{children:[e("strong",{children:"@contractspec/lib.contracts-runtime-client-react"}),": Browser-safe helpers (React renderers, client SDK). Import this for web/React Native."]}),t("li",{children:[e("strong",{children:"@contractspec/lib.contracts-runtime-server-rest"}),": HTTP/MCP adapters, registries, integrations (Node-only)."]}),t("li",{children:[e("strong",{children:"@contractspec/lib.schema"}),": Schema dictionary (SchemaModel, FieldType) for I/O definitions."]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table contract example"}),t("p",{className:"text-muted-foreground",children:["The canonical account-grid example starts here in"," ",e("code",{children:"@contractspec/lib.contracts-spec"}),". The contract declares table execution mode, selection, pinning, resizing, row expansion, and initial state before any renderer is chosen."]}),e(o,{language:"typescript",code:c}),t("p",{className:"text-muted-foreground text-sm",children:["See the live version in"," ",e(a,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"/docs/examples/data-grid-showcase"}),"."]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Core Concepts"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"OperationSpec"}),": Immutable description of an operation (Command or Query). Defines I/O, policy, and metadata."]}),t("li",{children:[e("strong",{children:"OperationSpecRegistry"}),": Registry of specs + handlers. Use ",e("code",{className:"font-mono text-xs",children:"installOp"})," ","to attach a handler."]}),t("li",{children:[e("strong",{children:"CapabilitySpec"}),": Canonical capability declaration (requires/provides)."]}),t("li",{children:[e("strong",{children:"PolicySpec"}),": Declarative policy rules (ABAC/ReBAC, rate limits)."]}),t("li",{children:[e("strong",{children:"TelemetrySpec"}),": Analytics definitions and privacy levels."]}),t("li",{children:[e("strong",{children:"PresentationSpec (V2)"}),": Describes how data is rendered (Web Components, Markdown, Data)."]}),t("li",{children:[e("strong",{children:"DataViewSpec"}),": Declarative list, table, grid, and detail contracts that the table showcase uses as its canonical account-grid example."]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Lifecycle"}),t("ol",{className:"list-inside list-decimal space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"Define"})," the spec (I/O via SchemaModel or Zod)."]}),t("li",{children:[e("strong",{children:"Register"})," it:"," ",e("code",{className:"font-mono text-xs",children:"installOp(registry, spec, handler)"}),"."]}),t("li",{children:[e("strong",{children:"Expose"})," it via an adapter (REST, GraphQL, MCP)."]}),t("li",{children:[e("strong",{children:"Validate"})," at runtime automatically."]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Adapters"}),t("ul",{className:"space-y-2 text-muted-foreground",children:[t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/rest-next-app"}),": Next.js App Router adapter"]}),t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/provider-mcp"}),": Model Context Protocol (MCP) for AI agents"]}),t("li",{children:[e("code",{className:"rounded bg-background/50 px-2 py-1",children:"server/graphql-pothos"}),": GraphQL schema generator"]})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[t(a,{href:"/docs/libraries/schema",className:"btn-primary",children:["Next: Schema ",e(r,{size:16})]}),e(a,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Core Concepts"})]})]})}export{d as LibrariesContractsPage};
|
|
@@ -1,38 +1,50 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{CodeBlock as
|
|
3
|
-
import {
|
|
2
|
+
import{CodeBlock as o,InstallCommand as i}from"@contractspec/lib.design-system";import t from"@contractspec/lib.ui-link";import{ChevronRight as l}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";var r=`import { Button, DataTable } from '@contractspec/lib.design-system';
|
|
3
|
+
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
5
|
+
import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
|
|
6
|
+
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
|
|
7
|
+
import {
|
|
8
|
+
ExpandedRowContent,
|
|
9
|
+
ShowcaseToolbar,
|
|
10
|
+
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
|
|
11
|
+
|
|
12
|
+
export function AccountHealthTable() {
|
|
13
|
+
const columns = useShowcaseColumns();
|
|
13
14
|
|
|
14
|
-
const
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const controller = useContractTable({
|
|
16
|
+
data: SHOWCASE_ROWS,
|
|
17
|
+
columns,
|
|
18
|
+
selectionMode: 'multiple',
|
|
19
|
+
initialState: {
|
|
20
|
+
sorting: [{ id: 'arr', desc: true }],
|
|
21
|
+
pagination: { pageIndex: 0, pageSize: 4 },
|
|
22
|
+
columnVisibility: { notes: false },
|
|
23
|
+
columnPinning: { left: ['account'], right: [] },
|
|
24
|
+
},
|
|
25
|
+
renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
|
|
26
|
+
getCanExpand: () => true,
|
|
27
|
+
});
|
|
18
28
|
|
|
19
|
-
export function SignupForm() {
|
|
20
29
|
return (
|
|
21
|
-
<
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
30
|
+
<DataTable
|
|
31
|
+
controller={controller}
|
|
32
|
+
title="Account health"
|
|
33
|
+
description="Composed table surface for the canonical account grid."
|
|
34
|
+
headerActions={<Button variant="outline">Reset</Button>}
|
|
35
|
+
toolbar={
|
|
36
|
+
<ShowcaseToolbar
|
|
37
|
+
controller={controller}
|
|
38
|
+
label="Client mode"
|
|
39
|
+
primaryColumnId="account"
|
|
40
|
+
toggleColumnId="notes"
|
|
41
|
+
pinColumnId="owner"
|
|
42
|
+
sortColumnIds={['arr', 'renewalDate']}
|
|
43
|
+
/>
|
|
44
|
+
}
|
|
45
|
+
loading={false}
|
|
46
|
+
emptyState={<div>No rows available.</div>}
|
|
47
|
+
footer={\`Page \${controller.pageIndex + 1} of \${controller.pageCount}\`}
|
|
25
48
|
/>
|
|
26
49
|
);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// For installation commands with package manager tabs
|
|
30
|
-
<InstallCommand package="my-package" />
|
|
31
|
-
<InstallCommand package={["react", "react-dom"]} dev />
|
|
32
|
-
|
|
33
|
-
// For code examples with syntax highlighting
|
|
34
|
-
<CodeBlock
|
|
35
|
-
language="typescript"
|
|
36
|
-
code={\`const hello = "world";\`}
|
|
37
|
-
filename="example.ts"
|
|
38
|
-
/>`})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Key Exports"}),a("div",{className:"grid gap-4 md:grid-cols-2",children:[a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Organisms"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"AppLayout, AppHeader, AppSidebar"}),e("li",{children:"MarketingLayout, HeroSection"}),e("li",{children:"ListCardPage, ListTablePage"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"DataViewRenderer"}),e("li",{children:"ZodForm"}),e("li",{children:"FormLayout, FormDialog"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Code Display"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"CodeBlock (syntax highlighting)"}),e("li",{children:"CommandTabs (package manager tabs)"}),e("li",{children:"InstallCommand (convenience wrapper)"}),e("li",{children:"CopyButton"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Providers"}),e("ul",{className:"space-y-1 text-muted-foreground text-sm",children:e("li",{children:"PackageManagerProvider"})})]})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[e(i,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),a(i,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",e(l,{size:16})]})]})]})}export{n as LibrariesDesignSystemPage};
|
|
50
|
+
}`;function d(){return a("div",{className:"space-y-8",children:[a("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.design-system"}),a("p",{className:"text-muted-foreground",children:["High-level design system components, patterns, and layouts for LSSM applications. Built on top of ",e("code",{children:"@contractspec/lib.ui-kit"}),"."]})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(i,{package:"@contractspec/lib.design-system"})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"What It Provides"}),a("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[a("li",{children:[e("strong",{children:"Composite Components"}),": Molecules and Organisms that solve common UI problems"]}),a("li",{children:[e("strong",{children:"Layouts"}),": Ready-to-use page structures for dashboards, marketing sites, and lists"]}),a("li",{children:[e("strong",{children:"Data Views"}),": Standardized renderers for lists, tables, and detail views"]}),a("li",{children:[e("strong",{children:"Forms"}),": Zod-integrated form layouts and components"]}),a("li",{children:[e("strong",{children:"Code Display"}),": Syntax-highlighted code blocks with package manager tabs"]}),a("li",{children:[e("strong",{children:"Platform Utilities"}),": Hooks for responsive and adaptive design"]}),a("li",{children:[e("strong",{children:"Legal Templates"}),": Compliant templates for Terms, Privacy, and GDPR"]})]})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table example"}),a("p",{className:"text-muted-foreground",children:["This is the composed lane from the canonical"," ",e(t,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". The design-system wrapper owns title, description, header actions, and the opinionated card shell on top of the raw web primitive."]}),e(o,{language:"tsx",code:r})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Key Exports"}),a("div",{className:"grid gap-4 md:grid-cols-2",children:[a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Organisms"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"AppLayout, AppHeader, AppSidebar"}),e("li",{children:"MarketingLayout, HeroSection"}),e("li",{children:"ListCardPage, ListTablePage"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Data & Forms"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"DataTable"}),e("li",{children:"DataViewTable"}),e("li",{children:"DataViewRenderer"}),e("li",{children:"ZodForm"}),e("li",{children:"FormLayout, FormDialog"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Code Display"}),a("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"CodeBlock (syntax highlighting)"}),e("li",{children:"CommandTabs (package manager tabs)"}),e("li",{children:"InstallCommand (convenience wrapper)"}),e("li",{children:"CopyButton"})]})]}),a("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Providers"}),e("ul",{className:"space-y-1 text-muted-foreground text-sm",children:e("li",{children:"PackageManagerProvider"})})]})]})]}),a("div",{className:"flex items-center gap-4 pt-4",children:[e(t,{href:"/docs/libraries/ui-kit-web",className:"btn-ghost",children:"Previous: UI Kit Web"}),a(t,{href:"/docs/libraries/accessibility",className:"btn-primary",children:["Next: Accessibility ",e(l,{size:16})]})]})]})}export{d as LibrariesDesignSystemPage};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import r from"@contractspec/lib.ui-link";import{ChevronRight as s}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var
|
|
2
|
+
import r from"@contractspec/lib.ui-link";import{ChevronRight as s}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var c=[{title:"Contract and schema foundation",body:"Use these packages to define explicit contracts, schemas, and generated artifacts without inventing a new platform-specific language.",items:[{title:"@contractspec/lib.contracts-spec",description:"Define operations, events, policies, and generated surfaces in TypeScript.",href:"/docs/libraries/contracts"},{title:"@contractspec/lib.schema",description:"Share type-safe schema definitions across validation, clients, and runtime adapters.",href:"/docs/libraries/schema"}]},{title:"Runtime and surface libraries",body:"These packages execute the contract model across UI, data, observability, workflows, and generated runtime behavior.",items:[{title:"@contractspec/lib.runtime",description:"Run typed capability surfaces, execute policies, and connect runtime adapters.",href:"/docs/libraries/runtime"},{title:"@contractspec/lib.ui-kit",description:"Render shared surfaces across web and React Native without forking the contract layer.",href:"/docs/libraries/ui-kit"},{title:"@contractspec/lib.ui-kit-web",description:"Use the raw web primitive layer directly when you want the browser table, accessibility, and interaction model without the design-system shell.",href:"/docs/libraries/ui-kit-web"},{title:"@contractspec/lib.design-system",description:"Build higher-level product surfaces and documented marketing/docs primitives on top of the web and native UI packages.",href:"/docs/libraries/design-system"},{title:"@contractspec/lib.data-views",description:"Generate and render list/detail style surfaces that stay aligned with data contracts.",href:"/docs/libraries/data-views"}]},{title:"Operator and system packages",body:"These packages matter once the system is live and you need governance, resilience, and observability.",items:[{title:"@contractspec/lib.observability",description:"Trace, log, and measure contract execution using the same system boundaries.",href:"/docs/libraries/observability"},{title:"@contractspec/lib.resilience",description:"Add circuit breakers, retries, and failure controls without hiding the integration model.",href:"/docs/libraries/resilience"},{title:"@contractspec/lib.multi-tenancy",description:"Keep tenant-specific config, policy, and surface resolution explicit.",href:"/docs/libraries/multi-tenancy"},{title:"@contractspec/lib.workflow-composer",description:"Compose and extend workflows without smearing orchestration concerns across apps.",href:"/docs/libraries/workflow-composer"}]}];function l(){return t("div",{className:"space-y-10",children:[t("div",{className:"space-y-3",children:[e("p",{className:"editorial-kicker",children:"Build"}),e("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"The OSS foundation is a library system, not a closed platform."}),e("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:"ContractSpec is assembled from libraries that remain useful on their own and stronger together. Start with the contract and schema foundation, then add runtime, UI, integration, and operator packages as your system grows."})]}),t("div",{className:"editorial-proof-strip",children:[t("div",{className:"editorial-stat",children:[e("span",{className:"editorial-label",children:"Layering rule"}),e("span",{className:"editorial-stat-value",children:"libs \u2192 bundles \u2192 apps"})]}),e("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"Keep reusable behavior in libraries, compose it into bundle-level surfaces, and reserve app packages for concrete delivery shells."})]}),e("div",{className:"space-y-6",children:c.map((i)=>t("section",{className:"editorial-panel space-y-5",children:[t("div",{className:"space-y-2",children:[e("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:i.title}),e("p",{className:"text-muted-foreground text-sm leading-7",children:i.body})]}),e("div",{className:"grid gap-4 md:grid-cols-2",children:i.items.map((a)=>t(r,{href:a.href,className:"rounded-[24px] border border-border/75 bg-background/70 p-5 transition-colors hover:border-[color:rgb(162_79_42_/_0.45)]",children:[e("h3",{className:"font-semibold text-lg",children:a.title}),e("p",{className:"mt-2 text-muted-foreground text-sm leading-7",children:a.description}),t("div",{className:"mt-3 flex items-center gap-2 text-[color:var(--rust)] text-sm",children:["Learn more ",e(s,{size:14})]})]},a.title))})]},i.title))})]})}export{l as LibrariesOverviewPage};
|
|
@@ -1,20 +1,46 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
import{CodeBlock as
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
import{CodeBlock as o,InstallCommand as i}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as l}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var r=`import { DataTable } from '@contractspec/lib.ui-kit/ui/data-table';
|
|
3
|
+
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
|
|
4
|
+
|
|
5
|
+
import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
|
|
6
|
+
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
|
|
7
|
+
import {
|
|
8
|
+
ExpandedRowContent,
|
|
9
|
+
ShowcaseToolbar,
|
|
10
|
+
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
|
|
11
|
+
|
|
12
|
+
export function NativeAccountGrid() {
|
|
13
|
+
const columns = useShowcaseColumns();
|
|
14
|
+
|
|
15
|
+
const controller = useContractTable({
|
|
16
|
+
data: SHOWCASE_ROWS,
|
|
17
|
+
columns,
|
|
18
|
+
selectionMode: 'single',
|
|
19
|
+
initialState: {
|
|
20
|
+
sorting: [{ id: 'arr', desc: true }],
|
|
21
|
+
pagination: { pageIndex: 0, pageSize: 4 },
|
|
22
|
+
columnVisibility: { notes: false },
|
|
23
|
+
columnPinning: { left: ['account'], right: [] },
|
|
24
|
+
},
|
|
25
|
+
renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
|
|
26
|
+
getCanExpand: () => true,
|
|
27
|
+
});
|
|
5
28
|
|
|
6
|
-
export function MyComponent() {
|
|
7
29
|
return (
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
30
|
+
<DataTable
|
|
31
|
+
controller={controller}
|
|
32
|
+
toolbar={
|
|
33
|
+
<ShowcaseToolbar
|
|
34
|
+
controller={controller}
|
|
35
|
+
label="Native primitive"
|
|
36
|
+
primaryColumnId="account"
|
|
37
|
+
toggleColumnId="notes"
|
|
38
|
+
pinColumnId="owner"
|
|
39
|
+
sortColumnIds={['arr', 'renewalDate']}
|
|
40
|
+
/>
|
|
41
|
+
}
|
|
42
|
+
loading={false}
|
|
43
|
+
footer={\`Rows \${controller.rows.length}\`}
|
|
44
|
+
/>
|
|
19
45
|
);
|
|
20
|
-
}
|
|
46
|
+
}`;function s(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit"}),t("p",{className:"text-muted-foreground",children:["Universal UI components for React Native and Web, built on top of",e("code",{children:"nativewind"})," and ",e("code",{children:"@rn-primitives"}),"."]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(i,{package:"@contractspec/lib.ui-kit"})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Key Features"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[t("li",{children:[e("strong",{children:"Universal"}),": Components render natively on iOS/Android and as standard HTML on web"]}),t("li",{children:[e("strong",{children:"Styled with NativeWind"}),": Uses Tailwind CSS classes for styling"]}),t("li",{children:[e("strong",{children:"Accessible"}),": Leverages ",e("code",{children:"@rn-primitives"})," ","(Radix UI for Native)"]}),t("li",{children:[e("strong",{children:"Atomic Design"}),": Exports atoms, molecules, and organisms"]})]})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table example"}),t("p",{className:"text-muted-foreground",children:["The canonical"," ",e(a,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"})," ","uses ",e("code",{children:"@contractspec/lib.ui-kit/ui/data-table"})," as the native-first primitive lane. It shares the same controller model as the web renderer while keeping the React Native / Expo surface explicit."]}),e(o,{language:"tsx",code:r})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Core Components"}),t("div",{className:"grid gap-4 md:grid-cols-3",children:[t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Form Controls"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Button"}),e("li",{children:"Input"}),e("li",{children:"Checkbox"}),e("li",{children:"Switch"}),e("li",{children:"Select"})]})]}),t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Layout"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Card"}),e("li",{children:"Stack"}),e("li",{children:"Separator"}),e("li",{children:"Sheet"})]})]}),t("div",{className:"card-subtle p-4",children:[e("h3",{className:"mb-2 font-semibold",children:"Feedback"}),t("ul",{className:"space-y-1 text-muted-foreground text-sm",children:[e("li",{children:"Alert"}),e("li",{children:"Skeleton"}),e("li",{children:"Progress"}),e("li",{children:"Tooltip"})]})]})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(a,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),t(a,{href:"/docs/libraries/ui-kit-web",className:"btn-primary",children:["Next: UI Kit Web ",e(l,{size:16})]})]})]})}export{s as LibrariesUIKitPage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function LibrariesUIKitWebPage(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
import{CodeBlock as i,InstallCommand as o}from"@contractspec/lib.design-system";import a from"@contractspec/lib.ui-link";import{ChevronRight as n}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";var r=`import { DataTable } from '@contractspec/lib.ui-kit-web/ui/data-table';
|
|
3
|
+
import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
|
|
4
|
+
|
|
5
|
+
import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
|
|
6
|
+
import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
|
|
7
|
+
import {
|
|
8
|
+
ExpandedRowContent,
|
|
9
|
+
ShowcaseToolbar,
|
|
10
|
+
} from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
|
|
11
|
+
|
|
12
|
+
export function WebAccountGrid() {
|
|
13
|
+
const columns = useShowcaseColumns();
|
|
14
|
+
|
|
15
|
+
const controller = useContractTable({
|
|
16
|
+
data: SHOWCASE_ROWS,
|
|
17
|
+
columns,
|
|
18
|
+
selectionMode: 'single',
|
|
19
|
+
initialState: {
|
|
20
|
+
sorting: [{ id: 'lastActivityAt', desc: true }],
|
|
21
|
+
pagination: { pageIndex: 0, pageSize: 4 },
|
|
22
|
+
columnVisibility: { notes: false },
|
|
23
|
+
columnPinning: { left: ['account'], right: [] },
|
|
24
|
+
},
|
|
25
|
+
renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
|
|
26
|
+
getCanExpand: () => true,
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<DataTable
|
|
31
|
+
controller={controller}
|
|
32
|
+
toolbar={
|
|
33
|
+
<ShowcaseToolbar
|
|
34
|
+
controller={controller}
|
|
35
|
+
label="Web primitive"
|
|
36
|
+
primaryColumnId="account"
|
|
37
|
+
toggleColumnId="notes"
|
|
38
|
+
pinColumnId="owner"
|
|
39
|
+
sortColumnIds={['arr', 'renewalDate']}
|
|
40
|
+
/>
|
|
41
|
+
}
|
|
42
|
+
loading={false}
|
|
43
|
+
emptyState={<div>No rows available.</div>}
|
|
44
|
+
footer={\`Rows \${controller.totalItems}\`}
|
|
45
|
+
/>
|
|
46
|
+
);
|
|
47
|
+
}`;function d(){return t("div",{className:"space-y-8",children:[t("div",{className:"space-y-4",children:[e("h1",{className:"font-bold text-4xl",children:"@contractspec/lib.ui-kit-web"}),e("p",{className:"text-muted-foreground",children:"Web-first React and Next primitives for ContractSpec. The canonical data-table example uses this package to render the raw browser table layer directly, without the design-system shell on top."})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Installation"}),e(o,{package:"@contractspec/lib.ui-kit-web"})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Data table example"}),t("p",{className:"text-muted-foreground",children:["This is the raw browser lane from the canonical"," ",e(a,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),". It demonstrates the primitive renderer with sorting, pagination, single selection, column visibility, column resizing, left/right pinning, row expansion, loading, and empty-state slots."]}),e(i,{language:"tsx",filename:"web-account-grid.tsx",code:r})]}),t("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"What this layer owns"}),t("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[e("li",{children:"The raw table renderer and browser interaction model."}),e("li",{children:"Pagination, column visibility menus, pin menus, resize handles, and empty/loading states."}),e("li",{children:"Accessibility helpers and other web-specific primitives that stay outside the native-first package."})]})]}),t("div",{className:"flex items-center gap-4 pt-4",children:[e(a,{href:"/docs/libraries/ui-kit",className:"btn-ghost",children:"Previous: UI Kit"}),t(a,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",e(n,{size:16})]})]})]})}export{d as LibrariesUIKitWebPage};
|
|
@@ -23,5 +23,6 @@ export { LibrariesSLOPage } from './LibrariesSLOPage';
|
|
|
23
23
|
export { LibrariesSupportBotPage } from './LibrariesSupportBotPage';
|
|
24
24
|
export { LibrariesTestingPage } from './LibrariesTestingPage';
|
|
25
25
|
export { LibrariesUIKitPage } from './LibrariesUIKitPage';
|
|
26
|
+
export { LibrariesUIKitWebPage } from './LibrariesUIKitWebPage';
|
|
26
27
|
export { LibrariesWorkflowComposerPage } from './LibrariesWorkflowComposerPage';
|
|
27
28
|
export { LibrariesWorkflowsPage } from './LibrariesWorkflowsPage';
|