@clerk/react 6.6.6 → 6.7.0-canary.v20260518200459

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.
@@ -1,11 +1,10 @@
1
1
  import {
2
- ConfigureSSO,
3
2
  assertSingleChild,
4
3
  normalizeWithDefaultValue,
5
4
  safeExecute,
6
5
  useAuth,
7
6
  withClerk
8
- } from "./chunk-GRZDFHDQ.mjs";
7
+ } from "./chunk-XDQVAV6K.mjs";
9
8
  import "./chunk-RQWALB2R.mjs";
10
9
  import "./chunk-E5QRIS4Z.mjs";
11
10
 
@@ -152,7 +151,6 @@ import {
152
151
  export {
153
152
  CheckoutButton,
154
153
  __experimental_CheckoutProvider as CheckoutProvider,
155
- ConfigureSSO,
156
154
  __experimental_PaymentElement as PaymentElement,
157
155
  __experimental_PaymentElementProvider as PaymentElementProvider,
158
156
  PlanDetailsButton,
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/components/CheckoutButton.tsx","../src/components/PlanDetailsButton.tsx","../src/components/SubscriptionDetailsButton.tsx","../src/experimental.ts"],"sourcesContent":["import type { __experimental_CheckoutButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useAuth } from '../hooks';\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Checkout drawer when clicked. Render only when the user is signed in (e.g., wrap with `<Show when=\"signed-in\">`).\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { CheckoutButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Checkout\" text\n * function BasicCheckout() {\n * return (\n * <Show when=\"signed-in\">\n * <CheckoutButton planId=\"plan_123\" />\n * </Show>\n * );\n * }\n *\n * // Custom button with organization subscription\n * function OrganizationCheckout() {\n * return (\n * <Show when=\"signed-in\">\n * <CheckoutButton\n * planId=\"plan_123\"\n * planPeriod=\"month\"\n * for=\"organization\"\n * onSubscriptionComplete={() => console.log('Subscription completed!')}\n * >\n * <button className=\"custom-button\">Subscribe Now</button>\n * </CheckoutButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @throws {Error} When rendered while the user is signed out\n * @throws {Error} When `for=\"organization\"` is used without an active organization context\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const CheckoutButton = withClerk(\n ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<__experimental_CheckoutButtonProps>>) => {\n const {\n planId,\n planPeriod,\n for: _for,\n onSubscriptionComplete,\n newSubscriptionRedirectUrl,\n checkoutProps,\n getContainer,\n component,\n ...rest\n } = props;\n\n const { userId, orgId } = useAuth();\n\n if (userId === null) {\n throw new Error(\n 'Clerk: Ensure that `<CheckoutButton />` is rendered only when the user is signed in (wrap with `<Show when=\"signed-in\">` or guard with `useAuth()`).',\n );\n }\n\n if (orgId === null && _for === 'organization') {\n throw new Error(\n 'Clerk: Wrap `<CheckoutButton for=\"organization\" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object',\n );\n }\n\n children = normalizeWithDefaultValue(children, 'Checkout');\n const child = assertSingleChild(children)('CheckoutButton');\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openCheckout({\n planId,\n planPeriod,\n for: _for,\n onSubscriptionComplete,\n newSubscriptionRedirectUrl,\n ...checkoutProps,\n });\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'CheckoutButton', renderWhileLoading: true },\n);\n","import type { __experimental_PlanDetailsButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Plan Details drawer when clicked. This component is part of\n * Clerk's Billing feature which is available under a public beta.\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { PlanDetailsButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Plan details\" text\n * function BasicPlanDetails() {\n * return <PlanDetailsButton planId=\"plan_123\" />;\n * }\n *\n * // Custom button with custom text\n * function CustomPlanDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <PlanDetailsButton planId=\"plan_123\">\n * <button>View Plan Details</button>\n * </PlanDetailsButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const PlanDetailsButton = withClerk(\n ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<__experimental_PlanDetailsButtonProps>>) => {\n const { plan, planId, initialPlanPeriod, planDetailsProps, getContainer, component, ...rest } = props;\n\n children = normalizeWithDefaultValue(children, 'Plan details');\n const child = assertSingleChild(children)('PlanDetailsButton');\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openPlanDetails({\n plan,\n planId,\n initialPlanPeriod,\n ...planDetailsProps,\n } as __experimental_PlanDetailsButtonProps);\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'PlanDetailsButton', renderWhileLoading: true },\n);\n","import type { __experimental_SubscriptionDetailsButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useAuth } from '../hooks';\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Subscription Details drawer when clicked. Render only when the user is signed in (e.g., wrap with `<Show when=\"signed-in\">`).\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { SubscriptionDetailsButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Subscription details\" text\n * function BasicSubscriptionDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <SubscriptionDetailsButton />\n * </Show>\n * );\n * }\n *\n * // Custom button with Organization Subscription\n * function OrganizationSubscriptionDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <SubscriptionDetailsButton\n * for=\"organization\"\n * onSubscriptionCancel={() => console.log('Subscription canceled')}\n * >\n * <button>View Organization Subscription</button>\n * </SubscriptionDetailsButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @throws {Error} When rendered while the user is signed out\n * @throws {Error} When `for=\"organization\"` is used without an Active Organization context\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const SubscriptionDetailsButton = withClerk(\n ({\n clerk,\n children,\n ...props\n }: WithClerkProp<React.PropsWithChildren<__experimental_SubscriptionDetailsButtonProps>>) => {\n const { for: _for, subscriptionDetailsProps, onSubscriptionCancel, getContainer, component, ...rest } = props;\n children = normalizeWithDefaultValue(children, 'Subscription details');\n const child = assertSingleChild(children)('SubscriptionDetailsButton');\n\n const { userId, orgId } = useAuth();\n\n if (userId === null) {\n throw new Error(\n 'Clerk: Ensure that `<SubscriptionDetailsButton />` is rendered only when the user is signed in (wrap with `<Show when=\"signed-in\">` or guard with `useAuth()`).',\n );\n }\n\n if (orgId === null && _for === 'organization') {\n throw new Error(\n 'Clerk: Wrap `<SubscriptionDetailsButton for=\"organization\" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object',\n );\n }\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openSubscriptionDetails({\n for: _for,\n onSubscriptionCancel,\n ...subscriptionDetailsProps,\n });\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'SubscriptionDetailsButton', renderWhileLoading: true },\n);\n","export { CheckoutButton } from './components/CheckoutButton';\nexport { PlanDetailsButton } from './components/PlanDetailsButton';\nexport { SubscriptionDetailsButton } from './components/SubscriptionDetailsButton';\n\n/**\n * @experimental\n * This component and its prop types are unstable and may change in future releases.\n */\nexport { ConfigureSSO } from './components/uiComponents';\n\nexport type {\n __experimental_CheckoutButtonProps as CheckoutButtonProps,\n __experimental_SubscriptionDetailsButtonProps as SubscriptionDetailsButtonProps,\n __experimental_PlanDetailsButtonProps as PlanDetailsButtonProps,\n /**\n * @experimental\n * This type is unstable and may change in future releases.\n */\n __experimental_ConfigureSSOProps as ConfigureSSOProps,\n} from '@clerk/shared/types';\n\nexport {\n __experimental_PaymentElementProvider as PaymentElementProvider,\n __experimental_usePaymentElement as usePaymentElement,\n __experimental_PaymentElement as PaymentElement,\n __experimental_usePaymentAttempts as usePaymentAttempts,\n __experimental_useStatements as useStatements,\n __experimental_usePaymentMethods as usePaymentMethods,\n __experimental_usePlans as usePlans,\n __experimental_useSubscription as useSubscription,\n __experimental_CheckoutProvider as CheckoutProvider,\n __experimental_useCheckout as useCheckout,\n} from '@clerk/shared/react';\n"],"mappings":";;;;;;;;;;;;AACA,OAAO,WAAW;AA8CX,IAAM,iBAAiB;AAAA,EAC5B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AI,SAAS,OAAO,UAAU,YAAY,WAAW,OAAO;AAC1D,cAAM,YAAY,MAAM,MAAM,OAAO,EAAE,CAAC;AAAA,MAC1C;AACA,aAAO,aAAa;AAAA,IACtB;AAEA,UAAM,aAAa,EAAE,GAAG,MAAM,SAAS,yBAAyB;AAChE,WAAOC,OAAM,aAAa,OAAsC,UAAU;AAAA,EAC5E;AAAA,EACA,EAAE,WAAW,6BAA6B,oBAAoB,KAAK;AACrE;;;ACvEA;AAAA,EAC2C;AAAA,EACL;AAAA,EACH;AAAA,EACI;AAAA,EACL;AAAA,EACI;AAAA,EACT;AAAA,EACO;AAAA,EACC;AAAA,EACL;AAAA,OACzB;","names":["React","React","React","React"]}
1
+ {"version":3,"sources":["../src/components/CheckoutButton.tsx","../src/components/PlanDetailsButton.tsx","../src/components/SubscriptionDetailsButton.tsx","../src/experimental.ts"],"sourcesContent":["import type { __experimental_CheckoutButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useAuth } from '../hooks';\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Checkout drawer when clicked. Render only when the user is signed in (e.g., wrap with `<Show when=\"signed-in\">`).\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { CheckoutButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Checkout\" text\n * function BasicCheckout() {\n * return (\n * <Show when=\"signed-in\">\n * <CheckoutButton planId=\"plan_123\" />\n * </Show>\n * );\n * }\n *\n * // Custom button with organization subscription\n * function OrganizationCheckout() {\n * return (\n * <Show when=\"signed-in\">\n * <CheckoutButton\n * planId=\"plan_123\"\n * planPeriod=\"month\"\n * for=\"organization\"\n * onSubscriptionComplete={() => console.log('Subscription completed!')}\n * >\n * <button className=\"custom-button\">Subscribe Now</button>\n * </CheckoutButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @throws {Error} When rendered while the user is signed out\n * @throws {Error} When `for=\"organization\"` is used without an active organization context\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const CheckoutButton = withClerk(\n ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<__experimental_CheckoutButtonProps>>) => {\n const {\n planId,\n planPeriod,\n for: _for,\n onSubscriptionComplete,\n newSubscriptionRedirectUrl,\n checkoutProps,\n getContainer,\n component,\n ...rest\n } = props;\n\n const { userId, orgId } = useAuth();\n\n if (userId === null) {\n throw new Error(\n 'Clerk: Ensure that `<CheckoutButton />` is rendered only when the user is signed in (wrap with `<Show when=\"signed-in\">` or guard with `useAuth()`).',\n );\n }\n\n if (orgId === null && _for === 'organization') {\n throw new Error(\n 'Clerk: Wrap `<CheckoutButton for=\"organization\" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object',\n );\n }\n\n children = normalizeWithDefaultValue(children, 'Checkout');\n const child = assertSingleChild(children)('CheckoutButton');\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openCheckout({\n planId,\n planPeriod,\n for: _for,\n onSubscriptionComplete,\n newSubscriptionRedirectUrl,\n ...checkoutProps,\n });\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'CheckoutButton', renderWhileLoading: true },\n);\n","import type { __experimental_PlanDetailsButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Plan Details drawer when clicked. This component is part of\n * Clerk's Billing feature which is available under a public beta.\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { PlanDetailsButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Plan details\" text\n * function BasicPlanDetails() {\n * return <PlanDetailsButton planId=\"plan_123\" />;\n * }\n *\n * // Custom button with custom text\n * function CustomPlanDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <PlanDetailsButton planId=\"plan_123\">\n * <button>View Plan Details</button>\n * </PlanDetailsButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const PlanDetailsButton = withClerk(\n ({ clerk, children, ...props }: WithClerkProp<React.PropsWithChildren<__experimental_PlanDetailsButtonProps>>) => {\n const { plan, planId, initialPlanPeriod, planDetailsProps, getContainer, component, ...rest } = props;\n\n children = normalizeWithDefaultValue(children, 'Plan details');\n const child = assertSingleChild(children)('PlanDetailsButton');\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openPlanDetails({\n plan,\n planId,\n initialPlanPeriod,\n ...planDetailsProps,\n } as __experimental_PlanDetailsButtonProps);\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'PlanDetailsButton', renderWhileLoading: true },\n);\n","import type { __experimental_SubscriptionDetailsButtonProps } from '@clerk/shared/types';\nimport React from 'react';\n\nimport { useAuth } from '../hooks';\nimport type { WithClerkProp } from '../types';\nimport { assertSingleChild, normalizeWithDefaultValue, safeExecute } from '../utils';\nimport { withClerk } from './withClerk';\n\n/**\n * A button component that opens the Clerk Subscription Details drawer when clicked. Render only when the user is signed in (e.g., wrap with `<Show when=\"signed-in\">`).\n *\n * @example\n * ```tsx\n * import { Show } from '@clerk/react';\n * import { SubscriptionDetailsButton } from '@clerk/react/experimental';\n *\n * // Basic usage with default \"Subscription details\" text\n * function BasicSubscriptionDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <SubscriptionDetailsButton />\n * </Show>\n * );\n * }\n *\n * // Custom button with Organization Subscription\n * function OrganizationSubscriptionDetails() {\n * return (\n * <Show when=\"signed-in\">\n * <SubscriptionDetailsButton\n * for=\"organization\"\n * onSubscriptionCancel={() => console.log('Subscription canceled')}\n * >\n * <button>View Organization Subscription</button>\n * </SubscriptionDetailsButton>\n * </Show>\n * );\n * }\n * ```\n *\n * @throws {Error} When rendered while the user is signed out\n * @throws {Error} When `for=\"organization\"` is used without an Active Organization context\n *\n * @experimental This is an experimental API for the Billing feature that is available under a public beta, and the API is subject to change. It is advised to [pin](https://clerk.com/docs/pinning) the SDK version and the clerk-js version to avoid breaking changes.\n */\nexport const SubscriptionDetailsButton = withClerk(\n ({\n clerk,\n children,\n ...props\n }: WithClerkProp<React.PropsWithChildren<__experimental_SubscriptionDetailsButtonProps>>) => {\n const { for: _for, subscriptionDetailsProps, onSubscriptionCancel, getContainer, component, ...rest } = props;\n children = normalizeWithDefaultValue(children, 'Subscription details');\n const child = assertSingleChild(children)('SubscriptionDetailsButton');\n\n const { userId, orgId } = useAuth();\n\n if (userId === null) {\n throw new Error(\n 'Clerk: Ensure that `<SubscriptionDetailsButton />` is rendered only when the user is signed in (wrap with `<Show when=\"signed-in\">` or guard with `useAuth()`).',\n );\n }\n\n if (orgId === null && _for === 'organization') {\n throw new Error(\n 'Clerk: Wrap `<SubscriptionDetailsButton for=\"organization\" />` with a check for an active organization. Retrieve `orgId` from `useAuth()` and confirm it is defined. For SSR, see: https://clerk.com/docs/reference/backend/types/auth-object#how-to-access-the-auth-object',\n );\n }\n\n const clickHandler = () => {\n if (!clerk) {\n return;\n }\n\n return clerk.__internal_openSubscriptionDetails({\n for: _for,\n onSubscriptionCancel,\n ...subscriptionDetailsProps,\n });\n };\n\n const wrappedChildClickHandler: React.MouseEventHandler = async e => {\n if (child && typeof child === 'object' && 'props' in child) {\n await safeExecute(child.props.onClick)(e);\n }\n return clickHandler();\n };\n\n const childProps = { ...rest, onClick: wrappedChildClickHandler };\n return React.cloneElement(child as React.ReactElement<unknown>, childProps);\n },\n { component: 'SubscriptionDetailsButton', renderWhileLoading: true },\n);\n","export { CheckoutButton } from './components/CheckoutButton';\nexport { PlanDetailsButton } from './components/PlanDetailsButton';\nexport { SubscriptionDetailsButton } from './components/SubscriptionDetailsButton';\n\nexport type {\n __experimental_CheckoutButtonProps as CheckoutButtonProps,\n __experimental_SubscriptionDetailsButtonProps as SubscriptionDetailsButtonProps,\n __experimental_PlanDetailsButtonProps as PlanDetailsButtonProps,\n} from '@clerk/shared/types';\n\nexport {\n __experimental_PaymentElementProvider as PaymentElementProvider,\n __experimental_usePaymentElement as usePaymentElement,\n __experimental_PaymentElement as PaymentElement,\n __experimental_usePaymentAttempts as usePaymentAttempts,\n __experimental_useStatements as useStatements,\n __experimental_usePaymentMethods as usePaymentMethods,\n __experimental_usePlans as usePlans,\n __experimental_useSubscription as useSubscription,\n __experimental_CheckoutProvider as CheckoutProvider,\n __experimental_useCheckout as useCheckout,\n} from '@clerk/shared/react';\n"],"mappings":";;;;;;;;;;;AACA,OAAO,WAAW;AA8CX,IAAM,iBAAiB;AAAA,EAC5B,CAAC,EAAE,OAAO,UAAU,GAAG,MAAM,MAAkF;AAC7G,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA,KAAK;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,GAAG;AAAA,IACL,IAAI;AAEJ,UAAM,EAAE,QAAQ,MAAM,IAAI,QAAQ;AAElC,QAAI,WAAW,MAAM;AACnB,YAAM,IAAI;AAAA,QACR;AAAA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ClFA;AAAA,EAC2C;AAAA,EACL;AAAA,EACH;AAAA,EACI;AAAA,EACL;AAAA,EACI;AAAA,EACT;AAAA,EACO;AAAA,EACC;AAAA,EACL;AAAA,OACzB;","names":["React","React","React","React"]}
package/dist/index.d.mts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { Theme, Ui } from '@clerk/ui/internal';
2
- export { A as APIKeys, a as CreateOrganization, G as GoogleOneTap, O as OAuthConsent, b as OrganizationList, c as OrganizationProfile, d as OrganizationSwitcher, P as PricingTable, S as SignIn, e as SignUp, T as TaskChooseOrganization, f as TaskResetPassword, g as TaskSetupMFA, U as UserAvatar, h as UserButton, i as UserProfile, W as Waitlist } from './uiComponents-B-kcRBSr.mjs';
3
- export { A as AuthenticateWithRedirectCallback, C as ClerkDegraded, a as ClerkFailed, b as ClerkLoaded, c as ClerkLoading, R as RedirectToCreateOrganization, d as RedirectToOrganizationProfile, e as RedirectToSignIn, f as RedirectToSignUp, g as RedirectToTasks, h as RedirectToUserProfile, S as Show, i as ShowProps, j as useAuth } from './useAuth-ClszkEhj.mjs';
4
2
  import * as _clerk_shared_types from '@clerk/shared/types';
5
- import { SignInButtonProps, SignOutOptions, SignUpButtonProps, SetActiveNavigate, SignInResource, CreateEmailLinkFlowReturn, SignInStartEmailLinkFlowParams, SignUpResource, StartEmailLinkFlowParams, EmailAddressResource, SignInSignalValue, SignUpSignalValue, WaitlistSignalValue } from '@clerk/shared/types';
3
+ import { Without, APIKeysProps, ConfigureSSOProps, CreateOrganizationProps, OrganizationListProps, OrganizationProfileProps, OrganizationSwitcherProps, SignInProps, SignUpProps, TaskChooseOrganizationProps, TaskResetPasswordProps, TaskSetupMFAProps, UserAvatarProps, UserButtonProps, UserProfileProps, WaitlistProps, SignInButtonProps, SignOutOptions, SignUpButtonProps, SetActiveNavigate, SignInResource, CreateEmailLinkFlowReturn, SignInStartEmailLinkFlowParams, SignUpResource, StartEmailLinkFlowParams, EmailAddressResource, SignInSignalValue, SignUpSignalValue, WaitlistSignalValue } from '@clerk/shared/types';
6
4
  export { BrowserClerk, BrowserClerkConstructor, ClerkProp, HeadlessBrowserClerk, HeadlessBrowserClerkConstructor, IsomorphicClerkOptions } from '@clerk/shared/types';
7
- import React, { ReactNode } from 'react';
8
- import { WithClerkProp, SignInWithMetamaskButtonProps, ClerkProviderProps } from './types.mjs';
5
+ import React, { ReactNode, PropsWithChildren } from 'react';
6
+ import { WithClerkProp, OrganizationProfilePageProps, OrganizationProfileLinkProps, UserProfilePageProps, UserProfileLinkProps, UserButtonActionProps, UserButtonLinkProps, SignInWithMetamaskButtonProps, ClerkProviderProps } from './types.mjs';
7
+ export { A as AuthenticateWithRedirectCallback, C as ClerkDegraded, a as ClerkFailed, b as ClerkLoaded, c as ClerkLoading, R as RedirectToCreateOrganization, d as RedirectToOrganizationProfile, e as RedirectToSignIn, f as RedirectToSignUp, g as RedirectToTasks, h as RedirectToUserProfile, S as Show, i as ShowProps, j as useAuth } from './useAuth-ClszkEhj.mjs';
9
8
  export { UNSAFE_PortalProvider, __experimental_CheckoutProvider, __experimental_PaymentElement, __experimental_PaymentElementProvider, __experimental_useCheckout, __experimental_usePaymentElement, useAPIKeys, useClerk, useOAuthConsent, useOrganization, useOrganizationCreationDefaults, useOrganizationList, useReverification, useSession, useSessionList, useUser } from '@clerk/shared/react';
10
9
  export { getToken } from '@clerk/shared/getToken';
11
10
  import '@clerk/shared/ui';
@@ -21,6 +20,167 @@ declare global {
21
20
  }
22
21
  }
