@svadmin/ui 0.76.0 → 0.78.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.
Files changed (57) hide show
  1. package/dist/app.css +439 -72
  2. package/dist/app.theme.css +439 -72
  3. package/dist/component-registry.d.ts +300 -0
  4. package/dist/component-registry.js +2 -0
  5. package/dist/components/AboutSettings.svelte +4 -3
  6. package/dist/components/AboutSettings.svelte.d.ts +1 -0
  7. package/dist/components/AdminApp.svelte +30 -15
  8. package/dist/components/ApiSettings.svelte +39 -2
  9. package/dist/components/AppearanceSettings.svelte +35 -9
  10. package/dist/components/AppearanceSettings.svelte.d.ts +4 -1
  11. package/dist/components/AutoTable.svelte +10 -6
  12. package/dist/components/AutoTable.svelte.d.ts +2 -0
  13. package/dist/components/IntegrationsSettings.svelte +5 -3
  14. package/dist/components/IntegrationsSettings.svelte.d.ts +1 -0
  15. package/dist/components/Layout.svelte +38 -5
  16. package/dist/components/Layout.svelte.d.ts +4 -3
  17. package/dist/components/NotificationsSettings.svelte +18 -12
  18. package/dist/components/NotificationsSettings.svelte.d.ts +1 -0
  19. package/dist/components/ProfilePage.svelte +3 -3
  20. package/dist/components/ProfilePage.svelte.d.ts +4 -1
  21. package/dist/components/ResourceOverview.svelte +36 -0
  22. package/dist/components/ResourceOverview.svelte.d.ts +6 -0
  23. package/dist/components/ResourceOverviewCard.svelte +50 -0
  24. package/dist/components/ResourceOverviewCard.svelte.d.ts +7 -0
  25. package/dist/components/SecuritySettings.svelte +9 -6
  26. package/dist/components/SecuritySettings.svelte.d.ts +4 -1
  27. package/dist/components/Sidebar.svelte +1 -1
  28. package/dist/components/account/SettingsEnterprisePage.svelte +19 -19
  29. package/dist/components/account/SettingsPlainPage.svelte +7 -3
  30. package/dist/components/account/SettingsSidebarPage.svelte +3 -3
  31. package/dist/components/content/ContentPageHeader.svelte +20 -4
  32. package/dist/components/content/ContentPageHeader.svelte.d.ts +2 -0
  33. package/dist/components/content/ContentPageShell.svelte +12 -3
  34. package/dist/components/content/ContentPageShell.svelte.d.ts +1 -0
  35. package/dist/components/content/DashboardPage.svelte +35 -0
  36. package/dist/components/content/DashboardPage.svelte.d.ts +13 -0
  37. package/dist/components/content/FeedbackNotice.svelte +1 -1
  38. package/dist/components/content/MetricBlock.svelte +1 -1
  39. package/dist/components/content/PageSection.svelte +28 -0
  40. package/dist/components/content/PageSection.svelte.d.ts +10 -0
  41. package/dist/components/content/SettingsFieldRow.svelte +10 -5
  42. package/dist/components/content/SettingsFieldRow.svelte.d.ts +1 -0
  43. package/dist/components/content/SettingsGroup.svelte +3 -3
  44. package/dist/components/content/SettingsGroup.svelte.d.ts +1 -0
  45. package/dist/components/content/index.d.ts +2 -0
  46. package/dist/components/content/index.js +2 -0
  47. package/dist/components/ui/button/button.svelte +17 -1
  48. package/dist/components/ui/button/button.svelte.d.ts +1 -0
  49. package/dist/components/ui/sheet/sheet.svelte +3 -0
  50. package/dist/default-theme.d.ts +3 -0
  51. package/dist/default-theme.js +4 -0
  52. package/dist/index.d.ts +3 -0
  53. package/dist/index.js +3 -0
  54. package/dist/page-chrome.css +4 -4
  55. package/dist/recipes.d.ts +77 -38
  56. package/dist/recipes.js +33 -8
  57. package/package.json +3 -3
@@ -16,6 +16,7 @@
16
16
  variant?: ButtonVariantValue;
17
17
  size?: ButtonSizeValue;
18
18
  disabledReason?: string;
19
+ disabledReasonDisplay?: "tooltip" | "inline";
19
20
  restrictionClass?: string;
20
21
  restrictionStyle?: string;
21
22
  };
@@ -34,6 +35,7 @@
34
35
  type = "button",
35
36
  disabled,
