@contractspec/bundle.library 3.8.11 → 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.
Files changed (202) hide show
  1. package/.turbo/turbo-build.log +290 -282
  2. package/CHANGELOG.md +68 -0
  3. package/dist/application/index.js +11 -11
  4. package/dist/application/mcp/cliMcp.js +6 -6
  5. package/dist/application/mcp/cliMcp.onboarding.d.ts +4 -0
  6. package/dist/application/mcp/cliMcp.onboarding.js +2 -0
  7. package/dist/application/mcp/cliMcp.test.d.ts +1 -0
  8. package/dist/application/mcp/contractsMcp.js +2 -2
  9. package/dist/application/mcp/contractsMcp.test.d.ts +1 -0
  10. package/dist/application/mcp/contractsMcpAdoptionTools.d.ts +3 -0
  11. package/dist/application/mcp/contractsMcpAdoptionTools.js +2 -0
  12. package/dist/application/mcp/contractsMcpResources.js +1 -1
  13. package/dist/application/mcp/contractsMcpTools.js +1 -1
  14. package/dist/application/mcp/contractsMcpTypes.d.ts +16 -0
  15. package/dist/application/mcp/index.js +11 -11
  16. package/dist/components/docs/DocsIndexPage.js +1 -1
  17. package/dist/components/docs/docsManifest.js +1 -1
  18. package/dist/components/docs/examples/DocsExamplesPage.js +1 -17
  19. package/dist/components/docs/examples/ExampleShowcasePage.d.ts +1 -1
  20. package/dist/components/docs/examples/ExampleShowcasePage.js +2 -17
  21. package/dist/components/docs/examples/exampleShowcaseData.d.ts +2 -2
  22. package/dist/components/docs/examples/exampleShowcaseData.js +2 -17
  23. package/dist/components/docs/examples/exampleShowcaseData.test.d.ts +1 -0
  24. package/dist/components/docs/examples/index.js +2 -17
  25. package/dist/components/docs/getting-started/CLIPage.js +5 -4
  26. package/dist/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  27. package/dist/components/docs/getting-started/StartHerePage.js +4 -2
  28. package/dist/components/docs/getting-started/index.js +56 -76
  29. package/dist/components/docs/guides/GuideConnectInRepoPage.js +29 -4
  30. package/dist/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  31. package/dist/components/docs/guides/GuideReleaseCapsulesPage.d.ts +1 -0
  32. package/dist/components/docs/guides/GuideReleaseCapsulesPage.js +16 -0
  33. package/dist/components/docs/guides/GuidesIndexPage.js +1 -1
  34. package/dist/components/docs/guides/index.d.ts +1 -0
  35. package/dist/components/docs/guides/index.js +93 -39
  36. package/dist/components/docs/index.js +572 -421
  37. package/dist/components/docs/libraries/LibrariesContractsPage.js +43 -18
  38. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
  39. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  40. package/dist/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  41. package/dist/components/docs/libraries/LibrariesUIKitWebPage.d.ts +1 -0
  42. package/dist/components/docs/libraries/LibrariesUIKitWebPage.js +47 -0
  43. package/dist/components/docs/libraries/index.d.ts +1 -0
  44. package/dist/components/docs/libraries/index.js +221 -113
  45. package/dist/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  46. package/dist/components/docs/specs/SpecsConnectPage.js +4 -2
  47. package/dist/components/docs/specs/SpecsDataViewsPage.js +39 -32
  48. package/dist/components/docs/specs/index.js +65 -41
  49. package/dist/index.js +583 -432
  50. package/dist/node/application/index.js +11 -11
  51. package/dist/node/application/mcp/cliMcp.js +6 -6
  52. package/dist/node/application/mcp/cliMcp.onboarding.js +1 -0
  53. package/dist/node/application/mcp/contractsMcp.js +2 -2
  54. package/dist/node/application/mcp/contractsMcpAdoptionTools.js +1 -0
  55. package/dist/node/application/mcp/contractsMcpResources.js +1 -1
  56. package/dist/node/application/mcp/contractsMcpTools.js +1 -1
  57. package/dist/node/application/mcp/index.js +11 -11
  58. package/dist/node/components/docs/DocsIndexPage.js +1 -1
  59. package/dist/node/components/docs/docsManifest.js +1 -1
  60. package/dist/node/components/docs/examples/DocsExamplesPage.js +1 -17
  61. package/dist/node/components/docs/examples/ExampleShowcasePage.js +2 -17
  62. package/dist/node/components/docs/examples/exampleShowcaseData.js +2 -17
  63. package/dist/node/components/docs/examples/index.js +2 -17
  64. package/dist/node/components/docs/getting-started/CLIPage.js +5 -4
  65. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +44 -67
  66. package/dist/node/components/docs/getting-started/StartHerePage.js +4 -2
  67. package/dist/node/components/docs/getting-started/index.js +56 -76
  68. package/dist/node/components/docs/guides/GuideConnectInRepoPage.js +29 -4
  69. package/dist/node/components/docs/guides/GuideHostBuilderWorkbenchPage.js +21 -6
  70. package/dist/node/components/docs/guides/GuideReleaseCapsulesPage.js +15 -0
  71. package/dist/node/components/docs/guides/GuidesIndexPage.js +1 -1
  72. package/dist/node/components/docs/guides/index.js +93 -39
  73. package/dist/node/components/docs/index.js +572 -421
  74. package/dist/node/components/docs/libraries/LibrariesContractsPage.js +43 -18
  75. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +43 -31
  76. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  77. package/dist/node/components/docs/libraries/LibrariesUIKitPage.js +42 -16
  78. package/dist/node/components/docs/libraries/LibrariesUIKitWebPage.js +46 -0
  79. package/dist/node/components/docs/libraries/index.js +221 -113
  80. package/dist/node/components/docs/specs/SpecsBuilderControlPlanePage.js +18 -3
  81. package/dist/node/components/docs/specs/SpecsConnectPage.js +4 -2
  82. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +39 -32
  83. package/dist/node/components/docs/specs/index.js +65 -41
  84. package/dist/node/index.js +583 -432
  85. package/package.json +66 -17
  86. package/src/application/mcp/cliMcp.onboarding.ts +297 -0
  87. package/src/application/mcp/cliMcp.test.ts +99 -0
  88. package/src/application/mcp/cliMcp.ts +30 -3
  89. package/src/application/mcp/contractsMcp.test.ts +65 -0
  90. package/src/application/mcp/contractsMcpAdoptionTools.ts +131 -0
  91. package/src/application/mcp/contractsMcpResources.ts +49 -0
  92. package/src/application/mcp/contractsMcpTools.ts +2 -0
  93. package/src/application/mcp/contractsMcpTypes.ts +16 -0
  94. package/src/components/docs/docsManifest.ts +12 -0
  95. package/src/components/docs/examples/DocsExamplesPage.tsx +6 -14
  96. package/src/components/docs/examples/ExampleShowcasePage.tsx +22 -18
  97. package/src/components/docs/examples/exampleShowcaseData.test.ts +22 -0
  98. package/src/components/docs/examples/exampleShowcaseData.ts +75 -50
  99. package/src/components/docs/generated/docs-index._common.json +2008 -1691
  100. package/src/components/docs/generated/docs-index.agent-console.json +377 -377
  101. package/src/components/docs/generated/docs-index.ai-chat-assistant.json +17 -17
  102. package/src/components/docs/generated/docs-index.ai-chat.json +105 -105
  103. package/src/components/docs/generated/docs-index.ai-support-bot.json +9 -9
  104. package/src/components/docs/generated/docs-index.analytics-dashboard.json +169 -169
  105. package/src/components/docs/generated/docs-index.app-config.json +137 -137
  106. package/src/components/docs/generated/docs-index.artisan-knowledge-product.json +17 -17
  107. package/src/components/docs/generated/docs-index.artisan-payments-stripe.json +33 -33
  108. package/src/components/docs/generated/docs-index.audit-trail.json +49 -49
  109. package/src/components/docs/generated/docs-index.calendar-google.json +9 -9
  110. package/src/components/docs/generated/docs-index.content-generation.json +9 -9
  111. package/src/components/docs/generated/docs-index.control-plane.json +17 -17
  112. package/src/components/docs/generated/docs-index.crm-pipeline.json +161 -161
  113. package/src/components/docs/generated/docs-index.data-grid-showcase.json +25 -17
  114. package/src/components/docs/generated/docs-index.defineExample.json +9 -9
  115. package/src/components/docs/generated/docs-index.email-gmail.json +9 -9
  116. package/src/components/docs/generated/docs-index.feature-flags.json +217 -217
  117. package/src/components/docs/generated/docs-index.files.json +177 -177
  118. package/src/components/docs/generated/docs-index.generated.ts +20 -20
  119. package/src/components/docs/generated/docs-index.harness-lab.json +9 -9
  120. package/src/components/docs/generated/docs-index.health.json +97 -97
  121. package/src/components/docs/generated/docs-index.identity-rbac.json +313 -313
  122. package/src/components/docs/generated/docs-index.in-app-docs.json +9 -9
  123. package/src/components/docs/generated/docs-index.integration-hub.json +265 -265
  124. package/src/components/docs/generated/docs-index.integration-posthog.json +9 -9
  125. package/src/components/docs/generated/docs-index.integration-stripe.json +9 -9
  126. package/src/components/docs/generated/docs-index.integration-supabase.json +9 -9
  127. package/src/components/docs/generated/docs-index.jobs.json +137 -137
  128. package/src/components/docs/generated/docs-index.kb-update-pipeline.json +129 -129
  129. package/src/components/docs/generated/docs-index.knowledge-canon.json +9 -9
  130. package/src/components/docs/generated/docs-index.learning-journey-ambient-coach.json +9 -9
  131. package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +49 -49
  132. package/src/components/docs/generated/docs-index.learning-journey-duo-drills.json +9 -9
  133. package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +49 -49
  134. package/src/components/docs/generated/docs-index.learning-journey-quest-challenges.json +9 -9
  135. package/src/components/docs/generated/docs-index.learning-journey-registry.json +33 -33
  136. package/src/components/docs/generated/docs-index.learning-journey-studio-onboarding.json +49 -49
  137. package/src/components/docs/generated/docs-index.learning-journey-ui-coaching.json +9 -9
  138. package/src/components/docs/generated/docs-index.learning-journey-ui-gamified.json +9 -9
  139. package/src/components/docs/generated/docs-index.learning-journey-ui-onboarding.json +9 -9
  140. package/src/components/docs/generated/docs-index.learning-journey-ui-shared.json +9 -9
  141. package/src/components/docs/generated/docs-index.learning-journey.json +241 -217
  142. package/src/components/docs/generated/docs-index.learning-patterns.json +9 -9
  143. package/src/components/docs/generated/docs-index.lifecycle-cli.json +9 -9
  144. package/src/components/docs/generated/docs-index.lifecycle-dashboard.json +9 -9
  145. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +65 -57
  146. package/src/components/docs/generated/docs-index.manifest.json +432 -432
  147. package/src/components/docs/generated/docs-index.marketplace.json +337 -337
  148. package/src/components/docs/generated/docs-index.meeting-recorder-providers.json +9 -9
  149. package/src/components/docs/generated/docs-index.meeting-recorder.json +49 -49
  150. package/src/components/docs/generated/docs-index.messaging-agent-actions.json +17 -17
  151. package/src/components/docs/generated/docs-index.metrics.json +201 -201
  152. package/src/components/docs/generated/docs-index.minimal.json +17 -17
  153. package/src/components/docs/generated/docs-index.mobile-demo-tasks.json +33 -33
  154. package/src/components/docs/generated/docs-index.notifications.json +65 -65
  155. package/src/components/docs/generated/docs-index.openbanking-powens.json +9 -9
  156. package/src/components/docs/generated/docs-index.openbanking.json +65 -65
  157. package/src/components/docs/generated/docs-index.opencode-cli.json +17 -17
  158. package/src/components/docs/generated/docs-index.personalization.json +9 -9
  159. package/src/components/docs/generated/docs-index.platform-acp.json +137 -137
  160. package/src/components/docs/generated/docs-index.platform-agent.json +201 -185
  161. package/src/components/docs/generated/docs-index.platform-context.json +121 -105
  162. package/src/components/docs/generated/docs-index.platform-control-plane.json +321 -321
  163. package/src/components/docs/generated/docs-index.platform-database.json +89 -89
  164. package/src/components/docs/generated/docs-index.platform-docs.json +161 -153
  165. package/src/components/docs/generated/docs-index.platform-harness.json +177 -177
  166. package/src/components/docs/generated/docs-index.platform-integrations.json +329 -329
  167. package/src/components/docs/generated/docs-index.platform-knowledge.json +57 -57
  168. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +217 -185
  169. package/src/components/docs/generated/docs-index.pocket-family-office.json +129 -129
  170. package/src/components/docs/generated/docs-index.policy-safe-knowledge-assistant.json +9 -9
  171. package/src/components/docs/generated/docs-index.product-intent.json +9 -9
  172. package/src/components/docs/generated/docs-index.project-management-sync.json +9 -9
  173. package/src/components/docs/generated/docs-index.saas-boilerplate.json +209 -209
  174. package/src/components/docs/generated/docs-index.service-business-os.json +193 -193
  175. package/src/components/docs/generated/docs-index.team-hub.json +185 -185
  176. package/src/components/docs/generated/docs-index.unknown.json +521 -521
  177. package/src/components/docs/generated/docs-index.versioned-knowledge-base.json +81 -81
  178. package/src/components/docs/generated/docs-index.video-api-showcase.json +33 -33
  179. package/src/components/docs/generated/docs-index.video-docs-terminal.json +9 -9
  180. package/src/components/docs/generated/docs-index.video-marketing-clip.json +9 -9
  181. package/src/components/docs/generated/docs-index.visualization-showcase.json +17 -17
  182. package/src/components/docs/generated/docs-index.voice-providers.json +9 -9
  183. package/src/components/docs/generated/docs-index.wealth-snapshot.json +153 -153
  184. package/src/components/docs/generated/docs-index.workflow-system.json +433 -433
  185. package/src/components/docs/generated/docs-index.workspace-cli.json +9 -9
  186. package/src/components/docs/getting-started/CLIPage.tsx +10 -2
  187. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +63 -70
  188. package/src/components/docs/getting-started/StartHerePage.tsx +10 -9
  189. package/src/components/docs/guides/GuideConnectInRepoPage.tsx +52 -3
  190. package/src/components/docs/guides/GuideHostBuilderWorkbenchPage.tsx +55 -6
  191. package/src/components/docs/guides/GuideReleaseCapsulesPage.tsx +147 -0
  192. package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
  193. package/src/components/docs/guides/index.ts +1 -0
  194. package/src/components/docs/libraries/LibrariesContractsPage.tsx +72 -27
  195. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +67 -61
  196. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +7 -1
  197. package/src/components/docs/libraries/LibrariesUIKitPage.tsx +63 -25
  198. package/src/components/docs/libraries/LibrariesUIKitWebPage.tsx +115 -0
  199. package/src/components/docs/libraries/index.ts +1 -0
  200. package/src/components/docs/specs/SpecsBuilderControlPlanePage.tsx +58 -3
  201. package/src/components/docs/specs/SpecsConnectPage.tsx +30 -0
  202. package/src/components/docs/specs/SpecsDataViewsPage.tsx +63 -42
