@svadmin/create 0.40.2 → 0.41.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -4,6 +4,17 @@ Read `DESIGN.md` before creating, revising, or reviewing any UI. It is the
4
4
  authority for visual language, page hierarchy, feedback ownership, and
5
5
  acceptance checks in this project.
6
6
 
7
+ ## Product-first generation
8
+
9
+ Read `PRODUCT.md` before converting a schema, API, or feature list into pages. Build the product brief, workflows, resources, actions, surfaces, and menu in that order. Resources are data contracts; they are not automatic pages or menu entries.
10
+
11
+ - Keep one primary purpose and one dominant next action per surface.
12
+ - Give every core workflow a serving surface or contextual entry.
13
+ - Declare loading, empty, error, forbidden, and success states before writing markup.
14
+ - Menu count is determined by actual business needs. Never apply a fixed global cap; use roles, task frequency, placement, grouping, and context to keep it legible.
15
+ - Run `svadmin vibe review ./svadmin.product.json` before generating UI and `svadmin vibe plan ./svadmin.product.json --role <role-id>` to inspect role-specific navigation.
16
+ - Treat review warnings as prompts for product judgment. Do not silently delete business-required workflows or menu entries to make a count pass.
17
+
7
18
  ## Platform entrypoints
8
19
 
9
20
  Before generating or modifying application code, read these stable files
@@ -9,9 +9,15 @@ colors:
9
9
  surface-subtle: "#f1f4f8"
10
10
  muted-foreground: "#425466"
11
11
  border: "#e6ebf1"
12
- primary: "#635bff"
13
- on-primary: "#ffffff"
14
- success: "oklch(0.51 0.16 151)"
12
+ secondary: "#eef2f7"
13
+ accent: "#eef0ff"
14
+ accent-foreground: "#5147d9"
15
+ input: "#cbd5e1"
16
+ sidebar: "#ffffff"
17
+ sidebar-foreground: "#425466"
18
+ primary: "oklch(0.54 0.24 293)"
19
+ on-primary: "oklch(0.99 0 0)"
20
+ success: "oklch(0.55 0.16 151)"
15
21
  warning: "oklch(0.7 0.15 75)"
16
22
  danger: "oklch(0.58 0.22 27)"
17
23
  typography:
@@ -123,7 +129,7 @@ not become a mixed visual theme:
123
129
 
124
130
  | Reference | Adopted responsibility | Explicitly excluded |
125
131
  | --- | --- | --- |
126
- | Stripe style prompt | `#635bff` action accent, technical grid, hairline borders, layered elevation, lift/depress feedback | Stripe brand assets, marketing gradients, oversized hero treatment |
132
+ | Stripe style prompt | theme-menu chip `#635bff`, painted `--primary: oklch(0.54 0.24 293)`, technical grid, hairline borders, layered elevation, lift/depress feedback | Stripe brand assets, marketing gradients, oversized hero treatment |
127
133
  | Corporate-clean prompt | neutral enterprise surfaces, readable hierarchy, generous spacing, focus-ring offset, motion capped at 200ms | blue-only palette, rigid utility-class recipes, decorative cards |
128
134
  | Fuse / Midone / Skote | navigation anatomy, page-family coverage, toolbar/table/form composition, density observations | vendor palette, logos, fonts, CSS, copied markup or component chrome |
129
135
  | svadmin | semantic tokens, component API, state ownership, accessibility, responsive contracts | no second visual authority |
@@ -160,7 +166,9 @@ The same contract is used at every delivery surface:
160
166
  use motion-token fallbacks so they also work without the full UI package.
161
167
  - `packages/lite` mirrors the palette with literal colors. Its legacy-browser
162
168
  contract deliberately excludes custom properties and modern selectors;
163
- visual alignment must not remove that compatibility.
169
+ visual alignment must not remove that compatibility. Its literal accent
170
+ remains the preset chip `#635bff`, not the oklch `--primary` used by
171
+ `@svadmin/ui`.
164
172
 
165
173
  Theme refinements must preserve component density, invalid and selected states.
166
174
  Focus belongs to the active control, not every enclosing card. Search icons and
@@ -224,8 +232,41 @@ not a page background. Success, warning, and danger are reserved for semantic
224
232
  status and feedback. Consumer themes may replace the primary hue while keeping
225
233
  the neutral hierarchy and contrast relationships intact.
