@contractspec/bundle.library 3.9.6 → 3.9.8

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 (153) hide show
  1. package/.turbo/turbo-build.log +238 -230
  2. package/CHANGELOG.md +88 -0
  3. package/dist/components/docs/DocsIndexPage.js +2 -2
  4. package/dist/components/docs/docsManifest.js +1 -1
  5. package/dist/components/docs/getting-started/DataViewTutorialPage.js +40 -4
  6. package/dist/components/docs/getting-started/index.js +46 -10
  7. package/dist/components/docs/guides/GuideContractDrivenFormsPage.content.d.ts +3 -0
  8. package/dist/components/docs/guides/GuideContractDrivenFormsPage.content.js +95 -0
  9. package/dist/components/docs/guides/GuideContractDrivenFormsPage.d.ts +1 -0
  10. package/dist/components/docs/guides/GuideContractDrivenFormsPage.js +95 -0
  11. package/dist/components/docs/guides/GuideSpecValidationTypingPage.js +1 -1
  12. package/dist/components/docs/guides/GuidesIndexPage.js +2 -2
  13. package/dist/components/docs/guides/guides.docblocks.js +3 -1
  14. package/dist/components/docs/guides/index.d.ts +1 -0
  15. package/dist/components/docs/guides/index.js +139 -44
  16. package/dist/components/docs/index.js +586 -266
  17. package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts +16 -0
  18. package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.js +148 -0
  19. package/dist/components/docs/libraries/LibrariesApplicationShellPage.d.ts +1 -0
  20. package/dist/components/docs/libraries/LibrariesApplicationShellPage.js +148 -0
  21. package/dist/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
  22. package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
  23. package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  24. package/dist/components/docs/libraries/index.d.ts +1 -0
  25. package/dist/components/docs/libraries/index.js +217 -64
  26. package/dist/components/docs/specs/SpecsDataViewsPage.js +37 -1
  27. package/dist/components/docs/specs/index.js +37 -1
  28. package/dist/index.js +597 -277
  29. package/dist/libs/posthog/client.js +1 -1
  30. package/dist/node/components/docs/DocsIndexPage.js +2 -2
  31. package/dist/node/components/docs/docsManifest.js +1 -1
  32. package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +40 -4
  33. package/dist/node/components/docs/getting-started/index.js +46 -10
  34. package/dist/node/components/docs/guides/GuideContractDrivenFormsPage.content.js +94 -0
  35. package/dist/node/components/docs/guides/GuideContractDrivenFormsPage.js +94 -0
  36. package/dist/node/components/docs/guides/GuideSpecValidationTypingPage.js +1 -1
  37. package/dist/node/components/docs/guides/GuidesIndexPage.js +2 -2
  38. package/dist/node/components/docs/guides/guides.docblocks.js +3 -1
  39. package/dist/node/components/docs/guides/index.js +139 -44
  40. package/dist/node/components/docs/index.js +586 -266
  41. package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js +147 -0
  42. package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.js +147 -0
  43. package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
  44. package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
  45. package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
  46. package/dist/node/components/docs/libraries/index.js +217 -64
  47. package/dist/node/components/docs/specs/SpecsDataViewsPage.js +37 -1
  48. package/dist/node/components/docs/specs/index.js +37 -1
  49. package/dist/node/index.js +597 -277
  50. package/dist/node/libs/posthog/client.js +1 -1
  51. package/package.json +71 -23
  52. package/src/components/docs/docsManifest.ts +22 -0
  53. package/src/components/docs/generated/docs-index._common.json +2008 -1699
  54. package/src/components/docs/generated/docs-index.agent-console.json +377 -377
  55. package/src/components/docs/generated/docs-index.ai-chat-assistant.json +17 -17
  56. package/src/components/docs/generated/docs-index.ai-chat.json +105 -105
  57. package/src/components/docs/generated/docs-index.ai-support-bot.json +9 -9
  58. package/src/components/docs/generated/docs-index.analytics-dashboard.json +169 -169
  59. package/src/components/docs/generated/docs-index.app-config.json +137 -137
  60. package/src/components/docs/generated/docs-index.artisan-knowledge-product.json +17 -17
  61. package/src/components/docs/generated/docs-index.artisan-payments-stripe.json +33 -33
  62. package/src/components/docs/generated/docs-index.audit-trail.json +49 -49
  63. package/src/components/docs/generated/docs-index.calendar-google.json +9 -9
  64. package/src/components/docs/generated/docs-index.content-generation.json +9 -9
  65. package/src/components/docs/generated/docs-index.control-plane.json +17 -17
  66. package/src/components/docs/generated/docs-index.crm-pipeline.json +161 -161
  67. package/src/components/docs/generated/docs-index.data-grid-showcase.json +25 -25
  68. package/src/components/docs/generated/docs-index.defineExample.json +9 -9
  69. package/src/components/docs/generated/docs-index.email-gmail.json +9 -9
  70. package/src/components/docs/generated/docs-index.feature-flags.json +217 -217
  71. package/src/components/docs/generated/docs-index.files.json +177 -177
  72. package/src/components/docs/generated/docs-index.generated.ts +20 -20
  73. package/src/components/docs/generated/docs-index.harness-lab.json +9 -9
  74. package/src/components/docs/generated/docs-index.health.json +97 -97
  75. package/src/components/docs/generated/docs-index.identity-rbac.json +313 -313
  76. package/src/components/docs/generated/docs-index.in-app-docs.json +9 -9
  77. package/src/components/docs/generated/docs-index.integration-hub.json +265 -265
  78. package/src/components/docs/generated/docs-index.integration-posthog.json +9 -9
  79. package/src/components/docs/generated/docs-index.integration-stripe.json +9 -9
  80. package/src/components/docs/generated/docs-index.integration-supabase.json +9 -9
  81. package/src/components/docs/generated/docs-index.jobs.json +137 -137
  82. package/src/components/docs/generated/docs-index.kb-update-pipeline.json +129 -129
  83. package/src/components/docs/generated/docs-index.knowledge-canon.json +9 -9
  84. package/src/components/docs/generated/docs-index.learning-journey-ambient-coach.json +9 -9
  85. package/src/components/docs/generated/docs-index.learning-journey-crm-onboarding.json +49 -49
  86. package/src/components/docs/generated/docs-index.learning-journey-duo-drills.json +9 -9
  87. package/src/components/docs/generated/docs-index.learning-journey-platform-tour.json +49 -49
  88. package/src/components/docs/generated/docs-index.learning-journey-quest-challenges.json +9 -9
  89. package/src/components/docs/generated/docs-index.learning-journey-registry.json +33 -33
  90. package/src/components/docs/generated/docs-index.learning-journey-studio-onboarding.json +49 -49
  91. package/src/components/docs/generated/docs-index.learning-journey-ui-coaching.json +9 -9
  92. package/src/components/docs/generated/docs-index.learning-journey-ui-gamified.json +9 -9
  93. package/src/components/docs/generated/docs-index.learning-journey-ui-onboarding.json +9 -9
  94. package/src/components/docs/generated/docs-index.learning-journey-ui-shared.json +9 -9
  95. package/src/components/docs/generated/docs-index.learning-journey.json +241 -241
  96. package/src/components/docs/generated/docs-index.learning-patterns.json +9 -9
  97. package/src/components/docs/generated/docs-index.lifecycle-cli.json +9 -9
  98. package/src/components/docs/generated/docs-index.lifecycle-dashboard.json +9 -9
  99. package/src/components/docs/generated/docs-index.locale-jurisdiction-gate.json +65 -65
  100. package/src/components/docs/generated/docs-index.marketplace.json +337 -337
  101. package/src/components/docs/generated/docs-index.meeting-recorder-providers.json +9 -9
  102. package/src/components/docs/generated/docs-index.meeting-recorder.json +49 -49
  103. package/src/components/docs/generated/docs-index.messaging-agent-actions.json +17 -17
  104. package/src/components/docs/generated/docs-index.metrics.json +201 -201
  105. package/src/components/docs/generated/docs-index.minimal.json +17 -17
  106. package/src/components/docs/generated/docs-index.mobile-demo-landing.json +41 -41
  107. package/src/components/docs/generated/docs-index.notifications.json +65 -65
  108. package/src/components/docs/generated/docs-index.openbanking-powens.json +9 -9
  109. package/src/components/docs/generated/docs-index.openbanking.json +65 -65
  110. package/src/components/docs/generated/docs-index.opencode-cli.json +17 -17
  111. package/src/components/docs/generated/docs-index.personalization.json +9 -9
  112. package/src/components/docs/generated/docs-index.platform-acp.json +137 -137
  113. package/src/components/docs/generated/docs-index.platform-agent.json +201 -201
  114. package/src/components/docs/generated/docs-index.platform-context.json +121 -121
  115. package/src/components/docs/generated/docs-index.platform-control-plane.json +321 -321
  116. package/src/components/docs/generated/docs-index.platform-database.json +89 -89
  117. package/src/components/docs/generated/docs-index.platform-docs.json +161 -161
  118. package/src/components/docs/generated/docs-index.platform-harness.json +177 -177
  119. package/src/components/docs/generated/docs-index.platform-integrations.json +329 -329
  120. package/src/components/docs/generated/docs-index.platform-knowledge.json +57 -57
  121. package/src/components/docs/generated/docs-index.platform-provider-ranking.json +217 -217
  122. package/src/components/docs/generated/docs-index.pocket-family-office.json +129 -129
  123. package/src/components/docs/generated/docs-index.policy-safe-knowledge-assistant.json +9 -9
  124. package/src/components/docs/generated/docs-index.product-intent.json +9 -9
  125. package/src/components/docs/generated/docs-index.project-management-sync.json +9 -9
  126. package/src/components/docs/generated/docs-index.saas-boilerplate.json +209 -209
  127. package/src/components/docs/generated/docs-index.service-business-os.json +193 -193
  128. package/src/components/docs/generated/docs-index.team-hub.json +185 -185
  129. package/src/components/docs/generated/docs-index.unknown.json +521 -521
  130. package/src/components/docs/generated/docs-index.versioned-knowledge-base.json +81 -81
  131. package/src/components/docs/generated/docs-index.video-api-showcase.json +33 -33
  132. package/src/components/docs/generated/docs-index.video-docs-terminal.json +9 -9
  133. package/src/components/docs/generated/docs-index.video-marketing-clip.json +9 -9
  134. package/src/components/docs/generated/docs-index.visualization-showcase.json +17 -17
  135. package/src/components/docs/generated/docs-index.voice-providers.json +9 -9
  136. package/src/components/docs/generated/docs-index.wealth-snapshot.json +153 -153
  137. package/src/components/docs/generated/docs-index.workflow-system.json +433 -433
  138. package/src/components/docs/generated/docs-index.workspace-cli.json +9 -9
  139. package/src/components/docs/getting-started/DataViewTutorialPage.tsx +40 -1
  140. package/src/components/docs/guides/GuideContractDrivenFormsPage.content.ts +98 -0
  141. package/src/components/docs/guides/GuideContractDrivenFormsPage.tsx +143 -0
  142. package/src/components/docs/guides/GuideSpecValidationTypingPage.tsx +2 -2
  143. package/src/components/docs/guides/GuidesIndexPage.tsx +7 -0
  144. package/src/components/docs/guides/guides.docblocks.ts +12 -0
  145. package/src/components/docs/guides/index.ts +1 -0
  146. package/src/components/docs/libraries/LibrariesApplicationShellPage.content.ts +170 -0
  147. package/src/components/docs/libraries/LibrariesApplicationShellPage.tsx +112 -0
  148. package/src/components/docs/libraries/LibrariesDataViewsPage.tsx +26 -5
  149. package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +9 -0
  150. package/src/components/docs/libraries/LibrariesOverviewPage.tsx +6 -0
  151. package/src/components/docs/libraries/index.ts +1 -0
  152. package/src/components/docs/specs/SpecsDataViewsPage.tsx +39 -3
  153. package/src/libs/posthog/client.ts +11 -9
