@svadmin/ui 0.42.3 → 0.43.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 (76) hide show
  1. package/dist/app.css +462 -825
  2. package/dist/app.theme.css +462 -825
  3. package/dist/components/ErrorPage.svelte +4 -56
  4. package/dist/components/TwoFactorAuthPage.svelte +44 -232
  5. package/dist/components/account/CompanyProfilePage.svelte +21 -142
  6. package/dist/components/account/GetStartedPage.svelte +33 -115
  7. package/dist/components/account/GetStartedPage.svelte.d.ts +1 -2
  8. package/dist/components/account/SecurityLogPage.svelte +16 -131
  9. package/dist/components/account/SettingsEnterprisePage.svelte +15 -275
  10. package/dist/components/account/SettingsPlainPage.svelte +10 -175
  11. package/dist/components/account/SettingsSidebarPage.svelte +11 -304
  12. package/dist/components/account/TeamMembersPage.svelte +18 -187
  13. package/dist/components/account/UserProfilePage.svelte +19 -196
  14. package/dist/components/account/UserProfilePage.svelte.d.ts +1 -2
  15. package/dist/components/content/ApiKeyList.svelte +13 -0
  16. package/dist/components/content/ApiKeyList.svelte.d.ts +16 -0
  17. package/dist/components/content/ContentPageHeader.svelte +31 -0
  18. package/dist/components/content/ContentPageHeader.svelte.d.ts +12 -0
  19. package/dist/components/content/ContentPageShell.svelte +39 -0
  20. package/dist/components/content/ContentPageShell.svelte.d.ts +14 -0
  21. package/dist/components/content/DataState.svelte +44 -0
  22. package/dist/components/content/DataState.svelte.d.ts +13 -0
  23. package/dist/components/content/DescriptionList.svelte +27 -0
  24. package/dist/components/content/DescriptionList.svelte.d.ts +14 -0
  25. package/dist/components/content/FileList.svelte +13 -0
  26. package/dist/components/content/FileList.svelte.d.ts +16 -0
  27. package/dist/components/content/FilterToolbar.svelte +24 -0
  28. package/dist/components/content/FilterToolbar.svelte.d.ts +11 -0
  29. package/dist/components/content/ImportDropzone.svelte +19 -0
  30. package/dist/components/content/ImportDropzone.svelte.d.ts +10 -0
  31. package/dist/components/content/IntegrationCard.svelte +16 -0
  32. package/dist/components/content/IntegrationCard.svelte.d.ts +15 -0
  33. package/dist/components/content/MemberList.svelte +16 -0
  34. package/dist/components/content/MemberList.svelte.d.ts +17 -0
  35. package/dist/components/content/MetricBlock.svelte +27 -0
  36. package/dist/components/content/MetricBlock.svelte.d.ts +13 -0
  37. package/dist/components/content/NetworkTable.svelte +18 -0
  38. package/dist/components/content/NetworkTable.svelte.d.ts +31 -0
  39. package/dist/components/content/NetworkTable.types.d.ts +4 -0
  40. package/dist/components/content/NetworkTable.types.js +1 -0
  41. package/dist/components/content/NetworkUserCard.svelte +17 -0
  42. package/dist/components/content/NetworkUserCard.svelte.d.ts +17 -0
  43. package/dist/components/content/OtpInput.svelte +22 -0
  44. package/dist/components/content/OtpInput.svelte.d.ts +10 -0
  45. package/dist/components/content/PageToolbar.svelte +18 -0
  46. package/dist/components/content/PageToolbar.svelte.d.ts +10 -0
  47. package/dist/components/content/ProjectCard.svelte +39 -0
  48. package/dist/components/content/ProjectCard.svelte.d.ts +20 -0
  49. package/dist/components/content/SectionHeader.svelte +18 -0
  50. package/dist/components/content/SectionHeader.svelte.d.ts +10 -0
  51. package/dist/components/content/SecurityEventTable.svelte +18 -0
  52. package/dist/components/content/SecurityEventTable.svelte.d.ts +15 -0
  53. package/dist/components/content/StatusBadge.svelte +19 -0
  54. package/dist/components/content/StatusBadge.svelte.d.ts +9 -0
  55. package/dist/components/content/SystemErrorState.svelte +18 -0
  56. package/dist/components/content/SystemErrorState.svelte.d.ts +10 -0
  57. package/dist/components/content/TeamCard.svelte +26 -0
  58. package/dist/components/content/TeamCard.svelte.d.ts +23 -0
  59. package/dist/components/content/TwoFactorStepper.svelte +11 -0
  60. package/dist/components/content/TwoFactorStepper.svelte.d.ts +8 -0
  61. package/dist/components/content/index.d.ts +32 -0
  62. package/dist/components/content/index.js +22 -0
  63. package/dist/components/network/TeamCrewTablePage.svelte +29 -181
  64. package/dist/components/network/UserCardsNFTPage.svelte +24 -137
  65. package/dist/components/profile/ActivityTimeline.svelte +17 -91
  66. package/dist/components/profile/ProfileCard.svelte +4 -4
  67. package/dist/components/profile/ProjectsGrid.svelte +28 -106
  68. package/dist/components/profile/ProjectsGrid.svelte.d.ts +2 -12
  69. package/dist/components/profile/PublicProfilePage.svelte +31 -181
  70. package/dist/components/profile/TeamsShowcase.svelte +12 -114
  71. package/dist/components/profile/TeamsShowcase.svelte.d.ts +2 -12
  72. package/dist/index.d.ts +36 -0
  73. package/dist/index.js +24 -0
  74. package/dist/reference-data.d.ts +171 -0
  75. package/dist/reference-data.js +39 -0
  76. package/package.json +1 -1
