bedrock-flows 0.7.1

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 (85) hide show
  1. package/auth-schema.sql +8 -0
  2. package/bin/bedrock-flows.mjs +127 -0
  3. package/lib/setup.mjs +262 -0
  4. package/package.json +11 -0
  5. package/template/.storybook/main.js +46 -0
  6. package/template/.storybook/manager-head.html +963 -0
  7. package/template/.storybook/preview-head.html +35 -0
  8. package/template/.storybook/preview.js +23 -0
  9. package/template/CHANGELOG.md +236 -0
  10. package/template/README.md +26 -0
  11. package/template/apps/dashboard/index.html +15 -0
  12. package/template/apps/dashboard/package.json +22 -0
  13. package/template/apps/dashboard/src/App.module.css +1318 -0
  14. package/template/apps/dashboard/src/App.tsx +2716 -0
  15. package/template/apps/dashboard/src/auth-client.ts +17 -0
  16. package/template/apps/dashboard/src/changelog.tsx +92 -0
  17. package/template/apps/dashboard/src/index.css +86 -0
  18. package/template/apps/dashboard/src/main.tsx +15 -0
  19. package/template/apps/dashboard/src/theme.ts +31 -0
  20. package/template/apps/dashboard/src/vite-env.d.ts +4 -0
  21. package/template/apps/dashboard/vite.config.ts +48 -0
  22. package/template/apps/worker/.dev.vars.example +50 -0
  23. package/template/apps/worker/package.json +19 -0
  24. package/template/apps/worker/src/index.ts +295 -0
  25. package/template/apps/worker/tsconfig.json +11 -0
  26. package/template/apps/worker/wrangler.jsonc +29 -0
  27. package/template/bedrock.config.ts +16 -0
  28. package/template/design-system/README.md +97 -0
  29. package/template/design-system/starter-v1/components/button/component.css +42 -0
  30. package/template/design-system/starter-v1/components/button/danger.html +21 -0
  31. package/template/design-system/starter-v1/components/button/default.html +21 -0
  32. package/template/design-system/starter-v1/components/button/disabled.html +21 -0
  33. package/template/design-system/starter-v1/components/button/ghost.html +21 -0
  34. package/template/design-system/starter-v1/components/button/macro.njk +14 -0
  35. package/template/design-system/starter-v1/components/button/primary.html +21 -0
  36. package/template/design-system/starter-v1/components/button/variants.json +30 -0
  37. package/template/design-system/starter-v1/ds.json +3 -0
  38. package/template/design-system/starter-v1/global.css +52 -0
  39. package/template/design-system/starter-v1/style.css +107 -0
  40. package/template/gitignore +8 -0
  41. package/template/package.json +41 -0
  42. package/template/prototypes/F-001-hello/1-welcome.njk +30 -0
  43. package/template/prototypes/F-001-hello/2-form.njk +46 -0
  44. package/template/prototypes/F-001-hello/3-done.njk +29 -0
  45. package/template/prototypes/F-001-hello/meta.json +6 -0
  46. package/template/prototypes/_shared/_auth-gate.njk +54 -0
  47. package/template/prototypes/_shared/delivery.njk +43 -0
  48. package/template/prototypes/_shared/layout.njk +15 -0
  49. package/template/prototypes/_shared/screen.njk +1818 -0
  50. package/template/prototypes/_shared/wireflow.njk +4731 -0
  51. package/template/public/auth-gate.css +150 -0
  52. package/template/public/bedrock/color-inspector.js +284 -0
  53. package/template/public/bedrock/component-overlay.js +219 -0
  54. package/template/public/bedrock/data/bedrock-config.js +45 -0
  55. package/template/public/bedrock/font-size-overlay.js +590 -0
  56. package/template/public/bedrock/grid-overlay.js +379 -0
  57. package/template/public/bedrock/prototype-navigation.js +974 -0
  58. package/template/public/cmdk.js +146 -0
  59. package/template/public/ds-xray.css +112 -0
  60. package/template/public/ds-xray.js +271 -0
  61. package/template/public/favicon.svg +4 -0
  62. package/template/public/icons/bolt-fill.svg +3 -0
  63. package/template/public/icons/bolt.svg +3 -0
  64. package/template/public/icons/caret-down-fill.svg +3 -0
  65. package/template/public/icons/check-double.svg +4 -0
  66. package/template/public/icons/check.svg +3 -0
  67. package/template/public/icons/chevron-left.svg +3 -0
  68. package/template/public/icons/chevron-right.svg +3 -0
  69. package/template/public/icons/circle-info.svg +6 -0
  70. package/template/public/icons/grid.svg +6 -0
  71. package/template/public/icons/message-square-1.svg +3 -0
  72. package/template/public/icons/message-square.svg +3 -0
  73. package/template/public/icons/messages.svg +4 -0
  74. package/template/public/icons/options-horizontal.svg +5 -0
  75. package/template/public/icons/swatches.svg +6 -0
  76. package/template/public/icons/workflow.svg +6 -0
  77. package/template/public/lightbox.js +87 -0
  78. package/template/public/proto-chrome.css +596 -0
  79. package/template/public/screen-comments.css +723 -0
  80. package/template/public/wireflow-client.js +26 -0
  81. package/template/scripts/build-storybooks.mjs +8 -0
  82. package/template/scripts/dev-setup.mjs +15 -0
  83. package/template/scripts/generate-stories.mjs +12 -0
  84. package/template/scripts/generate-variants.mjs +22 -0
  85. package/template/tsconfig.base.json +19 -0
