@contractspec/bundle.library 3.9.7 → 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.
- package/.turbo/turbo-build.log +144 -140
- package/CHANGELOG.md +44 -0
- package/dist/components/docs/DocsIndexPage.js +1 -1
- package/dist/components/docs/docsManifest.js +1 -1
- package/dist/components/docs/getting-started/DataViewTutorialPage.js +40 -4
- package/dist/components/docs/getting-started/index.js +46 -10
- package/dist/components/docs/index.js +493 -268
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts +16 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.content.js +148 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.d.ts +1 -0
- package/dist/components/docs/libraries/LibrariesApplicationShellPage.js +148 -0
- package/dist/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
- package/dist/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
- package/dist/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/components/docs/libraries/index.d.ts +1 -0
- package/dist/components/docs/libraries/index.js +217 -64
- package/dist/components/docs/specs/SpecsDataViewsPage.js +37 -1
- package/dist/components/docs/specs/index.js +37 -1
- package/dist/index.js +503 -278
- package/dist/node/components/docs/DocsIndexPage.js +1 -1
- package/dist/node/components/docs/docsManifest.js +1 -1
- package/dist/node/components/docs/getting-started/DataViewTutorialPage.js +40 -4
- package/dist/node/components/docs/getting-started/index.js +46 -10
- package/dist/node/components/docs/index.js +493 -268
- package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js +147 -0
- package/dist/node/components/docs/libraries/LibrariesApplicationShellPage.js +147 -0
- package/dist/node/components/docs/libraries/LibrariesDataViewsPage.js +13 -6
- package/dist/node/components/docs/libraries/LibrariesDesignSystemPage.js +3 -3
- package/dist/node/components/docs/libraries/LibrariesOverviewPage.js +1 -1
- package/dist/node/components/docs/libraries/index.js +217 -64
- package/dist/node/components/docs/specs/SpecsDataViewsPage.js +37 -1
- package/dist/node/components/docs/specs/index.js +37 -1
- package/dist/node/index.js +503 -278
- package/package.json +47 -23
- package/src/components/docs/docsManifest.ts +10 -0
- package/src/components/docs/getting-started/DataViewTutorialPage.tsx +40 -1
- package/src/components/docs/libraries/LibrariesApplicationShellPage.content.ts +170 -0
- package/src/components/docs/libraries/LibrariesApplicationShellPage.tsx +112 -0
- package/src/components/docs/libraries/LibrariesDataViewsPage.tsx +26 -5
- package/src/components/docs/libraries/LibrariesDesignSystemPage.tsx +9 -0
- package/src/components/docs/libraries/LibrariesOverviewPage.tsx +6 -0
- package/src/components/docs/libraries/index.ts +1 -0
- package/src/components/docs/specs/SpecsDataViewsPage.tsx +39 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/bundle.library",
|
|
3
|
-
"version": "3.9.
|
|
3
|
+
"version": "3.9.8",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rm -rf dist",
|
|
@@ -780,6 +780,18 @@
|
|
|
780
780
|
"node": "./dist/node/components/docs/libraries/LibrariesAnalyticsPage.js",
|
|
781
781
|
"default": "./dist/components/docs/libraries/LibrariesAnalyticsPage.js"
|
|
782
782
|
},
|
|
783
|
+
"./components/docs/libraries/LibrariesApplicationShellPage": {
|
|
784
|
+
"types": "./dist/components/docs/libraries/LibrariesApplicationShellPage.d.ts",
|
|
785
|
+
"bun": "./dist/components/docs/libraries/LibrariesApplicationShellPage.js",
|
|
786
|
+
"node": "./dist/node/components/docs/libraries/LibrariesApplicationShellPage.js",
|
|
787
|
+
"default": "./dist/components/docs/libraries/LibrariesApplicationShellPage.js"
|
|
788
|
+
},
|
|
789
|
+
"./components/docs/libraries/LibrariesApplicationShellPage.content": {
|
|
790
|
+
"types": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts",
|
|
791
|
+
"bun": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.js",
|
|
792
|
+
"node": "./dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js",
|
|
793
|
+
"default": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.js"
|
|
794
|
+
},
|
|
783
795
|
"./components/docs/libraries/LibrariesContentGenPage": {
|
|
784
796
|
"types": "./dist/components/docs/libraries/LibrariesContentGenPage.d.ts",
|
|
785
797
|
"bun": "./dist/components/docs/libraries/LibrariesContentGenPage.js",
|
|
@@ -1950,27 +1962,27 @@
|
|
|
1950
1962
|
"react": "19.2.0"
|
|
1951
1963
|
},
|
|
1952
1964
|
"dependencies": {
|
|
1953
|
-
"@contractspec/bundle.workspace": "4.5.
|
|
1965
|
+
"@contractspec/bundle.workspace": "4.5.6",
|
|
1954
1966
|
"@apollo/client": "^4.1.7",
|
|
1955
1967
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
1956
|
-
"@contractspec/example.data-grid-showcase": "3.8.
|
|
1957
|
-
"@contractspec/lib.ai-providers": "3.7.
|
|
1958
|
-
"@contractspec/lib.contracts-spec": "6.
|
|
1959
|
-
"@contractspec/lib.contracts-library": "3.7.
|
|
1960
|
-
"@contractspec/lib.content-gen": "3.7.
|
|
1961
|
-
"@contractspec/lib.contracts-runtime-server-mcp": "3.8.
|
|
1962
|
-
"@contractspec/lib.design-system": "4.
|
|
1963
|
-
"@contractspec/lib.surface-runtime": "0.5.
|
|
1964
|
-
"@contractspec/lib.provider-ranking": "0.7.
|
|
1965
|
-
"@contractspec/lib.example-shared-ui": "7.0.
|
|
1966
|
-
"@contractspec/lib.knowledge": "3.8.
|
|
1967
|
-
"@contractspec/lib.logger": "3.7.
|
|
1968
|
-
"@contractspec/lib.runtime-sandbox": "3.0.
|
|
1968
|
+
"@contractspec/example.data-grid-showcase": "3.8.20",
|
|
1969
|
+
"@contractspec/lib.ai-providers": "3.7.19",
|
|
1970
|
+
"@contractspec/lib.contracts-spec": "6.1.0",
|
|
1971
|
+
"@contractspec/lib.contracts-library": "3.7.26",
|
|
1972
|
+
"@contractspec/lib.content-gen": "3.7.26",
|
|
1973
|
+
"@contractspec/lib.contracts-runtime-server-mcp": "3.8.6",
|
|
1974
|
+
"@contractspec/lib.design-system": "4.3.0",
|
|
1975
|
+
"@contractspec/lib.surface-runtime": "0.5.26",
|
|
1976
|
+
"@contractspec/lib.provider-ranking": "0.7.19",
|
|
1977
|
+
"@contractspec/lib.example-shared-ui": "7.0.5",
|
|
1978
|
+
"@contractspec/lib.knowledge": "3.8.2",
|
|
1979
|
+
"@contractspec/lib.logger": "3.7.19",
|
|
1980
|
+
"@contractspec/lib.runtime-sandbox": "3.0.5",
|
|
1969
1981
|
"@contractspec/lib.schema": "3.7.14",
|
|
1970
|
-
"@contractspec/lib.ui-kit-web": "3.13.
|
|
1971
|
-
"@contractspec/lib.ui-link": "3.7.
|
|
1972
|
-
"@contractspec/module.context-storage": "0.7.
|
|
1973
|
-
"@contractspec/module.examples": "4.0.
|
|
1982
|
+
"@contractspec/lib.ui-kit-web": "3.13.1",
|
|
1983
|
+
"@contractspec/lib.ui-link": "3.7.21",
|
|
1984
|
+
"@contractspec/module.context-storage": "0.7.25",
|
|
1985
|
+
"@contractspec/module.examples": "4.0.5",
|
|
1974
1986
|
"@dnd-kit/core": "^6.1.0",
|
|
1975
1987
|
"@dnd-kit/sortable": "^10.0.0",
|
|
1976
1988
|
"@dnd-kit/utilities": "^3.2.2",
|
|
@@ -1986,10 +1998,10 @@
|
|
|
1986
1998
|
"posthog-react-native": "^4.42.3",
|
|
1987
1999
|
"react-hook-form": "^7.72.1",
|
|
1988
2000
|
"zod": "^4.3.5",
|
|
1989
|
-
"@contractspec/lib.contracts-integrations": "3.8.
|
|
1990
|
-
"@contractspec/lib.contracts-runtime-server-rest": "3.8.
|
|
1991
|
-
"@contractspec/lib.contracts-runtime-server-graphql": "3.8.
|
|
1992
|
-
"@contractspec/lib.contracts-runtime-client-react": "3.
|
|
2001
|
+
"@contractspec/lib.contracts-integrations": "3.8.18",
|
|
2002
|
+
"@contractspec/lib.contracts-runtime-server-rest": "3.8.5",
|
|
2003
|
+
"@contractspec/lib.contracts-runtime-server-graphql": "3.8.5",
|
|
2004
|
+
"@contractspec/lib.contracts-runtime-client-react": "3.13.0"
|
|
1993
2005
|
},
|
|
1994
2006
|
"devDependencies": {
|
|
1995
2007
|
"@types/react": "~19.2.14",
|
|
@@ -2769,6 +2781,18 @@
|
|
|
2769
2781
|
"node": "./dist/node/components/docs/libraries/LibrariesAnalyticsPage.js",
|
|
2770
2782
|
"default": "./dist/components/docs/libraries/LibrariesAnalyticsPage.js"
|
|
2771
2783
|
},
|
|
2784
|
+
"./components/docs/libraries/LibrariesApplicationShellPage": {
|
|
2785
|
+
"types": "./dist/components/docs/libraries/LibrariesApplicationShellPage.d.ts",
|
|
2786
|
+
"bun": "./dist/components/docs/libraries/LibrariesApplicationShellPage.js",
|
|
2787
|
+
"node": "./dist/node/components/docs/libraries/LibrariesApplicationShellPage.js",
|
|
2788
|
+
"default": "./dist/components/docs/libraries/LibrariesApplicationShellPage.js"
|
|
2789
|
+
},
|
|
2790
|
+
"./components/docs/libraries/LibrariesApplicationShellPage.content": {
|
|
2791
|
+
"types": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.d.ts",
|
|
2792
|
+
"bun": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.js",
|
|
2793
|
+
"node": "./dist/node/components/docs/libraries/LibrariesApplicationShellPage.content.js",
|
|
2794
|
+
"default": "./dist/components/docs/libraries/LibrariesApplicationShellPage.content.js"
|
|
2795
|
+
},
|
|
2772
2796
|
"./components/docs/libraries/LibrariesContentGenPage": {
|
|
2773
2797
|
"types": "./dist/components/docs/libraries/LibrariesContentGenPage.d.ts",
|
|
2774
2798
|
"bun": "./dist/components/docs/libraries/LibrariesContentGenPage.js",
|
|
@@ -406,6 +406,16 @@ export const DOCS_PAGES: readonly DocsPageEntry[] = [
|
|
|
406
406
|
audience: 'oss',
|
|
407
407
|
ctaMode: 'oss-next',
|
|
408
408
|
},
|
|
409
|
+
{
|
|
410
|
+
href: '/docs/libraries/application-shell',
|
|
411
|
+
title: 'Application shell',
|
|
412
|
+
description:
|
|
413
|
+
'Implement reusable app navigation with desktop sidebars, topbar breadcrumbs, command search, mobile adapters, and PageOutline section navigation.',
|
|
414
|
+
section: 'build',
|
|
415
|
+
order: 72,
|
|
416
|
+
audience: 'oss',
|
|
417
|
+
ctaMode: 'oss-next',
|
|
418
|
+
},
|
|
409
419
|
{
|
|
410
420
|
href: '/docs/architecture',
|
|
411
421
|
title: 'Architecture',
|
|
@@ -45,8 +45,44 @@ export const TransactionHistory = defineDataView({
|
|
|
45
45
|
{ key: 'account', label: 'Account', dataPath: 'account', sortable: true },
|
|
46
46
|
{ key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
|
|
47
47
|
{ key: 'status', label: 'Status', dataPath: 'status', sortable: true },
|
|
48
|
+
{
|
|
49
|
+
key: 'amount',
|
|
50
|
+
label: 'Amount',
|
|
51
|
+
dataPath: 'amount',
|
|
52
|
+
sortable: true,
|
|
53
|
+
format: { type: 'currency', currency: 'EUR', rounded: true },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'renewalDate',
|
|
57
|
+
label: 'Renewal',
|
|
58
|
+
dataPath: 'renewalDate',
|
|
59
|
+
format: { type: 'date', dateStyle: 'medium' },
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'processingTime',
|
|
63
|
+
label: 'Processing time',
|
|
64
|
+
dataPath: 'processingMinutes',
|
|
65
|
+
format: { type: 'duration', unit: 'minute', display: 'digital' },
|
|
66
|
+
},
|
|
48
67
|
{ key: 'notes', label: 'Notes', dataPath: 'notes' },
|
|
49
68
|
],
|
|
69
|
+
filters: [
|
|
70
|
+
{ key: 'status', label: 'Status', field: 'status', type: 'enum' },
|
|
71
|
+
{
|
|
72
|
+
key: 'amount',
|
|
73
|
+
label: 'Amount',
|
|
74
|
+
field: 'amount',
|
|
75
|
+
type: 'currency',
|
|
76
|
+
valueMode: 'range',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'renewalDate',
|
|
80
|
+
label: 'Renewal',
|
|
81
|
+
field: 'renewalDate',
|
|
82
|
+
type: 'date',
|
|
83
|
+
valueMode: 'range',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
50
86
|
},
|
|
51
87
|
});`;
|
|
52
88
|
|
|
@@ -154,7 +190,10 @@ export function TransactionsPage() {
|
|
|
154
190
|
Column visibility, pinning, resizing, and row expansion stay
|
|
155
191
|
contract-driven
|
|
156
192
|
</li>
|
|
157
|
-
<li>
|
|
193
|
+
<li>
|
|
194
|
+
Typed format rules for numbers, percent values, currency, dates,
|
|
195
|
+
times, datetimes, and durations applied consistently
|
|
196
|
+
</li>
|
|
158
197
|
<li>Export to CSV/PDF using the same spec</li>
|
|
159
198
|
<li>A/B test different layouts without touching the backend</li>
|
|
160
199
|
</ul>
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
export const shellUsageExample = `import {
|
|
2
|
+
AppShell,
|
|
3
|
+
PageOutline,
|
|
4
|
+
type AppShellNavigationSection,
|
|
5
|
+
type PageOutlineItem,
|
|
6
|
+
} from "@contractspec/lib.design-system/shell";
|
|
7
|
+
|
|
8
|
+
const navigation: AppShellNavigationSection[] = [
|
|
9
|
+
{
|
|
10
|
+
title: "Workspace",
|
|
11
|
+
items: [
|
|
12
|
+
{ label: "Dashboard", href: "/dashboard" },
|
|
13
|
+
{
|
|
14
|
+
label: "Contracts",
|
|
15
|
+
href: "/contracts",
|
|
16
|
+
children: [
|
|
17
|
+
{ label: "Operations", href: "/contracts/operations" },
|
|
18
|
+
{ label: "Events", href: "/contracts/events" },
|
|
19
|
+
],
|
|
20
|
+
},
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
];
|
|
24
|
+
|
|
25
|
+
const outline: PageOutlineItem[] = [
|
|
26
|
+
{
|
|
27
|
+
id: "architecture",
|
|
28
|
+
label: "Architecture",
|
|
29
|
+
level: 1,
|
|
30
|
+
children: [
|
|
31
|
+
{ id: "desktop", label: "Desktop shell", level: 2 },
|
|
32
|
+
{ id: "mobile", label: "Mobile adaptation", level: 2 },
|
|
33
|
+
],
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
export function WorkspacePage() {
|
|
38
|
+
return (
|
|
39
|
+
<AppShell
|
|
40
|
+
brand={{ label: "ContractSpec", href: "/dashboard" }}
|
|
41
|
+
navigation={navigation}
|
|
42
|
+
breadcrumbs={[
|
|
43
|
+
{ label: "Workspace", href: "/dashboard" },
|
|
44
|
+
{ label: "Contracts" },
|
|
45
|
+
]}
|
|
46
|
+
command={{
|
|
47
|
+
placeholder: "Search contracts or run an action",
|
|
48
|
+
groups: [
|
|
49
|
+
{
|
|
50
|
+
title: "Quick actions",
|
|
51
|
+
actions: [
|
|
52
|
+
{ id: "new-contract", label: "New contract" },
|
|
53
|
+
{ id: "import", label: "Import existing app" },
|
|
54
|
+
],
|
|
55
|
+
},
|
|
56
|
+
],
|
|
57
|
+
}}
|
|
58
|
+
user={{
|
|
59
|
+
name: "Ada Lovelace",
|
|
60
|
+
email: "ada@example.com",
|
|
61
|
+
actions: [{ label: "Sign out", onSelect: () => signOut() }],
|
|
62
|
+
}}
|
|
63
|
+
pageOutline={<PageOutline items={outline} activeId="desktop" />}
|
|
64
|
+
>
|
|
65
|
+
<main>{/* route content */}</main>
|
|
66
|
+
</AppShell>
|
|
67
|
+
);
|
|
68
|
+
}`;
|
|
69
|
+
|
|
70
|
+
export const scratchPrompt = `You are implementing a modern application shell from scratch.
|
|
71
|
+
|
|
72
|
+
Goal:
|
|
73
|
+
Build a reusable application shell for a React/Next.js web app and an Expo React Native app. The shell must provide a desktop sidebar, desktop topbar, command search, breadcrumbs, nested navigation, user/auth actions, and an in-page section navigator called PageOutline.
|
|
74
|
+
|
|
75
|
+
Use this architecture:
|
|
76
|
+
- Keep route content independent from navigation chrome.
|
|
77
|
+
- Create a typed navigation model with sections, items, active state, optional children, badges, icons, disabled items, and href/onSelect support.
|
|
78
|
+
- Create a command model with search input, grouped suggestions, quick actions, keyboard shortcut labels, empty state, and loading state.
|
|
79
|
+
- Create a breadcrumb model for the topbar.
|
|
80
|
+
- Create a PageOutline model for right-side in-page navigation with exactly three supported levels. It should render anchors, support active section state, and degrade gracefully when no sections exist.
|
|
81
|
+
- Expose the system from the design system or a dedicated shell module, not from a single app route.
|
|
82
|
+
|
|
83
|
+
Desktop behavior:
|
|
84
|
+
- Persistent left sidebar with app logo/title, command trigger, grouped navigation, nested submenus, and current user/auth/logout area.
|
|
85
|
+
- Topbar with breadcrumbs and an optional command trigger.
|
|
86
|
+
- Content area with optional right PageOutline.
|
|
87
|
+
- Keep dimensions stable. Navigation labels must not resize layout on hover or active state.
|
|
88
|
+
|
|
89
|
+
Mobile web behavior:
|
|
90
|
+
- Use bottom navigation for the primary destinations.
|
|
91
|
+
- Put deeper navigation, command search, auth actions, and secondary actions behind a menu or drawer.
|
|
92
|
+
- Keep route content first and make the shell controls reachable without covering important content.
|
|
93
|
+
|
|
94
|
+
Native behavior:
|
|
95
|
+
- Add .native.tsx entrypoints for Expo/React Native.
|
|
96
|
+
- Prefer bottom tabs for primary destinations and a menu/sheet for deeper navigation and account actions.
|
|
97
|
+
- Keep the same typed navigation, command, breadcrumb, and PageOutline data contracts across web and native.
|
|
98
|
+
|
|
99
|
+
Implementation constraints:
|
|
100
|
+
- Reuse the existing design-system primitives, tokens, icons, and accessibility patterns.
|
|
101
|
+
- Do not hardcode app-specific routes in the shell component.
|
|
102
|
+
- Do not introduce a new dependency unless the repo already uses it for dialogs, menus, icons, or navigation.
|
|
103
|
+
- Include tests for navigation rendering, nested items, command filtering, breadcrumbs, PageOutline level handling, active section state, and mobile/native adaptation contracts.
|
|
104
|
+
- Update docs and exports so developers can import the shell from a stable public API.
|
|
105
|
+
|
|
106
|
+
Deliverables:
|
|
107
|
+
- Typed shell models.
|
|
108
|
+
- Web shell components.
|
|
109
|
+
- Native shell components or adapters.
|
|
110
|
+
- PageOutline component with three-level support.
|
|
111
|
+
- Usage example.
|
|
112
|
+
- Focused tests and typecheck/build evidence.`;
|
|
113
|
+
|
|
114
|
+
export const refactorPrompt = `You are refactoring an existing application to use the shared application shell system.
|
|
115
|
+
|
|
116
|
+
Goal:
|
|
117
|
+
Replace app-specific sidebar, topbar, breadcrumb, command palette, account menu, mobile navigation, and in-page table-of-contents code with the shared AppShell and PageOutline system.
|
|
118
|
+
|
|
119
|
+
Start by auditing:
|
|
120
|
+
- Current layout wrappers and route groups.
|
|
121
|
+
- Sidebar, topbar, breadcrumb, command/search, auth menu, and mobile navigation implementations.
|
|
122
|
+
- Any duplicated navigation arrays, route labels, icon maps, access-control checks, and active-state logic.
|
|
123
|
+
- Any in-page summary/table-of-contents components that should become PageOutline data.
|
|
124
|
+
- Web-only assumptions that would block Expo/React Native adaptation.
|
|
125
|
+
|
|
126
|
+
Refactor plan:
|
|
127
|
+
1. Define a single typed navigation source for primary nav, grouped sidebar nav, nested children, labels, icons, badges, disabled states, and permissions.
|
|
128
|
+
2. Map existing command/search behavior into grouped command actions with search text and quick actions.
|
|
129
|
+
3. Map existing route metadata into breadcrumbs.
|
|
130
|
+
4. Convert page table-of-contents or section summary data into PageOutline items with a maximum of three levels.
|
|
131
|
+
5. Wrap app routes in AppShell while keeping page content components route-local.
|
|
132
|
+
6. Move primary mobile destinations into bottom navigation and deeper/account actions into a menu or drawer.
|
|
133
|
+
7. Add or preserve .native.tsx adapters when the app targets Expo.
|
|
134
|
+
|
|
135
|
+
Preserve behavior:
|
|
136
|
+
- Existing route URLs and access rules.
|
|
137
|
+
- Existing keyboard shortcuts where they are public behavior.
|
|
138
|
+
- Existing analytics or telemetry events on navigation and command actions.
|
|
139
|
+
- Existing auth/logout behavior.
|
|
140
|
+
- Existing responsive breakpoints unless there is a documented design-system breakpoint to adopt.
|
|
141
|
+
|
|
142
|
+
Quality gates:
|
|
143
|
+
- Add regression tests around current visible navigation before removing old shell code when coverage is missing.
|
|
144
|
+
- Test active nav state, nested nav expansion, command search/action invocation, breadcrumbs, auth menu, mobile bottom navigation, and PageOutline anchor behavior.
|
|
145
|
+
- Run lint, typecheck, and the app's relevant test/build command.
|
|
146
|
+
- Remove dead app-specific shell components only after the shared shell path is verified.
|
|
147
|
+
|
|
148
|
+
Output:
|
|
149
|
+
- List old shell files removed or simplified.
|
|
150
|
+
- List new shared shell integration points.
|
|
151
|
+
- Include before/after route coverage and verification commands.`;
|
|
152
|
+
|
|
153
|
+
export const shellParts = [
|
|
154
|
+
{
|
|
155
|
+
title: 'Sidebar',
|
|
156
|
+
body: 'Desktop owns brand, command entry, grouped navigation, nested items, and account actions in one persistent scanning area.',
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
title: 'Topbar',
|
|
160
|
+
body: 'Breadcrumbs stay visible while the current route changes. The command trigger can live here when the sidebar is collapsed or hidden.',
|
|
161
|
+
},
|
|
162
|
+
{
|
|
163
|
+
title: 'PageOutline',
|
|
164
|
+
body: 'The right-side in-page navigator replaces ad hoc tables of contents. It supports three levels of section anchors and active state.',
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
title: 'Mobile adapters',
|
|
168
|
+
body: 'Small web and native surfaces move primary destinations to bottom navigation and reserve drawers or menus for deep navigation and account actions.',
|
|
169
|
+
},
|
|
170
|
+
] as const;
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { CodeBlock, InstallCommand } from '@contractspec/lib.design-system';
|
|
2
|
+
import { Box, HStack, VStack } from '@contractspec/lib.design-system/layout';
|
|
3
|
+
import {
|
|
4
|
+
Code,
|
|
5
|
+
H1,
|
|
6
|
+
H2,
|
|
7
|
+
H3,
|
|
8
|
+
P,
|
|
9
|
+
Text,
|
|
10
|
+
} from '@contractspec/lib.design-system/typography';
|
|
11
|
+
import Link from '@contractspec/lib.ui-link';
|
|
12
|
+
import { ChevronRight } from 'lucide-react';
|
|
13
|
+
import {
|
|
14
|
+
refactorPrompt,
|
|
15
|
+
scratchPrompt,
|
|
16
|
+
shellParts,
|
|
17
|
+
shellUsageExample,
|
|
18
|
+
} from './LibrariesApplicationShellPage.content';
|
|
19
|
+
|
|
20
|
+
export function LibrariesApplicationShellPage() {
|
|
21
|
+
return (
|
|
22
|
+
<VStack className="space-y-8">
|
|
23
|
+
<VStack className="space-y-4">
|
|
24
|
+
<H1 className="font-bold text-4xl">Application shell</H1>
|
|
25
|
+
<P className="text-lg text-muted-foreground">
|
|
26
|
+
A reusable navigation system for product apps: desktop sidebar, topbar
|
|
27
|
+
breadcrumbs, command search, account actions, mobile adapters, and a
|
|
28
|
+
Notion-style <Code>PageOutline</Code> for page sections.
|
|
29
|
+
</P>
|
|
30
|
+
</VStack>
|
|
31
|
+
|
|
32
|
+
<VStack className="space-y-4">
|
|
33
|
+
<H2 className="font-bold text-2xl">Installation</H2>
|
|
34
|
+
<InstallCommand package="@contractspec/lib.design-system" />
|
|
35
|
+
</VStack>
|
|
36
|
+
|
|
37
|
+
<VStack className="space-y-4">
|
|
38
|
+
<H2 className="font-bold text-2xl">What It Standardizes</H2>
|
|
39
|
+
<Box className="grid gap-4 md:grid-cols-2">
|
|
40
|
+
{shellParts.map((part) => (
|
|
41
|
+
<Box key={part.title} className="card-subtle p-4">
|
|
42
|
+
<H3 className="font-semibold">{part.title}</H3>
|
|
43
|
+
<P className="mt-2 text-muted-foreground text-sm leading-7">
|
|
44
|
+
{part.body}
|
|
45
|
+
</P>
|
|
46
|
+
</Box>
|
|
47
|
+
))}
|
|
48
|
+
</Box>
|
|
49
|
+
</VStack>
|
|
50
|
+
|
|
51
|
+
<VStack className="space-y-4">
|
|
52
|
+
<H2 className="font-bold text-2xl">Import Surface</H2>
|
|
53
|
+
<P className="text-muted-foreground">
|
|
54
|
+
The shell is exposed as a focused design-system subpath so apps can
|
|
55
|
+
adopt navigation chrome without pulling unrelated documentation or
|
|
56
|
+
marketing helpers.
|
|
57
|
+
</P>
|
|
58
|
+
<CodeBlock
|
|
59
|
+
language="tsx"
|
|
60
|
+
filename="app-shell-example.tsx"
|
|
61
|
+
code={shellUsageExample}
|
|
62
|
+
/>
|
|
63
|
+
</VStack>
|
|
64
|
+
|
|
65
|
+
<VStack className="space-y-4">
|
|
66
|
+
<H2 className="font-bold text-2xl">AI Prompt: Build From Scratch</H2>
|
|
67
|
+
<P className="text-muted-foreground">
|
|
68
|
+
Use this prompt when the app does not already have a shell or when the
|
|
69
|
+
design-system package needs the reusable primitive first.
|
|
70
|
+
</P>
|
|
71
|
+
<CodeBlock
|
|
72
|
+
language="markdown"
|
|
73
|
+
filename="implement-application-shell.md"
|
|
74
|
+
code={scratchPrompt}
|
|
75
|
+
/>
|
|
76
|
+
</VStack>
|
|
77
|
+
|
|
78
|
+
<VStack className="space-y-4">
|
|
79
|
+
<H2 className="font-bold text-2xl">AI Prompt: Refactor An App</H2>
|
|
80
|
+
<P className="text-muted-foreground">
|
|
81
|
+
Use this prompt when an app already has custom navigation chrome and
|
|
82
|
+
needs to migrate without breaking route behavior.
|
|
83
|
+
</P>
|
|
84
|
+
<CodeBlock
|
|
85
|
+
language="markdown"
|
|
86
|
+
filename="refactor-to-application-shell.md"
|
|
87
|
+
code={refactorPrompt}
|
|
88
|
+
/>
|
|
89
|
+
</VStack>
|
|
90
|
+
|
|
91
|
+
<VStack className="card-subtle space-y-3 p-6">
|
|
92
|
+
<H2 className="font-bold text-2xl">Naming</H2>
|
|
93
|
+
<P className="text-muted-foreground">
|
|
94
|
+
Use <Code>AppShell</Code> for the whole navigation frame and{' '}
|
|
95
|
+
<Code>PageOutline</Code> for the in-page navigation helper. The latter
|
|
96
|
+
is the product-app equivalent of a table of contents, but it is
|
|
97
|
+
intentionally named for live page sections rather than static
|
|
98
|
+
documentation.
|
|
99
|
+
</P>
|
|
100
|
+
</VStack>
|
|
101
|
+
|
|
102
|
+
<HStack className="flex flex-wrap items-center gap-3 pt-2">
|
|
103
|
+
<Link href="/docs/libraries/cross-platform-ui" className="btn-ghost">
|
|
104
|
+
<Text>Cross-platform UI</Text>
|
|
105
|
+
</Link>
|
|
106
|
+
<Link href="/docs/libraries/design-system" className="btn-primary">
|
|
107
|
+
<Text>Design System</Text> <ChevronRight size={16} />
|
|
108
|
+
</Link>
|
|
109
|
+
</HStack>
|
|
110
|
+
</VStack>
|
|
111
|
+
);
|
|
112
|
+
}
|
|
@@ -62,7 +62,9 @@ export function UserPage() {
|
|
|
62
62
|
<code>filters</code>: Current filter state object.
|
|
63
63
|
</li>
|
|
64
64
|
<li>
|
|
65
|
-
<code>onFilterChange</code>: Callback when filters change.
|
|
65
|
+
<code>onFilterChange</code>: Callback when typed filters change.
|
|
66
|
+
Renderers emit <code>DataViewFilterValue</code> objects for numeric,
|
|
67
|
+
percent, currency, temporal, duration, and boolean filters.
|
|
66
68
|
</li>
|
|
67
69
|
<li>
|
|
68
70
|
<code>pagination</code>: Object with <code>page</code>,{' '}
|
|
@@ -71,6 +73,18 @@ export function UserPage() {
|
|
|
71
73
|
<li>
|
|
72
74
|
<code>onPageChange</code>: Callback when page changes.
|
|
73
75
|
</li>
|
|
76
|
+
<li>
|
|
77
|
+
<code>viewMode</code> / <code>defaultViewMode</code>: Controlled
|
|
78
|
+
or initial collection mode for specs that allow <code>list</code>,{' '}
|
|
79
|
+
<code>grid</code>, or <code>table</code> projections through{' '}
|
|
80
|
+
<code>view.collection.viewModes</code>.
|
|
81
|
+
</li>
|
|
82
|
+
<li>
|
|
83
|
+
<code>density</code> / <code>defaultDensity</code>: Controlled or
|
|
84
|
+
initial density for collection renderers, seeded by{' '}
|
|
85
|
+
<code>view.collection.density</code> and table{' '}
|
|
86
|
+
<code>view.density</code>.
|
|
87
|
+
</li>
|
|
74
88
|
</ul>
|
|
75
89
|
</div>
|
|
76
90
|
|
|
@@ -86,12 +100,19 @@ export function UserPage() {
|
|
|
86
100
|
code={`import { DataViewQueryGenerator } from '@contractspec/lib.contracts-spec/data-views/query-generator';
|
|
87
101
|
|
|
88
102
|
const generator = new DataViewQueryGenerator(MyUserList);
|
|
89
|
-
const
|
|
103
|
+
const params = {
|
|
90
104
|
pagination: { page: 1, pageSize: 20 },
|
|
91
|
-
filters: {
|
|
92
|
-
}
|
|
105
|
+
filters: {
|
|
106
|
+
role: { kind: 'single', value: 'admin' },
|
|
107
|
+
revenue: { kind: 'range', from: 1000, to: 5000 },
|
|
108
|
+
lastSeenAt: { kind: 'single', value: '2026-04-28T08:30:00Z' }
|
|
109
|
+
}
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
const errors = generator.validateParams(params);
|
|
113
|
+
const query = generator.generate(params);
|
|
93
114
|
|
|
94
|
-
// query.input contains
|
|
115
|
+
// query.input contains skip/take plus the typed filter payloads.`}
|
|
95
116
|
/>
|
|
96
117
|
</div>
|
|
97
118
|
|
|
@@ -187,6 +187,7 @@ export function LibrariesDesignSystemPage() {
|
|
|
187
187
|
<div className="card-subtle p-4">
|
|
188
188
|
<h3 className="mb-2 font-semibold">Organisms</h3>
|
|
189
189
|
<ul className="space-y-1 text-muted-foreground text-sm">
|
|
190
|
+
<li>AppShell, PageOutline</li>
|
|
190
191
|
<li>AppLayout, AppHeader, AppSidebar</li>
|
|
191
192
|
<li>MarketingLayout, HeroSection</li>
|
|
192
193
|
<li>ListCardPage, ListTablePage</li>
|
|
@@ -224,6 +225,14 @@ export function LibrariesDesignSystemPage() {
|
|
|
224
225
|
<h2 className="font-bold text-2xl">Where this layer fits</h2>
|
|
225
226
|
<p className="text-muted-foreground">
|
|
226
227
|
Read{' '}
|
|
228
|
+
<Link
|
|
229
|
+
href="/docs/libraries/application-shell"
|
|
230
|
+
className="text-[color:var(--rust)] underline underline-offset-4"
|
|
231
|
+
>
|
|
232
|
+
Application shell
|
|
233
|
+
</Link>{' '}
|
|
234
|
+
for the shared sidebar, topbar, command search, mobile navigation, and{' '}
|
|
235
|
+
<code>PageOutline</code> pattern. Read{' '}
|
|
227
236
|
<Link
|
|
228
237
|
href="/docs/libraries/cross-platform-ui"
|
|
229
238
|
className="text-[color:var(--rust)] underline underline-offset-4"
|
|
@@ -48,6 +48,12 @@ const libraryGroups = [
|
|
|
48
48
|
'Build higher-level product surfaces and documented marketing/docs primitives on top of the web and native UI packages.',
|
|
49
49
|
href: '/docs/libraries/design-system',
|
|
50
50
|
},
|
|
51
|
+
{
|
|
52
|
+
title: 'Application shell',
|
|
53
|
+
description:
|
|
54
|
+
'Adopt the shared sidebar, topbar, command search, mobile navigation, and PageOutline patterns for product apps.',
|
|
55
|
+
href: '/docs/libraries/application-shell',
|
|
56
|
+
},
|
|
51
57
|
{
|
|
52
58
|
title: 'Cross-platform UI',
|
|
53
59
|
description:
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export { LibrariesAccessibilityPage } from './LibrariesAccessibilityPage';
|
|
2
2
|
export { LibrariesAiAgentPage } from './LibrariesAiAgentPage';
|
|
3
3
|
export { LibrariesAnalyticsPage } from './LibrariesAnalyticsPage';
|
|
4
|
+
export { LibrariesApplicationShellPage } from './LibrariesApplicationShellPage';
|
|
4
5
|
export { LibrariesContentGenPage } from './LibrariesContentGenPage';
|
|
5
6
|
export { LibrariesContractsPage } from './LibrariesContractsPage';
|
|
6
7
|
export { LibrariesCostTrackingPage } from './LibrariesCostTrackingPage';
|
|
@@ -45,8 +45,44 @@ export const DataGridShowcaseDataView = defineDataView({
|
|
|
45
45
|
{ key: 'account', label: 'Account', dataPath: 'account', sortable: true },
|
|
46
46
|
{ key: 'owner', label: 'Owner', dataPath: 'owner', sortable: true },
|
|
47
47
|
{ key: 'status', label: 'Status', dataPath: 'status', sortable: true },
|
|
48
|
+
{
|
|
49
|
+
key: 'arr',
|
|
50
|
+
label: 'ARR',
|
|
51
|
+
dataPath: 'arr',
|
|
52
|
+
sortable: true,
|
|
53
|
+
format: { type: 'currency', currency: 'USD', rounded: true },
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: 'healthScore',
|
|
57
|
+
label: 'Health score',
|
|
58
|
+
dataPath: 'healthScore',
|
|
59
|
+
format: { type: 'percent', valueScale: 'fraction', maximumFractionDigits: 1 },
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
key: 'lastActivityAt',
|
|
63
|
+
label: 'Last activity',
|
|
64
|
+
dataPath: 'lastActivityAt',
|
|
65
|
+
format: { type: 'datetime', dateStyle: 'medium', timeStyle: 'short' },
|
|
66
|
+
},
|
|
48
67
|
{ key: 'notes', label: 'Notes', dataPath: 'notes' },
|
|
49
68
|
],
|
|
69
|
+
filters: [
|
|
70
|
+
{ key: 'status', label: 'Status', field: 'status', type: 'enum' },
|
|
71
|
+
{
|
|
72
|
+
key: 'arr',
|
|
73
|
+
label: 'ARR',
|
|
74
|
+
field: 'arr',
|
|
75
|
+
type: 'currency',
|
|
76
|
+
valueMode: 'range',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
key: 'lastActivityAt',
|
|
80
|
+
label: 'Last activity',
|
|
81
|
+
field: 'lastActivityAt',
|
|
82
|
+
type: 'datetime',
|
|
83
|
+
valueMode: 'range',
|
|
84
|
+
},
|
|
85
|
+
],
|
|
50
86
|
},
|
|
51
87
|
});`;
|
|
52
88
|
|
|
@@ -84,9 +120,9 @@ export function SpecsDataViewsPage() {
|
|
|
84
120
|
<h3 className="font-semibold text-lg">Filtering</h3>
|
|
85
121
|
<p className="text-muted-foreground">
|
|
86
122
|
Define filters that users can apply to narrow down results.
|
|
87
|
-
Filters
|
|
88
|
-
|
|
89
|
-
|
|
123
|
+
Filters are typed as search, enum, number, percent, currency,
|
|
124
|
+
date, time, datetime, duration, or boolean so renderers and query
|
|
125
|
+
helpers can validate values before execution.
|
|
90
126
|
</p>
|
|
91
127
|
</div>
|
|
92
128
|
<div>
|