@contractspec/lib.example-shared-ui 3.4.3 → 4.0.2

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.
@@ -2128,6 +2128,82 @@ function SaveToStudioButton({
2128
2128
  }, undefined, true, undefined, this);
2129
2129
  }
2130
2130
 
2131
+ // src/SpecDrivenTemplateShell.tsx
2132
+ import {
2133
+ BundleProvider,
2134
+ BundleRenderer
2135
+ } from "@contractspec/lib.surface-runtime/react";
2136
+ import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
2137
+ function SpecDrivenTemplateShell({
2138
+ plan,
2139
+ title,
2140
+ description,
2141
+ sidebar,
2142
+ actions,
2143
+ showSaveAction = true,
2144
+ saveProps,
2145
+ children
2146
+ }) {
2147
+ const headerContent = /* @__PURE__ */ jsxDEV8("header", {
2148
+ className: "border-border bg-card rounded-2xl border p-6 shadow-sm",
2149
+ children: [
2150
+ /* @__PURE__ */ jsxDEV8("div", {
2151
+ className: "flex flex-wrap items-center justify-between gap-4",
2152
+ children: [
2153
+ /* @__PURE__ */ jsxDEV8("div", {
2154
+ children: [
2155
+ /* @__PURE__ */ jsxDEV8("p", {
2156
+ className: "text-muted-foreground text-sm font-semibold tracking-wide uppercase",
2157
+ children: "ContractSpec Templates"
2158
+ }, undefined, false, undefined, this),
2159
+ /* @__PURE__ */ jsxDEV8("h1", {
2160
+ className: "text-3xl font-bold",
2161
+ children: title
2162
+ }, undefined, false, undefined, this),
2163
+ description ? /* @__PURE__ */ jsxDEV8("p", {
2164
+ className: "text-muted-foreground mt-2 max-w-2xl text-sm",
2165
+ children: description
2166
+ }, undefined, false, undefined, this) : null
2167
+ ]
2168
+ }, undefined, true, undefined, this),
2169
+ /* @__PURE__ */ jsxDEV8("div", {
2170
+ className: "flex flex-col items-end gap-2",
2171
+ children: [
2172
+ /* @__PURE__ */ jsxDEV8(LocalDataIndicator, {}, undefined, false, undefined, this),
2173
+ showSaveAction ? /* @__PURE__ */ jsxDEV8(SaveToStudioButton, {
2174
+ ...saveProps
2175
+ }, undefined, false, undefined, this) : null
2176
+ ]
2177
+ }, undefined, true, undefined, this)
2178
+ ]
2179
+ }, undefined, true, undefined, this),
2180
+ actions ? /* @__PURE__ */ jsxDEV8("div", {
2181
+ className: "mt-4",
2182
+ children: actions
2183
+ }, undefined, false, undefined, this) : null
2184
+ ]
2185
+ }, undefined, true, undefined, this);
2186
+ const slotContent = {
2187
+ header: headerContent,
2188
+ primary: /* @__PURE__ */ jsxDEV8("main", {
2189
+ className: "space-y-4 p-2",
2190
+ children
2191
+ }, undefined, false, undefined, this)
2192
+ };
2193
+ if (sidebar != null) {
2194
+ slotContent.sidebar = /* @__PURE__ */ jsxDEV8("aside", {
2195
+ className: "border-border bg-card rounded-2xl border p-4",
2196
+ children: sidebar
2197
+ }, undefined, false, undefined, this);
2198
+ }
2199
+ return /* @__PURE__ */ jsxDEV8(BundleProvider, {
2200
+ plan,
2201
+ children: /* @__PURE__ */ jsxDEV8(BundleRenderer, {
2202
+ slotContent
2203
+ }, undefined, false, undefined, this)
2204
+ }, undefined, false, undefined, this);
2205
+ }
2206
+
2131
2207
  // src/utils/generateSpecFromTemplate.ts
