@svadmin/create 0.29.0 → 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 +1 -1
- package/dist/index.js +4 -4
- package/guidance/DESIGN.md +21 -11
- package/package.json +2 -2
- package/scaffold-manifest.json +6 -6
- package/template/src/App.svelte +17 -5
- package/template/src/pages/Dashboard.svelte +1 -1
- package/template/src/pages/Login.svelte +13 -10
- package/template/src/providers/mockAuth.ts +1 -1
- package/template/tsconfig.json +11 -1
package/README.md
CHANGED
|
@@ -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
|
|
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
|
@@ -6526,9 +6526,10 @@ var fieldTypes = {
|
|
|
6526
6526
|
number: true,
|
|
6527
6527
|
boolean: true,
|
|
6528
6528
|
date: true,
|
|
6529
|
-
time: true,
|
|
6530
|
-
datetime: true,
|
|
6531
6529
|
daterange: true,
|
|
6530
|
+
datetime: true,
|
|
6531
|
+
time: true,
|
|
6532
|
+
percent: true,
|
|
6532
6533
|
select: true,
|
|
6533
6534
|
multiselect: true,
|
|
6534
6535
|
tags: true,
|
|
@@ -6543,7 +6544,6 @@ var fieldTypes = {
|
|
|
6543
6544
|
email: true,
|
|
6544
6545
|
phone: true,
|
|
6545
6546
|
currency: true,
|
|
6546
|
-
percent: true,
|
|
6547
6547
|
file: true,
|
|
6548
6548
|
markdown: true,
|
|
6549
6549
|
password: true,
|
|
@@ -7453,7 +7453,7 @@ bun run dev
|
|
|
7453
7453
|
|
|
7454
7454
|
## Stack
|
|
7455
7455
|
|
|
7456
|
-
- **UI**: Svelte 5 + Bits UI + precompiled
|
|
7456
|
+
- **UI**: Svelte 5 + Bits UI + Tailwind semantic recipes (precompiled CSS)
|
|
7457
7457
|
- **Data**: ${dpLabel} DataProvider
|
|
7458
7458
|
- **Auth**: ${authLabel}
|
|
7459
7459
|
- **State**: TanStack Query v6
|
package/guidance/DESIGN.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
version: "alpha"
|
|
3
|
-
name: "svadmin
|
|
3
|
+
name: "svadmin Admin UI"
|
|
4
4
|
description: "A restrained, precise product interface for repeated administrative work."
|
|
5
5
|
colors:
|
|
6
|
-
background: "oklch(0.
|
|
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.
|
|
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
|
-
|
|
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
|
|
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
|
|
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.
|
|
191
|
-
- **Surface Shadow**: `0 1px 2px rgb(15 23 42 / 0.
|
|
192
|
-
- **Surface Hover Shadow**: `0
|
|
193
|
-
- **Overlay Shadow**: `0
|
|
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
|
-
- **
|
|
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.
|
|
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.
|
|
30
|
+
"@svadmin/core": "^0.54.0"
|
|
31
31
|
},
|
|
32
32
|
"keywords": [
|
|
33
33
|
"svadmin",
|
package/scaffold-manifest.json
CHANGED
|
@@ -10,9 +10,9 @@
|
|
|
10
10
|
"check": "svelte-check --tsconfig ./tsconfig.json"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@svadmin/core": "^0.
|
|
14
|
-
"@svadmin/ai-elements": "^0.
|
|
15
|
-
"@svadmin/ui": "^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.
|
|
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.
|
|
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.
|
|
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"
|
package/template/src/App.svelte
CHANGED
|
@@ -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
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
9
|
+
function connect() {
|
|
10
|
+
return createSimpleRestDataProvider('https://jsonplaceholder.typicode.com');
|
|
11
|
+
}
|
|
12
|
+
let connection = $state(connect());
|
|
10
13
|
</script>
|
|
11
14
|
|
|
12
|
-
|
|
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}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
<script lang="ts">
|
|
2
|
-
import {
|
|
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
|
|
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
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
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
|
};
|
package/template/tsconfig.json
CHANGED
|
@@ -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"]
|