Skip to content

Commit 20d9ec9

Browse files
feat(ui): add user profile account section (#9380)
1 parent 2b83bd3 commit 20d9ec9

25 files changed

Lines changed: 1379 additions & 0 deletions
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
---
2+
---

packages/swingset/src/components/DocsViewer.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ import { ViewSource } from './ViewSource';
1212
const docModules: Record<string, Record<string, React.ComponentType>> = {
1313
user: {
1414
'user-button': dynamic(() => import('../stories/user-button.mdx')),
15+
'user-profile-profile-panel': dynamic(() => import('../stories/user-profile-profile-panel.mdx')),
16+
'user-profile-account-section': dynamic(() => import('../stories/user-profile-account-section.mdx')),
17+
'user-profile-connected-accounts-section': dynamic(
18+
() => import('../stories/user-profile-connected-accounts-section.mdx'),
19+
),
20+
'user-profile-web3wallets-section': dynamic(() => import('../stories/user-profile-web3-wallets-section.mdx')),
21+
'user-profile-delete-section': dynamic(() => import('../stories/user-profile-delete-section.mdx')),
1522
},
1623
components: {
1724
avatar: dynamic(() => import('../stories/avatar.mdx')),

packages/swingset/src/lib/registry.ts

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,26 @@ import {
9696
Organizations as UserButtonOrganizations,
9797
User as UserButtonUser,
9898
} from '../stories/user-button.stories';
99+
import {
100+
Default as UserProfileAccountSectionDefault,
101+
meta as userProfileAccountSectionMeta,
102+
} from '../stories/user-profile-account-section.stories';
103+
import {
104+
Default as UserProfileConnectedAccountsSectionDefault,
105+
meta as userProfileConnectedAccountsSectionMeta,
106+
} from '../stories/user-profile-connected-accounts-section.stories';
107+
import {
108+
Default as UserProfileDeleteSectionDefault,
109+
meta as userProfileDeleteSectionMeta,
110+
} from '../stories/user-profile-delete-section.stories';
111+
import {
112+
Default as UserProfileProfilePanelDefault,
113+
meta as userProfileProfilePanelMeta,
114+
} from '../stories/user-profile-profile-panel.stories';
115+
import {
116+
Default as UserProfileWeb3WalletsSectionDefault,
117+
meta as userProfileWeb3WalletsSectionMeta,
118+
} from '../stories/user-profile-web3-wallets-section.stories';
99119
import { toSlug } from './slug';
100120
import type { StoryModule } from './types';
101121

@@ -204,9 +224,35 @@ const scrollAreaModule: StoryModule = {
204224

205225
const useDataTableModule: StoryModule = { meta: useDataTableMeta };
206226

227+
const userProfileAccountSectionModule: StoryModule = {
228+
meta: userProfileAccountSectionMeta,
229+
Default: UserProfileAccountSectionDefault,
230+
};
231+
const userProfileProfilePanelModule: StoryModule = {
232+
meta: userProfileProfilePanelMeta,
233+
Default: UserProfileProfilePanelDefault,
234+
};
235+
const userProfileConnectedAccountsSectionModule: StoryModule = {
236+
meta: userProfileConnectedAccountsSectionMeta,
237+
Default: UserProfileConnectedAccountsSectionDefault,
238+
};
239+
const userProfileWeb3WalletsSectionModule: StoryModule = {
240+
meta: userProfileWeb3WalletsSectionMeta,
241+
Default: UserProfileWeb3WalletsSectionDefault,
242+
};
243+
const userProfileDeleteSectionModule: StoryModule = {
244+
meta: userProfileDeleteSectionMeta,
245+
Default: UserProfileDeleteSectionDefault,
246+
};
247+
207248
export const registry: StoryModule[] = [
208249
// User
209250
userButtonModule,
251+
userProfileProfilePanelModule,
252+
userProfileAccountSectionModule,
253+
userProfileConnectedAccountsSectionModule,
254+
userProfileWeb3WalletsSectionModule,
255+
userProfileDeleteSectionModule,
210256
// Components
211257
avatarModule,
212258
badgeModule,
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as Stories from './user-profile-account-section.stories';
2+
3+
# UserProfileAccountSection
4+
5+
Account details, profile image, email addresses, and phone numbers composed with `Section`.
6+
7+
<Story
8+
name='Default'
9+
storyModule={Stories}
10+
composition={[
11+
{ name: 'Section', href: '/components/section', layer: 'Components' },
12+
{ name: 'Avatar', href: '/components/avatar', layer: 'Components' },
13+
]}
14+
/>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { UserProfileAccountSectionView } from '@clerk/ui/mosaic/user-profile/user-profile-account-section.view';
2+
3+
import type { StoryMeta } from '@/lib/types';
4+
5+
export { default as __source } from './user-profile-account-section.stories?raw';
6+
7+
export const meta: StoryMeta = {
8+
group: 'User',
9+
title: 'UserProfileAccountSection',
10+
source: 'packages/ui/src/mosaic/user-profile/user-profile-account-section.view.tsx',
11+
};
12+
13+
export function Default() {
14+
return (
15+
<UserProfileAccountSectionView
16+
emails={[
17+
{ id: 'email_1', value: 'item1@clerk.dev', isDefault: true, isVerified: true },
18+
{ id: 'email_2', value: 'item2@clerk.dev', isVerified: true },
19+
]}
20+
imageUrl='https://avatars.githubusercontent.com/u/51144033?v=4'
21+
name='Preston Booth'
22+
phones={[{ id: 'phone_1', value: '+1 801-888-8181', isDefault: true, isVerified: true }]}
23+
username='prestonxyz'
24+
onAddEmail={() => undefined}
25+
onAddPhone={() => undefined}
26+
onEditProfilePicture={() => undefined}
27+
onManageEmail={() => undefined}
28+
onManagePhone={() => undefined}
29+
onNameChange={() => undefined}
30+
onUsernameChange={() => undefined}
31+
/>
32+
);
33+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import * as Stories from './user-profile-connected-accounts-section.stories';
2+
3+
# UserProfileConnectedAccountsSection
4+
5+
Connected and available external identity providers with provider-specific actions.
6+
7+
<Story
8+
name='Default'
9+
storyModule={Stories}
10+
composition={[
11+
{ name: 'Section', href: '/components/section', layer: 'Components' },
12+
{ name: 'Button', href: '/components/button', layer: 'Components' },
13+
{ name: 'Icon', href: '/components/icon', layer: 'Components' },
14+
]}
15+
/>

0 commit comments

Comments
 (0)