23
22
 
23
+ type FallbackProp = {
24
+ /**
25
+ * An optional element to render while the component is mounting.
26
+ */
27
+ fallback?: ReactNode;
28
+ };
29
+ type UserProfileExportType = typeof _UserProfile & {
30
+ Page: typeof UserProfilePage;
31
+ Link: typeof UserProfileLink;
32
+ };
33
+ type UserButtonExportType = typeof _UserButton & {
34
+ UserProfilePage: typeof UserProfilePage;
35
+ UserProfileLink: typeof UserProfileLink;
36
+ MenuItems: typeof MenuItems;
37
+ Action: typeof MenuAction;
38
+ Link: typeof MenuLink;
39
+ /**
40
+ * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering
41
+ * of the `<UserButton />` without affecting its configuration or any custom pages that could be mounted
42
+ * @experimental This API is experimental and may change at any moment.
43
+ */
44
+ __experimental_Outlet: typeof UserButtonOutlet;
45
+ };
46
+ type UserButtonPropsWithoutCustomPages = Without<UserButtonProps, 'userProfileProps' | '__experimental_asStandalone'> & {
47
+ userProfileProps?: Pick<UserProfileProps, 'additionalOAuthScopes' | 'appearance' | 'apiKeysProps'>;
48
+ /**
49
+ * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
50
+ *
51
+ * @experimental This API is experimental and may change at any moment.
52
+ * @default undefined
53
+ */
54
+ __experimental_asProvider?: boolean;
55
+ };
56
+ type OrganizationProfileExportType = typeof _OrganizationProfile & {
57
+ Page: typeof OrganizationProfilePage;
58
+ Link: typeof OrganizationProfileLink;
59
+ };
60
+ type OrganizationSwitcherExportType = typeof _OrganizationSwitcher & {
61
+ OrganizationProfilePage: typeof OrganizationProfilePage;
62
+ OrganizationProfileLink: typeof OrganizationProfileLink;
63
+ /**
64
+ * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering
65
+ * of the `<OrganizationSwitcher />` without affecting its configuration or any custom pages that could be mounted
66
+ *
67
+ * @experimental This API is experimental and may change at any moment.
68
+ */
69
+ __experimental_Outlet: typeof OrganizationSwitcherOutlet;
70
+ };
71
+ type OrganizationSwitcherPropsWithoutCustomPages = Without<OrganizationSwitcherProps, 'organizationProfileProps' | '__experimental_asStandalone'> & {
72
+ organizationProfileProps?: Pick<OrganizationProfileProps, 'appearance'>;
73
+ /**
74
+ * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
75
+ *
76
+ * @experimental This API is experimental and may change at any moment.
77
+ * @default undefined
78
+ */
79
+ __experimental_asProvider?: boolean;
80
+ };
81
+ declare const SignIn: {
82
+ (props: Without<WithClerkProp<SignInProps & FallbackProp>, "clerk">): React.JSX.Element | null;
83
+ displayName: string;
84
+ };
85
+ declare const SignUp: {
86
+ (props: Without<WithClerkProp<SignUpProps & FallbackProp>, "clerk">): React.JSX.Element | null;
87
+ displayName: string;
88
+ };
89
+ declare function UserProfilePage({ children }: PropsWithChildren<UserProfilePageProps>): React.JSX.Element;
90
+ declare function UserProfileLink({ children }: PropsWithChildren<UserProfileLinkProps>): React.JSX.Element;
91
+ declare const _UserProfile: {
92
+ (props: Without<WithClerkProp<PropsWithChildren<Without<UserProfileProps, "customPages">> & FallbackProp>, "clerk">): React.JSX.Element | null;
93
+ displayName: string;
94
+ };
95
+ declare const UserProfile: UserProfileExportType;
96
+ declare const _UserButton: {
97
+ (props: Without<WithClerkProp<PropsWithChildren<UserButtonPropsWithoutCustomPages> & FallbackProp>, "clerk">): React.JSX.Element | null;
98
+ displayName: string;
99
+ };
100
+ declare function MenuItems({ children }: PropsWithChildren): React.JSX.Element;
101
+ declare function MenuAction({ children }: PropsWithChildren<UserButtonActionProps>): React.JSX.Element;
102
+ declare function MenuLink({ children }: PropsWithChildren<UserButtonLinkProps>): React.JSX.Element;
103
+ declare function UserButtonOutlet(outletProps: Without<UserButtonProps, 'userProfileProps'>): React.JSX.Element;
104
+ declare const UserButton: UserButtonExportType;
105
+ declare function OrganizationProfilePage({ children }: PropsWithChildren<OrganizationProfilePageProps>): React.JSX.Element;
106
+ declare function OrganizationProfileLink({ children }: PropsWithChildren<OrganizationProfileLinkProps>): React.JSX.Element;
107
+ declare const _OrganizationProfile: {
108
+ (props: Without<WithClerkProp<PropsWithChildren<Without<OrganizationProfileProps, "customPages">> & FallbackProp>, "clerk">): React.JSX.Element | null;
109
+ displayName: string;
110
+ };
111
+ declare const OrganizationProfile: OrganizationProfileExportType;
112
+ declare const CreateOrganization: {
113
+ (props: Without<WithClerkProp<CreateOrganizationProps & FallbackProp>, "clerk">): React.JSX.Element | null;
114
+ displayName: string;
115
+ };
116
+ declare const _OrganizationSwitcher: {
117
+ (props: Without<WithClerkProp<PropsWithChildren<OrganizationSwitcherPropsWithoutCustomPages> & FallbackProp>, "clerk">): React.JSX.Element | null;
118
+ displayName: string;
119
+ };
120
+ declare function OrganizationSwitcherOutlet(outletProps: Without<OrganizationSwitcherProps, 'organizationProfileProps'>): React.JSX.Element;
121
+ declare const OrganizationSwitcher: OrganizationSwitcherExportType;
122
+ declare const OrganizationList: {
123
+ (props: Without<WithClerkProp<OrganizationListProps & FallbackProp>, "clerk">): React.JSX.Element | null;
124
+ displayName: string;
125
+ };
126
+ declare const GoogleOneTap: {
127
+ (props: Without<WithClerkProp<_clerk_shared_types.SignInForceRedirectUrl & _clerk_shared_types.SignUpForceRedirectUrl & {
128
+ cancelOnTapOutside?: boolean;
129
+ itpSupport?: boolean;
130
+ fedCmSupport?: boolean;
131
+ appearance?: _clerk_shared_types.ClerkAppearanceTheme;
132
+ } & FallbackProp>, "clerk">): React.JSX.Element | null;
133
+ displayName: string;
134
+ };
135
+ declare const Waitlist: {
136
+ (props: Without<WithClerkProp<WaitlistProps & FallbackProp>, "clerk">): React.JSX.Element | null;
137
+ displayName: string;
138
+ };
139
+ declare const PricingTable: {
140
+ (props: Without<WithClerkProp<{
141
+ highlightedPlan?: string;
142
+ for?: _clerk_shared_types.ForPayerType;
143
+ appearance?: _clerk_shared_types.ClerkAppearanceTheme;
144
+ checkoutProps?: Pick<_clerk_shared_types.__internal_CheckoutProps, "appearance">;
145
+ } & {
146
+ ctaPosition?: "top" | "bottom";
147
+ collapseFeatures?: boolean;
148
+ newSubscriptionRedirectUrl?: string;
149
+ } & FallbackProp>, "clerk">): React.JSX.Element | null;
150
+ displayName: string;
151
+ };
152
+ /**
153
+ * @experimental This component is in early access and may change in future releases.
154
+ */
155
+ declare const APIKeys: {
156
+ (props: Without<WithClerkProp<APIKeysProps & FallbackProp>, "clerk">): React.JSX.Element | null;
157
+ displayName: string;
158
+ };
159
+ declare const ConfigureSSO: {
160
+ (props: Without<WithClerkProp<ConfigureSSOProps & FallbackProp>, "clerk">): React.JSX.Element | null;
161
+ displayName: string;
162
+ };
163
+ declare const OAuthConsent: {
164
+ (props: Without<WithClerkProp<_clerk_shared_types.OAuthConsentProps & FallbackProp>, "clerk">): React.JSX.Element | null;
165
+ displayName: string;
166
+ };
167
+ declare const UserAvatar: {
168
+ (props: Without<WithClerkProp<UserAvatarProps & FallbackProp>, "clerk">): React.JSX.Element | null;
169
+ displayName: string;
170
+ };
171
+ declare const TaskChooseOrganization: {
172
+ (props: Without<WithClerkProp<TaskChooseOrganizationProps & FallbackProp>, "clerk">): React.JSX.Element | null;
173
+ displayName: string;
174
+ };
175
+ declare const TaskResetPassword: {
176
+ (props: Without<WithClerkProp<TaskResetPasswordProps & FallbackProp>, "clerk">): React.JSX.Element | null;
177
+ displayName: string;
178
+ };
179
+ declare const TaskSetupMFA: {
180
+ (props: Without<WithClerkProp<TaskSetupMFAProps & FallbackProp>, "clerk">): React.JSX.Element | null;
181
+ displayName: string;
182
+ };
183
+
24
184
  declare const SignInButton: {
25
185
  (props: _clerk_shared_types.Without<WithClerkProp<React.PropsWithChildren<SignInButtonProps>>, "clerk">): React.JSX.Element | null;
26
186
  displayName: string;
@@ -160,4 +320,4 @@ declare const useSignUp: () => SignUpSignalValue;
160
320
  */
161
321
  declare function useWaitlist(): WaitlistSignalValue;
162
322
 
163
- export { ClerkProvider, ClerkProviderProps, HandleSSOCallback, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUpButton, useEmailLink, useSignIn, useSignUp, useWaitlist };
323
+ export { APIKeys, ClerkProvider, ClerkProviderProps, ConfigureSSO, CreateOrganization, GoogleOneTap, HandleSSOCallback, OAuthConsent, OrganizationList, OrganizationProfile, OrganizationSwitcher, PricingTable, SignIn, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUp, SignUpButton, TaskChooseOrganization, TaskResetPassword, TaskSetupMFA, UserAvatar, UserButton, UserProfile, Waitlist, useEmailLink, useSignIn, useSignUp, useWaitlist };
package/dist/index.d.ts CHANGED
@@ -1,11 +1,10 @@
1
1
  import { Theme, Ui } from '@clerk/ui/internal';
2
- export { A as APIKeys, a as CreateOrganization, G as GoogleOneTap, O as OAuthConsent, b as OrganizationList, c as OrganizationProfile, d as OrganizationSwitcher, P as PricingTable, S as SignIn, e as SignUp, T as TaskChooseOrganization, f as TaskResetPassword, g as TaskSetupMFA, U as UserAvatar, h as UserButton, i as UserProfile, W as Waitlist } from './uiComponents-CfPslVPx.js';
3
- export { A as AuthenticateWithRedirectCallback, C as ClerkDegraded, a as ClerkFailed, b as ClerkLoaded, c as ClerkLoading, R as RedirectToCreateOrganization, d as RedirectToOrganizationProfile, e as RedirectToSignIn, f as RedirectToSignUp, g as RedirectToTasks, h as RedirectToUserProfile, S as Show, i as ShowProps, j as useAuth } from './useAuth-DFYP0feq.js';
4
2
  import * as _clerk_shared_types from '@clerk/shared/types';
5
- import { SignInButtonProps, SignOutOptions, SignUpButtonProps, SetActiveNavigate, SignInResource, CreateEmailLinkFlowReturn, SignInStartEmailLinkFlowParams, SignUpResource, StartEmailLinkFlowParams, EmailAddressResource, SignInSignalValue, SignUpSignalValue, WaitlistSignalValue } from '@clerk/shared/types';
3
+ import { Without, APIKeysProps, ConfigureSSOProps, CreateOrganizationProps, OrganizationListProps, OrganizationProfileProps, OrganizationSwitcherProps, SignInProps, SignUpProps, TaskChooseOrganizationProps, TaskResetPasswordProps, TaskSetupMFAProps, UserAvatarProps, UserButtonProps, UserProfileProps, WaitlistProps, SignInButtonProps, SignOutOptions, SignUpButtonProps, SetActiveNavigate, SignInResource, CreateEmailLinkFlowReturn, SignInStartEmailLinkFlowParams, SignUpResource, StartEmailLinkFlowParams, EmailAddressResource, SignInSignalValue, SignUpSignalValue, WaitlistSignalValue } from '@clerk/shared/types';
6
4
  export { BrowserClerk, BrowserClerkConstructor, ClerkProp, HeadlessBrowserClerk, HeadlessBrowserClerkConstructor, IsomorphicClerkOptions } from '@clerk/shared/types';
7
- import React, { ReactNode } from 'react';
8
- import { WithClerkProp, SignInWithMetamaskButtonProps, ClerkProviderProps } from './types.js';
5
+ import React, { ReactNode, PropsWithChildren } from 'react';
6
+ import { WithClerkProp, OrganizationProfilePageProps, OrganizationProfileLinkProps, UserProfilePageProps, UserProfileLinkProps, UserButtonActionProps, UserButtonLinkProps, SignInWithMetamaskButtonProps, ClerkProviderProps } from './types.js';
7
+ export { A as AuthenticateWithRedirectCallback, C as ClerkDegraded, a as ClerkFailed, b as ClerkLoaded, c as ClerkLoading, R as RedirectToCreateOrganization, d as RedirectToOrganizationProfile, e as RedirectToSignIn, f as RedirectToSignUp, g as RedirectToTasks, h as RedirectToUserProfile, S as Show, i as ShowProps, j as useAuth } from './useAuth-DFYP0feq.js';
9
8
  export { UNSAFE_PortalProvider, __experimental_CheckoutProvider, __experimental_PaymentElement, __experimental_PaymentElementProvider, __experimental_useCheckout, __experimental_usePaymentElement, useAPIKeys, useClerk, useOAuthConsent, useOrganization, useOrganizationCreationDefaults, useOrganizationList, useReverification, useSession, useSessionList, useUser } from '@clerk/shared/react';
10
9
  export { getToken } from '@clerk/shared/getToken';
11
10
  import '@clerk/shared/ui';
@@ -21,6 +20,167 @@ declare global {
21
20
  }
22
21
  }