2132
2208
  function generateSpecFromTemplate(template) {
2133
2209
  const templateId = template?.id ?? "unknown";
@@ -2697,7 +2773,7 @@ function useSpecContent(templateId) {
2697
2773
  import { useCallback as useCallback8, useEffect as useEffect5 } from "react";
2698
2774
  import { Button as Button5, LoaderBlock as LoaderBlock3 } from "@contractspec/lib.design-system";
2699
2775
  import { Badge as Badge5 } from "@contractspec/lib.ui-kit-web/ui/badge";
2700
- import { jsxDEV as jsxDEV8 } from "react/jsx-dev-runtime";
2776
+ import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
2701
2777
  "use client";
2702
2778
  function SpecEditorPanel({
2703
2779
  templateId,
@@ -2739,54 +2815,54 @@ function SpecEditorPanel({
2739
2815
  onLog?.("Spec reset to template defaults");
2740
2816
  }, [reset, onLog]);
2741
2817
  if (loading) {
2742
- return /* @__PURE__ */ jsxDEV8(LoaderBlock3, {
2818
+ return /* @__PURE__ */ jsxDEV9(LoaderBlock3, {
2743
2819
  label: "Loading spec..."
2744
2820
  }, undefined, false, undefined, this);
2745
2821
  }
2746
- return /* @__PURE__ */ jsxDEV8("div", {
2822
+ return /* @__PURE__ */ jsxDEV9("div", {
2747
2823
  className: "space-y-4",
2748
2824
  children: [
2749
- /* @__PURE__ */ jsxDEV8("div", {
2825
+ /* @__PURE__ */ jsxDEV9("div", {
2750
2826
  className: "flex items-center justify-between",
2751
2827
  children: [
2752
- /* @__PURE__ */ jsxDEV8("div", {
2828
+ /* @__PURE__ */ jsxDEV9("div", {
2753
2829
  className: "flex items-center gap-2",
2754
2830
  children: [
2755
- /* @__PURE__ */ jsxDEV8(Button5, {
2831
+ /* @__PURE__ */ jsxDEV9(Button5, {
2756
2832
  variant: "default",
2757
2833
  size: "sm",
2758
2834
  onClick: handleSave,
2759
2835
  children: "Save"
2760
2836
  }, undefined, false, undefined, this),
2761
- /* @__PURE__ */ jsxDEV8(Button5, {
2837
+ /* @__PURE__ */ jsxDEV9(Button5, {
2762
2838
  variant: "outline",
2763
2839
  size: "sm",
2764
2840
  onClick: handleValidate,
2765
2841
  children: "Validate"
2766
2842
  }, undefined, false, undefined, this),
2767
- isDirty && /* @__PURE__ */ jsxDEV8(Badge5, {
2843
+ isDirty && /* @__PURE__ */ jsxDEV9(Badge5, {
2768
2844
  variant: "secondary",
2769
2845
  className: "border-amber-500/30 bg-amber-500/20 text-amber-400",
2770
2846
  children: "Unsaved changes"
2771
2847
  }, undefined, false, undefined, this),
2772
- validation && /* @__PURE__ */ jsxDEV8(Badge5, {
2848
+ validation && /* @__PURE__ */ jsxDEV9(Badge5, {
2773
2849
  variant: validation.valid ? "default" : "destructive",
2774
2850
  className: validation.valid ? "border-green-500/30 bg-green-500/20 text-green-400" : "",
2775
2851
  children: validation.valid ? "Valid" : `${validation.errors.filter((e) => e.severity === "error").length} errors`
2776
2852
  }, undefined, false, undefined, this)
2777
2853
  ]
2778
2854
  }, undefined, true, undefined, this),
2779
- /* @__PURE__ */ jsxDEV8("div", {
2855
+ /* @__PURE__ */ jsxDEV9("div", {
2780
2856
  className: "flex items-center gap-2",
2781
2857
  children: [
2782
- lastSaved && /* @__PURE__ */ jsxDEV8("span", {
2858
+ lastSaved && /* @__PURE__ */ jsxDEV9("span", {
2783
2859
  className: "text-muted-foreground text-xs",
2784
2860
  children: [
2785
2861
  "Last saved: ",
2786
2862
  new Date(lastSaved).toLocaleTimeString()
2787
2863
  ]
2788
2864
  }, undefined, true, undefined, this),
2789
- /* @__PURE__ */ jsxDEV8(Button5, {
2865
+ /* @__PURE__ */ jsxDEV9(Button5, {
2790
2866
  variant: "ghost",
2791
2867
  size: "sm",
2792
2868
  onPress: handleReset,
@@ -2796,16 +2872,16 @@ function SpecEditorPanel({
2796
2872
  }, undefined, true, undefined, this)
2797
2873
  ]
2798
2874
  }, undefined, true, undefined, this),
2799
- validation && validation.errors.length > 0 && /* @__PURE__ */ jsxDEV8("div", {
2875
+ validation && validation.errors.length > 0 && /* @__PURE__ */ jsxDEV9("div", {
2800
2876
  className: "rounded-lg border border-amber-500/50 bg-amber-500/10 p-3",
2801
2877
  children: [
2802
- /* @__PURE__ */ jsxDEV8("p", {
2878
+ /* @__PURE__ */ jsxDEV9("p", {
2803
2879
  className: "mb-2 text-xs font-semibold text-amber-400 uppercase",
2804
2880
  children: "Validation Issues"
2805
2881
  }, undefined, false, undefined, this),
2806
- /* @__PURE__ */ jsxDEV8("ul", {
2882
+ /* @__PURE__ */ jsxDEV9("ul", {
2807
2883
  className: "space-y-1",
2808
- children: validation.errors.map((error, index) => /* @__PURE__ */ jsxDEV8("li", {
2884
+ children: validation.errors.map((error, index) => /* @__PURE__ */ jsxDEV9("li", {
2809
2885
  className: `text-xs ${error.severity === "error" ? "text-red-400" : "text-amber-400"}`,
2810
2886
  children: [
2811
2887
  "Line ",
@@ -2817,9 +2893,9 @@ function SpecEditorPanel({
2817
2893
  }, undefined, false, undefined, this)
2818
2894
  ]
2819
2895
  }, undefined, true, undefined, this),
2820
- /* @__PURE__ */ jsxDEV8("div", {
2896
+ /* @__PURE__ */ jsxDEV9("div", {
2821
2897
  className: "border-border bg-card rounded-2xl border p-4",
2822
- children: /* @__PURE__ */ jsxDEV8(SpecEditor, {
2898
+ children: /* @__PURE__ */ jsxDEV9(SpecEditor, {
2823
2899
  projectId: "sandbox",
2824
2900
  type: "CAPABILITY",
2825
2901
  content,
@@ -2834,7 +2910,7 @@ function SpecEditorPanel({
2834
2910
  }
2835
2911
 
2836
2912
  // src/TemplateShell.tsx
2837
- import { jsxDEV as jsxDEV9 } from "react/jsx-dev-runtime";
2913
+ import { jsxDEV as jsxDEV10 } from "react/jsx-dev-runtime";
2838
2914
  var TemplateShell = ({
2839
2915
  title,
2840
2916
  description,
@@ -2843,56 +2919,56 @@ var TemplateShell = ({
2843
2919
  showSaveAction = true,
2844
2920
  saveProps,
2845
2921
  children
2846
- }) => /* @__PURE__ */ jsxDEV9("div", {
2922
+ }) => /* @__PURE__ */ jsxDEV10("div", {
2847
2923
  className: "space-y-6",
2848
2924
  children: [
2849
- /* @__PURE__ */ jsxDEV9("header", {
2925
+ /* @__PURE__ */ jsxDEV10("header", {
2850
2926
  className: "border-border bg-card rounded-2xl border p-6 shadow-sm",
2851
2927
  children: [
2852
- /* @__PURE__ */ jsxDEV9("div", {
2928
+ /* @__PURE__ */ jsxDEV10("div", {
2853
2929
  className: "flex flex-wrap items-center justify-between gap-4",
2854
2930
  children: [
2855
- /* @__PURE__ */ jsxDEV9("div", {
2931
+ /* @__PURE__ */ jsxDEV10("div", {
2856
2932
  children: [
2857
- /* @__PURE__ */ jsxDEV9("p", {
2933
+ /* @__PURE__ */ jsxDEV10("p", {
2858
2934
  className: "text-muted-foreground text-sm font-semibold tracking-wide uppercase",
2859
2935
  children: "ContractSpec Templates"
2860
2936
  }, undefined, false, undefined, this),
2861
- /* @__PURE__ */ jsxDEV9("h1", {
2937
+ /* @__PURE__ */ jsxDEV10("h1", {
2862
2938
  className: "text-3xl font-bold",
2863
2939
  children: title
2864
2940
  }, undefined, false, undefined, this),
2865
- description ? /* @__PURE__ */ jsxDEV9("p", {
2941
+ description ? /* @__PURE__ */ jsxDEV10("p", {
2866
2942
  className: "text-muted-foreground mt-2 max-w-2xl text-sm",
2867
2943
  children: description
2868
2944
  }, undefined, false, undefined, this) : null
2869
2945
  ]
2870
2946
  }, undefined, true, undefined, this),
2871
- /* @__PURE__ */ jsxDEV9("div", {
2947
+ /* @__PURE__ */ jsxDEV10("div", {
2872
2948
  className: "flex flex-col items-end gap-2",
2873
2949
  children: [
2874
- /* @__PURE__ */ jsxDEV9(LocalDataIndicator, {}, undefined, false, undefined, this),
2875
- showSaveAction ? /* @__PURE__ */ jsxDEV9(SaveToStudioButton, {
2950
+ /* @__PURE__ */ jsxDEV10(LocalDataIndicator, {}, undefined, false, undefined, this),
2951
+ showSaveAction ? /* @__PURE__ */ jsxDEV10(SaveToStudioButton, {
2876
2952
  ...saveProps
2877
2953
  }, undefined, false, undefined, this) : null
2878
2954
  ]
2879
2955
  }, undefined, true, undefined, this)
2880
2956
  ]
2881
2957
  }, undefined, true, undefined, this),
2882
- actions ? /* @__PURE__ */ jsxDEV9("div", {
2958
+ actions ? /* @__PURE__ */ jsxDEV10("div", {
2883
2959
  className: "mt-4",
2884
2960
  children: actions
2885
2961
  }, undefined, false, undefined, this) : null
2886
2962
  ]
2887
2963
  }, undefined, true, undefined, this),
2888
- /* @__PURE__ */ jsxDEV9("div", {
2964
+ /* @__PURE__ */ jsxDEV10("div", {
2889
2965
  className: sidebar ? "grid gap-6 lg:grid-cols-[minmax(0,1fr)_320px]" : "w-full",
2890
2966
  children: [
2891
- /* @__PURE__ */ jsxDEV9("main", {
2967
+ /* @__PURE__ */ jsxDEV10("main", {
2892
2968
  className: "space-y-4 p-2",
2893
2969
  children
2894
2970
  }, undefined, false, undefined, this),
2895
- sidebar ? /* @__PURE__ */ jsxDEV9("aside", {
2971
+ sidebar ? /* @__PURE__ */ jsxDEV10("aside", {
2896
2972
  className: "border-border bg-card rounded-2xl border p-4",
2897
2973
  children: sidebar
2898
2974
  }, undefined, false, undefined, this) : null
@@ -3486,6 +3562,7 @@ export {
3486
3562
  TemplateRuntimeContext,
3487
3563
  TemplateComponentRegistry,
3488
3564
  SpecEditorPanel,
3565
+ SpecDrivenTemplateShell,
3489
3566
  SaveToStudioButton,
3490
3567
  PersonalizationInsights,
3491
3568
  OverlayContextProvider,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@contractspec/lib.example-shared-ui",
3
- "version": "3.4.3",
3
+ "version": "4.0.2",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -10,6 +10,27 @@
10
10
  "browser": "./dist/browser/index.js",
11
11
  "default": "./dist/index.js"
12
12
  },
13
+ "./bundles": {
14
+ "types": "./dist/bundles/index.d.ts",
15
+ "bun": "./dist/bundles/index.js",
16
+ "node": "./dist/node/bundles/index.js",
17
+ "browser": "./dist/browser/bundles/index.js",
18
+ "default": "./dist/bundles/index.js"
19
+ },
20
+ "./bundles/ExampleTemplateBundle": {
21
+ "types": "./dist/bundles/ExampleTemplateBundle.d.ts",
22
+ "bun": "./dist/bundles/ExampleTemplateBundle.js",
23
+ "node": "./dist/node/bundles/ExampleTemplateBundle.js",
24
+ "browser": "./dist/browser/bundles/ExampleTemplateBundle.js",
25
+ "default": "./dist/bundles/ExampleTemplateBundle.js"
26
+ },
27
+ "./bundles/index": {
28
+ "types": "./dist/bundles/index.d.ts",
29
+ "bun": "./dist/bundles/index.js",
30
+ "node": "./dist/node/bundles/index.js",
31
+ "browser": "./dist/browser/bundles/index.js",
32
+ "default": "./dist/bundles/index.js"
33
+ },
13
34
  "./EvolutionDashboard": {
14
35
  "types": "./dist/EvolutionDashboard.d.ts",
15
36
  "bun": "./dist/EvolutionDashboard.js",
@@ -136,6 +157,13 @@
136
157
  "browser": "./dist/browser/SaveToStudioButton.js",
137
158
  "default": "./dist/SaveToStudioButton.js"
138
159
  },
160
+ "./SpecDrivenTemplateShell": {
161
+ "types": "./dist/SpecDrivenTemplateShell.d.ts",
162
+ "bun": "./dist/SpecDrivenTemplateShell.js",
163
+ "node": "./dist/node/SpecDrivenTemplateShell.js",
164
+ "browser": "./dist/browser/SpecDrivenTemplateShell.js",
165
+ "default": "./dist/SpecDrivenTemplateShell.js"
166
+ },
139
167
  "./SpecEditorPanel": {
140
168
  "types": "./dist/SpecEditorPanel.d.ts",
141
169
  "bun": "./dist/SpecEditorPanel.js",
@@ -205,6 +233,27 @@
205
233
  "browser": "./dist/browser/index.js",
206
234
  "default": "./dist/index.js"
207
235
  },
236
+ "./bundles": {
237
+ "types": "./dist/bundles/index.d.ts",
238
+ "bun": "./dist/bundles/index.js",
239
+ "node": "./dist/node/bundles/index.js",
240
+ "browser": "./dist/browser/bundles/index.js",
241
+ "default": "./dist/bundles/index.js"
242
+ },
243
+ "./bundles/ExampleTemplateBundle": {
244
+ "types": "./dist/bundles/ExampleTemplateBundle.d.ts",
245
+ "bun": "./dist/bundles/ExampleTemplateBundle.js",
246
+ "node": "./dist/node/bundles/ExampleTemplateBundle.js",
247
+ "browser": "./dist/browser/bundles/ExampleTemplateBundle.js",
248
+ "default": "./dist/bundles/ExampleTemplateBundle.js"
249
+ },
250
+ "./bundles/index": {
251
+ "types": "./dist/bundles/index.d.ts",
252
+ "bun": "./dist/bundles/index.js",
253
+ "node": "./dist/node/bundles/index.js",
254
+ "browser": "./dist/browser/bundles/index.js",
255
+ "default": "./dist/bundles/index.js"
256
+ },
208
257
  "./EvolutionDashboard": {
209
258
  "types": "./dist/EvolutionDashboard.d.ts",
210
259
  "bun": "./dist/EvolutionDashboard.js",
@@ -331,6 +380,13 @@
331
380
  "browser": "./dist/browser/SaveToStudioButton.js",
332
381
  "default": "./dist/SaveToStudioButton.js"
333
382
  },
383
+ "./SpecDrivenTemplateShell": {
384
+ "types": "./dist/SpecDrivenTemplateShell.d.ts",
385
+ "bun": "./dist/SpecDrivenTemplateShell.js",
386
+ "node": "./dist/node/SpecDrivenTemplateShell.js",
387
+ "browser": "./dist/browser/SpecDrivenTemplateShell.js",
388
+ "default": "./dist/SpecDrivenTemplateShell.js"
389
+ },
334
390
  "./SpecEditorPanel": {
335
391
  "types": "./dist/SpecEditorPanel.d.ts",
336
392
  "bun": "./dist/SpecEditorPanel.js",
@@ -375,24 +431,35 @@
375
431
  }
376
432
  }
377
433
  },
434
+ "peerDependencies": {
435
+ "@contractspec/lib.surface-runtime": "0.3.2"
436
+ },
437
+ "peerDependenciesMeta": {
438
+ "@contractspec/lib.surface-runtime": {
439
+ "optional": true
440
+ }
441
+ },
378
442
  "dependencies": {
379
443
  "@apollo/client": "^4.1.6",
380
- "@contractspec/lib.contracts-spec": "3.4.3",
381
- "@contractspec/lib.design-system": "3.4.3",
382
- "@contractspec/lib.ui-kit-web": "3.4.3",
444
+ "@contractspec/lib.contracts-spec": "3.5.2",
445
+ "@contractspec/lib.design-system": "3.5.2",
446
+ "@contractspec/lib.ui-kit-web": "3.5.2",
383
447
  "@tanstack/react-query": "^5.90.21",
384
- "framer-motion": "^12.35.0",
448
+ "framer-motion": "^12.35.1",
385
449
  "lucide-react": "^0.577.0",
386
450
  "react": "19.2.4",
387
451
  "react-dom": "19.2.4"
388
452
  },
453
+ "optionalDependencies": {
454
+ "@contractspec/lib.surface-runtime": "0.3.2"
455
+ },
389
456
  "devDependencies": {
390
- "@contractspec/tool.typescript": "3.4.3",
457
+ "@contractspec/tool.typescript": "3.5.2",
391
458
  "@types/react": "^19.2.14",
392
459
  "@types/react-dom": "^19.2.2",
393
460
  "eslint": "^9.39.2",
394
461
  "typescript": "^5.9.3",
395
- "@contractspec/tool.bun": "3.4.3"
462
+ "@contractspec/tool.bun": "3.5.2"
396
463
  },
397
464
  "types": "./dist/index.d.ts"
398
465
  }
@@ -0,0 +1,79 @@
1
+ import type { ReactNode } from 'react';
2
+ import {
3
+ BundleProvider,
4
+ BundleRenderer,
5
+ } from '@contractspec/lib.surface-runtime/react';
6
+ import type { ResolvedSurfacePlan } from '@contractspec/lib.surface-runtime/runtime/resolve-bundle';
7
+ import { LocalDataIndicator } from './LocalDataIndicator';
8
+ import {
9
+ SaveToStudioButton,
10
+ type SaveToStudioButtonProps,
11
+ } from './SaveToStudioButton';
12
+
13
+ export interface SpecDrivenTemplateShellProps {
14
+ plan: ResolvedSurfacePlan;
15
+ title: string;
16
+ description?: string;
17
+ sidebar?: ReactNode;
18
+ actions?: ReactNode;
19
+ children: ReactNode;
20
+ showSaveAction?: boolean;
21
+ saveProps?: SaveToStudioButtonProps;
22
+ }
23
+
24
+ /**
25
+ * Template shell driven by surface-runtime bundle spec.
26
+ * Uses BundleRenderer for adaptive, preference-driven layouts.
27
+ * Requires @contractspec/lib.surface-runtime as peer dependency.
28
+ */
29
+ export function SpecDrivenTemplateShell({
30
+ plan,
31
+ title,
32
+ description,
33
+ sidebar,
34
+ actions,
35
+ showSaveAction = true,
36
+ saveProps,
37
+ children,
38
+ }: SpecDrivenTemplateShellProps) {
39
+ const headerContent = (
40
+ <header className="border-border bg-card rounded-2xl border p-6 shadow-sm">
41
+ <div className="flex flex-wrap items-center justify-between gap-4">
42
+ <div>
43
+ <p className="text-muted-foreground text-sm font-semibold tracking-wide uppercase">
44
+ ContractSpec Templates
45
+ </p>
46
+ <h1 className="text-3xl font-bold">{title}</h1>
47
+ {description ? (
48
+ <p className="text-muted-foreground mt-2 max-w-2xl text-sm">
49
+ {description}
50
+ </p>
51
+ ) : null}
52
+ </div>
53
+ <div className="flex flex-col items-end gap-2">
54
+ <LocalDataIndicator />
55
+ {showSaveAction ? <SaveToStudioButton {...saveProps} /> : null}
56
+ </div>
57
+ </div>
58
+ {actions ? <div className="mt-4">{actions}</div> : null}
59
+ </header>
60
+ );
61
+
62
+ const slotContent: Partial<Record<string, ReactNode>> = {
63
+ header: headerContent,
64
+ primary: <main className="space-y-4 p-2">{children}</main>,
65
+ };
66
+ if (sidebar != null) {
67
+ slotContent.sidebar = (
68
+ <aside className="border-border bg-card rounded-2xl border p-4">
69
+ {sidebar}
70
+ </aside>
71
+ );
72
+ }
73
+
74
+ return (
75
+ <BundleProvider plan={plan}>
76
+ <BundleRenderer slotContent={slotContent} />
77
+ </BundleProvider>
78
+ );
79
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Minimal bundle spec for example template shells.
3
+ * Requires @contractspec/lib.surface-runtime when used.
4
+ */
5
+
6
+ import { defineModuleBundle } from '@contractspec/lib.surface-runtime/spec';
7
+
8
+ export const ExampleTemplateBundle = defineModuleBundle({
9
+ meta: {
10
+ key: 'example.template',
11
+ version: '0.1.0',
12
+ title: 'Example Template',
13
+ description: 'Adaptive template shell for ContractSpec examples',
14
+ owners: ['team-platform'],
15
+ tags: ['example', 'template'],
16
+ stability: 'experimental',
17
+ },
18
+
19
+ routes: [
20
+ {
21
+ routeId: 'template',
22
+ path: '/sandbox',
23
+ defaultSurface: 'template-shell',
24
+ },
25
+ ],
26
+
27
+ surfaces: {
28
+ 'template-shell': {
29
+ surfaceId: 'template-shell',
30
+ kind: 'workbench',
31
+ title: 'Template Shell',
32
+ slots: [
33
+ {
34
+ slotId: 'header',
35
+ role: 'header',
36
+ accepts: ['action-bar'],
37
+ cardinality: 'many',
38
+ },
39
+ {
40
+ slotId: 'primary',
41
+ role: 'primary',
42
+ accepts: ['entity-section', 'rich-doc', 'form', 'custom-widget'],
43
+ cardinality: 'many',
44
+ },
45
+ {
46
+ slotId: 'sidebar',
47
+ role: 'secondary',
48
+ accepts: ['entity-section', 'custom-widget'],
49
+ cardinality: 'one',
50
+ },
51
+ ],
52
+
53
+ layouts: [
54
+ {
55
+ layoutId: 'main-with-sidebar',
56
+ title: 'Main with sidebar',
57
+ root: {
58
+ type: 'panel-group',
59
+ direction: 'horizontal',
60
+ persistKey: 'example.template.main-sidebar',
61
+ children: [
62
+ {
63
+ type: 'panel-group',
64
+ direction: 'vertical',
65
+ persistKey: 'example.template.content',
66
+ children: [
67
+ { type: 'slot', slotId: 'header' },
68
+ { type: 'slot', slotId: 'primary' },
69
+ ],
70
+ },
71
+ { type: 'slot', slotId: 'sidebar' },
72
+ ],
73
+ },
74
+ },
75
+ ],
76
+ data: [],
77
+
78
+ verification: {
79
+ dimensions: {
80
+ guidance: 'Can reveal hints and walkthrough notes.',
81
+ density: 'Can select compact or balanced layouts.',
82
+ dataDepth: 'Controls content depth and expansion.',
83
+ control: 'Shows advanced options when allowed.',
84
+ media: 'Supports text-first and hybrid modes.',
85
+ pace: 'Maps to motion tokens and transitions.',
86
+ narrative: 'Can order summary before or after detail.',
87
+ },
88
+ },
89
+ },
90
+ },
91
+ });
@@ -0,0 +1 @@
1
+ export { ExampleTemplateBundle } from './ExampleTemplateBundle';
package/src/index.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from './TemplateShell';
2
+ export * from './SpecDrivenTemplateShell';
2
3
  export * from './LocalDataIndicator';
3
4
  export * from './SaveToStudioButton';
4
5
  export * from './overlay-types';