@svadmin/create 0.40.2 → 0.40.3
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/guidance/DESIGN.md +117 -8
- package/package.json +1 -1
- package/scaffold-manifest.json +1 -1
package/guidance/DESIGN.md
CHANGED
|
@@ -9,9 +9,15 @@ colors:
|
|
|
9
9
|
surface-subtle: "#f1f4f8"
|
|
10
10
|
muted-foreground: "#425466"
|
|
11
11
|
border: "#e6ebf1"
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
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
|
|
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
|
|
228
|
-
|
|
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
|
-
|
|
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.
|
package/package.json
CHANGED
package/scaffold-manifest.json
CHANGED