226
234
 
227
- The reference Stripe preset uses `#635bff`, `#0a2540`, `#f6f9fc`, and
228
- `#e6ebf1`. The grid is a low-contrast canvas texture only; buttons and data
235
+ **The Token Source Rule.** Frontmatter neutrals are the light values of
236
+ `.layout-clean-flat[data-theme="stripe"]` in `packages/ui/src/app.css`. The
237
+ painted action color is `--primary: oklch(0.54 0.24 293)` from `:root` and
238
+ `[data-theme="stripe"]`, matching `builtinPresets.stripe.light` in
239
+ `packages/core/src/theme.svelte.ts`. The preset menu chip
240
+ `builtinPresets.stripe.color` is `#635bff`. It identifies the preset. It is
241
+ not a second primary, and it must not be copied onto buttons, rings, or links.
242
+
243
+ Canvas neutrals in that same stripe block are `#f6f9fc`, `#0a2540`,
244
+ `#ffffff`, `#f1f4f8`, `#425466`, and `#e6ebf1`. Success, warning, and danger
245
+ stay on the semantic tokens and are not overridden by the stripe block:
246
+ `--success: oklch(0.55 0.16 151)`, `--warning: oklch(0.7 0.15 75)`,
247
+ `--destructive: oklch(0.58 0.22 27)`. `:root` oklch neutrals are the fallback
248
+ before the stripe layout block applies. Do not mix those fallback neutrals
249
+ with the stripe hex canvas.
250
+
251
+ Dark mode for the same preset replaces the canvas, not the accent family:
252
+
253
+ | Token | Dark value |
254
+ | --- | --- |
255
+ | background | `#0f172a` |
256
+ | foreground | `#f1f5f9` |
257
+ | card / popover | `#111c2e` |
258
+ | muted | `#18263b` |
259
+ | muted-foreground | `#9aa9bd` |
260
+ | border | `#26364c` |
261
+ | sidebar | `#101b2d` |
262
+ | primary | `oklch(0.72 0.19 293)` |
263
+ | on-primary | `oklch(0.16 0.02 270)` |
264
+
265
+ Named color themes (`neutral`, `indigo`, `blue`, `green`, `rose`, `orange`,
266
+ `violet`, `stripe`) replace primary, ring, sidebar-primary, and chart-1 only.
267
+ They do not rebuild the neutral ramp.
268
+
269
+ The grid is a low-contrast canvas texture only; buttons and data
229
270
  surfaces remain solid, and gradients are not used to communicate status. The
230
271
  runtime names for the shared depth and motion tokens are
231
272
  `--svadmin-shadow-control`, `--svadmin-shadow-surface`,
@@ -376,6 +417,24 @@ feedback use shared components and semantic tokens. Layout presets may adjust
376
417
  density and composition, but they must not replace component color, typography,
377
418
  focus, or elevation with hard-coded values.
378
419
 
420
+ ### Shell anatomy
421
+
422
+ These are the published shells. Compose them. Do not redraw them as generic cards.
423
+
424
+ | Shell | Contract | Chrome |
425
+ | --- | --- | --- |
426
+ | `Layout` | `data-svadmin-layout`, `data-svadmin-main`, `data-svadmin-sidebar`, `data-svadmin-topbar` | Sidebar and topbar are flat hairline regions. Stripe removes their shadows. Active sidebar items use a 9% primary wash and a 4px bar. |
427
+ | `Sidebar` | `data-svadmin-sidebar`, `.sidebar-menu-item` | System sans at 13px / 500. Section labels are not uppercase. |
428
+ | `AutoTable` | `data-svadmin-table-head`, `data-svadmin-table-row`, `data-svadmin-datatable` | The table is not wrapped in a card. Header labels are 12px / 600, sentence case, `letter-spacing: 0`. Numbers use `tabular-nums`. |
429
+ | `PageToolbar` | `data-svadmin-table-toolbar` | A hairline row (`border-bottom`), transparent, no radius and no surface shadow. |
430
+ | `AutoForm` | `data-svadmin-form-row`, `data-svadmin-form-actions`, `data-svadmin-field-label` | Rows are separated by a hairline. Under the stripe preset, save actions are a footer rule, not a floating card. |
431
+ | `ConfigurationPage`, `SettingsGroup`, `SettingsFieldRow` | `data-svadmin-settings-group` | Unframed. The group header is a bottom border, title at 16px / 600, description in muted text. One page `h1`; nested groups use `h3`. |
432
+ | `MetricBlock` | `data-svadmin-metric-card` | This is the bounded card: 8px radius, hairline border, surface shadow. Do not put it inside another card. |
433
+ | `AuthPageShell`, `LoginPage` | `data-svadmin-auth-page`, `data-svadmin-demo-credentials` | One auth surface. The title stays at 20px / 600. Demo credentials are a divided note inside that surface, not nested tiles. |
434
+
435
+ `FilterToolbar` (`data-svadmin-filter-toolbar`) owns search and advanced filters.
436
+ Its advanced panel may use a muted fill. That panel is not a second page card.
437
+
379
438
 