@@ -1,187 +1,22 @@
1
1
  <script lang="ts">
2
2
  import { useTranslation } from '@svadmin/core/i18n';
3
- import * as Card from '../ui/card/index.js';
4
3
  import { Button } from '../ui/button/index.js';
5
4
  import { Input } from '../ui/input/index.js';
6
5
  import { Label } from '../ui/label/index.js';
7
6
  import { Switch } from '../ui/switch/index.js';
8
- import { Separator } from '../ui/separator/index.js';
9
- import { Loader2, Camera, Trash2 } from '@lucide/svelte';
10
-
7
+ import * as Card from '../ui/card/index.js';
8
+ import ContentPageShell from '../content/ContentPageShell.svelte';
9
+ import ContentPageHeader from '../content/ContentPageHeader.svelte';
11
10
  const i18n = useTranslation();
12
-
13
11
  let displayName = $state('Alex Chen');
14
12
  let email = $state('alex@example.com');
15
- let phone = $state('+86 138 **** 9527');
16
- let dateOfBirth = $state('1995-04-18');
17
- let bio = $state('Full-stack developer focused on design systems and developer tooling.');
18
- let country = $state('China');
19
- let region = $state('Shanghai');
20
- let city = $state('Shanghai');
21
- let postcode = $state('200120');
22
- let currentPassword = $state('');
23
- let newPassword = $state('');
24
- let confirmPassword = $state('');
25
- let emailNotifications = $state(true);
26
- let twoFactor = $state(false);
27
- let confirmDelete = $state(false);
13
+ let notifications = $state(true);
14
+ let twoFactor = $state(true);
28
15
  let saving = $state(false);
29
-
30
- async function handleSave() {
31
- saving = true;
32
- await new Promise((r) => setTimeout(r, 800));
33
- saving = false;
34
- }
16
+ async function save() { saving = true; await new Promise((resolve) => setTimeout(resolve, 400)); saving = false; }
35
17
  </script>
36
18
 