@@ -1,23 +1,48 @@
1
- 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";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.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:"Quick Example"}),e(o,{language:"typescript",code:`import { defineCommand } from '@contractspec/lib.contracts-spec';
2
- import { SchemaModel, ScalarTypeEnum } from '@contractspec/lib.schema';
1
+ 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';
2
+ import { ListDataGridShowcaseRowsQuery } from '@contractspec/example.data-grid-showcase/contracts/data-grid-showcase.operation';
3
3
 
4
- const CreateUserInput = new SchemaModel({
5
- name: 'CreateUserInput',
6
- fields: {
7
- email: { type: ScalarTypeEnum.Email(), isOptional: false },
8
- name: { type: ScalarTypeEnum.NonEmptyString(), isOptional: false },
9
- },
10
- });
11
-
12
- export const CreateUser = defineCommand({
4
+ export const DataGridShowcaseDataView = defineDataView({
13
5
  meta: {
14
- key: 'users.createUser',
6
+ key: 'examples.data-grid-showcase.table',
15
7
  version: '1.0.0',
16
- description: 'Create a new user account',
8
+ entity: 'account',
9
+ title: 'Data Grid Showcase Table',
10
+ description:
11
+ 'Declarative DataViewSpec for the ContractSpec table showcase.',
12
+ domain: 'examples',
13
+ owners: ['@platform.core'],
14
+ tags: ['examples', 'table', 'data-grid'],
15
+ stability: 'experimental',
16
+ },
17
+ source: {
18
+ primary: {
19
+ key: ListDataGridShowcaseRowsQuery.meta.key,
20
+ version: ListDataGridShowcaseRowsQuery.meta.version,
21
+ },
17
22
  },
18
- io: {
19
- input: CreateUserInput,
20
- output: /* ... */,
23
+ view: {
24
+ kind: 'table',
25
+ executionMode: 'client',
26
+ selection: 'multiple',
27
+ columnVisibility: true,
28
+ columnResizing: true,
29
+ columnPinning: true,
30
+ rowExpansion: {
31
+ fields: ['notes', 'renewalDate', 'lastActivityAt'],
32
+ },
33
+ initialState: {
34
+ pageSize: 4,
35
+ hiddenColumns: ['notes'],
36
+ pinnedColumns: {
37
+ left: ['account'],
38
+ },
39
+ sorting: [{ field: 'arr', desc: true }],
40
+ },
41
+ fields: [
42
+ { key: 'account', label: 'Account', dataPath: 'account', sortable: true },
43
+ { key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
44
+ { key: 'status', label: 'Status', dataPath: 'status', sortable: true },
45
+ { key: 'notes', label: 'Notes', dataPath: 'notes' },
46
+ ],
21
47
  },
22
- policy: { auth: 'admin' },
23
- });`})]}),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};
48
+ });`;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,37 +1,49 @@
1
- import{CodeBlock as t,InstallCommand as o}from"@contractspec/lib.design-system";import i from"@contractspec/lib.ui-link";import{ChevronRight as l}from"lucide-react";import{jsx as e,jsxs as a}from"react/jsx-runtime";function n(){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(o,{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:"Example: App Layout"}),e(t,{language:"tsx",code:`import { AppLayout } from '@contractspec/lib.design-system';
2
- import { AppSidebar } from '@contractspec/lib.design-system';
1
+ 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';
2
+ import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
3
3
 
4
- export function Layout({ children }) {
5
- return (
6
- <AppLayout sidebar={<AppSidebar />}>
7
- {children}
8
- </AppLayout>
9
- );
10
- }`})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Example: Zod Form"}),e(t,{language:"tsx",code:`import { ZodForm } from '@contractspec/lib.design-system';
11
- import * as z from "zod";
4
+ import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
5
+ import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
6
+ import {
7
+ ExpandedRowContent,
8
+ ShowcaseToolbar,
9
+ } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
10
+
11
+ export function AccountHealthTable() {
12
+ const columns = useShowcaseColumns();
12
13
 
13
- const schema = z.object({
14
- name: z.string().min(1),
15
- email: z.string().email(),
16
- });
14
+ const controller = useContractTable({
15
+ data: SHOWCASE_ROWS,
16
+ columns,
17
+ selectionMode: 'multiple',
18
+ initialState: {
19
+ sorting: [{ id: 'arr', desc: true }],
20
+ pagination: { pageIndex: 0, pageSize: 4 },
21
+ columnVisibility: { notes: false },
22
+ columnPinning: { left: ['account'], right: [] },
23
+ },
24
+ renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
25
+ getCanExpand: () => true,
26
+ });
17
27
 
18
- export function SignupForm() {
19
28
  return (
20
- <ZodForm
21
- schema={schema}
22
- onSubmit={(data) => console.log(data)}
23
- submitLabel="Submit"
29
+ <DataTable
30
+ controller={controller}
31
+ title="Account health"
32
+ description="Composed table surface for the canonical account grid."
33
+ headerActions={<Button variant="outline">Reset</Button>}
34
+ toolbar={
35
+ <ShowcaseToolbar
36
+ controller={controller}
37
+ label="Client mode"
38
+ primaryColumnId="account"
39
+ toggleColumnId="notes"
40
+ pinColumnId="owner"
41
+ sortColumnIds={['arr', 'renewalDate']}
42
+ />
43
+ }
44
+ loading={false}
45
+ emptyState={<div>No rows available.</div>}
46
+ footer={\`Page \${controller.pageIndex + 1} of \${controller.pageCount}\`}
24
47
  />
25
48
  );
26
- }`})]}),a("div",{className:"space-y-4",children:[e("h2",{className:"font-bold text-2xl",children:"Example: Code Block with Package Manager Tabs"}),e(t,{language:"tsx",code:`import { CodeBlock, InstallCommand } from '@contractspec/lib.design-system';
27
-
28
- // For installation commands with package manager tabs
29
- <InstallCommand package="my-package" />
30
- <InstallCommand package={["react", "react-dom"]} dev />
31
-
32
- // For code examples with syntax highlighting
33
- <CodeBlock
34
- language="typescript"
35
- code={\`const hello = "world";\`}
36
- filename="example.ts"
37
- />`})]}),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};
49
+ }`;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 +1 @@
1
- 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 o=[{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.design-system",description:"Build higher-level product surfaces and documented marketing/docs primitives on top of the UI kit.",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 → bundles → 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:o.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
+ 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 → bundles → 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,19 +1,45 @@
1
- import{CodeBlock as a,InstallCommand as l}from"@contractspec/lib.design-system";import i from"@contractspec/lib.ui-link";import{ChevronRight as o}from"lucide-react";import{jsx as e,jsxs as t}from"react/jsx-runtime";function c(){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(l,{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:"Example Usage"}),e(a,{language:"tsx",code:`import { Button } from '@contractspec/lib.ui-kit/ui/button';
2
- import { Text } from '@contractspec/lib.ui-kit/ui/text';
3
- import { Card, CardHeader, CardTitle, CardContent } from '@contractspec/lib.ui-kit/ui/card';
1
+ 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';
2
+ import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
3
+
4
+ import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
5
+ import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
6
+ import {
7
+ ExpandedRowContent,
8
+ ShowcaseToolbar,
9
+ } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
10
+
11
+ export function NativeAccountGrid() {
12
+ const columns = useShowcaseColumns();
13
+
14
+ const controller = useContractTable({
15
+ data: SHOWCASE_ROWS,
16
+ columns,
17
+ selectionMode: 'single',
18
+ initialState: {
19
+ sorting: [{ id: 'arr', desc: true }],
20
+ pagination: { pageIndex: 0, pageSize: 4 },
21
+ columnVisibility: { notes: false },
22
+ columnPinning: { left: ['account'], right: [] },
23
+ },
24
+ renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
25
+ getCanExpand: () => true,
26
+ });
4
27
 
5
- export function MyComponent() {
6
28
  return (
7
- <Card className="w-full max-w-md">
8
- <CardHeader>
9
- <CardTitle>Welcome</CardTitle>
10
- </CardHeader>
11
- <CardContent className="gap-4">
12
- <Text>This works on Web and Native.</Text>
13
- <Button onPress={() => console.log('Clicked!')}>
14
- Click me
15
- </Button>
16
- </CardContent>
17
- </Card>
29
+ <DataTable
30
+ controller={controller}
31
+ toolbar={
32
+ <ShowcaseToolbar
33
+ controller={controller}
34
+ label="Native primitive"
35
+ primaryColumnId="account"
36
+ toggleColumnId="notes"
37
+ pinColumnId="owner"
38
+ sortColumnIds={['arr', 'renewalDate']}
39
+ />
40
+ }
41
+ loading={false}
42
+ footer={\`Rows \${controller.rows.length}\`}
43
+ />
18
44
  );
19
- }`})]}),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(i,{href:"/docs/libraries/schema",className:"btn-ghost",children:"Previous: Schema"}),t(i,{href:"/docs/libraries/design-system",className:"btn-primary",children:["Next: Design System ",e(o,{size:16})]})]})]})}export{c as LibrariesUIKitPage};
45
+ }`;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,46 @@
1
+ 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';
2
+ import { useContractTable } from '@contractspec/lib.presentation-runtime-react';
3
+
4
+ import { SHOWCASE_ROWS } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.data';
5
+ import { useShowcaseColumns } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.columns';
6
+ import {
7
+ ExpandedRowContent,
8
+ ShowcaseToolbar,
9
+ } from '@contractspec/example.data-grid-showcase/ui/data-grid-showcase.parts';
10
+
11
+ export function WebAccountGrid() {
12
+ const columns = useShowcaseColumns();
13
+
14
+ const controller = useContractTable({
15
+ data: SHOWCASE_ROWS,
16
+ columns,
17
+ selectionMode: 'single',
18
+ initialState: {
19
+ sorting: [{ id: 'lastActivityAt', desc: true }],
20
+ pagination: { pageIndex: 0, pageSize: 4 },
21
+ columnVisibility: { notes: false },
22
+ columnPinning: { left: ['account'], right: [] },
23
+ },
24
+ renderExpandedContent: (row) => <ExpandedRowContent row={row} />,
25
+ getCanExpand: () => true,
26
+ });
27
+
28
+ return (
29
+ <DataTable
30
+ controller={controller}
31
+ toolbar={
32
+ <ShowcaseToolbar
33
+ controller={controller}
34
+ label="Web primitive"
35
+ primaryColumnId="account"
36
+ toggleColumnId="notes"
37
+ pinColumnId="owner"
38
+ sortColumnIds={['arr', 'renewalDate']}
39
+ />
40
+ }
41
+ loading={false}
42
+ emptyState={<div>No rows available.</div>}
43
+ footer={\`Rows \${controller.totalItems}\`}
44
+ />
45
+ );
46
+ }`;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};