Skip to content

Commit 437b53b

Browse files
chore(clerk-js,types): Add descriptor ids to UserMembershipList and OrganizationSwitcherTrigger (#5881)
1 parent ff16e58 commit 437b53b

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

.changeset/smart-horses-wish.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@clerk/clerk-js': patch
3+
'@clerk/types': patch
4+
---
5+
6+
Add descriptor ids to `UserMembershipList` and `OrganizationSwitcherTrigger` elements to improve styling experience.

packages/clerk-js/src/ui/components/OrganizationSwitcher/OrganizationSwitcherTrigger.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ export const OrganizationSwitcherTrigger = withAvatarShimmer(
3030
return (
3131
<Button
3232
elementDescriptor={descriptors.organizationSwitcherTrigger}
33+
elementId={descriptors.organizationSwitcherTrigger.setId(organization ? 'organization' : 'personal')}
3334
variant='ghost'
3435
colorScheme='neutral'
3536
hoverAsFocus

packages/clerk-js/src/ui/components/OrganizationSwitcher/UserMembershipList.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ export const UserMembershipList = (props: UserMembershipListProps) => {
7777
{currentOrg && !hidePersonal && (
7878
<PreviewButton
7979
elementDescriptor={descriptors.organizationSwitcherPreviewButton}
80+
elementId={descriptors.organizationSwitcherPreviewButton.setId('personal')}
8081
icon={SwitchArrowRight}
8182
onClick={onPersonalWorkspaceClick}
8283
role='menuitem'
@@ -92,6 +93,7 @@ export const UserMembershipList = (props: UserMembershipListProps) => {
9293
<PreviewButton
9394
key={organization.id}
9495
elementDescriptor={descriptors.organizationSwitcherPreviewButton}
96+
elementId={descriptors.organizationSwitcherPreviewButton.setId('organization')}
9597
icon={SwitchArrowRight}
9698
onClick={() => onOrganizationClick(organization)}
9799
role='menuitem'

packages/types/src/appearance.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export type ElementsConfig = {
312312
userButtonPopoverFooter: WithOptions;
313313
userButtonPopoverFooterPagesLink: WithOptions<'terms' | 'privacy'>;
314314

315-
organizationSwitcherTrigger: WithOptions<never, 'open'>;
315+
organizationSwitcherTrigger: WithOptions<'personal' | 'organization', 'open'>;
316316
organizationSwitcherTriggerIcon: WithOptions<never, 'open'>;
317317
organizationSwitcherPopoverRootBox: WithOptions;
318318
organizationSwitcherPopoverCard: WithOptions;
@@ -323,7 +323,7 @@ export type ElementsConfig = {
323323
organizationSwitcherPopoverActionButton: WithOptions<
324324
'manageOrganization' | 'createOrganization' | 'switchOrganization'
325325
>;
326-
organizationSwitcherPreviewButton: WithOptions;
326+
organizationSwitcherPreviewButton: WithOptions<'personal' | 'organization'>;
327327
organizationSwitcherInvitationAcceptButton: WithOptions;
328328
organizationSwitcherPopoverActionButtonIconBox: WithOptions<'manageOrganization' | 'createOrganization'>;
329329
organizationSwitcherPopoverActionButtonIcon: WithOptions<'manageOrganization' | 'createOrganization'>;

0 commit comments

Comments
 (0)