23
22
 
23
+ type FallbackProp = {
24
+ /**
25
+ * An optional element to render while the component is mounting.
26
+ */
27
+ fallback?: ReactNode;
28
+ };
29
+ type UserProfileExportType = typeof _UserProfile & {
30
+ Page: typeof UserProfilePage;
31
+ Link: typeof UserProfileLink;
32
+ };
33
+ type UserButtonExportType = typeof _UserButton & {
34
+ UserProfilePage: typeof UserProfilePage;
35
+ UserProfileLink: typeof UserProfileLink;
36
+ MenuItems: typeof MenuItems;
37
+ Action: typeof MenuAction;
38
+ Link: typeof MenuLink;
39
+ /**
40
+ * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering
41
+ * of the `<UserButton />` without affecting its configuration or any custom pages that could be mounted
42
+ * @experimental This API is experimental and may change at any moment.
43
+ */
44
+ __experimental_Outlet: typeof UserButtonOutlet;
45
+ };
46
+ type UserButtonPropsWithoutCustomPages = Without<UserButtonProps, 'userProfileProps' | '__experimental_asStandalone'> & {
47
+ userProfileProps?: Pick<UserProfileProps, 'additionalOAuthScopes' | 'appearance' | 'apiKeysProps'>;
48
+ /**
49
+ * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
50
+ *
51
+ * @experimental This API is experimental and may change at any moment.
52
+ * @default undefined
53
+ */
54
+ __experimental_asProvider?: boolean;
55
+ };
56
+ type OrganizationProfileExportType = typeof _OrganizationProfile & {
57
+ Page: typeof OrganizationProfilePage;
58
+ Link: typeof OrganizationProfileLink;
59
+ };
60
+ type OrganizationSwitcherExportType = typeof _OrganizationSwitcher & {
61
+ OrganizationProfilePage: typeof OrganizationProfilePage;
62
+ OrganizationProfileLink: typeof OrganizationProfileLink;
63
+ /**
64
+ * The `<Outlet />` component can be used in conjunction with `asProvider` in order to control rendering
65
+ * of the `<OrganizationSwitcher />` without affecting its configuration or any custom pages that could be mounted
66
+ *
67
+ * @experimental This API is experimental and may change at any moment.
68
+ */
69
+ __experimental_Outlet: typeof OrganizationSwitcherOutlet;
70
+ };
71
+ type OrganizationSwitcherPropsWithoutCustomPages = Without<OrganizationSwitcherProps, 'organizationProfileProps' | '__experimental_asStandalone'> & {
72
+ organizationProfileProps?: Pick<OrganizationProfileProps, 'appearance'>;
73
+ /**
74
+ * Adding `asProvider` will defer rendering until the `<Outlet />` component is mounted.
75
+ *
76
+ * @experimental This API is experimental and may change at any moment.
77
+ * @default undefined
78
+ */
79
+ __experimental_asProvider?: boolean;
80
+ };
81
+ declare const SignIn: {
82
+ (props: Without<WithClerkProp<SignInProps & FallbackProp>, "clerk">): React.JSX.Element | null;
83
+ displayName: string;
84
+ };
85
+ declare const SignUp: {
86
+ (props: Without<WithClerkProp<SignUpProps & FallbackProp>, "clerk">): React.JSX.Element | null;
87
+ displayName: string;
88
+ };
89
+ declare function UserProfilePage({ children }: PropsWithChildren<UserProfilePageProps>): React.JSX.Element;
90
+ declare function UserProfileLink({ children }: PropsWithChildren<UserProfileLinkProps>): React.JSX.Element;
91
+ declare const _UserProfile: {
92
+ (props: Without<WithClerkProp<PropsWithChildren<Without<UserProfileProps, "customPages">> & FallbackProp>, "clerk">): React.JSX.Element | null;
93
+ displayName: string;
94
+ };
95
+ declare const UserProfile: UserProfileExportType;
96
+ declare const _UserButton: {
97
+ (props: Without<WithClerkProp<PropsWithChildren<UserButtonPropsWithoutCustomPages> & FallbackProp>, "clerk">): React.JSX.Element | null;
98
+ displayName: string;
99
+ };
100
+ declare function MenuItems({ children }: PropsWithChildren): React.JSX.Element;
101
+ declare function MenuAction({ children }: PropsWithChildren<UserButtonActionProps>): React.JSX.Element;
102
+ declare function MenuLink({ children }: PropsWithChildren<UserButtonLinkProps>): React.JSX.Element;
103
+ declare function UserButtonOutlet(outletProps: Without<UserButtonProps, 'userProfileProps'>): React.JSX.Element;
104
+ declare const UserButton: UserButtonExportType;
105
+ declare function OrganizationProfilePage({ children }: PropsWithChildren<OrganizationProfilePageProps>): React.JSX.Element;
106
+ declare function OrganizationProfileLink({ children }: PropsWithChildren<OrganizationProfileLinkProps>): React.JSX.Element;
107
+ declare const _OrganizationProfile: {
108
+ (props: Without<WithClerkProp<PropsWithChildren<Without<OrganizationProfileProps, "customPages">> & FallbackProp>, "clerk">): React.JSX.Element | null;
109
+ displayName: string;
110
+ };
111
+ declare const OrganizationProfile: OrganizationProfileExportType;
112
+ declare const CreateOrganization: {
113
+ (props: Without<WithClerkProp<CreateOrganizationProps & FallbackProp>, "clerk">): React.JSX.Element | null;
114
+ displayName: string;
115
+ };
116
+ declare const _OrganizationSwitcher: {
117
+ (props: Without<WithClerkProp<PropsWithChildren<OrganizationSwitcherPropsWithoutCustomPages> & FallbackProp>, "clerk">): React.JSX.Element | null;
118
+ displayName: string;
119
+ };
120
+ declare function OrganizationSwitcherOutlet(outletProps: Without<OrganizationSwitcherProps, 'organizationProfileProps'>): React.JSX.Element;
121
+ declare const OrganizationSwitcher: OrganizationSwitcherExportType;
122
+ declare const OrganizationList: {
123
+ (props: Without<WithClerkProp<OrganizationListProps & FallbackProp>, "clerk">): React.JSX.Element | null;
124
+ displayName: string;
125
+ };
126
+ declare const GoogleOneTap: {
127
+ (props: Without<WithClerkProp<_clerk_shared_types.SignInForceRedirectUrl & _clerk_shared_types.SignUpForceRedirectUrl & {
128
+ cancelOnTapOutside?: boolean;
129
+ itpSupport?: boolean;
130
+ fedCmSupport?: boolean;
131
+ appearance?: _clerk_shared_types.ClerkAppearanceTheme;
132
+ } & FallbackProp>, "clerk">): React.JSX.Element | null;
133
+ displayName: string;
134
+ };
135
+ declare const Waitlist: {
136
+ (props: Without<WithClerkProp<WaitlistProps & FallbackProp>, "clerk">): React.JSX.Element | null;
137
+ displayName: string;
138
+ };
139
+ declare const PricingTable: {
140
+ (props: Without<WithClerkProp<{
141
+ highlightedPlan?: string;
142
+ for?: _clerk_shared_types.ForPayerType;
143
+ appearance?: _clerk_shared_types.ClerkAppearanceTheme;
144
+ checkoutProps?: Pick<_clerk_shared_types.__internal_CheckoutProps, "appearance">;
145
+ } & {
146
+ ctaPosition?: "top" | "bottom";
147
+ collapseFeatures?: boolean;
148
+ newSubscriptionRedirectUrl?: string;
149
+ } & FallbackProp>, "clerk">): React.JSX.Element | null;
150
+ displayName: string;
151
+ };
152
+ /**
153
+ * @experimental This component is in early access and may change in future releases.
154
+ */
155
+ declare const APIKeys: {
156
+ (props: Without<WithClerkProp<APIKeysProps & FallbackProp>, "clerk">): React.JSX.Element | null;
157
+ displayName: string;
158
+ };
159
+ declare const ConfigureSSO: {
160
+ (props: Without<WithClerkProp<ConfigureSSOProps & FallbackProp>, "clerk">): React.JSX.Element | null;
161
+ displayName: string;
162
+ };
163
+ declare const OAuthConsent: {
164
+ (props: Without<WithClerkProp<_clerk_shared_types.OAuthConsentProps & FallbackProp>, "clerk">): React.JSX.Element | null;
165
+ displayName: string;
166
+ };
167
+ declare const UserAvatar: {
168
+ (props: Without<WithClerkProp<UserAvatarProps & FallbackProp>, "clerk">): React.JSX.Element | null;
169
+ displayName: string;
170
+ };
171
+ declare const TaskChooseOrganization: {
172
+ (props: Without<WithClerkProp<TaskChooseOrganizationProps & FallbackProp>, "clerk">): React.JSX.Element | null;
173
+ displayName: string;
174
+ };
175
+ declare const TaskResetPassword: {
176
+ (props: Without<WithClerkProp<TaskResetPasswordProps & FallbackProp>, "clerk">): React.JSX.Element | null;
177
+ displayName: string;
178
+ };
179
+ declare const TaskSetupMFA: {
180
+ (props: Without<WithClerkProp<TaskSetupMFAProps & FallbackProp>, "clerk">): React.JSX.Element | null;
181
+ displayName: string;
182
+ };
183
+
24
184
  declare const SignInButton: {
25
185
  (props: _clerk_shared_types.Without<WithClerkProp<React.PropsWithChildren<SignInButtonProps>>, "clerk">): React.JSX.Element | null;
26
186
  displayName: string;
@@ -160,4 +320,4 @@ declare const useSignUp: () => SignUpSignalValue;
160
320
  */
161
321
  declare function useWaitlist(): WaitlistSignalValue;
162
322
 
163
- export { ClerkProvider, ClerkProviderProps, HandleSSOCallback, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUpButton, useEmailLink, useSignIn, useSignUp, useWaitlist };
323
+ export { APIKeys, ClerkProvider, ClerkProviderProps, ConfigureSSO, CreateOrganization, GoogleOneTap, HandleSSOCallback, OAuthConsent, OrganizationList, OrganizationProfile, OrganizationSwitcher, PricingTable, SignIn, SignInButton, SignInWithMetamaskButton, SignOutButton, SignUp, SignUpButton, TaskChooseOrganization, TaskResetPassword, TaskSetupMFA, UserAvatar, UserButton, UserProfile, Waitlist, useEmailLink, useSignIn, useSignUp, useWaitlist };
package/dist/index.js CHANGED
@@ -45,6 +45,7 @@ __export(src_exports, {
45
45
  ClerkLoaded: () => ClerkLoaded,
46
46
  ClerkLoading: () => ClerkLoading,
47
47
  ClerkProvider: () => ClerkProvider,
48
+ ConfigureSSO: () => ConfigureSSO,
48
49
  CreateOrganization: () => CreateOrganization,
49
50
  GoogleOneTap: () => GoogleOneTap,
50
51
  HandleSSOCallback: () => HandleSSOCallback,
@@ -1160,8 +1161,8 @@ var ConfigureSSO = withClerk(
1160
1161
  ClerkHostRenderer,
1161
1162
  {
1162
1163
  component,
1163
- mount: clerk.__experimental_mountConfigureSSO,
1164
- unmount: clerk.__experimental_unmountConfigureSSO,
1164
+ mount: clerk.mountConfigureSSO,
1165
+ unmount: clerk.unmountConfigureSSO,
1165
1166
  updateProps: clerk.__internal_updateProps,
1166
1167
  props,
1167
1168
  rootProps: rendererRootProps
@@ -2354,7 +2355,7 @@ if (typeof globalThis.__BUILD_DISABLE_RHC__ === "undefined") {
2354
2355
  }
2355
2356
  var SDK_METADATA = {
2356
2357
  name: "@clerk/react",
2357
- version: "6.6.6",
2358
+ version: "6.7.0-canary.v20260518200459",
2358
2359
  environment: process.env.NODE_ENV
2359
2360
  };
2360
2361
  var _status, _domain, _proxyUrl, _publishableKey, _eventBus, _stateProxy, _instance, _IsomorphicClerk_instances, waitForClerkJS_fn;
@@ -2669,7 +2670,7 @@ var _IsomorphicClerk = class _IsomorphicClerk {
2669
2670
  clerkjs.mountAPIKeys(node, props);
2670
2671
  });
2671
2672
  this.premountConfigureSSONodes.forEach((props, node) => {
2672
- clerkjs.__experimental_mountConfigureSSO(node, props);
2673
+ clerkjs.mountConfigureSSO(node, props);
2673
2674
  });
2674
2675
  this.premountOAuthConsentNodes.forEach((props, node) => {
2675
2676
  clerkjs.__internal_mountOAuthConsent(node, props);
@@ -3056,20 +3057,32 @@ var _IsomorphicClerk = class _IsomorphicClerk {
3056
3057
  this.premountAPIKeysNodes.delete(node);
3057
3058
  }
3058
3059
  };
3059
- this.__experimental_mountConfigureSSO = (node, props) => {
3060
+ this.mountConfigureSSO = (node, props) => {
3060
3061
  if (this.clerkjs && this.loaded) {
3061
- this.clerkjs.__experimental_mountConfigureSSO(node, props);
3062
+ this.clerkjs.mountConfigureSSO(node, props);
3062
3063
  } else {
3063
3064
  this.premountConfigureSSONodes.set(node, props);
3064
3065
  }
3065
3066
  };
3066
- this.__experimental_unmountConfigureSSO = (node) => {
3067
+ this.unmountConfigureSSO = (node) => {
3067
3068
  if (this.clerkjs && this.loaded) {
3068
- this.clerkjs.__experimental_unmountConfigureSSO(node);
3069
+ this.clerkjs.unmountConfigureSSO(node);
3069
3070
  } else {
3070
3071
  this.premountConfigureSSONodes.delete(node);
3071
3072
  }
3072
3073
  };
3074
+ /**
3075
+ * @deprecated Use `mountConfigureSSO` instead.
3076
+ */
3077
+ this.__experimental_mountConfigureSSO = (node, props) => {
3078
+ this.mountConfigureSSO(node, props);
3079
+ };
3080
+ /**
3081
+ * @deprecated Use `unmountConfigureSSO` instead.
3082
+ */
3083
+ this.__experimental_unmountConfigureSSO = (node) => {
3084
+ this.unmountConfigureSSO(node);
3085
+ };
3073
3086
  this.__internal_mountOAuthConsent = (node, props) => {
3074
3087
  if (this.clerkjs && this.loaded) {
3075
3088
  this.clerkjs.__internal_mountOAuthConsent(node, props);
@@ -3818,6 +3831,7 @@ setErrorThrowerOptions({ packageName: "@clerk/react" });
3818
3831
  ClerkLoaded,
3819
3832
  ClerkLoading,
3820
3833
  ClerkProvider,
3834
+ ConfigureSSO,
3821
3835
  CreateOrganization,
3822
3836
  GoogleOneTap,
3823
3837
  HandleSSOCallback,