Skip to content

Commit 4edbec3

Browse files
committed
update naming and write jsdoc
1 parent 48811c7 commit 4edbec3

File tree

3 files changed

+36
-10
lines changed

3 files changed

+36
-10
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,16 @@ const OrganizationSwitcherWithFloatingTree = withFloatingTree<{ children: ReactE
4545
});
4646

4747
const _OrganizationSwitcher = () => {
48-
const { __experimental_hideTrigger, __experimental_onActionEnded } = useOrganizationSwitcherContext();
48+
const { __experimental_standalone, __experimental_onDismiss } = useOrganizationSwitcherContext();
4949

5050
return (
5151
<Flow.Root
5252
flow='organizationSwitcher'
5353
sx={{ display: 'inline-flex' }}
5454
>
5555
<AcceptedInvitationsProvider>
56-
{__experimental_hideTrigger ? (
57-
<OrganizationSwitcherPopover close={__experimental_onActionEnded} />
56+
{__experimental_standalone ? (
57+
<OrganizationSwitcherPopover close={__experimental_onDismiss} />
5858
) : (
5959
<OrganizationSwitcherWithFloatingTree>
6060
<OrganizationSwitcherPopover />

packages/clerk-js/src/ui/components/UserButton/UserButton.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,15 +44,15 @@ const UserButtonWithFloatingTree = withFloatingTree<{ children: ReactElement }>(
4444
});
4545

4646
const _UserButton = withFloatingTree(() => {
47-
const { __experimental_hideTrigger, __experimental_onActionEnded } = useUserButtonContext();
47+
const { __experimental_standalone, __experimental_onDismiss } = useUserButtonContext();
4848

4949
return (
5050
<Flow.Root
5151
flow='userButton'
5252
sx={{ display: 'inline-flex' }}
5353
>
54-
{__experimental_hideTrigger ? (
55-
<UserButtonPopover close={__experimental_onActionEnded} />
54+
{__experimental_standalone ? (
55+
<UserButtonPopover close={__experimental_onDismiss} />
5656
) : (
5757
<UserButtonWithFloatingTree>
5858
<UserButtonPopover />

packages/types/src/clerk.ts

Lines changed: 30 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -910,8 +910,22 @@ export type UserButtonProps = UserButtonProfileMode & {
910910
*/
911911
defaultOpen?: boolean;
912912

913-
__experimental_hideTrigger?: boolean;
914-
__experimental_onActionEnded?: () => void;
913+
/**
914+
* If true the UserButton will only render the popover.
915+
* Enables developers to implement a custom dialog.
916+
* @experimental This API is experimental and may change at any moment.
917+
* @default false
918+
*/
919+
__experimental_standalone?: boolean;
920+
921+
/**
922+
* Notifies the caller that it's safe to unmount UserButton.
923+
* It only fires when used in conjunction with `__experimental_standalone`.
924+
* @experimental This API is experimental and may change at any moment.
925+
* @default undefined
926+
*/
927+
__experimental_onDismiss?: () => void;
928+
915929
/**
916930
* Full URL or path to navigate after sign out is complete
917931
* @deprecated Configure `afterSignOutUrl` as a global configuration, either in <ClerkProvider/> or in await Clerk.load()
@@ -972,9 +986,21 @@ export type OrganizationSwitcherProps = CreateOrganizationMode &
972986
* Controls the default state of the OrganizationSwitcher
973987
*/
974988
defaultOpen?: boolean;
989+
/**
990+
* If true the OrganizationSwitcher will only render the popover.
991+
* Enables developers to implement a custom dialog.
992+
* @experimental This API is experimental and may change at any moment.
993+
* @default false
994+
*/
995+
__experimental_standalone?: boolean;
975996

976-
__experimental_hideTrigger?: boolean;
977-
__experimental_onActionEnded?: () => void;
997+
/**
998+
* Notifies the caller that it's safe to unmount OrganizationSwitcher.
999+
* It only fires when used in conjunction with `__experimental_standalone`.
1000+
* @experimental This API is experimental and may change at any moment.
1001+
* @default undefined
1002+
*/
1003+
__experimental_onDismiss?: () => void;
9781004
/**
9791005
* By default, users can switch between organization and their personal account.
9801006
* This option controls whether OrganizationSwitcher will include the user's personal account

0 commit comments

Comments
 (0)