380
439
  ## Micro-interactions & Motion
381
440
 
@@ -476,18 +535,68 @@ Before accepting an AI-generated application page, verify all of the following:
476
535
  6. Desktop and mobile screenshots show no overlap, clipping, horizontal scroll,
477
536
  or action displacement caused by feedback content.
478
537
 
538
+ ## Responsive behavior
539
+
540
+ Breakpoints already in the shell, not a new layout system:
541
+
542
+ - Sidebar content offset switches at `768px`. Below that, the sidebar does not
543
+ reserve the 252px or 70px desktop margin.
544
+ - Filter toolbars become a horizontal row at `640px`.
545
+ - Stripe content padding tightens at `48rem`.
546
+ - Auth credential columns stack at `40rem`.
547
+ - Coarse-pointer targets stay at least 44px. Fine-pointer tables may be denser.
548
+
479
549
  ## Do's and Don'ts
480
550
 
481
551
  - Do keep hierarchy quiet, dense, aligned, and easy to scan repeatedly.
482
552
  - Do show loading, empty, error, permission, progress, and mutation feedback.
483
553
  - Do preserve visible keyboard focus and at least 44px coarse-pointer targets.
484
554
  - Do remove, downgrade, or relocate feedback as soon as its state is resolved.
555
+ - Do use the system sans already set on `body` and the stripe layout rule:
556
+ `ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif`.
485
557
  - Don't copy Metronic colors, decorative treatment, or template branding.
486
558
  - Don't repeat a success fact across Toast, title, description, banner, badge,
487
559
  and table data.
488
560
  - Don't use persistent success banners for routine mutations.
561
+ - Don't set `font-family` to Inter, or to any single downloaded face, as the
562
+ product font. A system stack is the contract.
563
+ - Don't paint marketing gradients, mesh backgrounds, glass, or a purple hero.
564
+ The only canvas texture is the 40px technical grid at 2% primary on
565
+ `[data-svadmin-main]` and 4% on the auth page.
566
+ - Don't put muted gray type on a saturated fill. Solid status fills use their
567
+ foreground token. The tinted `.svadmin-product-status` badge mixes the status
568
+ color into `--foreground` and keeps a neutral card base.
569
+ - Don't use cards inside cards, uppercase tracked labels, bounce easing, or
570
+ make every section a floating card.
489
571
  - Don't use decorative gradients, glow, glassmorphism, negative letter spacing,
490
572
  or blanket `!important` overrides as the default product language. A subtle
491
573
  two-line grid is allowed on the work canvas because it is part of the current
492
574
  Stripe-inspired reference direction.
