@svadmin/create 0.28.7 → 0.30.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.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  The official scaffolding CLI for `headless-admin-svelte` (svadmin).
4
4
 
5
- Quickly bootstrap a completely configured, headless admin panel project built on Svelte 5, Shadcn Svelte, and TanStack Query.
5
+ Quickly bootstrap a completely configured, headless admin panel project built on Svelte 5, the native-CSS `@svadmin/ui` components, and TanStack Query.
6
6
 
7
7
  ## Quick Start
8
8
 
@@ -21,7 +21,7 @@ Follow the interactive prompts to:
21
21
 
22
22
  The generated project is pre-configured with:
23
23
  - **Svelte 5** + **Vite**
24
- - **Tailwind CSS** + **Shadcn Svelte** UI components
24
+ - **@svadmin/ui** native CSS, semantic tokens and Bits UI interactions; no host CSS compiler is required
25
25
  - **@svadmin/core**: The headless business logic and hooks (useTable, useForm, useAuth, etc.)
26
26
  - **@svadmin/ai-elements**: Composable Svelte 5 AI conversation, tool, reasoning, and source components.
27
27
  - **@svadmin/ui**: Beautiful default dashboard UI, standalone CRUD buttons, and data tables.
@@ -127,7 +127,7 @@ bun src/sync-template.ts
127
127
  bun run build
