@svadmin/create 0.37.1 → 0.39.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.
@@ -28,6 +28,19 @@ business code inside `src/features/<module>/` and expose it through the module's
28
28
 
29
29
  ### Default-first page composition
30
30
 
31
+ - Select the page family using the coverage matrix in `DESIGN.md` before
32
+ generating markup. Keep resource-driven `ListPage`, `CreatePage`, `EditPage`,
33
+ and `ShowPage`; never nest complete titled pages.
34
+ - For custom business pages, use `PagePattern` with `kind="list"`, `"form"`,
35
+ `"detail"`, `"workspace"`, or `"dashboard"` only when the installed
36
+ `@svadmin/ui` exports it. Otherwise compose the documented `ContentPageShell`
37
+ and `WorkspaceLayout`; do not invent imports or bypass permission checks.
38
+ - Use `ConfigurationPage` for settings when available. Provide business-owned
39
+ pending, dirty, failure, and confirmed-success states. A layout supplies
40
+ neither persistence nor access control.
41
+ - Start from the matching composition example, not a blank canvas. Keep
42
+ presentation unframed, use existing semantic tokens, and inspect rendered
43
+ long labels, dense data, empty results, and errors before calling it complete.
31
44
  - Start with `AdminApp`, a provider bundle, and schema-backed resources. Its
32
45
  default layout is clean-flat; the default color is Stripe unless the user has
33
46
  saved another selection. Keep explicit theme overrides only for intentional changes.
@@ -289,6 +289,85 @@ status badges, avatar groups, and controls whose geometry carries meaning.
289
289
 
290
290
  ## Components
291
291
 
292
+ ### Page pattern assembly
293
+
294
+ First select the existing page family. Resource-backed CRUD must keep
295
+ `ListPage`, `CreatePage`, `EditPage`, and `ShowPage`: these own permissions,
296
+ queries, navigation guards, and mutations. Never wrap these full pages inside
297
+ another titled page shell. Keep `DashboardPage` for existing dashboards.
298
+
299
+ Use `PagePattern` for custom business compositions that do not fit those
300
+ resource routes. It supplies layout only, not querying, permissions, form
301
+ submission, or loading/error handling:
302
+
303
+ - `list`: compact title, toolbar, table/list content, and list empty states.
304
+ - `form`: narrow reading width, comfortable grouped fields and a single save area.
305
+ - `detail`: read-only summary and related content.
306
+ - `workspace`: primary work area plus an optional secondary panel.
307
+ - `dashboard`: wide layout with optional metrics and secondary context.
308
+
309
+ Optional `secondary` content renders beside the primary content for every kind.
310
+ For advanced resizable, collapsible, or independently scrolling work areas,
311
+ compose `WorkspaceLayout` or `MasterDetailView` directly. The pattern does not
312
+ replace those interaction contracts.
313
+
314
+ The pattern supplies the page shell and named composition regions. The caller
315
+ supplies business data, permissions, mutations, and state-specific content.
316
+ Do not recreate these page families with arbitrary nested cards or repeated
317
+ gray title bars.
318
+
319
+ | Workflow | First choice | Business-owned state |
320
+ | --- | --- | --- |
321
+ | Resource list | ListPage | Resource contract and access policy |
322
+ | Create/edit | CreatePage / EditPage | Validation and mutation result |
323
+ | Resource detail | ShowPage | Resource contract and related records |
324
+ | Settings | ConfigurationPage + SettingsGroup | Dirty/pending/success/error |
325
+ | Custom list/form/detail | PagePattern | Query, access, validation, pagination |
326
+ | Master/detail | PagePattern + MasterDetailView | Selection and scope changes |
327
+ | Approval | ApprovalCenter / ApprovalActionCard | Authorization and decision result |
328
+ | Dashboard | DashboardPage | Real metrics and drill-down destinations |
329
+ | Audit log | SecurityLogPage / AuditLogViewer | Permission, time range, pagination |
330
+
331
+ Acceptance scenarios for every custom page:
332
+
333
+ - Given a populated page with long business labels, when rendered in a narrow
334
+ or wide container, then content wraps without hiding controls or overflowing.
335
+ - Given an empty collection, when filters are absent, then show an initial-empty
336
+ message; when filters exclude records, show no-results and an available reset.
337
+ - Given a failed request, when retry is selected, then rerun the query without
338
+ displaying stale content as current or suggesting the request succeeded.
339
+ - Given a denied operation, when rendering actions, then omit/disable the
340
+ operation according to policy; a layout component never grants permission.
341
+ - Given form edits, when saving fails, then retain the edits and show one
342
+ actionable error; show success only after confirmed persistence.
343
+
344
+ ### Configuration page assembly
345
+
346
+ For configuration workflows, start with `ConfigurationPage`, then compose
347
+ `SettingsGroup` and `SettingsFieldRow`. Do not recreate the page shell using
348
+ cards, repeated title bars, or unrestricted two-column fields.
349
+
350
+ - Use one page title and group related settings under descriptive headings.
351
+ - Connect each field label to its control through `controlId`.
352
+ - Put one transaction's save/reset controls in the `footer` snippet. For
353
+ independently saved sections, use each group's `actions` instead; do not
354
+ duplicate the same save command in both places.
355
+ - The caller owns dirty, pending, success, validation, and failure states.
356
+ Disable duplicate submissions while pending. Only show success after the
357
+ persistence request succeeds; preserve edits after failure.
358
+ - Separate initial-empty content from filtered-no-results content. Offer
359
+ creation only when permitted, and clearing filters only when filters exist.
360
+ - Use compact density for operational work and comfortable density for forms.
361
+ - Reference `packages/ui/stories/ConfigurationExample.svelte` in the SVAdmin
362
+ source for a working composition; its save action is in-memory demo state,
363
+ not a persistence implementation.
364
+
365
+ Before generating a page, select the existing page family (list, configuration,
366
+ detail, or workspace), identify its primary action, and reuse its components.
367
+ Verify populated, empty, loading, and failed states with realistic long labels.
368
+ Inspect rendered alignment, overflow, duplicate headings, and excessive space;
369
+ passing component tests alone does not establish visual acceptance.
370
+
292
371
  Buttons, fields, tabs, tables, badges, empty states, skeletons, alerts, and
293
372
  feedback use shared components and semantic tokens. Layout presets may adjust
294
373
  density and composition, but they must not replace component color, typography,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/create",
3
- "version": "0.37.1",
3
+ "version": "0.39.0",
4
4
  "description": "Scaffolding tool for svadmin projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -13,7 +13,7 @@
13
13
  "@svadmin/core": "^0.58.0",
14
14
  "@svadmin/app": "^0.2.1",
15
15
  "@svadmin/ai-elements": "^0.10.3",
16
- "@svadmin/ui": "^0.80.0",
16
+ "@svadmin/ui": "^0.81.0",
17
17
  "@sinclair/typebox": "^0.34.52",
18
18
  "@tanstack/svelte-query": "^6.1.48",
19
19
  "@lucide/svelte": "^1.35.0"