493
- - Don't use cards inside cards or make every section a floating card.
575
+
576
+ ## Agent prompt guide
577
+
578
+ Read `PRODUCT.md` for who this product is, then follow this file for pixels.
579
+ `DESIGN.md` wins visual conflicts. `PRODUCT.md` wins product boundaries.
580
+
581
+ When generating a page, start from the shell table above and the page-family
582
+ matrix. Use semantic tokens (`--background`, `--foreground`, `--card`,
583
+ `--primary`, `--border`, `--muted-foreground`, `--success`, `--warning`,
584
+ `--destructive`). Do not introduce a parallel palette.
585
+
586
+ Quick light reference for the default stripe + clean-flat preset:
587
+
588
+ - Canvas `#f6f9fc`, ink `#0a2540`, surface `#ffffff`, hairline `#e6ebf1`.
589
+ - Action `oklch(0.54 0.24 293)` on `oklch(0.99 0 0)`. Chip only: `#635bff`.
590
+ - Body 14px / 400 / 1.5. Page title 20px / 600 / 1.3. Labels 13px / 500.
591
+ - Radius 8px on controls and bounded surfaces. Spacing 4 / 8 / 16 / 24 / 32.
592
+ - Focus: 2px solid `--ring`, offset `--svadmin-focus-offset` (2px).
593
+
594
+ Reject the result when the first viewport has nested cards, a gradient hero,
595
+ Inter as the only font, gray text on a colored button, or the same fact repeated
596
+ in a banner and the data below it.
597
+
598
+ Do not add `npx impeccable detect` to CI. The UI workflow already builds
599
+ packages and checks browser contracts. A default detector run flags intentional
600
+ admin choices (the Stripe accent, the technical grid, compact tables) and would
601
+ need a large ignore list. Use that detector locally only as a hint, and keep
602
+ this file as the authority when a finding conflicts with the tokens above.
@@ -0,0 +1,29 @@
1
+ # Product-first generation rules
2
+
3
+ svadmin generates an admin application from business decisions, not from a raw resource list. Read this file before turning an API, database schema, or feature request into UI.
4
+
5
+ ## Decision order
6
+
7
+ 1. Write the product brief: primary outcome, audience, constraints, non-goals, and assumptions.
8
+ 2. List the real workflows in actor language. Each core workflow needs a trigger, goal, steps, success criteria, exceptions, priority, and frequency.
9
+ 3. Register resources as data contracts. A resource can be contextual or internal; it does not automatically become a page or menu item.
10
+ 4. Define actions with an owning workflow and role visibility.
11
+ 5. Define surfaces by purpose. Keep one primary action per surface, declare empty/loading/error/forbidden/success states, and move secondary actions into context or More.
12
+ 6. Define menu nodes last. Every node should point to a workflow, resource, or surface and declare the roles that need it.
13
+
14
+ ## Menu policy
15
+
16
+ There is no fixed menu-count limit. A small product may need one entry; a large operational product may need many. Do not delete business-required entries to satisfy an arbitrary count. Use role visibility, workflow frequency, placement, grouping, and contextual entries to keep the navigation legible. Backend authorization remains authoritative; menu visibility is only a UI hint.
17
+
18
+ ## CLI review loop
19
+
20
+ Store the plan as JSON using schema version `product/v1`, then run:
21
+
22
+ - `svadmin vibe review ./svadmin.product.json` to report orphan resources, unserved workflows, unknown references, missing states, and dense surfaces.
23
+ - `svadmin vibe plan ./svadmin.product.json --role operator` to inspect the role-specific menu and generated page plans.
24
+
25
+ Fix product review errors before generating Svelte markup. Warnings are review prompts, not automatic page deletion rules.
26
+
27
+ ## Visual acceptance
28
+
29
+ Generated pages must have one clear purpose, one dominant next action, and an explicit state contract. Prefer the existing `@svadmin/ui` page families and semantic tokens. Inspect long labels, dense tables, empty results, denied permissions, failures, and mobile layouts before accepting the result.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/create",
3
- "version": "0.40.2",
3
+ "version": "0.41.0",
4
4
  "description": "Scaffolding tool for svadmin projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -30,7 +30,7 @@
30
30
  "@types/node": "^26.4.0",
31
31
  "@types/prompts": "^2.4.9",
32
32
  "typescript": "^7.0.2",
33
- "@svadmin/core": "^0.60.0"
33
+ "@svadmin/core": "^0.61.0"
34
34
  },
35
35
  "keywords": [
36
36
  "svadmin",
@@ -10,10 +10,10 @@
10
10
  "check": "svelte-check --tsconfig ./tsconfig.json"
11
11
  },
12
12
  "dependencies": {
13
- "@svadmin/core": "^0.60.0",
14
- "@svadmin/app": "^0.2.3",
15
- "@svadmin/ai-elements": "^0.11.1",
16
- "@svadmin/ui": "^0.83.1",
13
+ "@svadmin/core": "^0.61.0",
14
+ "@svadmin/app": "^0.2.4",
15
+ "@svadmin/ai-elements": "^0.11.2",
16
+ "@svadmin/ui": "^0.84.0",
17
17
  "typebox": "^1.3.34",
18
18
  "@tanstack/svelte-query": "^6.1.48",
19
19
  "@lucide/svelte": "^1.35.0"
@@ -42,76 +42,76 @@
42
42
  "graphql": "^16.8.0"
43
43
  },