128
128
  ```
129
129
  Generated projects include root-level `DESIGN.md` and `AGENTS.md` files. They
130
- define the Stripe-first visual language, page information budget, feedback
130
+ define svadmin's Admin UI design principles, page information budget, feedback
131
131
  ownership, and AI generation acceptance rules.
132
132
 
133
133
  Existing projects can preview and install any missing guidance files without
package/dist/index.js CHANGED
@@ -5891,6 +5891,13 @@ function generateTypeBoxSchemaCode(resource) {
5891
5891
  case "date":
5892
5892
  typeDef = "Type.String({ format: 'date-time' })";
5893
5893
  break;
5894
+ case "datetime":
5895
+ case "time":
5896
+ typeDef = "Type.String()";
5897
+ break;
5898
+ case "daterange":
5899
+ typeDef = "Type.Union([Type.Object({ start: Type.Union([Type.String(), Type.Null()]), end: Type.Union([Type.String(), Type.Null()]) }, { additionalProperties: false }), Type.Null()])";
5900
+ break;
5894
5901
  case "email":
5895
5902
  typeDef = "Type.String({ format: 'email' })";
5896
5903
  break;
@@ -6519,6 +6526,10 @@ var fieldTypes = {
6519
6526
  number: true,
6520
6527
  boolean: true,
6521
6528
  date: true,
6529
+ daterange: true,
6530
+ datetime: true,
6531
+ time: true,
6532
+ percent: true,
6522
6533
  select: true,
6523
6534
  multiselect: true,
6524
6535
  tags: true,
@@ -7442,7 +7453,7 @@ bun run dev
7442
7453
 
7443
7454
  ## Stack
7444
7455
 
7445
- - **UI**: Svelte 5 + Shadcn Svelte + TailwindCSS
7456
+ - **UI**: Svelte 5 + Bits UI + Tailwind semantic recipes (precompiled CSS)
7446
7457
  - **Data**: ${dpLabel} DataProvider
7447
7458
  - **Auth**: ${authLabel}
7448
7459
  - **State**: TanStack Query v6
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  version: "alpha"
3
- name: "svadmin Stripe-first"
3
+ name: "svadmin Admin UI"
4
4
  description: "A restrained, precise product interface for repeated administrative work."
5
5
  colors:
6
- background: "oklch(0.982 0.003 264)"
6
+ background: "oklch(0.985 0.001 264)"
7
7
  foreground: "oklch(0.205 0.012 264)"
8
8
  surface: "oklch(1 0 0)"
9
9
  surface-subtle: "oklch(0.968 0.004 264)"
10
10
  muted-foreground: "oklch(0.493 0.018 264)"
11
- border: "oklch(0.914 0.006 264)"
11
+ border: "oklch(0.925 0.003 264)"
12
12
  primary: "oklch(0.558 0.22 278)"
13
13
  on-primary: "oklch(0.99 0 0)"
14
14
  success: "oklch(0.51 0.16 151)"
@@ -91,7 +91,17 @@ components:
91
91
 
92
92
  ## Overview
93
93
 
94
- svadmin uses a Stripe-first product language: quiet neutral canvases, precise
94
+ ### Visual update: September 21, 2026
95
+
96
+ The current UI follows Metronic Tailwind demo1 for layout rhythm, light surfaces,
97
+ thin borders and restrained shadows, as requested by the project owner.
98
+ This supersedes the older capability-only reference limitation below.
99
+ Keep SVAdmin's own branding, semantic tokens, OpenUI contracts and Bits UI behavior.
100
+ App chrome must use explicit anatomy hooks; never style every business `header`.
101
+ Package utilities live in sublayers of `utilities`, so host-authored responsive
102
+ utilities win regardless of lazy package stylesheet load order.
103
+
104
+ svadmin defines its own Admin UI product language: quiet neutral canvases, precise
95
105
  type, hairline borders, restrained elevation, compact controls, and clear
96
106
  feedback for repeated operational work. The interface should feel like a real
97
107
  administrative product with trustworthy states, not a collection of dashboard
@@ -104,7 +114,7 @@ visual authority.
104
114
 
105
115
  ### Design principles
106
116
 
107
- Seven principles turn the Stripe-first direction into reviewable product
117
+ Seven principles turn svadmin's design direction into reviewable product
108
118
  decisions. They apply to built-in components, examples, generated applications,
109
119
  and documentation:
110
120
 
@@ -121,7 +131,7 @@ and documentation:
121
131
  destructive, reversible, and completed states expose their scope and next
122
132
  step. Data freshness, permission boundaries, and action consequences must be
123
133
  visible when they affect a decision.
124
- 5. **Restrained like Stripe:** neutral surfaces and precise hierarchy carry the
134
+ 5. **Restrained by purpose:** neutral surfaces and precise hierarchy carry the
125
135
  interface. Accent, elevation, radius, animation, and decoration are used only
126
136
  when they clarify priority or interaction.
127
137
  6. **Accessible by construction:** keyboard access, visible focus, semantic
@@ -187,10 +197,10 @@ may increase slightly for genuinely clickable items, without translation or
187
197
  glow. Dialogs and menus receive stronger depth because they are floating
188
198
  layers. Dark mode keeps the same hierarchy with low-chroma surfaces.
189
199
 
190
- - **Control Shadow**: `0 1px 2px rgb(15 23 42 / 0.05), 0 0 0 1px rgb(15 23 42 / 0.025)`
191
- - **Surface Shadow**: `0 1px 2px rgb(15 23 42 / 0.035), 0 1px 3px rgb(15 23 42 / 0.025)`
192
- - **Surface Hover Shadow**: `0 2px 5px rgb(15 23 42 / 0.055), 0 1px 2px rgb(15 23 42 / 0.035)`
193
- - **Overlay Shadow**: `0 18px 48px rgb(15 23 42 / 0.14), 0 4px 12px rgb(15 23 42 / 0.08)`
200
+ - **Control Shadow**: `0 1px 2px rgb(15 23 42 / 0.09), 0 0 0 1px rgb(15 23 42 / 0.045)`
201
+ - **Surface Shadow**: `0 1px 2px rgb(15 23 42 / 0.08), 0 10px 24px rgb(15 23 42 / 0.07)`
202
+ - **Surface Hover Shadow**: `0 3px 8px rgb(15 23 42 / 0.1), 0 16px 32px rgb(15 23 42 / 0.08)`
203
+ - **Overlay Shadow**: `0 20px 52px rgb(15 23 42 / 0.18), 0 6px 16px rgb(15 23 42 / 0.1)`
194
204
 
195
205
  ## Shapes
196
206
 
@@ -226,7 +236,7 @@ Transitions provide clear state confirmation without delaying user action:
226
236
 
227
237
  The reference stack is layered. It is not a visual mixture:
228
238
 
229
- - **Stripe is the visual authority:** hierarchy, restraint, neutral surfaces,
239
+ - **svadmin owns its visual principles:** hierarchy, restraint, neutral surfaces,
230
240
  typography, density, and interaction tone.
231
241
  - **Refine is an application-model reference:** resource routing, CRUD flows,
232
242
  provider state, access control, and mutation ownership.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/create",
3
- "version": "0.28.7",
3
+ "version": "0.30.0",
4
4
  "description": "Scaffolding tool for svadmin projects",
5
5
  "type": "module",
6
6
  "bin": {
@@ -27,7 +27,7 @@
27
27
  "@types/node": "^26.4.0",
28
28
  "@types/prompts": "^2.4.9",
29
29
  "typescript": "^7.0.2",
30
- "@svadmin/core": "^0.52.0"
30
+ "@svadmin/core": "^0.54.0"
31
31
  },
32
32
  "keywords": [
33
33
  "svadmin",
@@ -10,9 +10,9 @@
10
10
  "check": "svelte-check --tsconfig ./tsconfig.json"
11
11
  },
12
12
  "dependencies": {
13
- "@svadmin/core": "^0.52.0",
14
- "@svadmin/ai-elements": "^0.7.4",
15
- "@svadmin/ui": "^0.72.0",
13
+ "@svadmin/core": "^0.54.0",
14
+ "@svadmin/ai-elements": "^0.9.0",
15
+ "@svadmin/ui": "^0.74.0",
16
16
  "@sinclair/typebox": "^0.34.52",
17
17
  "@tanstack/svelte-query": "^6.1.48",
18
18
  "@lucide/svelte": "^1.35.0"
@@ -30,16 +30,16 @@
30
30
  "@refinedev/core": "^5.0.12"
31
31
  },
32
32
  "simple-rest": {
33
- "@svadmin/simple-rest": "^0.10.6",
33
+ "@svadmin/simple-rest": "^0.10.8",
34
34
  "@refinedev/simple-rest": "^6.0.1"
35
35
  },
36
36
  "supabase": {
37
- "@svadmin/supabase": "^0.15.0",
37
+ "@svadmin/supabase": "^0.15.2",
38
38
  "@supabase/supabase-js": "^2.112.4",
39
39
  "@refinedev/supabase": "^6.0.2"
40
40
  },
41
41
  "graphql": {
42
- "@svadmin/graphql": "^0.10.6",
42
+ "@svadmin/graphql": "^0.10.8",
43
43
  "@refinedev/graphql": "^8.0.1",
44
44
  "graphql-request": "^7.4.0",
45
45
  "graphql": "^16.8.0"
@@ -1,12 +1,24 @@
1
1
  <script lang="ts">
2
- import { AdminApp } from '@svadmin/ui';
2
+ import { AdminApp, DataState } from '@svadmin/ui';
3
3
  import { createSimpleRestDataProvider } from '@svadmin/simple-rest';
4
4
  import { resources } from './resources';
5
5
  import { mockAuthProvider } from './providers/mockAuth';
6
+ import Dashboard from './pages/Dashboard.svelte';
7
+ import Login from './pages/Login.svelte';
6
8
 
7
- const dataProvider = createSimpleRestDataProvider({
8
- apiUrl: 'https://jsonplaceholder.typicode.com',
9
- });
9
+ function connect() {
10
+ return createSimpleRestDataProvider('https://jsonplaceholder.typicode.com');
11
+ }
12
+ let connection = $state(connect());
10
13
  </script>
11
14
 
12
- <AdminApp {dataProvider} {resources} authProvider={mockAuthProvider} title="svadmin Demo" locale="en" />
15
+ {#await connection}
16
+ <DataState state="loading" />
17
+ {:then dataProvider}
18
+ <AdminApp {dataProvider} {resources} authProvider={mockAuthProvider} title="svadmin Demo" locale="en">
19
+ {#snippet dashboard()}<Dashboard />{/snippet}
20
+ {#snippet loginPage()}<Login />{/snippet}
21
+ </AdminApp>
22
+ {:catch}
23
+ <DataState state="error" title="Unable to initialize data provider" retry={() => { connection = connect(); }} />
24
+ {/await}
@@ -82,7 +82,7 @@
82
82
  </div>
83
83
  {:else}
84
84
  <DataState state="empty">
85
- {#snippet action()}<Button href="#/users/create">Create user</Button>{/snippet}
85
+ {#snippet action()}<Button href="#/users">View users</Button>{/snippet}
86
86
  </DataState>
87
87
  {/each}
88
88
  </div>
@@ -1,9 +1,8 @@
1
1
  <script lang="ts">
2
- import { getAuthProvider } from '@svadmin/core';
3
- import { navigate } from '@svadmin/core/router';
2
+ import { useLogin } from '@svadmin/core';
4
3
  import { Loader2, Shield } from '@lucide/svelte';
5
4
 
6
- const auth = getAuthProvider();
5
+ const login = useLogin({ successNotification: false, errorMessage: false });
7
6
 
8
7
  let email = $state('');
9
8
  let password = $state('');
@@ -12,16 +11,20 @@
12
11
 
13
12
  async function handleLogin(e: Event) {
14
13
  e.preventDefault();
14
+ if (loading) return;
15
15
  loading = true;
16
16
  error = null;
17
17
 
18
- const result = await auth.login({ email, password });
19
- if (result.success) {
20
- navigate(result.redirectTo ?? '/');
21
- } else {
22
- error = result.error?.message ?? 'Login failed';
18
+ try {
19
+ const result = await login.mutate({ email, password });
20
+ if (!result.success) {
21
+ error = result.error?.message ?? 'Login failed';
22
+ }
23
+ } catch {
24
+ error = 'Unable to sign in. Please try again.';
25
+ } finally {
26
+ loading = false;
23
27
  }
24
- loading = false;
25
28
  }
26
29
  </script>
27
30
 
@@ -38,7 +41,7 @@
38
41
 
39
42
  <!-- Error -->
40
43
  {#if error}
41
- <div class="rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-700">
44
+ <div role="alert" class="rounded-lg bg-red-50 border border-red-200 px-4 py-3 text-sm text-red-700">
42
45
  {error}
43
46
  </div>
44
47
  {/if}
@@ -44,7 +44,7 @@ export const mockAuthProvider: AuthProvider = {
44
44
  if (!auth) return null;
45
45
  return {
46
46
  id: '1',
47
- name: auth.email.split('@')[0],
47
+ name: auth.email.split('@')[0] ?? auth.email,
48
48
  email: auth.email,
49
49
  avatar: `https://api.dicebear.com/7.x/initials/svg?seed=${auth.email}`,
50
50
  };
@@ -1,6 +1,16 @@
1
1
  {
2
- "extends": "../tsconfig.json",
3
2
  "compilerOptions": {
3
+ "target": "ES2022",
4
+ "module": "ESNext",
5
+ "moduleResolution": "bundler",
6
+ "strict": true,
7
+ "noUncheckedIndexedAccess": true,
8
+ "exactOptionalPropertyTypes": true,
9
+ "esModuleInterop": true,
10
+ "resolveJsonModule": true,
11
+ "forceConsistentCasingInFileNames": true,
12
+ "skipLibCheck": false,
13
+ "noEmit": true,
4
14
  "types": ["vite/client"]
5
15
  },
6
16
  "include": ["src/**/*.ts", "src/**/*.svelte", "vite.config.ts"]