@svadmin/ui 0.108.1 → 0.108.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/dist/app.css CHANGED
@@ -11146,6 +11146,7 @@ main {
11146
11146
  .sidebar-content-collapsed {
11147
11147
  margin-left: 0;
11148
11148
  margin-right: 0;
11149
+ transition-property: none;
11149
11150
  }
11150
11151
  }
11151
11152
 
@@ -11146,6 +11146,7 @@ main {
11146
11146
  .sidebar-content-collapsed {
11147
11147
  margin-left: 0;
11148
11148
  margin-right: 0;
11149
+ transition-property: none;
11149
11150
  }
11150
11151
  }
11151
11152
 
@@ -11,7 +11,7 @@
11
11
  const resources = $derived(adminContext.resources.filter((resource) => resource.meta?.['aboutVisible'] !== false));
12
12
  const providerNames = $derived(adminContext.getDataProviderNames());
13
13
  let { version: suppliedVersion, headingLevel = 'h1' }: { version?: string; headingLevel?: 'h1' | 'h2' } = $props();
14
- const buildVersion = "0.108.1";
14
+ const buildVersion = "0.108.2";
15
15
  const version = $derived(suppliedVersion ?? (
16
16
  buildVersion.startsWith('__')
17
17
  ? (i18n.locale === 'zh-CN' ? '开发构建(未提供版本)' : 'Development build (version unavailable)')
@@ -27,8 +27,25 @@
27
27
  const storedPageSize = typeof window !== 'undefined' ? Number(localStorage.getItem(PAGE_SIZE_KEY) ?? '10') : 10;
28
28
  let pageSize = $state(pageSizeOptions.includes(storedPageSize) ? storedPageSize : 10);
29
29
  const localeNames: Record<string, string> = { 'zh-CN': '中文(简体)', en: 'English', ja: '日本語', ko: '한국어' };
30
+ const defaultColorLabels: Record<string, string> = {
31
+ neutral: 'Neutral',
32
+ indigo: 'Indigo',
33
+ blue: 'Blue',
34
+ green: 'Green',
35
+ rose: 'Rose',
36
+ orange: 'Orange',
37
+ violet: 'Violet',
38
+ default: 'Default',
39
+ stripe: 'Stripe',
40
+ };
30
41
  function setDensity(value: 'compact' | 'standard') { density = value; if (typeof window !== 'undefined') { localStorage.setItem(DENSITY_KEY, value); window.dispatchEvent(new CustomEvent('svadmin-density-change', { detail: value })); } }
31
42
  function setPageSize(size: number) { pageSize = size; if (typeof window !== 'undefined') localStorage.setItem(PAGE_SIZE_KEY, String(size)); }
43
+ function colorLabel(name: string, label: string): string {
44
+ if (defaultColorLabels[name] !== label) return label;
45
+ const key = `settings.accent.${name}`;
46
+ const translated = i18n.t(key);
47
+ return translated === key ? label : translated;
48
+ }
32
49
  </script>
33
50
 
34
51
  <div class="space-y-6">
@@ -49,7 +66,7 @@
49
66
  <div class="flex flex-wrap gap-3">
50
67
  {#each presets as preset (preset.name)}
51
68
  {@const active = currentColor === preset.name}
52
- <button class="relative size-9 rounded-full border border-border transition-opacity {active ? 'ring-2 ring-primary ring-offset-2 ring-offset-background' : 'opacity-70 hover:opacity-100'}" style="background-color: {preset.color}" onclick={() => setColorTheme(preset.name as Parameters<typeof setColorTheme>[0])} aria-label={preset.label} aria-pressed={active}>{#if active}<Check class="absolute inset-0 m-auto size-4 text-white drop-shadow-sm" />{/if}</button>
69
+ <button class="relative size-9 rounded-full border border-border transition-opacity {active ? 'ring-2 ring-primary ring-offset-2 ring-offset-background' : 'opacity-70 hover:opacity-100'}" style="background-color: {preset.color}" onclick={() => setColorTheme(preset.name as Parameters<typeof setColorTheme>[0])} aria-label={colorLabel(preset.name, preset.label)} aria-pressed={active}>{#if active}<Check class="absolute inset-0 m-auto size-4 text-white drop-shadow-sm" />{/if}</button>
53
70
  {/each}
54
71
  </div>
55
72
  </SettingsGroup>
@@ -1,6 +1,10 @@
1
1
  <script lang="ts">
2
2
  import type { Snippet } from 'svelte';
3
+ import { useTranslation } from '@svadmin/core/i18n';
3
4
  import { cn } from '../utils.js';
5
+ import { listText } from './list-i18n.js';
6
+
7
+ const i18n = useTranslation();
4
8
 
5
9
  interface Props {
6
10
  /** Optional table heading. Omit it when the page already owns the heading. */
@@ -40,7 +44,7 @@
40
44
  <div class="svadmin-data-table-shell__heading">
41
45
  <h2 class="svadmin-data-table-shell__title">{title}</h2>
42
46
  {#if count !== undefined}
43
- <span class="svadmin-data-table-shell__count" data-svadmin-data-table-count>{count} 条</span>
47
+ <span class="svadmin-data-table-shell__count" data-svadmin-data-table-count>{listText(i18n, 'common.total', { total: count })}</span>
44
48
  {/if}
45
49
  </div>
46
50
  {/if}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@svadmin/ui",
3
- "version": "0.108.1",
3
+ "version": "0.108.2",
4
4
  "description": "Pre-built admin UI components — AdminApp, AutoTable, AutoForm, Sidebar, Layout",
5
5
  "type": "module",
6
6
  "sideEffects": [