@@ -43,7 +43,43 @@ export const DataGridShowcaseDataView = defineDataView({
43
43
  { key: 'account', label: 'Account', dataPath: 'account', sortable: true },
44
44
  { key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
45
45
  { key: 'status', label: 'Status', dataPath: 'status', sortable: true },
46
+ {
47
+ key: 'arr',
48
+ label: 'ARR',
49
+ dataPath: 'arr',
50
+ sortable: true,
51
+ format: { type: 'currency', currency: 'USD', rounded: true },
52
+ },
53
+ {
54
+ key: 'healthScore',
55
+ label: 'Health score',
56
+ dataPath: 'healthScore',
57
+ format: { type: 'percent', valueScale: 'fraction', maximumFractionDigits: 1 },
58
+ },
59
+ {
60
+ key: 'lastActivityAt',
61
+ label: 'Last activity',
62
+ dataPath: 'lastActivityAt',
63
+ format: { type: 'datetime', dateStyle: 'medium', timeStyle: 'short' },
64
+ },
46
65
  { key: 'notes', label: 'Notes', dataPath: 'notes' },
47
66
  ],
67
+ filters: [
68
+ { key: 'status', label: 'Status', field: 'status', type: 'enum' },
69
+ {
70
+ key: 'arr',
71
+ label: 'ARR',
72
+ field: 'arr',
73
+ type: 'currency',
74
+ valueMode: 'range',
75
+ },
76
+ {
77
+ key: 'lastActivityAt',
78
+ label: 'Last activity',
79
+ field: 'lastActivityAt',
80
+ type: 'datetime',
81
+ valueMode: 'range',
82
+ },
83
+ ],
48
84
  },
49
- });`;function q(){return B("div",{className:"space-y-8",children:[B("div",{className:"space-y-4",children:[z("h1",{className:"font-bold text-4xl",children:"DataViews"}),B("p",{className:"text-muted-foreground",children:["A ",z("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Core concepts"}),B("div",{className:"space-y-3",children:[B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Data sources"}),z("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Filtering"}),z("p",{className:"text-muted-foreground",children:`Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Sorting"}),z("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Pagination"}),z("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Aggregations"}),z("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),B("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",z(H,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),z("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:z("pre",{children:U})}),z("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Policy integration"}),B("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",z(H,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),z("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Served outputs"}),z("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),B("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:[z("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),B("li",{children:[z("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),B("li",{children:[z("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),B("li",{children:[z("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),B("li",{children:[z("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Best practices"}),B("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),z("li",{children:"Use appropriate indexes for sortable and filterable fields."}),z("li",{children:"Set reasonable pagination limits to prevent performance issues."}),z("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),z("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),B("div",{className:"flex items-center gap-4 pt-4",children:[z(H,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),B(H,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",z(Q,{size:16})]})]})]})}export{q as SpecsDataViewsPage};
85
+ });`;function q(){return B("div",{className:"space-y-8",children:[B("div",{className:"space-y-4",children:[z("h1",{className:"font-bold text-4xl",children:"DataViews"}),B("p",{className:"text-muted-foreground",children:["A ",z("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Core concepts"}),B("div",{className:"space-y-3",children:[B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Data sources"}),z("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Filtering"}),z("p",{className:"text-muted-foreground",children:"Define filters that users can apply to narrow down results. Filters are typed as search, enum, number, percent, currency, date, time, datetime, duration, or boolean so renderers and query helpers can validate values before execution."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Sorting"}),z("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Pagination"}),z("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),B("div",{children:[z("h3",{className:"font-semibold text-lg",children:"Aggregations"}),z("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),B("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",z(H,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),z("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:z("pre",{children:U})}),z("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Policy integration"}),B("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",z(H,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),z("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Served outputs"}),z("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),B("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[B("li",{children:[z("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),B("li",{children:[z("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),B("li",{children:[z("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),B("li",{children:[z("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),B("li",{children:[z("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),B("div",{className:"space-y-4",children:[z("h2",{className:"font-bold text-2xl",children:"Best practices"}),B("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[z("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),z("li",{children:"Use appropriate indexes for sortable and filterable fields."}),z("li",{children:"Set reasonable pagination limits to prevent performance issues."}),z("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),z("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),B("div",{className:"flex items-center gap-4 pt-4",children:[z(H,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),B(H,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",z(Q,{size:16})]})]})]})}export{q as SpecsDataViewsPage};
@@ -136,10 +136,46 @@ export const DataGridShowcaseDataView = defineDataView({
136
136
  { key: 'account', label: 'Account', dataPath: 'account', sortable: true },
137
137
  { key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
138
138
  { key: 'status', label: 'Status', dataPath: 'status', sortable: true },
139
+ {
140
+ key: 'arr',
141
+ label: 'ARR',
142
+ dataPath: 'arr',
143
+ sortable: true,
144
+ format: { type: 'currency', currency: 'USD', rounded: true },
145
+ },
146
+ {
147
+ key: 'healthScore',
148
+ label: 'Health score',
149
+ dataPath: 'healthScore',
150
+ format: { type: 'percent', valueScale: 'fraction', maximumFractionDigits: 1 },
151
+ },
152
+ {
153
+ key: 'lastActivityAt',
154
+ label: 'Last activity',
155
+ dataPath: 'lastActivityAt',
156
+ format: { type: 'datetime', dateStyle: 'medium', timeStyle: 'short' },
157
+ },
139
158
  { key: 'notes', label: 'Notes', dataPath: 'notes' },
140
159
  ],
160
+ filters: [
161
+ { key: 'status', label: 'Status', field: 'status', type: 'enum' },
162
+ {
163
+ key: 'arr',
164
+ label: 'ARR',
165
+ field: 'arr',
166
+ type: 'currency',
167
+ valueMode: 'range',
168
+ },
169
+ {
170
+ key: 'lastActivityAt',
171
+ label: 'Last activity',
172
+ field: 'lastActivityAt',
173
+ type: 'datetime',
174
+ valueMode: 'range',
175
+ },
176
+ ],
141
177
  },
142
- });`;function $(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"DataViews"}),m("p",{className:"text-muted-foreground",children:["A ",n("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Core concepts"}),m("div",{className:"space-y-3",children:[m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Data sources"}),n("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Filtering"}),n("p",{className:"text-muted-foreground",children:`Define filters that users can apply to narrow down results. Filters can be simple (e.g., "status equals 'active'") or complex (e.g., "created within the last 30 days AND assigned to current user").`})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Sorting"}),n("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Pagination"}),n("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Aggregations"}),n("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),m("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",n(w,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:Z})}),n("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Policy integration"}),m("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",n(w,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),n("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Served outputs"}),n("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:[n("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),m("li",{children:[n("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),m("li",{children:[n("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),m("li",{children:[n("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),m("li",{children:[n("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Best practices"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),n("li",{children:"Use appropriate indexes for sortable and filterable fields."}),n("li",{children:"Set reasonable pagination limits to prevent performance issues."}),n("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),n("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),m("div",{className:"flex items-center gap-4 pt-4",children:[n(w,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),m(w,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",n(X,{size:16})]})]})]})}import{CodeBlock as T}from"@contractspec/lib.design-system";import O from"@contractspec/lib.ui-link";import{jsx as l,jsxs as h}from"react/jsx-runtime";var L=["declared routes, surfaces, layouts, slots, actions, and data recipes","entity registries and field renderers for relation-heavy workbenches","preference-aware adaptation across guidance, density, data depth, control, media, pace, and narrative","auditable overlays and bounded AI patch proposals instead of free-form JSX generation"],x=["Define one `ModuleBundleSpec` with `defineModuleBundle` and keep the route and surface map explicit.","Resolve the bundle with `resolveBundle` for a real user, route, device, and preference profile.","Render the plan through `BundleProvider` and `BundleRenderer` so the UI stays downstream of the resolved spec.","Add overlays, policy hooks, planner proposals, and telemetry only after the base route resolves cleanly.","Pilot one dense domain first, such as a PM or operations workbench, before expanding the abstraction across the app."];function j(){return h("div",{className:"space-y-10",children:[h("section",{className:"space-y-3",children:[l("p",{className:"editorial-kicker",children:"Spec pack"}),l("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Module bundles turn surface composition into a typed ContractSpec runtime instead of a pile of bespoke page code."}),h("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented package is"," ",l("code",{children:"@contractspec/lib.surface-runtime"}),". It lets you define a bundle spec once, resolve it into a personalized surface plan, then render that plan through React without letting AI or per-route custom code bypass the declared system boundary."]})]}),h("section",{className:"editorial-proof-strip",children:[h("div",{className:"editorial-stat",children:[l("span",{className:"editorial-label",children:"Runtime promise"}),l("span",{className:"editorial-stat-value",children:"bundle spec \u2192 resolved surface plan"})]}),l("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"The bundle spec owns what can render, where it can render, which preferences matter, and how overlays and AI proposals stay bounded."})]}),l("section",{className:"grid gap-4 md:grid-cols-2",children:L.map((t)=>h("article",{className:"editorial-panel space-y-3",children:[l("h2",{className:"font-semibold text-xl",children:"Bundle capability"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:t})]},t))}),h("section",{className:"editorial-panel space-y-5",children:[h("div",{className:"space-y-2",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"1) Define the bundle"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:"Start with a typed route and one surface. The runtime validates that you declared routes, surfaces, and verification coverage for all seven preference dimensions."})]}),l(T,{language:"typescript",filename:"support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
178
+ });`;function $(){return m("div",{className:"space-y-8",children:[m("div",{className:"space-y-4",children:[n("h1",{className:"font-bold text-4xl",children:"DataViews"}),m("p",{className:"text-muted-foreground",children:["A ",n("strong",{children:"DataViewSpec"})," describes how data should be queried, filtered, sorted, and presented to users. Runtime adapters execute optimized database queries and serve list views, detail views, and search interfaces while respecting policy constraints."]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Core concepts"}),m("div",{className:"space-y-3",children:[m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Data sources"}),n("p",{className:"text-muted-foreground",children:"A DataView connects to one or more data sources\u2014databases, APIs, or other capabilities. You specify the source and the fields you want to expose."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Filtering"}),n("p",{className:"text-muted-foreground",children:"Define filters that users can apply to narrow down results. Filters are typed as search, enum, number, percent, currency, date, time, datetime, duration, or boolean so renderers and query helpers can validate values before execution."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Sorting"}),n("p",{className:"text-muted-foreground",children:"Specify which fields can be sorted and the default sort order. ContractSpec generates efficient database queries with proper indexes."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Pagination"}),n("p",{className:"text-muted-foreground",children:"DataViews automatically support pagination to handle large datasets. You can configure page size limits and cursor-based or offset-based pagination."})]}),m("div",{children:[n("h3",{className:"font-semibold text-lg",children:"Aggregations"}),n("p",{className:"text-muted-foreground",children:"Compute aggregates like counts, sums, averages, and group-by operations. These are useful for dashboards and summary views."})]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Example DataViewSpec"}),m("p",{className:"text-muted-foreground",children:["Here is the canonical table contract used by the live"," ",n(w,{href:"/docs/examples/data-grid-showcase",className:"text-[color:var(--rust)] underline underline-offset-4",children:"Data Grid Showcase"}),":"]}),n("div",{className:"overflow-x-auto rounded-lg border border-border bg-background/50 p-4 font-mono text-muted-foreground text-sm",children:n("pre",{children:Z})}),n("p",{className:"text-muted-foreground text-sm",children:"This one contract drives the DataView lane, while the same rows and controller also feed the raw web primitive, native-first primitive, and composed design-system demos."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Policy integration"}),m("p",{className:"text-muted-foreground",children:["DataViews automatically enforce"," ",n(w,{href:"/docs/specs/policy",className:"text-violet-400 hover:text-violet-300",children:"PolicySpecs"}),". If a user doesn't have permission to see certain fields, those fields are automatically filtered out or redacted. If a user can only see their own data, the query is automatically scoped."]}),n("p",{className:"text-muted-foreground",children:"This means you define the data view once, and it works correctly for all users based on their permissions\u2014no need to write separate queries for different roles."})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Served outputs"}),n("p",{className:"text-muted-foreground",children:"From a DataViewSpec, ContractSpec serves:"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[m("li",{children:[n("strong",{children:"Database queries"})," \u2013 Optimized SQL or NoSQL queries executed at runtime"]}),m("li",{children:[n("strong",{children:"API endpoints"})," \u2013 RESTful or GraphQL endpoints for fetching data"]}),m("li",{children:[n("strong",{children:"UI components"})," \u2013 List views, tables, cards, and detail views"]}),m("li",{children:[n("strong",{children:"Search interfaces"})," \u2013 Full-text search with autocomplete"]}),m("li",{children:[n("strong",{children:"Export functions"})," \u2013 CSV, JSON, or Excel exports"]})]})]}),m("div",{className:"space-y-4",children:[n("h2",{className:"font-bold text-2xl",children:"Best practices"}),m("ul",{className:"list-inside list-disc space-y-2 text-muted-foreground",children:[n("li",{children:"Only expose fields that users actually need\u2014this improves performance and security."}),n("li",{children:"Use appropriate indexes for sortable and filterable fields."}),n("li",{children:"Set reasonable pagination limits to prevent performance issues."}),n("li",{children:"Use aggregations sparingly\u2014they can be expensive on large datasets."}),n("li",{children:"Test DataViews with realistic data volumes to ensure they perform well."})]})]}),m("div",{className:"flex items-center gap-4 pt-4",children:[n(w,{href:"/docs/specs/capabilities",className:"btn-ghost",children:"Previous: Capabilities"}),m(w,{href:"/docs/specs/workflows",className:"btn-primary",children:["Next: Workflows ",n(X,{size:16})]})]})]})}import{CodeBlock as T}from"@contractspec/lib.design-system";import O from"@contractspec/lib.ui-link";import{jsx as l,jsxs as h}from"react/jsx-runtime";var L=["declared routes, surfaces, layouts, slots, actions, and data recipes","entity registries and field renderers for relation-heavy workbenches","preference-aware adaptation across guidance, density, data depth, control, media, pace, and narrative","auditable overlays and bounded AI patch proposals instead of free-form JSX generation"],x=["Define one `ModuleBundleSpec` with `defineModuleBundle` and keep the route and surface map explicit.","Resolve the bundle with `resolveBundle` for a real user, route, device, and preference profile.","Render the plan through `BundleProvider` and `BundleRenderer` so the UI stays downstream of the resolved spec.","Add overlays, policy hooks, planner proposals, and telemetry only after the base route resolves cleanly.","Pilot one dense domain first, such as a PM or operations workbench, before expanding the abstraction across the app."];function j(){return h("div",{className:"space-y-10",children:[h("section",{className:"space-y-3",children:[l("p",{className:"editorial-kicker",children:"Spec pack"}),l("h1",{className:"font-serif text-4xl tracking-[-0.04em] md:text-5xl",children:"Module bundles turn surface composition into a typed ContractSpec runtime instead of a pile of bespoke page code."}),h("p",{className:"max-w-3xl text-lg text-muted-foreground leading-8",children:["The implemented package is"," ",l("code",{children:"@contractspec/lib.surface-runtime"}),". It lets you define a bundle spec once, resolve it into a personalized surface plan, then render that plan through React without letting AI or per-route custom code bypass the declared system boundary."]})]}),h("section",{className:"editorial-proof-strip",children:[h("div",{className:"editorial-stat",children:[l("span",{className:"editorial-label",children:"Runtime promise"}),l("span",{className:"editorial-stat-value",children:"bundle spec \u2192 resolved surface plan"})]}),l("p",{className:"max-w-2xl text-muted-foreground text-sm leading-7",children:"The bundle spec owns what can render, where it can render, which preferences matter, and how overlays and AI proposals stay bounded."})]}),l("section",{className:"grid gap-4 md:grid-cols-2",children:L.map((t)=>h("article",{className:"editorial-panel space-y-3",children:[l("h2",{className:"font-semibold text-xl",children:"Bundle capability"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:t})]},t))}),h("section",{className:"editorial-panel space-y-5",children:[h("div",{className:"space-y-2",children:[l("h2",{className:"font-serif text-3xl tracking-[-0.03em]",children:"1) Define the bundle"}),l("p",{className:"text-muted-foreground text-sm leading-7",children:"Start with a typed route and one surface. The runtime validates that you declared routes, surfaces, and verification coverage for all seven preference dimensions."})]}),l(T,{language:"typescript",filename:"support.workbench.bundle.ts",code:`import { defineModuleBundle } from "@contractspec/lib.surface-runtime/spec/define-module-bundle";
143
179
 
144
180
  export const SupportWorkbenchBundle = defineModuleBundle({
145
181
  meta: {