37
- <div class="space-y-6" data-svadmin-content-page="account">
38
- <div class="flex items-start justify-between gap-4">
39
- <div>
40
- <h2 class="text-xl font-semibold text-foreground">{i18n.t('account.settingsPlain')}</h2>
41
- <p class="mt-1 text-sm text-muted-foreground">{i18n.t('account.settingsPlainDescription')}</p>
42
- </div>
43
- <Button onclick={handleSave} disabled={saving} size="sm">
44
- {#if saving}<Loader2 class="h-4 w-4 animate-spin mr-2" />{/if}
45
- {i18n.t('common.save')}
46
- </Button>
47
- </div>
48
-
49
- <!-- General Settings -->
50
- <Card.Card class="border-border/60">
51
- <Card.CardHeader>
52
- <Card.CardTitle class="text-base">{i18n.t('settings.general')}</Card.CardTitle>
53
- </Card.CardHeader>
54
- <Card.CardContent class="space-y-4">
55
- <div class="flex items-center gap-4">
56
- <div class="relative">
57
- <div class="flex h-16 w-16 items-center justify-center rounded-full bg-primary/10 text-primary text-xl font-bold">AC</div>
58
- <button class="absolute -bottom-1 -right-1 flex h-6 w-6 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm">
59
- <Camera class="h-3 w-3" />
60
- </button>
61
- </div>
62
- <div>
63
- <p class="text-sm font-medium text-foreground">{i18n.t('account.photo')}</p>
64
- <p class="text-xs text-muted-foreground">150x150px JPEG, PNG Image</p>
65
- </div>
66
- </div>
67
-
68
- <Separator />
69
-
70
- <div class="grid gap-4 sm:grid-cols-2">
71
- <div class="space-y-2">
72
- <Label for="display-name">{i18n.t('profile.name')}</Label>
73
- <Input id="display-name" bind:value={displayName} />
74
- </div>
75
- <div class="space-y-2">
76
- <Label for="email">Email</Label>
77
- <Input id="email" bind:value={email} type="email" />
78
- </div>
79
- <div class="space-y-2">
80
- <Label for="phone">{i18n.t('account.phone')}</Label>
81
- <Input id="phone" bind:value={phone} />
82
- </div>
83
- <div class="space-y-2">
84
- <Label for="dob">{i18n.t('account.dateOfBirth')}</Label>
85
- <Input id="dob" bind:value={dateOfBirth} type="date" />
86
- </div>
87
- </div>
88
-
89
- <div class="space-y-2">
90
- <Label for="bio">{i18n.t('account.bio')}</Label>
91
- <textarea
92
- id="bio"
93
- bind:value={bio}
94
- rows={3}
95
- class="flex w-full rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
96
- ></textarea>
97
- </div>
98
-
99
- <Separator />
100
-
101
- <div class="flex items-center justify-between gap-4">
102
- <div class="space-y-1">
103
- <Label for="email-notif">{i18n.t('notifications.emailTitle')}</Label>
104
- <p class="text-xs text-muted-foreground">{i18n.t('notifications.emailDescription')}</p>
105
- </div>
106
- <Switch id="email-notif" bind:checked={emailNotifications} />
107
- </div>
108
-
109
- <div class="flex items-center justify-between gap-4">
110
- <div class="space-y-1">
111
- <Label for="two-factor">{i18n.t('account.twoFactorAuth')}</Label>
112
- <p class="text-xs text-muted-foreground">{i18n.t('security.twoFactorDescription')}</p>
113
- </div>
114
- <Switch id="two-factor" bind:checked={twoFactor} />
115
- </div>
116
- </Card.CardContent>
117
- </Card.Card>
118
-
119
- <!-- Address -->
120
- <Card.Card class="border-border/60">
121
- <Card.CardHeader>
122
- <Card.CardTitle class="text-base">{i18n.t('account.address')}</Card.CardTitle>
123
- </Card.CardHeader>
124
- <Card.CardContent>
125
- <div class="grid gap-4 sm:grid-cols-2">
126
- <div class="space-y-2">
127
- <Label for="country">{i18n.t('account.country')}</Label>
128
- <Input id="country" bind:value={country} />
129
- </div>
130
- <div class="space-y-2">
131
- <Label for="state">{i18n.t('account.state')}</Label>
132
- <Input id="state" bind:value={region} />
133
- </div>
134
- <div class="space-y-2">
135
- <Label for="city">{i18n.t('account.city')}</Label>
136
- <Input id="city" bind:value={city} />
137
- </div>
138
- <div class="space-y-2">
139
- <Label for="postcode">{i18n.t('account.postcode')}</Label>
140
- <Input id="postcode" bind:value={postcode} />
141
- </div>
142
- </div>
143
- </Card.CardContent>
144
- </Card.Card>
145
-
146
- <!-- Password -->
147
- <Card.Card class="border-border/60">
148
- <Card.CardHeader>
149
- <Card.CardTitle class="text-base">{i18n.t('account.password')}</Card.CardTitle>
150
- </Card.CardHeader>
151
- <Card.CardContent>
152
- <div class="grid gap-4 sm:grid-cols-3">
153
- <div class="space-y-2">
154
- <Label for="current-password">{i18n.t('profile.currentPassword')}</Label>
155
- <Input id="current-password" bind:value={currentPassword} type="password" />
156
- </div>
157
- <div class="space-y-2">
158
- <Label for="new-password">{i18n.t('profile.newPassword')}</Label>
159
- <Input id="new-password" bind:value={newPassword} type="password" />
160
- </div>
161
- <div class="space-y-2">
162
- <Label for="confirm-password">{i18n.t('auth.confirmPassword')}</Label>
163
- <Input id="confirm-password" bind:value={confirmPassword} type="password" />
164
- </div>
165
- </div>
166
- </Card.CardContent>
167
- </Card.Card>
168
-
169
- <!-- Delete Account -->
170
- <Card.Card class="border-destructive/30">
171
- <Card.CardHeader>
172
- <Card.CardTitle class="text-base text-destructive">{i18n.t('account.deleteAccount')}</Card.CardTitle>
173
- <Card.CardDescription>{i18n.t('account.deleteAccountDescription')}</Card.CardDescription>
174
- </Card.CardHeader>
175
- <Card.CardContent class="space-y-4">
176
- <div class="flex items-center justify-between gap-4">
177
- <Label for="confirm-delete" class="text-sm font-normal">{i18n.t('account.confirmDeleteAccount')}</Label>
178
- <Switch id="confirm-delete" bind:checked={confirmDelete} />
179
- </div>
180
- <div class="flex justify-end">
181
- <Button variant="destructive" size="sm" disabled={!confirmDelete}>
182
- <Trash2 class="h-4 w-4 mr-1" />{i18n.t('account.deleteAccount')}
183
- </Button>
184
- </div>
185
- </Card.CardContent>
186
- </Card.Card>
187
- </div>
19
+ <ContentPageShell pageId="account-settings-plain" width="narrow">
20
+ <div class="flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between"><ContentPageHeader title={i18n.t('account.settingsPlain')} description={i18n.t('account.settingsPlainDescription')} /><Button size="sm" onclick={save} disabled={saving}>{i18n.t('common.save')}</Button></div>
21
+ <Card.Card><Card.CardContent class="space-y-5 p-5"><div class="space-y-2"><Label for="settings-name">{i18n.t('profile.name')}</Label><Input id="settings-name" bind:value={displayName} /></div><div class="space-y-2"><Label for="settings-email">Email</Label><Input id="settings-email" bind:value={email} type="email" /></div><div class="flex items-center justify-between gap-4 border-t border-border pt-4"><div><p class="text-sm font-medium text-foreground">{i18n.t('settings.notifications')}</p><p class="mt-1 text-sm text-muted-foreground">Receive account and workflow updates.</p></div><Switch bind:checked={notifications} /></div><div class="flex items-center justify-between gap-4 border-t border-border pt-4"><div><p class="text-sm font-medium text-foreground">{i18n.t('account.twoFactorAuth')}</p><p class="mt-1 text-sm text-muted-foreground">Require an additional verification code when signing in.</p></div><Switch bind:checked={twoFactor} /></div></Card.CardContent></Card.Card>
22
+ </ContentPageShell>
@@ -1,312 +1,19 @@
1
1
  <script lang="ts">
2
2
  import { useTranslation } from '@svadmin/core/i18n';
3
- import * as Card from '../ui/card/index.js';
4
3
  import { Button } from '../ui/button/index.js';
5
- import { Badge } from '../ui/badge/index.js';
6
4
  import { Input } from '../ui/input/index.js';
7
- import { Label } from '../ui/label/index.js';
8
5
  import { Switch } from '../ui/switch/index.js';
9
- import { Separator } from '../ui/separator/index.js';
10
- import { Loader2, Camera, Key, Copy, Check } from '@lucide/svelte';
11
-
6
+ import * as Card from '../ui/card/index.js';
7
+ import ContentPageShell from '../content/ContentPageShell.svelte';
8
+ import ContentPageHeader from '../content/ContentPageHeader.svelte';
12
9
  const i18n = useTranslation();
13
-
14
- const navItems = [
15
- { id: 'basic', label: 'account.basicSettings' },
16
- { id: 'signin', label: 'account.socialSignIn' },
17
- { id: 'password', label: 'account.password' },
18
- { id: 'sso', label: 'account.singleSignOn' },
19
- { id: 'preferences', label: 'account.preferences' },
20
- { id: 'address', label: 'account.address' },
21
- { id: 'api', label: 'account.manageApi' },
22
- { id: 'delete', label: 'account.deleteAccount' },
23
- ];
24
-
25
- let activeSection = $state('basic');
26
-
27
- function scrollTo(id: string) {
28
- activeSection = id;
29
- if (typeof document !== 'undefined') {
30
- document.getElementById(`settings-section-${id}`)?.scrollIntoView({ behavior: 'smooth', block: 'start' });
31
- }
32
- }
33
-
34
- let displayName = $state('Alex Chen');
35
- let company = $state('Nebula Labs');
36
- let phone = $state('+86 138 **** 9527');
37
- let email = $state('alex@example.com');
38
- let availableToHire = $state(true);
39
- let profileVisible = $state(true);
40
- let socialGithub = $state(true);
41
- let socialGoogle = $state(false);
42
- let twoFactor = $state(true);
43
- let language = $state('en');
44
- let timezone = $state('Asia/Shanghai');
45
- let currency = $state('CNY');
46
- let apiKey = $state('sv_demo_pub_9f3e••••41ab');
47
- let copied = $state(false);
48
- let saving = $state(false);
49
-
50
- async function handleSave() {
51
- saving = true;
52
- await new Promise((r) => setTimeout(r, 800));
53
- saving = false;
54
- }
55
-
56
- async function copyApiKey() {
57
- try {
58
- await navigator.clipboard.writeText(apiKey);
59
- copied = true;
60
- setTimeout(() => (copied = false), 2000);
61
- } catch {
62
- copied = false;
63
- }
64
- }
10
+ const sections = [{ id: 'profile', title: i18n.t('account.basicSettings') }, { id: 'signin', title: i18n.t('account.socialSignIn') }, { id: 'preferences', title: i18n.t('account.preferences') }, { id: 'api', title: i18n.t('account.manageApi') }];
11
+ let active = $state('profile');
12
+ let visible = $state(true);
13
+ let available = $state(true);
65
14
  </script>
66
15
 
67
- <div class="space-y-6" data-svadmin-content-page="account">
68
- <div class="flex items-start justify-between gap-4">
69
- <div>
70
- <h2 class="text-xl font-semibold text-foreground">{i18n.t('account.settingsSidebar')}</h2>
71
- <p class="mt-1 text-sm text-muted-foreground">{i18n.t('account.settingsSidebarDescription')}</p>
72
- </div>
73
- <Button onclick={handleSave} disabled={saving} size="sm">
74
- {#if saving}<Loader2 class="h-4 w-4 animate-spin mr-2" />{/if}
75
- {i18n.t('common.save')}
76
- </Button>
77
- </div>
78
-
79
- <div class="flex flex-col gap-6 lg:flex-row">
80
- <!-- Anchor nav -->
81
- <nav class="w-full shrink-0 lg:w-52">
82
- <div class="flex gap-1 overflow-x-auto lg:sticky lg:top-6 lg:flex-col">
83
- {#each navItems as item (item.id)}
84
- <button
85
- class="whitespace-nowrap rounded-lg px-3 py-2 text-left text-sm transition-colors
86
- {activeSection === item.id ? 'bg-primary/10 font-medium text-primary' : 'text-muted-foreground hover:bg-accent hover:text-foreground'}"
87
- onclick={() => scrollTo(item.id)}
88
- >
89
- {i18n.t(item.label)}
90
- </button>
91
- {/each}
92
- </div>
93
- </nav>
94
-
95
- <div class="min-w-0 flex-1 space-y-6">
96
- <!-- Basic Settings -->
97
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-basic">
98
- <Card.CardHeader>
99
- <Card.CardTitle class="text-base">{i18n.t('account.basicSettings')}</Card.CardTitle>
100
- </Card.CardHeader>
101
- <Card.CardContent class="space-y-4">
102
- <div class="flex items-center gap-4">
103
- <div class="relative">
104
- <div class="flex h-16 w-16 items-center justify-center rounded-full bg-primary/10 text-primary text-xl font-bold">AC</div>
105
- <button class="absolute -bottom-1 -right-1 flex h-6 w-6 items-center justify-center rounded-full bg-primary text-primary-foreground shadow-sm">
106
- <Camera class="h-3 w-3" />
107
- </button>
108
- </div>
109
- <div>
110
- <p class="text-sm font-medium text-foreground">{i18n.t('account.photo')}</p>
111
- <p class="text-xs text-muted-foreground">150x150px JPEG, PNG Image</p>
112
- </div>
113
- </div>
114
- <Separator />
115
- <div class="grid gap-4 sm:grid-cols-2">
116
- <div class="space-y-2">
117
- <Label for="sb-name">{i18n.t('profile.name')}</Label>
118
- <Input id="sb-name" bind:value={displayName} />
119
- </div>
120
- <div class="space-y-2">
121
- <Label for="sb-company">{i18n.t('profile.company')}</Label>
122
- <Input id="sb-company" bind:value={company} />
123
- </div>
124
- <div class="space-y-2">
125
- <Label for="sb-phone">{i18n.t('account.phone')}</Label>
126
- <Input id="sb-phone" bind:value={phone} />
127
- </div>
128
- <div class="space-y-2">
129
- <Label for="sb-email">Email</Label>
130
- <Input id="sb-email" bind:value={email} type="email" />
131
- </div>
132
- </div>
133
- <Separator />
134
- <div class="flex items-center justify-between gap-4">
135
- <div class="space-y-1">
136
- <Label for="sb-visibility">{i18n.t('account.visibility')}</Label>
137
- <p class="text-xs text-muted-foreground">{i18n.t('account.publicProfileCard')}</p>
138
- </div>
139
- <Switch id="sb-visibility" bind:checked={profileVisible} />
140
- </div>
141
- <div class="flex items-center justify-between gap-4">
142
- <div class="space-y-1">
143
- <Label for="sb-availability">{i18n.t('account.availability')}</Label>
144
- <p class="text-xs text-muted-foreground">{i18n.t('account.availableToHire')}</p>
145
- </div>
146
- <Switch id="sb-availability" bind:checked={availableToHire} />
147
- </div>
148
- </Card.CardContent>
149
- </Card.Card>
150
-
151
- <!-- Social Sign in + 2FA -->
152
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-signin">
153
- <Card.CardHeader>
154
- <Card.CardTitle class="text-base">{i18n.t('account.socialSignIn')}</Card.CardTitle>
155
- </Card.CardHeader>
156
- <Card.CardContent class="space-y-4">
157
- <div class="flex items-center justify-between gap-4">
158
- <div class="space-y-1">
159
- <Label for="sb-github">Source Control</Label>
160
- <p class="text-xs text-muted-foreground">alexchen</p>
161
- </div>
162
- <Switch id="sb-github" bind:checked={socialGithub} />
163
- </div>
164
- <div class="flex items-center justify-between gap-4">
165
- <div class="space-y-1">
166
- <Label for="sb-google">Identity Cloud</Label>
167
- <p class="text-xs text-muted-foreground">alex@example.com</p>
168
- </div>
169
- <Switch id="sb-google" bind:checked={socialGoogle} />
170
- </div>
171
- <Separator />
172
- <div class="flex items-center justify-between gap-4">
173
- <div class="space-y-1">
174
- <Label for="sb-2fa">{i18n.t('account.twoFactorAuth')}</Label>
175
- <p class="text-xs text-muted-foreground">{i18n.t('security.twoFactorDescription')}</p>
176
- </div>
177
- <div class="flex items-center gap-2">
178
- <Badge variant="secondary" class="text-[10px]">{twoFactor ? i18n.t('security.twoFactorActive') : i18n.t('security.twoFactorInactive')}</Badge>
179
- <Switch id="sb-2fa" bind:checked={twoFactor} />
180
- </div>
181
- </div>
182
- </Card.CardContent>
183
- </Card.Card>
184
-
185
- <!-- Password -->
186
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-password">
187
- <Card.CardHeader>
188
- <Card.CardTitle class="text-base">{i18n.t('account.password')}</Card.CardTitle>
189
- </Card.CardHeader>
190
- <Card.CardContent>
191
- <div class="grid gap-4 sm:grid-cols-3">
192
- <div class="space-y-2">
193
- <Label for="sb-current-pw">{i18n.t('profile.currentPassword')}</Label>
194
- <Input id="sb-current-pw" type="password" />
195
- </div>
196
- <div class="space-y-2">
197
- <Label for="sb-new-pw">{i18n.t('profile.newPassword')}</Label>
198
- <Input id="sb-new-pw" type="password" />
199
- </div>
200
- <div class="space-y-2">
201
- <Label for="sb-confirm-pw">{i18n.t('auth.confirmPassword')}</Label>
202
- <Input id="sb-confirm-pw" type="password" />
203
- </div>
204
- </div>
205
- </Card.CardContent>
206
- </Card.Card>
207
-
208
- <!-- SSO -->
209
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-sso">
210
- <Card.CardHeader>
211
- <Card.CardTitle class="text-base">{i18n.t('account.singleSignOn')}</Card.CardTitle>
212
- </Card.CardHeader>
213
- <Card.CardContent>
214
- <div class="grid gap-4 sm:grid-cols-2">
215
- <div class="space-y-2">
216
- <Label for="sb-client-id">Client ID</Label>
217
- <Input id="sb-client-id" placeholder="xxxxxxxx-xxxx-xxxx" />
218
- </div>
219
- <div class="space-y-2">
220
- <Label for="sb-client-secret">Client Secret</Label>
221
- <Input id="sb-client-secret" type="password" placeholder="••••••••" />
222
- </div>
223
- </div>
224
- </Card.CardContent>
225
- </Card.Card>
226
-
227
- <!-- Preferences -->
228
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-preferences">
229
- <Card.CardHeader>
230
- <Card.CardTitle class="text-base">{i18n.t('account.preferences')}</Card.CardTitle>
231
- </Card.CardHeader>
232
- <Card.CardContent>
233
- <div class="grid gap-4 sm:grid-cols-3">
234
- <div class="space-y-2">
235
- <Label for="sb-language">{i18n.t('account.language')}</Label>
236
- <select id="sb-language" bind:value={language} class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring">
237
- <option value="en">English</option>
238
- <option value="zh-CN">中文(简体)</option>
239
- </select>
240
- </div>
241
- <div class="space-y-2">
242
- <Label for="sb-timezone">{i18n.t('account.timezone')}</Label>
243
- <select id="sb-timezone" bind:value={timezone} class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring">
244
- <option value="Asia/Shanghai">Asia/Shanghai (GMT+8)</option>
245
- <option value="America/Los_Angeles">America/Los_Angeles (GMT-7)</option>
246
- <option value="Europe/Berlin">Europe/Berlin (GMT+2)</option>
247
- </select>
248
- </div>
249
- <div class="space-y-2">
250
- <Label for="sb-currency">{i18n.t('account.currency')}</Label>
251
- <select id="sb-currency" bind:value={currency} class="flex h-9 w-full rounded-md border border-input bg-background px-3 py-2 text-sm focus:outline-none focus:ring-2 focus:ring-ring">
252
- <option value="CNY">CNY (¥)</option>
253
- <option value="USD">USD ($)</option>
254
- <option value="EUR">EUR (€)</option>
255
- </select>
256
- </div>
257
- </div>
258
- </Card.CardContent>
259
- </Card.Card>
260
-
261
- <!-- Address -->
262
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-address">
263
- <Card.CardHeader>
264
- <Card.CardTitle class="text-base">{i18n.t('account.address')}</Card.CardTitle>
265
- </Card.CardHeader>
266
- <Card.CardContent>
267
- <div class="grid gap-4 sm:grid-cols-2">
268
- <div class="space-y-2">
269
- <Label for="sb-country">{i18n.t('account.country')}</Label>
270
- <Input id="sb-country" value="China" />
271
- </div>
272
- <div class="space-y-2">
273
- <Label for="sb-city">{i18n.t('account.city')}</Label>
274
- <Input id="sb-city" value="Shanghai" />
275
- </div>
276
- </div>
277
- </Card.CardContent>
278
- </Card.Card>
279
-
280
- <!-- Manage API -->
281
- <Card.Card class="border-border/60 scroll-mt-6" id="settings-section-api">
282
- <Card.CardHeader>
283
- <Card.CardTitle class="flex items-center gap-2 text-base">
284
- <Key class="h-4 w-4 text-muted-foreground" />{i18n.t('account.manageApi')}
285
- </Card.CardTitle>
286
- </Card.CardHeader>
287
- <Card.CardContent>
288
- <div class="flex items-center gap-2">
289
- <Input readonly value={apiKey} class="h-9 font-mono text-xs" />
290
- <Button size="sm" variant="outline" onclick={copyApiKey}>
291
- {#if copied}<Check class="h-4 w-4 text-green-500" />{:else}<Copy class="h-4 w-4" />{/if}
292
- </Button>
293
- <Button size="sm" variant="ghost">{i18n.t('api.regenerate')}</Button>
294
- </div>
295
- </Card.CardContent>
296
- </Card.Card>
297
-
298
- <!-- Delete Account -->
299
- <Card.Card class="border-destructive/30 scroll-mt-6" id="settings-section-delete">
300
- <Card.CardHeader>
301
- <Card.CardTitle class="text-base text-destructive">{i18n.t('account.deleteAccount')}</Card.CardTitle>
302
- <Card.CardDescription>{i18n.t('account.deleteAccountDescription')}</Card.CardDescription>
303
- </Card.CardHeader>
304
- <Card.CardContent>
305
- <div class="flex justify-end">
306
- <Button variant="destructive" size="sm">{i18n.t('account.deleteAccount')}</Button>
307
- </div>
308
- </Card.CardContent>
309
- </Card.Card>
310
- </div>
311
- </div>
312
- </div>
16
+ <ContentPageShell pageId="account-settings-sidebar" width="wide">
17
+ <ContentPageHeader title={i18n.t('account.settingsSidebar')} description={i18n.t('account.settingsSidebarDescription')} />
18
+ <div class="grid gap-6 lg:grid-cols-[12rem_minmax(0,1fr)]"><nav class="flex gap-1 overflow-x-auto lg:flex-col">{#each sections as section (section.id)}<button type="button" class={'whitespace-nowrap rounded-md px-3 py-2 text-left text-sm ' + (active === section.id ? 'bg-muted font-medium text-foreground' : 'text-muted-foreground hover:text-foreground')} onclick={() => active = section.id}>{section.title}</button>{/each}</nav><div class="space-y-4">{#if active === 'profile'}<Card.Card><Card.CardContent class="space-y-4 p-5"><h2 class="text-sm font-semibold text-foreground">{i18n.t('account.basicSettings')}</h2><Input value="Alex Chen" aria-label={i18n.t('profile.name')} /><Input value="Nebula Labs" aria-label="Company" /><div class="flex items-center justify-between border-t border-border pt-4"><span class="text-sm text-foreground">{i18n.t('account.visibility')}</span><Switch bind:checked={visible} /></div><div class="flex items-center justify-between"><span class="text-sm text-foreground">{i18n.t('account.availability')}</span><Switch bind:checked={available} /></div></Card.CardContent></Card.Card>{:else if active === 'signin'}<Card.Card><Card.CardContent class="space-y-4 p-5"><h2 class="text-sm font-semibold text-foreground">{i18n.t('account.socialSignIn')}</h2><p class="text-sm text-muted-foreground">Connect the providers your team trusts for sign in.</p><Button variant="outline">GitHub</Button><Button variant="outline">Google</Button></Card.CardContent></Card.Card>{:else if active === 'preferences'}<Card.Card><Card.CardContent class="space-y-4 p-5"><h2 class="text-sm font-semibold text-foreground">{i18n.t('account.preferences')}</h2><Input value="English" aria-label={i18n.t('account.language')} /><Input value="Asia/Shanghai" aria-label={i18n.t('account.timezone')} /><Input value="CNY" aria-label={i18n.t('account.currency')} /></Card.CardContent></Card.Card>{:else}<Card.Card><Card.CardContent class="space-y-4 p-5"><h2 class="text-sm font-semibold text-foreground">{i18n.t('account.manageApi')}</h2><Input readonly value="sv_demo_pub_9f3e********41ab" aria-label="API key" /><Button variant="outline">{i18n.t('common.copy')}</Button></Card.CardContent></Card.Card>{/if}</div></div>
19
+ </ContentPageShell>