44
44
  "simple-rest": {
45
- "@svadmin/simple-rest": "^0.12.4",
45
+ "@svadmin/simple-rest": "^0.12.5",
46
46
  "@refinedev/simple-rest": "^6.0.1"
47
47
  },
48
48
  "supabase": {
49
- "@svadmin/supabase": "^0.19.1",
49
+ "@svadmin/supabase": "^0.19.2",
50
50
  "@supabase/supabase-js": "^2.112.4",
51
51
  "@refinedev/supabase": "^6.0.2"
52
52
  },
53
53
  "graphql": {
54
- "@svadmin/graphql": "^0.12.4",
54
+ "@svadmin/graphql": "^0.12.5",
55
55
  "@refinedev/graphql": "^8.0.1",
56
56
  "graphql-request": "^7.4.0",
57
57
  "graphql": "^16.8.0"
58
58
  },
59
59
  "rest": {
60
- "@svadmin/rest": "^0.2.3",
60
+ "@svadmin/rest": "^0.2.4",
61
61
  "@refinedev/rest": "^2.1.1",
62
62
  "@nestjsx/crud-request": "^5.0.0-alpha.3"
63
63
  },
64
64
  "airtable": {
65
- "@svadmin/airtable": "^0.12.4",
65
+ "@svadmin/airtable": "^0.12.5",
66
66
  "@refinedev/airtable": "^5.0.1"
67
67
  },
68
68
  "appwrite": {
69
- "@svadmin/appwrite": "^0.11.4",
69
+ "@svadmin/appwrite": "^0.11.5",
70
70
  "appwrite": ">=26.2.0",
71
71
  "@refinedev/appwrite": "^8.0.1"
72
72
  },
73
73
  "directus": {
74
- "@svadmin/directus": "^0.11.4"
74
+ "@svadmin/directus": "^0.11.5"
75
75
  },
76
76
  "drizzle": {
77
- "@svadmin/drizzle": "^0.14.1",
77
+ "@svadmin/drizzle": "^0.14.2",
78
78
  "drizzle-orm": "^1.0.0-rc.1",
79
79
  "refine-sqlx": "^0.10.3"
80
80
  },
81
81
  "elysia": {
82
- "@svadmin/elysia": "^0.14.4",
82
+ "@svadmin/elysia": "^0.14.5",
83
83
  "elysia": ">=1.4.30",
84
84
  "@elysiajs/eden": ">=1.4.9"
85
85
  },
86
86
  "firebase": {
87
- "@svadmin/firebase": "^0.12.4"
87
+ "@svadmin/firebase": "^0.12.5"
88
88
  },
89
89
  "hasura": {
90
- "@svadmin/hasura": "^0.12.4",
90
+ "@svadmin/hasura": "^0.12.5",
91
91
  "@refinedev/hasura": "^7.0.1",
92
92
  "graphql-request": "^7.4.0"
93
93
  },
94
94
  "medusa": {
95
- "@svadmin/medusa": "^0.12.4",
95
+ "@svadmin/medusa": "^0.12.5",
96
96
  "@refinedev/medusa": "^5.0.0"
97
97
  },
98
98
  "nestjs-query": {
99
- "@svadmin/nestjs-query": "^0.12.4",
99
+ "@svadmin/nestjs-query": "^0.12.5",
100
100
  "@refinedev/nestjs-query": "^5.0.0"
101
101
  },
102
102
  "nestjsx-crud": {
103
- "@svadmin/nestjsx-crud": "^0.12.4",
103
+ "@svadmin/nestjsx-crud": "^0.12.5",
104
104
  "@refinedev/nestjsx-crud": "^6.0.1"
105
105
  },
106
106
  "pocketbase": {
107
- "@svadmin/pocketbase": "^0.13.1",
107
+ "@svadmin/pocketbase": "^0.13.2",
108
108
  "pocketbase": ">=0.28.0"
109
109
  },
110
110
  "sanity": {
111
- "@svadmin/sanity": "^0.11.4"
111
+ "@svadmin/sanity": "^0.11.5"
112
112
  },
113
113
  "strapi": {
114
- "@svadmin/strapi": "^0.12.4",
114
+ "@svadmin/strapi": "^0.12.5",
115
115
  "@refinedev/strapi-v4": "^7.0.1"
116
116
  }
117
117
  },