36
37
  disabledReason = "",
38
+ disabledReasonDisplay = "tooltip",
37
39
  restrictionClass,
38
40
  restrictionStyle,
39
41
  children,
@@ -100,7 +102,21 @@
100
102
  {/if}
101
103
  {/snippet}
102
104
 
103
- {#if restriction}
105
+ {#if restriction && disabledReasonDisplay === "inline"}
106
+ <span
107
+ data-slot="button-restriction"
108
+ data-disabled-reason={restriction}
109
+ role="group"
110
+ aria-label={restProps["aria-label"]}
111
+ aria-labelledby={restProps["aria-labelledby"]}
112
+ aria-describedby={describedBy}
113
+ class={restrictionClass}
114
+ style={`display: inline-flex; flex-direction: column; align-items: flex-start; gap: .375rem; min-width: 0; max-width: 100%; ${restrictionStyle ?? ""}`}
115
+ >
116
+ {@render control()}
117
+ <span id={restrictionId} data-slot="button-restriction-description" style="font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere;">{restriction}</span>
118
+ </span>
119
+ {:else if restriction}
104
120
  <Tooltip.Root>
105
121
  <Tooltip.Trigger>
106
122
  {#snippet child({ props })}
@@ -6,6 +6,7 @@ export type ButtonProps = WithElementRef<HTMLButtonAttributes & HTMLAnchorAttrib
6
6
  variant?: ButtonVariantValue;
7
7
  size?: ButtonSizeValue;
8
8
  disabledReason?: string;
9
+ disabledReasonDisplay?: "tooltip" | "inline";
9
10
  restrictionClass?: string;
10
11
  restrictionStyle?: string;
11
12
  };
@@ -33,6 +33,7 @@
33
33
  <script lang="ts">
34
34
  /* eslint-disable svelte/no-unused-svelte-ignore */
35
35
  import { tick } from "svelte";
36
+ import { Portal } from "bits-ui";
36
37
  import { cn, type WithElementRef } from "../../../utils.js";
37
38
  import type { HTMLAttributes } from "svelte/elements";
38
39
 
@@ -159,6 +160,7 @@
159
160
  <svelte:document onkeydown={handleKeydown} />
160
161
 
161
162
  {#if open}
163
+ <Portal>
162
164
  <!-- Overlay -->
163
165
  <!-- svelte-ignore a11y_click_events_have_key_events a11y_no_static_element_interactions -->
164
166
  <div
@@ -191,4 +193,5 @@
191
193
  <span class="svadmin-sr-only">{closeLabel}</span>
192
194
  </button>
193
195
  </div>
196
+ </Portal>
194
197
  {/if}
@@ -0,0 +1,3 @@
1
+ import type { ThemeConfig } from '@svadmin/core';
2
+ /** UI 默认值不改变 headless core 的主题归属规则,也不覆盖已保存的配色。 */
3
+ export declare function resolveAdminThemeConfig(config?: ThemeConfig): ThemeConfig;
@@ -0,0 +1,4 @@
1
+ /** UI 默认值不改变 headless core 的主题归属规则,也不覆盖已保存的配色。 */
2
+ export function resolveAdminThemeConfig(config) {
3
+ return { ...config, layoutPreset: config?.layoutPreset ?? 'clean-flat' };
4
+ }
package/dist/index.d.ts CHANGED
@@ -98,6 +98,7 @@ export { default as ApprovalActionCard } from './components/ApprovalActionCard.s
98
98
  export type { ApprovalStatus } from './components/ApprovalActionCard.svelte';
99
99
  export { default as ApprovalCenter } from './components/ApprovalCenter.svelte';
100
100
  export { default as DashboardView } from './components/DashboardView.svelte';
101
+ export { default as ResourceOverview } from './components/ResourceOverview.svelte';
101
102
  export { default as StepForm } from './components/StepForm.svelte';
102
103
  export type { FormStep } from './components/StepForm.svelte';
103
104
  export { default as ModalForm } from './components/ModalForm.svelte';
@@ -271,6 +272,8 @@ export { default as UserCardsNFTPage } from './components/network/UserCardsNFTPa
271
272
  export { default as TeamCrewTablePage } from './components/network/TeamCrewTablePage.svelte';
272
273
  export { default as TwoFactorAuthPage } from './components/TwoFactorAuthPage.svelte';
273
274
  export { default as ContentPageShell } from './components/content/ContentPageShell.svelte';
275
+ export { default as DashboardPage } from './components/content/DashboardPage.svelte';
276
+ export { default as PageSection } from './components/content/PageSection.svelte';
274
277
  export { default as ContentPageHeader } from './components/content/ContentPageHeader.svelte';
275
278
  export { default as SectionHeader } from './components/content/SectionHeader.svelte';
276
279
  export { default as PageToolbar } from './components/content/PageToolbar.svelte';
package/dist/index.js CHANGED
@@ -82,6 +82,7 @@ export { default as SensitiveDataMask } from './components/SensitiveDataMask.sve
82
82
  export { default as ApprovalActionCard } from './components/ApprovalActionCard.svelte';
83
83
  export { default as ApprovalCenter } from './components/ApprovalCenter.svelte';
84
84
  export { default as DashboardView } from './components/DashboardView.svelte';
85
+ export { default as ResourceOverview } from './components/ResourceOverview.svelte';
85
86
  export { default as StepForm } from './components/StepForm.svelte';
86
87
  export { default as ModalForm } from './components/ModalForm.svelte';
87
88
  export { default as DrawerForm } from './components/DrawerForm.svelte';
@@ -241,6 +242,8 @@ export { default as TeamCrewTablePage } from './components/network/TeamCrewTable
241
242
  export { default as TwoFactorAuthPage } from './components/TwoFactorAuthPage.svelte';
242
243
  // Admin UI content page and domain primitives
243
244
  export { default as ContentPageShell } from './components/content/ContentPageShell.svelte';
245
+ export { default as DashboardPage } from './components/content/DashboardPage.svelte';
246
+ export { default as PageSection } from './components/content/PageSection.svelte';
244
247
  export { default as ContentPageHeader } from './components/content/ContentPageHeader.svelte';
245
248
  export { default as SectionHeader } from './components/content/SectionHeader.svelte';
246
249
  export { default as PageToolbar } from './components/content/PageToolbar.svelte';
@@ -106,7 +106,7 @@
106
106
  .svadmin-filter-toolbar__search-icon {
107
107
  position: absolute;
108
108
  top: 50%;
109
- left: 0.75rem;
109
+ inset-inline-start: 0.75rem;
110
110
  width: var(--svadmin-filter-search-icon-size);
111
111
  height: var(--svadmin-filter-search-icon-size);
112
112
  color: var(--muted-foreground);
@@ -122,7 +122,7 @@
122
122
  .svadmin-filter-toolbar[data-density] .svadmin-filter-toolbar__clear {
123
123
  position: absolute;
124
124
  top: 50%;
125
- right: 0.25rem;
125
+ inset-inline-end: 0.25rem;
126
126
  transform: translateY(-50%);
127
127
  }
128
128
  .svadmin-filter-toolbar[data-density] .svadmin-filter-toolbar__toggle {
@@ -144,14 +144,14 @@
144
144
  .svadmin-filter-toolbar .svadmin-filter-toolbar__chevron {
145
145
  width: 0.75rem;
146
146
  height: 0.75rem;
147
- margin-left: 0.125rem;
147
+ margin-inline-start: 0.125rem;
148
148
  color: var(--muted-foreground);
149
149
  }
150
150
  .svadmin-filter-toolbar[data-density] .svadmin-filter-toolbar__count {
151
151
  height: 1rem;
152
152
  min-height: 1rem;
153
153
  min-width: 1rem;
154
- margin-left: 0.125rem;
154
+ margin-inline-start: 0.125rem;
155
155
  padding: 0 0.25rem;
156
156
  font-size: 0.625rem;
157
157
  font-weight: 600;
package/dist/recipes.d.ts CHANGED
@@ -120,6 +120,14 @@ declare const contentPageRecipeStyles: import("tailwind-variants").TVReturnType<
120
120
  root: string;
121
121
  };
122
122
  };
123
+ density: {
124
+ compact: {
125
+ root: string;
126
+ };
127
+ comfortable: {
128
+ root: string;
129
+ };
130
+ };
123
131
  }, {
124
132
  root: string;
125
133
  }, undefined, {
@@ -134,6 +142,14 @@ declare const contentPageRecipeStyles: import("tailwind-variants").TVReturnType<
134
142
  root: string;
135
143
  };
136
144
  };
145
+ density: {
146
+ compact: {
147
+ root: string;
148
+ };
149
+ comfortable: {
150
+ root: string;
151
+ };
152
+ };
137
153
  }, {
138
154
  root: string;
139
155
  }, import("tailwind-variants").TVReturnTypeLike<{
@@ -148,38 +164,37 @@ declare const contentPageRecipeStyles: import("tailwind-variants").TVReturnType<
148
164
  root: string;
149
165
  };
150
166
  };