@@ -0,0 +1,11 @@
1
+ {
2
+ "extends": "../../tsconfig.base.json",
3
+ "compilerOptions": {
4
+ "composite": false,
5
+ "declaration": false,
6
+ "noEmit": true,
7
+ "lib": ["ES2023"],
8
+ "types": ["@cloudflare/workers-types"]
9
+ },
10
+ "include": ["src", "../../bedrock.config.ts"]
11
+ }
@@ -0,0 +1,29 @@
1
+ {
2
+ "name": "bedrock-flows-demo",
3
+ "main": "src/index.ts",
4
+ "compatibility_date": "2025-09-17",
5
+ "compatibility_flags": ["nodejs_compat"],
6
+ // Static build output served via the ASSETS binding (Workers, not Pages).
7
+ // run_worker_first: asset matches must NOT bypass the worker — the fetch
8
+ // handler enforces the auth gate on design content (/p, /ds, /t, manifests)
9
+ // before falling through to env.ASSETS.fetch at the end.
10
+ "assets": { "directory": "../../dist", "binding": "ASSETS", "run_worker_first": true },
11
+ "kv_namespaces": [
12
+ { "binding": "WF_COMMENTS", "id": "a5134289e05f41b995527e0fb95f812c" },
13
+ { "binding": "SPEC_KV", "id": "57405365bd2948709e6cc7da74e8512a" }
14
+ ],
15
+ // Better Auth user store (also backs @mention → email resolution).
16
+ // ⚠️ REQUIRED per project: create a FRESH D1 and set BOTH fields below. NEVER
17
+ // point two deployments at the same database — users/sessions would leak across
18
+ // clients (e.g. two dashboards showing identical user lists). `bedrock-flows setup` creates + wires these automatically; for a manual deploy:
19
+ // wrangler d1 create <name>-auth
20
+ // wrangler d1 export <some-migrated-db> --remote --no-data --output schema.sql
21
+ // wrangler d1 execute <name>-auth --remote --file schema.sql
22
+ "d1_databases": [
23
+ {
24
+ "binding": "AUTH_DB",
25
+ "database_name": "bedrock-flows-demo-auth",
26
+ "database_id": "d0fed515-f1e3-40be-b145-a87a2400582b"
27
+ }
28
+ ]
29
+ }
@@ -0,0 +1,16 @@
1
+ import { defineConfig } from '@obra-studio/bedrock-flows/config'
2
+
3
+ export default defineConfig({
4
+ // The product is "Bedrock Flows" ("Bedrock 3" is the internal platform codename).
5
+ projectName: 'Bedrock Flows',
6
+ defaultDsVersion: 'starter-v1',
7
+ // mobileDsVersion: 'starter-mobile-v1',
8
+ modules: {
9
+ designSystem: { enabled: true },
10
+ flows: { enabled: true, specSource: 'google-docs' },
11
+ deliveries: { enabled: true },
12
+ // This deployment's own worker — every project sets its own prodOrigin
13
+ // (a child must never point at another project's worker/KV).
14
+ commenting: { enabled: true, prodOrigin: 'https://bedrock-flows-demo.johan-457.workers.dev' },
15
+ },
16
+ })
@@ -0,0 +1,97 @@
1
+ # Design System
2
+
3
+ This folder holds every design-system version that prototypes in this repo can render against. A "version" here is a snapshot of tokens + components frozen under a single name; prototypes reference one by name in their `meta.json`.
4
+
5
+ ## Folder layout
6
+
7
+ ```
8
+ design-system/
9
+ <name>/ one folder per DS version
10
+ global.css tokens + base + uncomponentized rules
11
+ style.css GENERATED bundle — do not edit
12
+ assets/ fonts, logos, avatars, marker shapes, etc.
13
+ foundations/ non-interactive references
14
+ colors/ icons/ surfaces/ typography/
15
+ components/ interactive UI
16
+ <component-name>/
17
+ component.css source of truth for this component's CSS
18
+ macro.njk Nunjucks macro — emits canonical markup
19
+ variants.json prop sets the variant generator renders
20
+ <variant>.html GENERATED standalone variant — do not edit
21
+ ...
22
+ utilities/ layout primitives (app-shell, stack)
23
+ <utility-name>/
24
+ component.css
25
+ macro.njk optional
26
+ variants.json optional
27
+ <variant>.html generated
28
+ ```
29
+
30
+ ## Naming the version folder
31
+
32
+ The folder name is an arbitrary string. Convention is `<theme>-<version>`:
33
+
34
+ - `ziptility-v1` — canonical Ziptility DS (orange brand, Archivo)
35
+ - `jungle-v1` — experimental theme (blue brand, Inter) used to verify version switching
36
+ - `ziptility-native-mobile-v1` — (future) native-feel patterns for RN flows
37
+ - `ziptility-v2` — (future) successor to ziptility-v1 once it's frozen
38
+
39
+ A prototype declares which one it consumes via `meta.json`:
40
+
41
+ ```json
42
+ { "id": "F-001", "name": "...", "dsVersion": "ziptility-v1" }
43
+ ```
44
+
45
+ URLs follow the folder name: `/ds/ziptility-v1/storybook/`, `/ds/jungle-v1/style.css`, etc.
46
+
47
+ ## Per-component contract
48
+
49
+ Every entry in `components/` and `utilities/` follows the same shape:
50
+
51
+ | File | Hand-authored? | Purpose |
52
+ |---|---|---|
53
+ | `component.css` | yes | The component's source-of-truth styles. Concatenated into `style.css` by the generator. |
54
+ | `macro.njk` | yes | Nunjucks macro(s) that emit canonical markup. Pages and variant HTML both import from here. |
55
+ | `variants.json` | yes | Declares named prop sets — `{ "macro": "<name>", "variants": [{ filename, name, props }, ...] }`. |
56
+ | `<variant>.html` | **GENERATED** | Standalone HTML doc per variant. Regenerated from the macro by `scripts/generate-variants.mjs`. |
57
+
58
+ Foundations (colors, typography, surfaces, icons) are showcase-only — they may have handwritten `*.html` files without `macro.njk` / `variants.json`. The generator skips folders without both.
59
+
60
+ ## Build pipeline
61
+
62
+ `npm run build` runs:
63
+
64
+ 1. **`generate-variants.mjs`** — renders each component's macro with each variant's prop set, writes `<variant>.html`.
65
+ 2. **`generate-stories.mjs`** — concatenates `global.css` + every `component.css` into `style.css`; writes one Storybook CSF file per component (one story per variant) into `.stories-generated/<name>/`.
66
+ 3. **`build-storybooks.mjs`** — invokes `storybook build` once per version, output to `dist/ds/<name>/storybook/`.
67
+
68
+ Editing any `component.css` / `macro.njk` / `variants.json` triggers a regeneration on the next build. The dev server's middleware also recompiles `/ds/<name>/style.css` on every request, so component-CSS edits flow live.
69
+
70
+ ## Adding a new DS version
71
+
72
+ ```bash
73
+ cp -r design-system/ziptility-v1 design-system/<new-name>
74
+ # edit <new-name>/global.css to swap tokens (brand color, fonts, etc.)
75
+ # component.css / macro.njk / variants.json carry over unchanged
76
+ npm run build
77
+ ```
78
+
79
+ The dashboard, storybook builder, and bundle compiler auto-detect the new folder.
80
+
81
+ ## Adding a new component
82
+
83
+ ```
84
+ design-system/<version>/components/<new-component>/
85
+ component.css the rules
86
+ macro.njk define a macro that emits canonical markup
87
+ variants.json { "macro": "...", "variants": [...] }
88
+ ```
89
+
90
+ The generator picks it up next build. Don't author `<variant>.html` by hand — it'll be wiped and regenerated. Filenames in `variants.json` should match what consumers expect (kebab-case, stable URLs).
91
+
92
+ ## Don't
93
+
94
+ - **Edit a generated `<variant>.html` file.** It's overwritten on every build. Edit `macro.njk` or `variants.json` instead.
95
+ - **Edit `style.css` directly.** It's generated.
96
+ - **Add story-scaffolding CSS** (`.story-grid`, `.frame-demo`) to `component.css`. That's storybook layout, not the component.
97
+ - **Reach across versions.** Components in `ziptility-v1/` should never reference paths inside `jungle-v1/` (or vice versa). Each version is a self-contained snapshot.
@@ -0,0 +1,42 @@
1
+ .btn {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ justify-content: center;
5
+ gap: 8px;
6
+ padding: 8px 16px;
7
+ border: 1px solid transparent;
8
+ border-radius: var(--radius-md);
9
+ background: var(--color-surface);
10
+ color: var(--color-fg);
11
+ font-family: inherit;
12
+ font-size: 14px;
13
+ font-weight: 500;
14
+ line-height: 1.2;
15
+ cursor: pointer;
16
+ text-decoration: none;
17
+ transition: background 120ms ease, border-color 120ms ease;
18
+ }
19
+
20
+ .btn:hover { border-color: var(--color-border); }
21
+
22
+ .btn--primary {
23
+ background: var(--color-accent);
24
+ color: var(--color-accent-fg);
25
+ }
26
+ .btn--primary:hover { background: var(--color-accent-hover); }
27
+
28
+ .btn--ghost {
29
+ background: transparent;
30
+ border-color: var(--color-border);
31
+ }
32
+
33
+ .btn--danger {
34
+ background: var(--color-danger);
35
+ color: #ffffff;
36
+ }
37
+
38
+ .btn[disabled],
39
+ .btn[aria-disabled='true'] {
40
+ opacity: 0.5;
41
+ cursor: not-allowed;
42
+ }
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <!--
3
+ AUTO-GENERATED by @bedrock-flows/design-system generateVariants — DO NOT EDIT.
4
+ Source of truth: ./macro.njk + ./variants.json
5
+ -->
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <title>Danger</title>
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&display=swap" />
13
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@24,400,0..1,0&display=swap" />
14
+ <link rel="stylesheet" href="../../global.css" />
15
+ <link rel="stylesheet" href="component.css" />
16
+ </head>
17
+ <body>
18
+ <button
19
+ class="btn" type="button">Button</button>
20
+ </body>
21
+ </html>
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <!--
3
+ AUTO-GENERATED by @bedrock-flows/design-system generateVariants — DO NOT EDIT.
4
+ Source of truth: ./macro.njk + ./variants.json
5
+ -->
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <title>Default</title>
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&display=swap" />
13
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@24,400,0..1,0&display=swap" />
14
+ <link rel="stylesheet" href="../../global.css" />
15
+ <link rel="stylesheet" href="component.css" />
16
+ </head>
17
+ <body>
18
+ <button
19
+ class="btn" type="button">Button</button>
20
+ </body>
21
+ </html>
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <!--
3
+ AUTO-GENERATED by @bedrock-flows/design-system generateVariants — DO NOT EDIT.
4
+ Source of truth: ./macro.njk + ./variants.json
5
+ -->
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <title>Disabled</title>
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&display=swap" />
13
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@24,400,0..1,0&display=swap" />
14
+ <link rel="stylesheet" href="../../global.css" />
15
+ <link rel="stylesheet" href="component.css" />
16
+ </head>
17
+ <body>
18
+ <button
19
+ class="btn" type="button">Button</button>
20
+ </body>
21
+ </html>
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <!--
3
+ AUTO-GENERATED by @bedrock-flows/design-system generateVariants — DO NOT EDIT.
4
+ Source of truth: ./macro.njk + ./variants.json
5
+ -->
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <title>Ghost</title>
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&display=swap" />
13
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@24,400,0..1,0&display=swap" />
14
+ <link rel="stylesheet" href="../../global.css" />
15
+ <link rel="stylesheet" href="component.css" />
16
+ </head>
17
+ <body>
18
+ <button
19
+ class="btn" type="button">Button</button>
20
+ </body>
21
+ </html>
@@ -0,0 +1,14 @@
1
+ {% macro button(props={}) %}
2
+ {%- set variant = props.variant or 'default' -%}
3
+ {%- set tag = props.href and 'a' or 'button' -%}
4
+ {%- set classes = ['btn'] -%}
5
+ {%- if variant != 'default' -%}
6
+ {%- set classes = classes.concat(['btn--' + variant]) -%}
7
+ {%- endif -%}
8
+ <{{ tag }}
9
+ class="{{ classes | join(' ') }}"
10
+ {%- if tag == 'a' %} href="{{ props.href }}"{% endif -%}
11
+ {%- if tag == 'button' %} type="{{ props.type or 'button' }}"{% endif -%}
12
+ {%- if props.disabled %} disabled aria-disabled="true"{% endif -%}
13
+ >{{ props.label or 'Button' }}</{{ tag }}>
14
+ {% endmacro %}
@@ -0,0 +1,21 @@
1
+ <!doctype html>
2
+ <!--
3
+ AUTO-GENERATED by @bedrock-flows/design-system generateVariants — DO NOT EDIT.
4
+ Source of truth: ./macro.njk + ./variants.json
5
+ -->
6
+ <html lang="en">
7
+ <head>
8
+ <meta charset="utf-8" />
9
+ <title>Primary</title>
10
+ <link rel="preconnect" href="https://fonts.googleapis.com" />
11
+ <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
12
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;900&display=swap" />
13
+ <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Sharp:opsz,wght,FILL,GRAD@24,400,0..1,0&display=swap" />
14
+ <link rel="stylesheet" href="../../global.css" />
15
+ <link rel="stylesheet" href="component.css" />
16
+ </head>
17
+ <body>
18
+ <button
19
+ class="btn" type="button">Button</button>
20
+ </body>
21
+ </html>
@@ -0,0 +1,30 @@
1
+ {
2
+ "macro": "button",
3
+ "variants": [
4
+ {
5
+ "name": "Default",
6
+ "filename": "default",
7
+ "props": { "label": "Button" }
8
+ },
9
+ {
10
+ "name": "Primary",
11
+ "filename": "primary",
12
+ "props": { "label": "Continue", "variant": "primary" }
13
+ },
14
+ {
15
+ "name": "Ghost",
16
+ "filename": "ghost",
17
+ "props": { "label": "Cancel", "variant": "ghost" }
18
+ },
19
+ {
20
+ "name": "Danger",
21
+ "filename": "danger",
22
+ "props": { "label": "Delete", "variant": "danger" }
23
+ },
24
+ {
25
+ "name": "Disabled",
26
+ "filename": "disabled",
27
+ "props": { "label": "Pending…", "variant": "primary", "disabled": true }
28
+ }
29
+ ]
30
+ }
@@ -0,0 +1,3 @@
1
+ {
2
+ "intendedViewport": { "min": { "w": 375, "h": 812 }, "max": { "w": 1440, "h": 900 } }
3
+ }
@@ -0,0 +1,52 @@
1
+ /*
2
+ * starter-v1 — minimal token + base layer for Bedrock Flows.
3
+ *
4
+ * Replace with your own design system. This file ships as proof that the
5
+ * Storybook + per-component generation pipeline works against an empty
6
+ * canvas. Token names, palette, and typography are deliberately neutral.
7
+ */
8
+
9
+ :root {
10
+ --color-bg: #ffffff;
11
+ --color-fg: #0f172a;
12
+ --color-fg-muted: #475569;
13
+ --color-border: #e2e8f0;
14
+ --color-surface: #f8fafc;
15
+
16
+ --color-accent: #2563eb;
17
+ --color-accent-fg: #ffffff;
18
+ --color-accent-hover: #1d4ed8;
19
+
20
+ --color-danger: #dc2626;
21
+
22
+ --radius-sm: 4px;
23
+ --radius-md: 8px;
24
+ --radius-lg: 12px;
25
+
26
+ --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
27
+ --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
28
+
29
+ --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
30
+ --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
31
+ }
32
+
33
+ :root[data-theme='dark'] {
34
+ --color-bg: #0b1220;
35
+ --color-fg: #e2e8f0;
36
+ --color-fg-muted: #94a3b8;
37
+ --color-border: #1e293b;
38
+ --color-surface: #111827;
39
+ }
40
+
41
+ *, *::before, *::after { box-sizing: border-box; }
42
+
43
+ html, body {
44
+ margin: 0;
45
+ background: var(--color-bg);
46
+ color: var(--color-fg);
47
+ font-family: var(--font-sans);
48
+ font-size: 15px;
49
+ line-height: 1.5;
50
+ }
51
+
52
+ a { color: var(--color-accent); }
@@ -0,0 +1,107 @@
1
+ /*
2
+ * AUTO-GENERATED bundle — do not edit.
3
+ * global.css concatenated with every component.css across
4
+ * foundations/, components/, and utilities/. Source of truth
5
+ * for component styles lives in each component folder.
6
+ */
7
+
8
+ /* === global.css === */
9
+
10
+ /*
11
+ * starter-v1 — minimal token + base layer for Bedrock Flows.
12
+ *
13
+ * Replace with your own design system. This file ships as proof that the
14
+ * Storybook + per-component generation pipeline works against an empty
15
+ * canvas. Token names, palette, and typography are deliberately neutral.
16
+ */
17
+
18
+ :root {
19
+ --color-bg: #ffffff;
20
+ --color-fg: #0f172a;
21
+ --color-fg-muted: #475569;
22
+ --color-border: #e2e8f0;
23
+ --color-surface: #f8fafc;
24
+
25
+ --color-accent: #2563eb;
26
+ --color-accent-fg: #ffffff;
27
+ --color-accent-hover: #1d4ed8;
28
+
29
+ --color-danger: #dc2626;
30
+
31
+ --radius-sm: 4px;
32
+ --radius-md: 8px;
33
+ --radius-lg: 12px;
34
+
35
+ --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
36
+ --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Consolas, "Liberation Mono", Menlo, monospace;
37
+
38
+ --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
39
+ --shadow-md: 0 4px 12px rgba(15, 23, 42, 0.08);
40
+ }
41
+
42
+ :root[data-theme='dark'] {
43
+ --color-bg: #0b1220;
44
+ --color-fg: #e2e8f0;
45
+ --color-fg-muted: #94a3b8;
46
+ --color-border: #1e293b;
47
+ --color-surface: #111827;
48
+ }
49
+
50
+ *, *::before, *::after { box-sizing: border-box; }
51
+
52
+ html, body {
53
+ margin: 0;
54
+ background: var(--color-bg);
55
+ color: var(--color-fg);
56
+ font-family: var(--font-sans);
57
+ font-size: 15px;
58
+ line-height: 1.5;
59
+ }
60
+
61
+ a { color: var(--color-accent); }
62
+
63
+
64
+ /* === components/button/component.css === */
65
+
66
+ .btn {
67
+ display: inline-flex;
68
+ align-items: center;
69
+ justify-content: center;
70
+ gap: 8px;
71
+ padding: 8px 16px;
72
+ border: 1px solid transparent;
73
+ border-radius: var(--radius-md);
74
+ background: var(--color-surface);
75
+ color: var(--color-fg);
76
+ font-family: inherit;
77
+ font-size: 14px;
78
+ font-weight: 500;
79
+ line-height: 1.2;
80
+ cursor: pointer;
81
+ text-decoration: none;
82
+ transition: background 120ms ease, border-color 120ms ease;
83
+ }
84
+
85
+ .btn:hover { border-color: var(--color-border); }
86
+
87
+ .btn--primary {
88
+ background: var(--color-accent);
89
+ color: var(--color-accent-fg);
90
+ }
91
+ .btn--primary:hover { background: var(--color-accent-hover); }
92
+
93
+ .btn--ghost {
94
+ background: transparent;
95
+ border-color: var(--color-border);
96
+ }
97
+
98
+ .btn--danger {
99
+ background: var(--color-danger);
100
+ color: #ffffff;
101
+ }
102
+
103
+ .btn[disabled],
104
+ .btn[aria-disabled='true'] {
105
+ opacity: 0.5;
106
+ cursor: not-allowed;
107
+ }
@@ -0,0 +1,8 @@
1
+ node_modules/
2
+ dist/
3
+ .stories-generated/
4
+ .wrangler/
5
+ *.log
6
+ .dev.vars
7
+ .DS_Store
8
+ *.tsbuildinfo
@@ -0,0 +1,41 @@
1
+ {
2
+ "name": "bedrock-flows-app",
3
+ "private": true,
4
+ "version": "0.0.0",
5
+ "type": "module",
6
+ "description": "A Bedrock Flows project — wireflow prototypes + versioned design systems on the published platform.",
7
+ "workspaces": [
8
+ "apps/*"
9
+ ],
10
+ "scripts": {
11
+ "build": "npm run build:stories && npm run build -w @bedrock-flows/dashboard && npm run build:storybook",
12
+ "build:variants": "node scripts/generate-variants.mjs",
13
+ "build:stories": "node scripts/generate-variants.mjs && node scripts/generate-stories.mjs",
14
+ "build:storybook": "node scripts/build-storybooks.mjs",
15
+ "dev": "node scripts/dev-setup.mjs && npm run build:stories && npm run build:storybook && concurrently -k -n worker,app -c blue,green \"npm run dev -w @bedrock-flows/worker\" \"npm run dev -w @bedrock-flows/dashboard\"",
16
+ "dev:dashboard": "npm run dev -w @bedrock-flows/dashboard",
17
+ "dev:storybook": "npm run build:stories && npm run build:storybook",
18
+ "dev:worker": "npm run dev -w @bedrock-flows/worker",
19
+ "deploy": "npm run build && npm run deploy -w @bedrock-flows/worker",
20
+ "typecheck": "npm run typecheck --workspaces --if-present"
21
+ },
22
+ "dependencies": {
23
+ "@obra-studio/bedrock-flows": "__BEDROCK_FLOWS_VERSION__"
24
+ },
25
+ "devDependencies": {
26
+ "@storybook/addon-docs": "^10.3.6",
27
+ "@storybook/html-vite": "^10.3.6",
28
+ "@types/node": "^24.12.2",
29
+ "concurrently": "^9.1.2",
30
+ "storybook": "^10.3.6",
31
+ "typescript": "~6.0.2",
32
+ "vite": "^8.0.10"
33
+ },
34
+ "overrides": {
35
+ "better-auth": "1.6.18",
36
+ "@better-auth/kysely-adapter": "1.6.18",
37
+ "@better-auth/infra": "0.2.14",
38
+ "kysely": "0.29.2",
39
+ "kysely-d1": "0.4.0"
40
+ }
41
+ }
@@ -0,0 +1,30 @@
1
+ {% extends '_shared/screen.njk' %}
2
+ {% set stepLabel = 'Welcome' %}
3
+ {% set stepNum = 1 %}
4
+ {% set stepTotal = 3 %}
5
+ {% set wfStart = true %}
6
+
7
+ {% block styles %}
8
+ .hello {
9
+ max-width: 480px;
10
+ margin: 80px auto;
11
+ padding: 32px;
12
+ background: var(--color-bg);
13
+ border: 1px solid var(--color-border);
14
+ border-radius: var(--radius-lg);
15
+ text-align: center;
16
+ font-family: var(--font-sans);
17
+ color: var(--color-fg);
18
+ box-shadow: var(--shadow-sm);
19
+ }
20
+ .hello h1 { margin: 0 0 12px; font-size: 22px; font-weight: 600; }
21
+ .hello p { margin: 0 0 24px; color: var(--color-fg-muted); }
22
+ {% endblock %}
23
+
24
+ {% block content %}
25
+ <section class="hello">
26
+ <h1>Hello world</h1>
27
+ <p>This is the welcome screen of the starter prototype. Step through to see the flow.</p>
28
+ <a class="btn btn--primary" href="2-form">Get started</a>
29
+ </section>
30
+ {% endblock %}
@@ -0,0 +1,46 @@
1
+ {% extends '_shared/screen.njk' %}
2
+ {% set stepLabel = 'Tell us your name' %}
3
+ {% set stepNum = 2 %}
4
+ {% set stepTotal = 3 %}
5
+
6
+ {% block styles %}
7
+ .hello {
8
+ max-width: 480px;
9
+ margin: 80px auto;
10
+ padding: 32px;
11
+ background: var(--color-bg);
12
+ border: 1px solid var(--color-border);
13
+ border-radius: var(--radius-lg);
14
+ font-family: var(--font-sans);
15
+ color: var(--color-fg);
16
+ box-shadow: var(--shadow-sm);
17
+ }
18
+ .hello h1 { margin: 0 0 16px; font-size: 20px; font-weight: 600; }
19
+ .hello label { display: block; font-size: 13px; color: var(--color-fg-muted); margin-bottom: 6px; }
20
+ .hello input {
21
+ width: 100%;
22
+ padding: 8px 12px;
23
+ font-family: inherit;
24
+ font-size: 15px;
25
+ color: var(--color-fg);
26
+ background: var(--color-bg);
27
+ border: 1px solid var(--color-border);
28
+ border-radius: var(--radius-md);
29
+ margin-bottom: 20px;
30
+ }
31
+ .hello .row { display: flex; gap: 8px; justify-content: flex-end; }
32
+ {% endblock %}
33
+
34
+ {% block content %}
35
+ <section class="hello">
36
+ <h1>What's your name?</h1>
37
+ <form action="3-done" method="get">
38
+ <label for="name">Name</label>
39
+ <input id="name" name="name" type="text" placeholder="Ada Lovelace" />
40
+ <div class="row">
41
+ <a class="btn btn--ghost" href="1-welcome">Back</a>
42
+ <button class="btn btn--primary" type="submit">Continue</button>
43
+ </div>
44
+ </form>
45
+ </section>
46
+ {% endblock %}