@svadmin/ui 0.5.0 → 0.5.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.5.0",
3
+ "version": "0.5.2",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [
package/src/app.css CHANGED
@@ -1,65 +1,94 @@
1
- /* @svadmin/ui — Design tokens (CSS custom properties)
2
- * Import this in your app's CSS AFTER @import "tailwindcss"
3
- * or import it standalone for the color variables.
1
+ /* @svadmin/ui — Design Tokens (Shadcn New York style)
2
+ * Auto-imported by AdminApp. Can be overridden by consumer's CSS.
3
+ *
4
+ * Based on shadcn/ui "New York" theme with oklch() color space.
5
+ * Differences from "Default" style:
6
+ * - Smaller border-radius (0.5rem vs 0.625rem)
7
+ * - Refined color palette with deeper contrast
8
+ * - Chart color tokens included
9
+ * - More polished dark mode
4
10
  */
5
11
 
6
- :root {
7
- --radius: 0.625rem;
8
- --background: oklch(1 0 0);
9
- --foreground: oklch(0.145 0 0);
10
- --card: oklch(1 0 0);
11
- --card-foreground: oklch(0.145 0 0);
12
- --popover: oklch(1 0 0);
13
- --popover-foreground: oklch(0.145 0 0);
14
- --primary: oklch(0.205 0 0);
15
- --primary-foreground: oklch(0.985 0 0);
16
- --secondary: oklch(0.97 0 0);
17
- --secondary-foreground: oklch(0.205 0 0);
18
- --muted: oklch(0.97 0 0);
19
- --muted-foreground: oklch(0.556 0 0);
20
- --accent: oklch(0.97 0 0);
21
- --accent-foreground: oklch(0.205 0 0);
22
- --destructive: oklch(0.577 0.245 27.325);
23
- --border: oklch(0.922 0 0);
24
- --input: oklch(0.922 0 0);
25
- --ring: oklch(0.708 0 0);
26
- --sidebar: oklch(0.985 0 0);
27
- --sidebar-foreground: oklch(0.145 0 0);
28
- --sidebar-primary: oklch(0.205 0 0);
29
- --sidebar-primary-foreground: oklch(0.985 0 0);
30
- --sidebar-accent: oklch(0.97 0 0);
31
- --sidebar-accent-foreground: oklch(0.205 0 0);
32
- --sidebar-border: oklch(0.922 0 0);
33
- --sidebar-ring: oklch(0.708 0 0);
12
+ @layer base {
13
+ :root {
14
+ --radius: 0.5rem;
15
+ --background: oklch(1 0 0);
16
+ --foreground: oklch(0.145 0 0);
17
+ --card: oklch(1 0 0);
18
+ --card-foreground: oklch(0.145 0 0);
19
+ --popover: oklch(1 0 0);
20
+ --popover-foreground: oklch(0.145 0 0);
21
+ --primary: oklch(0.205 0 0);
22
+ --primary-foreground: oklch(0.985 0 0);
23
+ --secondary: oklch(0.965 0 0);
24
+ --secondary-foreground: oklch(0.205 0 0);
25
+ --muted: oklch(0.965 0 0);
26
+ --muted-foreground: oklch(0.45 0 0);
27
+ --accent: oklch(0.965 0 0);
28
+ --accent-foreground: oklch(0.205 0 0);
29
+ --destructive: oklch(0.577 0.245 27.325);
30
+ --destructive-foreground: oklch(0.985 0 0);
31
+ --border: oklch(0.922 0 0);
32
+ --input: oklch(0.922 0 0);
33
+ --ring: oklch(0.708 0 0);
34
+ --chart-1: oklch(0.646 0.222 41.116);
35
+ --chart-2: oklch(0.6 0.118 184.704);
36
+ --chart-3: oklch(0.398 0.07 227.392);
37
+ --chart-4: oklch(0.828 0.189 84.429);
38
+ --chart-5: oklch(0.769 0.188 70.08);
39
+ --sidebar: oklch(0.985 0 0);
40
+ --sidebar-foreground: oklch(0.145 0 0);
41
+ --sidebar-primary: oklch(0.205 0 0);
42
+ --sidebar-primary-foreground: oklch(0.985 0 0);
43
+ --sidebar-accent: oklch(0.965 0 0);
44
+ --sidebar-accent-foreground: oklch(0.205 0 0);
45
+ --sidebar-border: oklch(0.922 0 0);
46
+ --sidebar-ring: oklch(0.708 0 0);
47
+ }
48
+
49
+ .dark {
50
+ --background: oklch(0.145 0 0);
51
+ --foreground: oklch(0.985 0 0);
52
+ --card: oklch(0.178 0 0);
53
+ --card-foreground: oklch(0.985 0 0);
54
+ --popover: oklch(0.178 0 0);
55
+ --popover-foreground: oklch(0.985 0 0);
56
+ --primary: oklch(0.985 0 0);
57
+ --primary-foreground: oklch(0.205 0 0);
58
+ --secondary: oklch(0.269 0 0);
59
+ --secondary-foreground: oklch(0.985 0 0);
60
+ --muted: oklch(0.269 0 0);
61
+ --muted-foreground: oklch(0.708 0 0);
62
+ --accent: oklch(0.269 0 0);
63
+ --accent-foreground: oklch(0.985 0 0);
64
+ --destructive: oklch(0.704 0.191 22.216);
65
+ --destructive-foreground: oklch(0.985 0 0);
66
+ --border: oklch(1 0 0 / 10%);
67
+ --input: oklch(1 0 0 / 15%);
68
+ --ring: oklch(0.556 0 0);
69
+ --chart-1: oklch(0.488 0.243 264.376);
70
+ --chart-2: oklch(0.696 0.17 162.48);
71
+ --chart-3: oklch(0.769 0.188 70.08);
72
+ --chart-4: oklch(0.627 0.265 303.9);
73
+ --chart-5: oklch(0.645 0.246 16.439);
74
+ --sidebar: oklch(0.178 0 0);
75
+ --sidebar-foreground: oklch(0.985 0 0);
76
+ --sidebar-primary: oklch(0.488 0.243 264.376);
77
+ --sidebar-primary-foreground: oklch(0.985 0 0);
78
+ --sidebar-accent: oklch(0.269 0 0);
79
+ --sidebar-accent-foreground: oklch(0.985 0 0);
80
+ --sidebar-border: oklch(1 0 0 / 10%);
81
+ --sidebar-ring: oklch(0.556 0 0);
82
+ }
34
83
  }
35
84
 
36
- .dark {
37
- --background: oklch(0.145 0 0);
38
- --foreground: oklch(0.985 0 0);
39
- --card: oklch(0.205 0 0);
40
- --card-foreground: oklch(0.985 0 0);
41
- --popover: oklch(0.205 0 0);
42
- --popover-foreground: oklch(0.985 0 0);
43
- --primary: oklch(0.922 0 0);
44
- --primary-foreground: oklch(0.205 0 0);
45
- --secondary: oklch(0.269 0 0);
46
- --secondary-foreground: oklch(0.985 0 0);
47
- --muted: oklch(0.269 0 0);
48
- --muted-foreground: oklch(0.708 0 0);
49
- --accent: oklch(0.269 0 0);
50
- --accent-foreground: oklch(0.985 0 0);
51
- --destructive: oklch(0.704 0.191 22.216);
52
- --border: oklch(1 0 0 / 10%);
53
- --input: oklch(1 0 0 / 15%);
54
- --ring: oklch(0.556 0 0);
55
- --sidebar: oklch(0.205 0 0);
56
- --sidebar-foreground: oklch(0.985 0 0);
57
- --sidebar-primary: oklch(0.488 0.243 264.376);
58
- --sidebar-primary-foreground: oklch(0.985 0 0);
59
- --sidebar-accent: oklch(0.269 0 0);
60
- --sidebar-accent-foreground: oklch(0.985 0 0);
61
- --sidebar-border: oklch(1 0 0 / 10%);
62
- --sidebar-ring: oklch(0.556 0 0);
85
+ /* Typography — Inter font via Bunny Fonts (global CDN, works in China) */
86
+ @import url('https://fonts.bunny.net/css?family=inter:400,500,600,700&display=swap');
87
+
88
+ body {
89
+ font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
90
+ -webkit-font-smoothing: antialiased;
91
+ -moz-osx-font-smoothing: grayscale;
63
92
  }
64
93
 
65
94
  /* Scrollbar styling */
@@ -67,3 +96,5 @@
67
96
  ::-webkit-scrollbar-track { background: transparent; }
68
97
  ::-webkit-scrollbar-thumb { background: oklch(0.8 0 0); border-radius: 3px; }
69
98
  ::-webkit-scrollbar-thumb:hover { background: oklch(0.65 0 0); }
99
+ .dark ::-webkit-scrollbar-thumb { background: oklch(0.35 0 0); }
100
+ .dark ::-webkit-scrollbar-thumb:hover { background: oklch(0.45 0 0); }
@@ -1,4 +1,6 @@
1
1
  <script lang="ts">
2
+ // Auto-inject design tokens so consumers don't need to manually import
3
+ import '../app.css';
2
4
  import type { Snippet } from 'svelte';
3
5
  import type { DataProvider, AuthProvider, ResourceDefinition, ThemeMode, RouterProvider } from '@svadmin/core';
4
6
  import { setDataProvider, setAuthProvider, setResources, setLocale, setTheme, setRouterProvider, getAuthProvider, createHashRouterProvider } from '@svadmin/core';
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import Alert, { type AlertVariant, alertVariants } from "./alert.svelte";
2
3
  import AlertTitle from "./alert-title.svelte";
3
4
  import AlertDescription from "./alert-description.svelte";
@@ -1,2 +1,3 @@
1
+ // @ts-nocheck
1
2
  export { default as Badge } from "./badge.svelte";
2
3
  export { badgeVariants, type BadgeVariant } from "./badge.svelte";
@@ -1,3 +1,4 @@
1
+ // @ts-nocheck
1
2
  import Root, {
2
3
  type ButtonProps,
3
4
  type ButtonSize,