167
+ density: {
168
+ compact: {
169
+ root: string;
170
+ };
171
+ comfortable: {
172
+ root: string;
173
+ };
174
+ };
151
175
  }, {
152
176
  root: string;
153
177
  }>>;
154
178
  declare const contentHeaderRecipeStyles: import("tailwind-variants").TVReturnType<{
155
- [key: string]: {
156
- [key: string]: import("tailwind-variants").ClassValue | {
157
- title?: import("tailwind-variants").ClassValue;
158
- description?: import("tailwind-variants").ClassValue;
159
- root?: import("tailwind-variants").ClassValue;
160
- row?: import("tailwind-variants").ClassValue;
161
- heading?: import("tailwind-variants").ClassValue;
162
- breadcrumbs?: import("tailwind-variants").ClassValue;
163
- currentCrumb?: import("tailwind-variants").ClassValue;
164
- eyebrow?: import("tailwind-variants").ClassValue;
165
- actions?: import("tailwind-variants").ClassValue;
179
+ density: {
180
+ compact: {
181
+ root: string;
182
+ row: string;
183
+ heading: string;
184
+ title: string;
185
+ description: string;
186
+ actions: string;
166
187
  };
167
- };
168
- } | {
169
- [x: string]: {
170
- [x: string]: import("tailwind-variants").ClassValue | {
171
- title?: import("tailwind-variants").ClassValue;
172
- description?: import("tailwind-variants").ClassValue;
173
- root?: import("tailwind-variants").ClassValue;
174
- row?: import("tailwind-variants").ClassValue;
175
- heading?: import("tailwind-variants").ClassValue;
176
- breadcrumbs?: import("tailwind-variants").ClassValue;
177
- currentCrumb?: import("tailwind-variants").ClassValue;
178
- eyebrow?: import("tailwind-variants").ClassValue;
179
- actions?: import("tailwind-variants").ClassValue;
188
+ comfortable: {
189
+ root: string;
190
+ row: string;
191
+ heading: string;
192
+ title: string;
193
+ description: string;
194
+ actions: string;
180
195
  };
181
196
  };
182
- } | {}, {
197
+ }, {
183
198
  root: string;
184
199
  breadcrumbs: string;
185
200
  currentCrumb: string;
@@ -190,20 +205,25 @@ declare const contentHeaderRecipeStyles: import("tailwind-variants").TVReturnTyp
190
205
  description: string;
191
206
  actions: string;
192
207
  }, undefined, {
193
- [key: string]: {
194
- [key: string]: import("tailwind-variants").ClassValue | {
195
- title?: import("tailwind-variants").ClassValue;
196
- description?: import("tailwind-variants").ClassValue;
197
- root?: import("tailwind-variants").ClassValue;
198
- row?: import("tailwind-variants").ClassValue;
199
- heading?: import("tailwind-variants").ClassValue;
200
- breadcrumbs?: import("tailwind-variants").ClassValue;
201
- currentCrumb?: import("tailwind-variants").ClassValue;
202
- eyebrow?: import("tailwind-variants").ClassValue;
203
- actions?: import("tailwind-variants").ClassValue;
208
+ density: {
209
+ compact: {
210
+ root: string;
211
+ row: string;
212
+ heading: string;
213
+ title: string;
214
+ description: string;
215
+ actions: string;
216
+ };
217
+ comfortable: {
218
+ root: string;
219
+ row: string;
220
+ heading: string;
221
+ title: string;
222
+ description: string;
223
+ actions: string;
204
224
  };
205
225
  };
206
- } | {}, {
226
+ }, {
207
227
  root: string;
208
228
  breadcrumbs: string;
209
229
  currentCrumb: string;
@@ -213,7 +233,26 @@ declare const contentHeaderRecipeStyles: import("tailwind-variants").TVReturnTyp
213
233
  title: string;
214
234
  description: string;
215
235
  actions: string;
216
- }, import("tailwind-variants").TVReturnTypeLike<unknown, {
236
+ }, import("tailwind-variants").TVReturnTypeLike<{
237
+ density: {
238
+ compact: {
239
+ root: string;
240
+ row: string;
241
+ heading: string;
242
+ title: string;
243
+ description: string;
244
+ actions: string;
245
+ };
246
+ comfortable: {
247
+ root: string;
248
+ row: string;
249
+ heading: string;
250
+ title: string;
251
+ description: string;
252
+ actions: string;
253
+ };
254
+ };
255
+ }, {
217
256
  root: string;
218
257
  breadcrumbs: string;
219
258
  currentCrumb: string;
package/dist/recipes.js CHANGED
@@ -55,28 +55,53 @@ const buttonRecipeDefaults = { variant: "default", size: "default" };
55
55
  const badgeRecipeDefaults = { variant: "default" };
56
56
  const textareaRecipeStyles = tv({ base: "svadmin-textarea" });
57
57
  const contentPageRecipeStyles = tv({
58
- slots: { root: `${semantic.page} svadmin-content-page space-y-6` },
58
+ slots: { root: `${semantic.page} svadmin-content-page` },
59
59
  variants: {
60
60
  width: {
61
61
  narrow: { root: "max-w-3xl" },
62
62
  default: { root: "max-w-[74rem]" },
63
63
  wide: { root: "max-w-[92rem]" },
64
64
  },
65
+ density: {
66
+ compact: { root: "space-y-4" },
67
+ comfortable: { root: "space-y-6" },
68
+ },
65
69
  },
66
- defaultVariants: { width: "default" },
70
+ defaultVariants: { width: "default", density: "comfortable" },
67
71
  });
68
72
  const contentHeaderRecipeStyles = tv({
69
73
  slots: {
70
- root: "svadmin-content-header space-y-3",
74
+ root: "svadmin-content-header",
71
75
  breadcrumbs: `${semantic.group} text-xs text-muted-foreground`,
72
76
  currentCrumb: "text-foreground",
73
- row: "flex flex-col gap-6 sm:flex-row sm:items-start sm:justify-between",
74
- heading: "min-w-0 space-y-1",
77
+ row: "flex flex-col sm:flex-row sm:items-start sm:justify-between",
78
+ heading: "min-w-0",
75
79
  eyebrow: "text-xs font-medium text-muted-foreground",
76
- title: "text-xl font-semibold leading-tight text-foreground",
77
- description: "max-w-2xl text-sm leading-6 text-muted-foreground",
78
- actions: "flex shrink-0 flex-wrap items-center gap-2",
80
+ title: "font-semibold leading-tight text-foreground",
81
+ description: "max-w-2xl text-muted-foreground",
82
+ actions: "flex shrink-0 flex-wrap items-center",
79
83
  },
84
+ variants: {
85
+ density: {
86
+ compact: {
87
+ root: "space-y-2",
88
+ row: "gap-3",
89
+ heading: "space-y-0.5",
90
+ title: "text-lg leading-tight",
91
+ description: "text-[0.8125rem] leading-5",
92
+ actions: "gap-1.5",
93
+ },
94
+ comfortable: {
95
+ root: "space-y-3",
96
+ row: "gap-6",
97
+ heading: "space-y-1",
98
+ title: "text-xl leading-tight",
99
+ description: "text-sm leading-6",
100
+ actions: "gap-2",
101
+ },
102
+ },
103
+ },
104
+ defaultVariants: { density: "comfortable" },
80
105
  });
81
106
  const metricBlockRecipeStyles = tv({
82
107
  slots: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.76.0",
3
+ "version": "0.78.0",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [
@@ -88,7 +88,7 @@
88
88
  "@codemirror/lang-json": "^6.0.0",
89
89
  "@codemirror/lang-markdown": "^6.0.0",
90
90
  "@codemirror/lang-sql": "^6.0.0",
91
- "@svadmin/core": "^0.56.0",
91
+ "@svadmin/core": "^0.57.0",
92
92
  "@tanstack/svelte-query": "^6.1.48",
93
93
  "codemirror": "^6.0.0",
94
94
  "isomorphic-dompurify": "^3.23.0",
@@ -175,7 +175,7 @@
175
175
  "@codemirror/lang-markdown": "^6.5.2",
176
176
  "@codemirror/lang-sql": "^6.10.0",
177
177
  "@happy-dom/global-registrator": "^20.11.12",
178
- "@svadmin/ai-elements": "^0.10.1",
178
+ "@svadmin/ai-elements": "^0.10.2",
179
179
  "@sveltejs/vite-plugin-svelte": "^7.3.0",
180
180
  "@tailwindcss/cli": "4.3.3",
181
181
  "@testing-library/dom": "^10.4.1",