@clerk/expo-native-components 0.0.0-stage → 0.0.1

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 (108) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +106 -2
  3. package/android/build.gradle +152 -0
  4. package/android/src/main/AndroidManifest.xml +4 -0
  5. package/android/src/main/java/expo/modules/clerk/ClerkAuthViewModule.kt +241 -0
  6. package/android/src/main/java/expo/modules/clerk/ClerkComposeNativeViewHost.kt +148 -0
  7. package/android/src/main/java/expo/modules/clerk/ClerkExpoModule.kt +1077 -0
  8. package/android/src/main/java/expo/modules/clerk/ClerkUserButtonViewModule.kt +156 -0
  9. package/android/src/main/java/expo/modules/clerk/ClerkUserProfileCustomPageState.kt +120 -0
  10. package/android/src/main/java/expo/modules/clerk/ClerkUserProfileViewModule.kt +315 -0
  11. package/android/src/test/java/expo/modules/clerk/BiometricCredentialBridgeTest.kt +326 -0
  12. package/android/src/test/java/expo/modules/clerk/ClerkUserProfileCustomPageStateTest.kt +163 -0
  13. package/app.plugin.d.ts +5 -0
  14. package/app.plugin.js +333 -0
  15. package/dist/AuthView.d.ts +35 -0
  16. package/dist/AuthView.d.ts.map +1 -0
  17. package/dist/AuthView.js +79 -0
  18. package/dist/AuthView.js.map +1 -0
  19. package/dist/AuthView.types.d.ts +62 -0
  20. package/dist/AuthView.types.d.ts.map +1 -0
  21. package/dist/AuthView.types.js +0 -0
  22. package/dist/EmbeddedNavigation.types.d.ts +24 -0
  23. package/dist/EmbeddedNavigation.types.d.ts.map +1 -0
  24. package/dist/EmbeddedNavigation.types.js +0 -0
  25. package/dist/UserButton.d.ts +38 -0
  26. package/dist/UserButton.d.ts.map +1 -0
  27. package/dist/UserButton.js +68 -0
  28. package/dist/UserButton.js.map +1 -0
  29. package/dist/UserProfileCustomPages.d.ts +81 -0
  30. package/dist/UserProfileCustomPages.d.ts.map +1 -0
  31. package/dist/UserProfileCustomPages.js +140 -0
  32. package/dist/UserProfileCustomPages.js.map +1 -0
  33. package/dist/UserProfileView.d.ts +76 -0
  34. package/dist/UserProfileView.d.ts.map +1 -0
  35. package/dist/UserProfileView.js +101 -0
  36. package/dist/UserProfileView.js.map +1 -0
  37. package/dist/_virtual/_rolldown/runtime.js +29 -0
  38. package/dist/index.d.ts +41 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +37 -0
  41. package/dist/specs/NativeClerkAuthView.android.d.ts +15 -0
  42. package/dist/specs/NativeClerkAuthView.android.d.ts.map +1 -0
  43. package/dist/specs/NativeClerkAuthView.android.js +8 -0
  44. package/dist/specs/NativeClerkAuthView.android.js.map +1 -0
  45. package/dist/specs/NativeClerkAuthView.d.ts +15 -0
  46. package/dist/specs/NativeClerkAuthView.d.ts.map +1 -0
  47. package/dist/specs/NativeClerkAuthView.js +9 -0
  48. package/dist/specs/NativeClerkAuthView.js.map +1 -0
  49. package/dist/specs/NativeClerkModule.d.ts +4 -0
  50. package/dist/specs/NativeClerkModule.d.ts.map +1 -0
  51. package/dist/specs/NativeClerkModule.js +8 -0
  52. package/dist/specs/NativeClerkModule.js.map +1 -0
  53. package/dist/specs/NativeClerkModule.types.d.ts +11 -0
  54. package/dist/specs/NativeClerkModule.types.d.ts.map +1 -0
  55. package/dist/specs/NativeClerkModule.types.js +0 -0
  56. package/dist/specs/NativeClerkModule.web.d.ts +4 -0
  57. package/dist/specs/NativeClerkModule.web.d.ts.map +1 -0
  58. package/dist/specs/NativeClerkModule.web.js +7 -0
  59. package/dist/specs/NativeClerkModule.web.js.map +1 -0
  60. package/dist/specs/NativeClerkUserButtonView.android.d.ts +6 -0
  61. package/dist/specs/NativeClerkUserButtonView.android.d.ts.map +1 -0
  62. package/dist/specs/NativeClerkUserButtonView.android.js +8 -0
  63. package/dist/specs/NativeClerkUserButtonView.android.js.map +1 -0
  64. package/dist/specs/NativeClerkUserButtonView.d.ts +6 -0
  65. package/dist/specs/NativeClerkUserButtonView.d.ts.map +1 -0
  66. package/dist/specs/NativeClerkUserButtonView.js +9 -0
  67. package/dist/specs/NativeClerkUserButtonView.js.map +1 -0
  68. package/dist/specs/NativeClerkUserProfileView.android.d.ts +13 -0
  69. package/dist/specs/NativeClerkUserProfileView.android.d.ts.map +1 -0
  70. package/dist/specs/NativeClerkUserProfileView.android.js +8 -0
  71. package/dist/specs/NativeClerkUserProfileView.android.js.map +1 -0
  72. package/dist/specs/NativeClerkUserProfileView.d.ts +13 -0
  73. package/dist/specs/NativeClerkUserProfileView.d.ts.map +1 -0
  74. package/dist/specs/NativeClerkUserProfileView.js +9 -0
  75. package/dist/specs/NativeClerkUserProfileView.js.map +1 -0
  76. package/dist/useAuthViewState.d.ts +12 -0
  77. package/dist/useAuthViewState.d.ts.map +1 -0
  78. package/dist/useAuthViewState.js +76 -0
  79. package/dist/useAuthViewState.js.map +1 -0
  80. package/dist/utils/native-module.d.ts +3 -0
  81. package/dist/utils/native-module.d.ts.map +1 -0
  82. package/dist/utils/native-module.js +14 -0
  83. package/dist/utils/native-module.js.map +1 -0
  84. package/expo-module.config.json +15 -0
  85. package/ios/ClerkAppDelegateSubscriber.swift +16 -0
  86. package/ios/ClerkAuthNativeView.swift +157 -0
  87. package/ios/ClerkExpo.podspec +67 -0
  88. package/ios/ClerkExpoModule.swift +315 -0
  89. package/ios/ClerkNativeBridge.swift +1575 -0
  90. package/ios/ClerkNativeViewHost.swift +204 -0
  91. package/ios/ClerkUserButtonNativeView.swift +34 -0
  92. package/ios/ClerkUserProfileNativeView.swift +92 -0
  93. package/ios/Tests/ClerkAuthNativeViewPaperTests.swift +30 -0
  94. package/ios/Tests/ClerkNativeBridgeTests.swift +185 -0
  95. package/ios/Tests/ClerkNativeViewHostTests.swift +66 -0
  96. package/ios/Tests/ClerkUserProfileCustomPageStateTests.swift +311 -0
  97. package/package.json +79 -3
  98. package/react-native.config.js +8 -0
  99. package/src/specs/NativeClerkAuthView.android.ts +15 -0
  100. package/src/specs/NativeClerkAuthView.ts +19 -0
  101. package/src/specs/NativeClerkModule.ts +6 -0
  102. package/src/specs/NativeClerkModule.types.ts +9 -0
  103. package/src/specs/NativeClerkModule.web.ts +3 -0
  104. package/src/specs/NativeClerkUserButtonView.android.ts +9 -0
  105. package/src/specs/NativeClerkUserButtonView.ts +11 -0
  106. package/src/specs/NativeClerkUserProfileView.android.ts +13 -0
  107. package/src/specs/NativeClerkUserProfileView.ts +17 -0
  108. package/src/specs/__tests__/native-view.web.test.ts +43 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserButton.js","names":["NativeClerkUserButtonView","isNativeSupported","UserProfileCustomPageHosts","StyleSheet"],"sources":["../src/UserButton.tsx"],"sourcesContent":["import type { ComponentProps, ComponentType, JSX, Ref } from 'react';\nimport { useMemo, useRef } from 'react';\nimport type { NativeSyntheticEvent } from 'react-native';\nimport { StyleSheet, useWindowDimensions } from 'react-native';\n\nimport NativeClerkUserButtonView from './specs/NativeClerkUserButtonView';\nimport type {\n NativeUserProfileNavigationHandle,\n UserProfileCustomDestination,\n UserProfileCustomPage,\n UserProfileCustomPageEvent,\n} from './UserProfileCustomPages';\nimport {\n serializeUserProfileCustomPages,\n UserProfileCustomPageHosts,\n useUserProfileCustomPages,\n} from './UserProfileCustomPages';\nimport { isNativeSupported } from './utils/native-module';\n\ntype CustomizableNativeUserButtonProps = ComponentProps<NonNullable<typeof NativeClerkUserButtonView>> & {\n customPages?: string;\n onCustomPageEvent?: (event: NativeSyntheticEvent<UserProfileCustomPageEvent>) => void;\n ref?: Ref<NativeUserProfileNavigationHandle>;\n};\n\nconst CustomizableNativeClerkUserButtonView =\n NativeClerkUserButtonView as ComponentType<CustomizableNativeUserButtonProps> | null;\n\nexport interface UserButtonUserProfileProps {\n /** Custom pages displayed as rows in the user profile. */\n customPages?: UserProfileCustomPage[];\n\n /** Custom destinations that can be pushed from a custom page without creating a profile row. */\n customDestinations?: UserProfileCustomDestination[];\n}\n\nexport interface UserButtonProps {\n /** Configuration passed to the user profile opened by the button. */\n userProfileProps?: UserButtonUserProfileProps;\n}\n\n/**\n * A pre-built button component that displays the user's avatar.\n *\n * `UserButton` renders the platform-native Clerk user button. Tapping it opens\n * the native user profile surface, matching Clerk's iOS and Android SDKs.\n *\n * @example\n * ```tsx\n * import { UserButton } from '@clerk/expo-native-components';\n *\n * export default function Home() {\n * return (\n * <UserButton\n * userProfileProps={{\n * customPages: [{ path: 'api-keys', label: 'API keys', icon: 'key', content: <APIKeysView /> }],\n * }}\n * />\n * );\n * }\n * ```\n *\n * @see {@link UserProfileView} The profile view to render in your own presentation surface\n * @see {@link https://clerk.com/docs/components/user/user-button} Clerk UserButton Documentation\n */\nexport function UserButton({ userProfileProps }: UserButtonProps): JSX.Element | null {\n const nativeViewRef = useRef<NativeUserProfileNavigationHandle>(null);\n const customPages = userProfileProps?.customPages;\n const customDestinations = userProfileProps?.customDestinations;\n const customRoutes = useMemo(\n () => [...(customPages ?? []), ...(customDestinations ?? [])],\n [customDestinations, customPages],\n );\n const { navigation, presentedPaths, onCustomPageEvent } = useUserProfileCustomPages(customRoutes, nativeViewRef);\n const { width, height } = useWindowDimensions();\n\n if (!isNativeSupported || !CustomizableNativeClerkUserButtonView) {\n return null;\n }\n\n return (\n <CustomizableNativeClerkUserButtonView\n ref={nativeViewRef}\n style={styles.host}\n customPages={serializeUserProfileCustomPages(customPages ?? [], customDestinations ?? [])}\n onCustomPageEvent={onCustomPageEvent}\n >\n <UserProfileCustomPageHosts\n customRoutes={customRoutes}\n presentedPaths={presentedPaths}\n navigation={navigation}\n style={{ width, height }}\n />\n </CustomizableNativeClerkUserButtonView>\n );\n}\n\nconst styles = StyleSheet.create({\n // React Native/Yoga does not infer the intrinsic size of this native host view.\n host: {\n width: 36,\n height: 36,\n },\n});\n"],"mappings":";;;;;;;;;;;AAyBA,MAAM,wCACJA;;;;;;;;;;;;;;;;;;;;;;;;;AAuCF,SAAgB,WAAW,EAAE,oBAAyD;CACpF,MAAM,kCAA0D,IAAI;CACpE,MAAM,cAAc,kBAAkB;CACtC,MAAM,qBAAqB,kBAAkB;CAC7C,MAAM,wCACE,CAAC,GAAI,eAAe,CAAC,GAAI,GAAI,sBAAsB,CAAC,CAAE,GAC5D,CAAC,oBAAoB,WAAW,CAClC;CACA,MAAM,EAAE,YAAY,gBAAgB,gFAAgD,cAAc,aAAa;CAC/G,MAAM,EAAE,OAAO,iDAA+B;CAE9C,IAAI,CAACC,6CAAqB,CAAC,uCACzB,OAAO;CAGT,OACE,2CAAC,uCAAD;EACE,KAAK;EACL,OAAO,OAAO;EACd,6EAA6C,eAAe,CAAC,GAAG,sBAAsB,CAAC,CAAC;EACrE;YAEnB,2CAACC,uDAAD;GACgB;GACE;GACJ;GACZ,OAAO;IAAE;IAAO;GAAO;EACxB;CACoC;AAE3C;AAEA,MAAM,SAASC,wBAAW,OAAO,EAE/B,MAAM;CACJ,OAAO;CACP,QAAQ;AACV,EACF,CAAC"}
@@ -0,0 +1,81 @@
1
+ import type { ReactNode, RefObject } from 'react';
2
+ import type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';
3
+ export type UserProfileCustomPageIcon = 'user' | 'profile' | 'security' | 'settings' | 'billing' | 'key' | 'lock' | 'email' | 'phone' | 'add' | 'switch' | 'users' | 'warning' | 'info' | 'globe' | 'folder' | 'book';
4
+ export type UserProfileSection = 'profile' | 'account';
5
+ export type UserProfileRow = 'manageAccount' | 'security' | 'switchAccount' | 'addAccount' | 'signOut';
6
+ export type UserProfileCustomPagePlacement = {
7
+ type: 'sectionStart';
8
+ section: UserProfileSection;
9
+ } | {
10
+ type: 'sectionEnd';
11
+ section: UserProfileSection;
12
+ } | {
13
+ type: 'before';
14
+ row: UserProfileRow;
15
+ } | {
16
+ type: 'after';
17
+ row: UserProfileRow;
18
+ };
19
+ interface UserProfileCustomDestinationBase {
20
+ /** Unique path used to identify and navigate to the page. */
21
+ path: string;
22
+ /** Text displayed in the native navigation title and, for root pages, the profile row. */
23
+ label: string;
24
+ }
25
+ interface UserProfileCustomPageBase extends UserProfileCustomDestinationBase {
26
+ /** Icon displayed in the native user profile row. */
27
+ icon?: UserProfileCustomPageIcon;
28
+ /** Where the row is inserted relative to Clerk's built-in rows. */
29
+ placement?: UserProfileCustomPagePlacement;
30
+ }
31
+ /** A custom page rendered from the root of the native user profile. */
32
+ export type UserProfileCustomPage = UserProfileCustomPageBase & ({
33
+ /** React Native content rendered when the row is selected. */
34
+ content: ReactNode;
35
+ href?: never;
36
+ } | {
37
+ /** URL opened when the row is selected. */
38
+ href: string;
39
+ content?: never;
40
+ });
41
+ /** A custom destination reached by pushing from another custom user profile page. */
42
+ export type UserProfileCustomDestination = UserProfileCustomDestinationBase & {
43
+ /** React Native content rendered when the destination is pushed. */
44
+ content: ReactNode;
45
+ };
46
+ type UserProfileCustomRoute = UserProfileCustomPage | UserProfileCustomDestination;
47
+ export type UserProfileCustomPageEvent = Readonly<{
48
+ type: 'presented' | 'dismissed';
49
+ path: string;
50
+ }>;
51
+ /** Navigation available to content rendered by a custom user profile page. */
52
+ export interface UserProfileCustomPageNavigation {
53
+ /** Navigates back one screen in the native user profile. */
54
+ navigateBack: () => Promise<void>;
55
+ /** Returns to the root user profile screen. */
56
+ popToRoot: () => Promise<void>;
57
+ /**
58
+ * Pushes another registered custom page or custom destination by path.
59
+ * Rejects when that path is already active in the navigation stack.
60
+ */
61
+ push: (path: string) => Promise<void>;
62
+ }
63
+ export interface NativeUserProfileNavigationHandle {
64
+ navigateCustomPage: (action: 'back' | 'popToRoot' | 'push', path?: string) => Promise<void>;
65
+ }
66
+ /** Returns navigation actions for the currently rendered custom user profile destination. */
67
+ export declare function useUserProfileCustomPageNavigation(): UserProfileCustomPageNavigation;
68
+ export declare function serializeUserProfileCustomPages(customPages: UserProfileCustomPage[], customDestinations?: UserProfileCustomDestination[]): string;
69
+ export declare function useUserProfileCustomPages(customRoutes: UserProfileCustomRoute[], navigationHandleRef: RefObject<NativeUserProfileNavigationHandle | null>): {
70
+ navigation: UserProfileCustomPageNavigation;
71
+ presentedPaths: ReadonlySet<string>;
72
+ onCustomPageEvent: (event: NativeSyntheticEvent<UserProfileCustomPageEvent>) => void;
73
+ };
74
+ export declare function UserProfileCustomPageHosts({ customRoutes, presentedPaths, navigation, style, }: {
75
+ customRoutes: UserProfileCustomRoute[];
76
+ presentedPaths: ReadonlySet<string>;
77
+ navigation: UserProfileCustomPageNavigation;
78
+ style?: StyleProp<ViewStyle>;
79
+ }): import("react/jsx-runtime").JSX.Element[];
80
+ export {};
81
+ //# sourceMappingURL=UserProfileCustomPages.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileCustomPages.d.ts","sourceRoot":"","sources":["../src/UserProfileCustomPages.tsx"],"names":[],"mappings":"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"}
@@ -0,0 +1,140 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let react = require("react");
3
+ let react_native = require("react-native");
4
+ let react_jsx_runtime = require("react/jsx-runtime");
5
+
6
+ //#region src/UserProfileCustomPages.tsx
7
+ const UserProfileCustomPageNavigationContext = (0, react.createContext)(null);
8
+ /** Returns navigation actions for the currently rendered custom user profile destination. */
9
+ function useUserProfileCustomPageNavigation() {
10
+ const navigation = (0, react.useContext)(UserProfileCustomPageNavigationContext);
11
+ if (!navigation) throw new Error("useUserProfileCustomPageNavigation must be used inside a custom user profile page.");
12
+ return navigation;
13
+ }
14
+ function serializeUserProfileCustomPages(customPages, customDestinations = []) {
15
+ const paths = /* @__PURE__ */ new Set();
16
+ for (const { path } of [...customPages, ...customDestinations]) {
17
+ if (paths.has(path)) throw new Error(`User profile custom page path "${path}" must be unique.`);
18
+ paths.add(path);
19
+ }
20
+ return JSON.stringify([...customPages.map((page) => ({
21
+ path: page.path,
22
+ label: page.label,
23
+ icon: page.icon ?? "settings",
24
+ placement: page.placement ?? {
25
+ type: "sectionEnd",
26
+ section: "profile"
27
+ }
28
+ })), ...customDestinations.map((destination) => ({
29
+ path: destination.path,
30
+ label: destination.label,
31
+ icon: "settings",
32
+ placement: {
33
+ type: "sectionEnd",
34
+ section: "profile"
35
+ },
36
+ showAsRow: false
37
+ }))]);
38
+ }
39
+ function useUserProfileCustomPages(customRoutes, navigationHandleRef) {
40
+ const [presentedPaths, setPresentedPaths] = (0, react.useState)(() => /* @__PURE__ */ new Set());
41
+ const presentedPathStack = (0, react.useRef)([]);
42
+ const isPoppingToRoot = (0, react.useRef)(false);
43
+ const openingPaths = (0, react.useRef)(/* @__PURE__ */ new Set());
44
+ const updatePresentedPaths = (0, react.useCallback)((update) => {
45
+ const currentPaths = presentedPathStack.current;
46
+ const nextPaths = update(currentPaths);
47
+ if (nextPaths === currentPaths) return;
48
+ presentedPathStack.current = nextPaths;
49
+ setPresentedPaths(new Set(nextPaths));
50
+ }, []);
51
+ const onCustomPageEvent = (0, react.useCallback)((event) => {
52
+ const { path, type } = event.nativeEvent;
53
+ if (type === "dismissed") {
54
+ updatePresentedPaths((currentPaths) => {
55
+ const pathIndex = currentPaths.lastIndexOf(path);
56
+ if (pathIndex === -1) return currentPaths;
57
+ if (isPoppingToRoot.current) {
58
+ isPoppingToRoot.current = false;
59
+ return [];
60
+ }
61
+ if (pathIndex !== currentPaths.length - 1) return currentPaths;
62
+ return currentPaths.slice(0, pathIndex);
63
+ });
64
+ return;
65
+ }
66
+ const page = customRoutes.find((candidate) => candidate.path === path);
67
+ if (!page) return;
68
+ updatePresentedPaths((currentPaths) => currentPaths.includes(path) ? currentPaths : [...currentPaths, path]);
69
+ if ("href" in page && page.href) {
70
+ if (openingPaths.current.has(path)) return;
71
+ openingPaths.current.add(path);
72
+ react_native.Linking.openURL(page.href).catch((error) => {
73
+ console.warn(`Could not open custom user profile page "${path}".`, error);
74
+ }).finally(() => {
75
+ openingPaths.current.delete(path);
76
+ navigationHandleRef.current?.navigateCustomPage("back");
77
+ });
78
+ return;
79
+ }
80
+ }, [
81
+ customRoutes,
82
+ navigationHandleRef,
83
+ updatePresentedPaths
84
+ ]);
85
+ return {
86
+ navigation: (0, react.useMemo)(() => ({
87
+ navigateBack: () => navigationHandleRef.current?.navigateCustomPage("back") ?? Promise.resolve(),
88
+ popToRoot: () => {
89
+ const navigationHandle = navigationHandleRef.current;
90
+ if (!navigationHandle) return Promise.resolve();
91
+ isPoppingToRoot.current = presentedPathStack.current.length > 0;
92
+ return navigationHandle.navigateCustomPage("popToRoot").catch((error) => {
93
+ isPoppingToRoot.current = false;
94
+ throw error;
95
+ });
96
+ },
97
+ push: (path) => {
98
+ const navigationHandle = navigationHandleRef.current;
99
+ if (!navigationHandle) return Promise.resolve();
100
+ if (!customRoutes.some((route) => route.path === path)) return Promise.reject(/* @__PURE__ */ new Error(`No custom user profile page or destination is registered for path "${path}".`));
101
+ if (presentedPathStack.current.includes(path)) return Promise.reject(/* @__PURE__ */ new Error(`Custom user profile page or destination "${path}" is already in the navigation stack.`));
102
+ updatePresentedPaths((currentPaths) => [...currentPaths, path]);
103
+ return navigationHandle.navigateCustomPage("push", path).catch((error) => {
104
+ updatePresentedPaths((currentPaths) => currentPaths[currentPaths.length - 1] === path ? currentPaths.slice(0, -1) : currentPaths);
105
+ throw error;
106
+ });
107
+ }
108
+ }), [
109
+ customRoutes,
110
+ navigationHandleRef,
111
+ updatePresentedPaths
112
+ ]),
113
+ presentedPaths,
114
+ onCustomPageEvent
115
+ };
116
+ }
117
+ function UserProfileCustomPageHosts({ customRoutes, presentedPaths, navigation, style }) {
118
+ return customRoutes.map((page) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
119
+ collapsable: false,
120
+ style: [styles.destination, style],
121
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(UserProfileCustomPageNavigationContext.Provider, {
122
+ value: navigation,
123
+ children: presentedPaths.has(page.path) && "content" in page ? page.content : null
124
+ })
125
+ }, page.path));
126
+ }
127
+ const styles = react_native.StyleSheet.create({ destination: {
128
+ position: "absolute",
129
+ top: 0,
130
+ right: 0,
131
+ bottom: 0,
132
+ left: 0
133
+ } });
134
+
135
+ //#endregion
136
+ exports.UserProfileCustomPageHosts = UserProfileCustomPageHosts;
137
+ exports.serializeUserProfileCustomPages = serializeUserProfileCustomPages;
138
+ exports.useUserProfileCustomPageNavigation = useUserProfileCustomPageNavigation;
139
+ exports.useUserProfileCustomPages = useUserProfileCustomPages;
140
+ //# sourceMappingURL=UserProfileCustomPages.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileCustomPages.js","names":["Linking","View","StyleSheet"],"sources":["../src/UserProfileCustomPages.tsx"],"sourcesContent":["import type { ReactNode, RefObject } from 'react';\nimport { createContext, useCallback, useContext, useMemo, useRef, useState } from 'react';\nimport type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';\nimport { Linking, StyleSheet, View } from 'react-native';\n\nexport type UserProfileCustomPageIcon =\n | 'user'\n | 'profile'\n | 'security'\n | 'settings'\n | 'billing'\n | 'key'\n | 'lock'\n | 'email'\n | 'phone'\n | 'add'\n | 'switch'\n | 'users'\n | 'warning'\n | 'info'\n | 'globe'\n | 'folder'\n | 'book';\n\nexport type UserProfileSection = 'profile' | 'account';\n\nexport type UserProfileRow = 'manageAccount' | 'security' | 'switchAccount' | 'addAccount' | 'signOut';\n\nexport type UserProfileCustomPagePlacement =\n | { type: 'sectionStart'; section: UserProfileSection }\n | { type: 'sectionEnd'; section: UserProfileSection }\n | { type: 'before'; row: UserProfileRow }\n | { type: 'after'; row: UserProfileRow };\n\ninterface UserProfileCustomDestinationBase {\n /** Unique path used to identify and navigate to the page. */\n path: string;\n\n /** Text displayed in the native navigation title and, for root pages, the profile row. */\n label: string;\n}\n\ninterface UserProfileCustomPageBase extends UserProfileCustomDestinationBase {\n /** Icon displayed in the native user profile row. */\n icon?: UserProfileCustomPageIcon;\n\n /** Where the row is inserted relative to Clerk's built-in rows. */\n placement?: UserProfileCustomPagePlacement;\n}\n\n/** A custom page rendered from the root of the native user profile. */\nexport type UserProfileCustomPage = UserProfileCustomPageBase &\n (\n | {\n /** React Native content rendered when the row is selected. */\n content: ReactNode;\n href?: never;\n }\n | {\n /** URL opened when the row is selected. */\n href: string;\n content?: never;\n }\n );\n\n/** A custom destination reached by pushing from another custom user profile page. */\nexport type UserProfileCustomDestination = UserProfileCustomDestinationBase & {\n /** React Native content rendered when the destination is pushed. */\n content: ReactNode;\n};\n\ntype UserProfileCustomRoute = UserProfileCustomPage | UserProfileCustomDestination;\n\nexport type UserProfileCustomPageEvent = Readonly<{\n type: 'presented' | 'dismissed';\n path: string;\n}>;\n\n/** Navigation available to content rendered by a custom user profile page. */\nexport interface UserProfileCustomPageNavigation {\n /** Navigates back one screen in the native user profile. */\n navigateBack: () => Promise<void>;\n\n /** Returns to the root user profile screen. */\n popToRoot: () => Promise<void>;\n\n /**\n * Pushes another registered custom page or custom destination by path.\n * Rejects when that path is already active in the navigation stack.\n */\n push: (path: string) => Promise<void>;\n}\n\nexport interface NativeUserProfileNavigationHandle {\n navigateCustomPage: (action: 'back' | 'popToRoot' | 'push', path?: string) => Promise<void>;\n}\n\nconst UserProfileCustomPageNavigationContext = createContext<UserProfileCustomPageNavigation | null>(null);\n\n/** Returns navigation actions for the currently rendered custom user profile destination. */\nexport function useUserProfileCustomPageNavigation(): UserProfileCustomPageNavigation {\n const navigation = useContext(UserProfileCustomPageNavigationContext);\n\n if (!navigation) {\n throw new Error('useUserProfileCustomPageNavigation must be used inside a custom user profile page.');\n }\n\n return navigation;\n}\n\nexport function serializeUserProfileCustomPages(\n customPages: UserProfileCustomPage[],\n customDestinations: UserProfileCustomDestination[] = [],\n): string {\n const paths = new Set<string>();\n\n for (const { path } of [...customPages, ...customDestinations]) {\n if (paths.has(path)) {\n throw new Error(`User profile custom page path \"${path}\" must be unique.`);\n }\n\n paths.add(path);\n }\n\n return JSON.stringify([\n ...customPages.map(page => ({\n path: page.path,\n label: page.label,\n icon: page.icon ?? 'settings',\n placement: page.placement ?? { type: 'sectionEnd', section: 'profile' },\n })),\n ...customDestinations.map(destination => ({\n path: destination.path,\n label: destination.label,\n icon: 'settings',\n placement: { type: 'sectionEnd', section: 'profile' },\n showAsRow: false,\n })),\n ]);\n}\n\nexport function useUserProfileCustomPages(\n customRoutes: UserProfileCustomRoute[],\n navigationHandleRef: RefObject<NativeUserProfileNavigationHandle | null>,\n) {\n const [presentedPaths, setPresentedPaths] = useState<ReadonlySet<string>>(() => new Set());\n const presentedPathStack = useRef<string[]>([]);\n const isPoppingToRoot = useRef(false);\n const openingPaths = useRef(new Set<string>());\n\n const updatePresentedPaths = useCallback((update: (paths: string[]) => string[]) => {\n const currentPaths = presentedPathStack.current;\n const nextPaths = update(currentPaths);\n\n if (nextPaths === currentPaths) {\n return;\n }\n\n presentedPathStack.current = nextPaths;\n setPresentedPaths(new Set(nextPaths));\n }, []);\n\n const onCustomPageEvent = useCallback(\n (event: NativeSyntheticEvent<UserProfileCustomPageEvent>) => {\n const { path, type } = event.nativeEvent;\n\n if (type === 'dismissed') {\n updatePresentedPaths(currentPaths => {\n const pathIndex = currentPaths.lastIndexOf(path);\n if (pathIndex === -1) {\n return currentPaths;\n }\n\n if (isPoppingToRoot.current) {\n isPoppingToRoot.current = false;\n return [];\n }\n\n // Native navigation stops rendering pages that are covered by a push. Keep\n // those pages mounted until they are actually removed from the back stack.\n if (pathIndex !== currentPaths.length - 1) {\n return currentPaths;\n }\n\n return currentPaths.slice(0, pathIndex);\n });\n return;\n }\n\n const page = customRoutes.find(candidate => candidate.path === path);\n if (!page) {\n return;\n }\n\n updatePresentedPaths(currentPaths => (currentPaths.includes(path) ? currentPaths : [...currentPaths, path]));\n\n if ('href' in page && page.href) {\n if (openingPaths.current.has(path)) {\n return;\n }\n\n openingPaths.current.add(path);\n void Linking.openURL(page.href)\n .catch(error => {\n console.warn(`Could not open custom user profile page \"${path}\".`, error);\n })\n .finally(() => {\n openingPaths.current.delete(path);\n void navigationHandleRef.current?.navigateCustomPage('back');\n });\n return;\n }\n },\n [customRoutes, navigationHandleRef, updatePresentedPaths],\n );\n\n const navigation = useMemo<UserProfileCustomPageNavigation>(\n () => ({\n navigateBack: () => navigationHandleRef.current?.navigateCustomPage('back') ?? Promise.resolve(),\n popToRoot: () => {\n const navigationHandle = navigationHandleRef.current;\n if (!navigationHandle) {\n return Promise.resolve();\n }\n\n isPoppingToRoot.current = presentedPathStack.current.length > 0;\n return navigationHandle.navigateCustomPage('popToRoot').catch(error => {\n isPoppingToRoot.current = false;\n throw error;\n });\n },\n push: path => {\n const navigationHandle = navigationHandleRef.current;\n if (!navigationHandle) {\n return Promise.resolve();\n }\n\n if (!customRoutes.some(route => route.path === path)) {\n return Promise.reject(\n new Error(`No custom user profile page or destination is registered for path \"${path}\".`),\n );\n }\n\n if (presentedPathStack.current.includes(path)) {\n return Promise.reject(\n new Error(`Custom user profile page or destination \"${path}\" is already in the navigation stack.`),\n );\n }\n\n updatePresentedPaths(currentPaths => [...currentPaths, path]);\n\n return navigationHandle.navigateCustomPage('push', path).catch(error => {\n updatePresentedPaths(currentPaths =>\n currentPaths[currentPaths.length - 1] === path ? currentPaths.slice(0, -1) : currentPaths,\n );\n throw error;\n });\n },\n }),\n [customRoutes, navigationHandleRef, updatePresentedPaths],\n );\n\n return { navigation, presentedPaths, onCustomPageEvent };\n}\n\nexport function UserProfileCustomPageHosts({\n customRoutes,\n presentedPaths,\n navigation,\n style,\n}: {\n customRoutes: UserProfileCustomRoute[];\n presentedPaths: ReadonlySet<string>;\n navigation: UserProfileCustomPageNavigation;\n style?: StyleProp<ViewStyle>;\n}) {\n return customRoutes.map(page => (\n <View\n key={page.path}\n collapsable={false}\n style={[styles.destination, style]}\n >\n <UserProfileCustomPageNavigationContext.Provider value={navigation}>\n {presentedPaths.has(page.path) && 'content' in page ? page.content : null}\n </UserProfileCustomPageNavigationContext.Provider>\n </View>\n ));\n}\n\nconst styles = StyleSheet.create({\n destination: {\n position: 'absolute',\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n },\n});\n"],"mappings":"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"}
@@ -0,0 +1,76 @@
1
+ import type { JSX } from 'react';
2
+ import type { StyleProp, ViewStyle } from 'react-native';
3
+ import type { EmbeddedNavigationProps } from './EmbeddedNavigation.types';
4
+ import type { UserProfileCustomDestination, UserProfileCustomPage } from './UserProfileCustomPages';
5
+ /**
6
+ * Props for the UserProfileView component.
7
+ */
8
+ export interface UserProfileViewProps extends EmbeddedNavigationProps {
9
+ /**
10
+ * Whether the inline profile view shows a dismiss button.
11
+ *
12
+ * This controls the native view's built-in dismiss button. It does not present
13
+ * a modal; render `UserProfileView` inside your own `Modal`, sheet, or route.
14
+ *
15
+ * @default true
16
+ */
17
+ isDismissible?: boolean;
18
+ /**
19
+ * Style applied to the container view.
20
+ */
21
+ style?: StyleProp<ViewStyle>;
22
+ /**
23
+ * Called when the user dismisses the native profile view.
24
+ */
25
+ onDismiss?: () => void;
26
+ /** Custom pages displayed as rows in the root profile screen. */
27
+ customPages?: UserProfileCustomPage[];
28
+ /** Custom destinations that can be pushed from a custom page without creating a root profile row. */
29
+ customDestinations?: UserProfileCustomDestination[];
30
+ }
31
+ /**
32
+ * A pre-built native component for managing the user's profile and account settings.
33
+ *
34
+ * `UserProfileView` renders inline within your React Native view hierarchy, powered by:
35
+ * - **iOS**: clerk-ios (SwiftUI) - https://github.com/clerk/clerk-ios
36
+ * - **Android**: clerk-android (Jetpack Compose) - https://github.com/clerk/clerk-android
37
+ *
38
+ * To present the profile, render it inside your own `Modal`, sheet, or route.
39
+ *
40
+ * To push the profile onto your own navigation stack, hide the route's header and
41
+ * pass `onHostBack` so Clerk's own chrome takes over.
42
+ *
43
+ * Sign-out is detected automatically and synced with the JS SDK. Use `useAuth()` in a
44
+ * `useEffect` to react to sign-out.
45
+ *
46
+ * @example
47
+ * ```tsx
48
+ * import { UserProfileView } from '@clerk/expo-native-components';
49
+ * import { useAuth } from '@clerk/expo';
50
+ *
51
+ * export default function ProfileScreen() {
52
+ * const { isSignedIn } = useAuth();
53
+ *
54
+ * useEffect(() => {
55
+ * if (!isSignedIn) router.replace('/sign-in');
56
+ * }, [isSignedIn]);
57
+ *
58
+ * return (
59
+ * <UserProfileView
60
+ * style={{ flex: 1 }}
61
+ * customPages={[
62
+ * { path: 'billing', label: 'Billing', icon: 'billing', content: <BillingView /> },
63
+ * { path: 'docs', label: 'Docs', icon: 'book', href: 'https://clerk.com/docs' },
64
+ * ]}
65
+ * customDestinations={[
66
+ * { path: 'invoice-details', label: 'Invoice details', content: <InvoiceDetailsView /> },
67
+ * ]}
68
+ * />
69
+ * );
70
+ * }
71
+ * ```
72
+ *
73
+ * @see {@link https://clerk.com/docs/components/user/user-profile} Clerk UserProfile Documentation
74
+ */
75
+ export declare function UserProfileView({ isDismissible, style, onDismiss, onHostBack, customPages, customDestinations, }: UserProfileViewProps): JSX.Element;
76
+ //# sourceMappingURL=UserProfileView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileView.d.ts","sourceRoot":"","sources":["../src/UserProfileView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAiC,GAAG,EAAO,MAAM,OAAO,CAAC;AAErE,OAAO,KAAK,EAAwB,SAAS,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAG/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAE1E,OAAO,KAAK,EAEV,4BAA4B,EAC5B,qBAAqB,EAEtB,MAAM,0BAA0B,CAAC;AAiBlC;;GAEG;AACH,MAAM,WAAW,oBAAqB,SAAQ,uBAAuB;IACnE;;;;;;;OAOG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;OAEG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC,SAAS,CAAC,CAAC;IAE7B;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,IAAI,CAAC;IAEvB,iEAAiE;IACjE,WAAW,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAEtC,qGAAqG;IACrG,kBAAkB,CAAC,EAAE,4BAA4B,EAAE,CAAC;CACrD;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2CG;AACH,wBAAgB,eAAe,CAAC,EAC9B,aAAoB,EACpB,KAAK,EACL,SAAS,EACT,UAAU,EACV,WAAgB,EAChB,kBAAuB,GACxB,EAAE,oBAAoB,GAAG,GAAG,CAAC,OAAO,CA2CpC"}
@@ -0,0 +1,101 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ const require_runtime = require('./_virtual/_rolldown/runtime.js');
3
+ let react = require("react");
4
+ let react_native = require("react-native");
5
+ let src_utils_native_module = require("./utils/native-module");
6
+ let react_jsx_runtime = require("react/jsx-runtime");
7
+ let src_UserProfileCustomPages = require("./UserProfileCustomPages");
8
+ let src_specs_NativeClerkUserProfileView = require("./specs/NativeClerkUserProfileView");
9
+ src_specs_NativeClerkUserProfileView = require_runtime.__toESM(src_specs_NativeClerkUserProfileView);
10
+
11
+ //#region src/UserProfileView.tsx
12
+ const CustomizableNativeClerkUserProfileView = src_specs_NativeClerkUserProfileView.default;
13
+ /**
14
+ * A pre-built native component for managing the user's profile and account settings.
15
+ *
16
+ * `UserProfileView` renders inline within your React Native view hierarchy, powered by:
17
+ * - **iOS**: clerk-ios (SwiftUI) - https://github.com/clerk/clerk-ios
18
+ * - **Android**: clerk-android (Jetpack Compose) - https://github.com/clerk/clerk-android
19
+ *
20
+ * To present the profile, render it inside your own `Modal`, sheet, or route.
21
+ *
22
+ * To push the profile onto your own navigation stack, hide the route's header and
23
+ * pass `onHostBack` so Clerk's own chrome takes over.
24
+ *
25
+ * Sign-out is detected automatically and synced with the JS SDK. Use `useAuth()` in a
26
+ * `useEffect` to react to sign-out.
27
+ *
28
+ * @example
29
+ * ```tsx
30
+ * import { UserProfileView } from '@clerk/expo-native-components';
31
+ * import { useAuth } from '@clerk/expo';
32
+ *
33
+ * export default function ProfileScreen() {
34
+ * const { isSignedIn } = useAuth();
35
+ *
36
+ * useEffect(() => {
37
+ * if (!isSignedIn) router.replace('/sign-in');
38
+ * }, [isSignedIn]);
39
+ *
40
+ * return (
41
+ * <UserProfileView
42
+ * style={{ flex: 1 }}
43
+ * customPages={[
44
+ * { path: 'billing', label: 'Billing', icon: 'billing', content: <BillingView /> },
45
+ * { path: 'docs', label: 'Docs', icon: 'book', href: 'https://clerk.com/docs' },
46
+ * ]}
47
+ * customDestinations={[
48
+ * { path: 'invoice-details', label: 'Invoice details', content: <InvoiceDetailsView /> },
49
+ * ]}
50
+ * />
51
+ * );
52
+ * }
53
+ * ```
54
+ *
55
+ * @see {@link https://clerk.com/docs/components/user/user-profile} Clerk UserProfile Documentation
56
+ */
57
+ function UserProfileView({ isDismissible = true, style, onDismiss, onHostBack, customPages = [], customDestinations = [] }) {
58
+ const nativeViewRef = (0, react.useRef)(null);
59
+ const customRoutes = (0, react.useMemo)(() => [...customPages, ...customDestinations], [customDestinations, customPages]);
60
+ const { navigation, presentedPaths, onCustomPageEvent } = (0, src_UserProfileCustomPages.useUserProfileCustomPages)(customRoutes, nativeViewRef);
61
+ const handleProfileEvent = (0, react.useCallback)((event) => {
62
+ if (event.nativeEvent.type === "dismissed") onDismiss?.();
63
+ }, [onDismiss]);
64
+ if (!src_utils_native_module.isNativeSupported || !CustomizableNativeClerkUserProfileView) return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.View, {
65
+ style: [styles.container, style],
66
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(react_native.Text, {
67
+ style: styles.text,
68
+ children: !src_utils_native_module.isNativeSupported ? "Native UserProfileView is only available on iOS and Android" : "Native UserProfileView requires a development build with the @clerk/expo-native-components config plugin. Add \"@clerk/expo-native-components\" to your app.json plugins array and rebuild your native app."
69
+ })
70
+ });
71
+ return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(CustomizableNativeClerkUserProfileView, {
72
+ ref: nativeViewRef,
73
+ style: [styles.container, style],
74
+ isDismissible,
75
+ hostBackButton: !!onHostBack,
76
+ customPages: (0, src_UserProfileCustomPages.serializeUserProfileCustomPages)(customPages, customDestinations),
77
+ onProfileEvent: handleProfileEvent,
78
+ onCustomPageEvent,
79
+ onHostBack: onHostBack ? () => onHostBack() : void 0,
80
+ children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(src_UserProfileCustomPages.UserProfileCustomPageHosts, {
81
+ customRoutes,
82
+ presentedPaths,
83
+ navigation
84
+ })
85
+ });
86
+ }
87
+ const styles = react_native.StyleSheet.create({
88
+ container: {
89
+ flex: 1,
90
+ justifyContent: "center",
91
+ alignItems: "center"
92
+ },
93
+ text: {
94
+ fontSize: 16,
95
+ color: "#666"
96
+ }
97
+ });
98
+
99
+ //#endregion
100
+ exports.UserProfileView = UserProfileView;
101
+ //# sourceMappingURL=UserProfileView.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserProfileView.js","names":["NativeClerkUserProfileView","isNativeSupported","View","Text","UserProfileCustomPageHosts","StyleSheet"],"sources":["../src/UserProfileView.tsx"],"sourcesContent":["import type { ComponentProps, ComponentType, JSX, Ref } from 'react';\nimport { useCallback, useMemo, useRef } from 'react';\nimport type { NativeSyntheticEvent, StyleProp, ViewStyle } from 'react-native';\nimport { StyleSheet, Text, View } from 'react-native';\n\nimport type { EmbeddedNavigationProps } from './EmbeddedNavigation.types';\nimport NativeClerkUserProfileView from './specs/NativeClerkUserProfileView';\nimport type {\n NativeUserProfileNavigationHandle,\n UserProfileCustomDestination,\n UserProfileCustomPage,\n UserProfileCustomPageEvent,\n} from './UserProfileCustomPages';\nimport {\n serializeUserProfileCustomPages,\n UserProfileCustomPageHosts,\n useUserProfileCustomPages,\n} from './UserProfileCustomPages';\nimport { isNativeSupported } from './utils/native-module';\n\ntype CustomizableNativeUserProfileProps = ComponentProps<NonNullable<typeof NativeClerkUserProfileView>> & {\n customPages?: string;\n onCustomPageEvent?: (event: NativeSyntheticEvent<UserProfileCustomPageEvent>) => void;\n ref?: Ref<NativeUserProfileNavigationHandle>;\n};\n\nconst CustomizableNativeClerkUserProfileView =\n NativeClerkUserProfileView as ComponentType<CustomizableNativeUserProfileProps> | null;\n\n/**\n * Props for the UserProfileView component.\n */\nexport interface UserProfileViewProps extends EmbeddedNavigationProps {\n /**\n * Whether the inline profile view shows a dismiss button.\n *\n * This controls the native view's built-in dismiss button. It does not present\n * a modal; render `UserProfileView` inside your own `Modal`, sheet, or route.\n *\n * @default true\n */\n isDismissible?: boolean;\n\n /**\n * Style applied to the container view.\n */\n style?: StyleProp<ViewStyle>;\n\n /**\n * Called when the user dismisses the native profile view.\n */\n onDismiss?: () => void;\n\n /** Custom pages displayed as rows in the root profile screen. */\n customPages?: UserProfileCustomPage[];\n\n /** Custom destinations that can be pushed from a custom page without creating a root profile row. */\n customDestinations?: UserProfileCustomDestination[];\n}\n\n/**\n * A pre-built native component for managing the user's profile and account settings.\n *\n * `UserProfileView` renders inline within your React Native view hierarchy, powered by:\n * - **iOS**: clerk-ios (SwiftUI) - https://github.com/clerk/clerk-ios\n * - **Android**: clerk-android (Jetpack Compose) - https://github.com/clerk/clerk-android\n *\n * To present the profile, render it inside your own `Modal`, sheet, or route.\n *\n * To push the profile onto your own navigation stack, hide the route's header and\n * pass `onHostBack` so Clerk's own chrome takes over.\n *\n * Sign-out is detected automatically and synced with the JS SDK. Use `useAuth()` in a\n * `useEffect` to react to sign-out.\n *\n * @example\n * ```tsx\n * import { UserProfileView } from '@clerk/expo-native-components';\n * import { useAuth } from '@clerk/expo';\n *\n * export default function ProfileScreen() {\n * const { isSignedIn } = useAuth();\n *\n * useEffect(() => {\n * if (!isSignedIn) router.replace('/sign-in');\n * }, [isSignedIn]);\n *\n * return (\n * <UserProfileView\n * style={{ flex: 1 }}\n * customPages={[\n * { path: 'billing', label: 'Billing', icon: 'billing', content: <BillingView /> },\n * { path: 'docs', label: 'Docs', icon: 'book', href: 'https://clerk.com/docs' },\n * ]}\n * customDestinations={[\n * { path: 'invoice-details', label: 'Invoice details', content: <InvoiceDetailsView /> },\n * ]}\n * />\n * );\n * }\n * ```\n *\n * @see {@link https://clerk.com/docs/components/user/user-profile} Clerk UserProfile Documentation\n */\nexport function UserProfileView({\n isDismissible = true,\n style,\n onDismiss,\n onHostBack,\n customPages = [],\n customDestinations = [],\n}: UserProfileViewProps): JSX.Element {\n const nativeViewRef = useRef<NativeUserProfileNavigationHandle>(null);\n const customRoutes = useMemo(() => [...customPages, ...customDestinations], [customDestinations, customPages]);\n const { navigation, presentedPaths, onCustomPageEvent } = useUserProfileCustomPages(customRoutes, nativeViewRef);\n const handleProfileEvent = useCallback(\n (event: { nativeEvent: { type: string } }) => {\n if (event.nativeEvent.type === 'dismissed') {\n onDismiss?.();\n }\n },\n [onDismiss],\n );\n\n if (!isNativeSupported || !CustomizableNativeClerkUserProfileView) {\n return (\n <View style={[styles.container, style]}>\n <Text style={styles.text}>\n {!isNativeSupported\n ? 'Native UserProfileView is only available on iOS and Android'\n : 'Native UserProfileView requires a development build with the @clerk/expo-native-components config plugin. Add \"@clerk/expo-native-components\" to your app.json plugins array and rebuild your native app.'}\n </Text>\n </View>\n );\n }\n\n return (\n <CustomizableNativeClerkUserProfileView\n ref={nativeViewRef}\n style={[styles.container, style]}\n isDismissible={isDismissible}\n hostBackButton={!!onHostBack}\n customPages={serializeUserProfileCustomPages(customPages, customDestinations)}\n onProfileEvent={handleProfileEvent}\n onCustomPageEvent={onCustomPageEvent}\n onHostBack={onHostBack ? () => onHostBack() : undefined}\n >\n <UserProfileCustomPageHosts\n customRoutes={customRoutes}\n presentedPaths={presentedPaths}\n navigation={navigation}\n />\n </CustomizableNativeClerkUserProfileView>\n );\n}\n\nconst styles = StyleSheet.create({\n container: {\n flex: 1,\n justifyContent: 'center',\n alignItems: 'center',\n },\n text: {\n fontSize: 16,\n color: '#666',\n },\n});\n"],"mappings":";;;;;;;;;;;AA0BA,MAAM,yCACJA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA6EF,SAAgB,gBAAgB,EAC9B,gBAAgB,MAChB,OACA,WACA,YACA,cAAc,CAAC,GACf,qBAAqB,CAAC,KACc;CACpC,MAAM,kCAA0D,IAAI;CACpE,MAAM,wCAA6B,CAAC,GAAG,aAAa,GAAG,kBAAkB,GAAG,CAAC,oBAAoB,WAAW,CAAC;CAC7G,MAAM,EAAE,YAAY,gBAAgB,gFAAgD,cAAc,aAAa;CAC/G,MAAM,6CACH,UAA6C;EAC5C,IAAI,MAAM,YAAY,SAAS,aAC7B,YAAY;CAEhB,GACA,CAAC,SAAS,CACZ;CAEA,IAAI,CAACC,6CAAqB,CAAC,wCACzB,OACE,2CAACC,mBAAD;EAAM,OAAO,CAAC,OAAO,WAAW,KAAK;YACnC,2CAACC,mBAAD;GAAM,OAAO,OAAO;aACjB,CAACF,4CACE,gEACA;EACA;CACF;CAIV,OACE,2CAAC,wCAAD;EACE,KAAK;EACL,OAAO,CAAC,OAAO,WAAW,KAAK;EAChB;EACf,gBAAgB,CAAC,CAAC;EAClB,6EAA6C,aAAa,kBAAkB;EAC5E,gBAAgB;EACG;EACnB,YAAY,mBAAmB,WAAW,IAAI;YAE9C,2CAACG,uDAAD;GACgB;GACE;GACJ;EACb;CACqC;AAE5C;AAEA,MAAM,SAASC,wBAAW,OAAO;CAC/B,WAAW;EACT,MAAM;EACN,gBAAgB;EAChB,YAAY;CACd;CACA,MAAM;EACJ,UAAU;EACV,OAAO;CACT;AACF,CAAC"}
@@ -0,0 +1,29 @@
1
+ //#region \0rolldown/runtime.js
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __copyProps = (to, from, except, desc) => {
9
+ if (from && typeof from === "object" || typeof from === "function") {
10
+ for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
+ key = keys[i];
12
+ if (!__hasOwnProp.call(to, key) && key !== except) {
13
+ __defProp(to, key, {
14
+ get: ((k) => from[k]).bind(null, key),
15
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
16
+ });
17
+ }
18
+ }
19
+ }
20
+ return to;
21
+ };
22
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
23
+ value: mod,
24
+ enumerable: true
25
+ }) : target, mod));
26
+
27
+ //#endregion
28
+
29
+ exports.__toESM = __toESM;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Native UI components for Clerk authentication in Expo apps.
3
+ *
4
+ * These components provide pre-built, native authentication experiences powered by:
5
+ * - **iOS**: clerk-ios (SwiftUI) - https://github.com/clerk/clerk-ios
6
+ * - **Android**: clerk-android (Jetpack Compose) - https://github.com/clerk/clerk-android
7
+ *
8
+ * ## Installation
9
+ *
10
+ * Native components require the `@clerk/expo-native-components` config plugin in your `app.json`, alongside `@clerk/expo`:
11
+ *
12
+ * ```json
13
+ * {
14
+ * "expo": {
15
+ * "plugins": ["@clerk/expo", "@clerk/expo-native-components"]
16
+ * }
17
+ * }
18
+ * ```
19
+ *
20
+ * Then run `npx expo prebuild` to generate native code.
21
+ *
22
+ * ## Components
23
+ *
24
+ * - {@link AuthView} - Authentication flow (sign-in/sign-up), renders inline
25
+ * - {@link UserProfileView} - User profile and account management, renders inline
26
+ * - {@link UserButton} - Avatar button that opens the native user profile
27
+ *
28
+ * @module @clerk/expo-native-components
29
+ */
30
+ export { AuthView } from './AuthView';
31
+ export type { AuthViewProps, AuthViewMode } from './AuthView.types';
32
+ export type { EmbeddedNavigationProps } from './EmbeddedNavigation.types';
33
+ export { useAuthViewState } from './useAuthViewState';
34
+ export type { UseAuthViewStateReturn } from './useAuthViewState';
35
+ export { UserButton } from './UserButton';
36
+ export type { UserButtonProps, UserButtonUserProfileProps } from './UserButton';
37
+ export { useUserProfileCustomPageNavigation } from './UserProfileCustomPages';
38
+ export type { UserProfileCustomPageNavigation, UserProfileCustomDestination, UserProfileCustomPage, UserProfileCustomPageIcon, UserProfileCustomPagePlacement, UserProfileRow, UserProfileSection, } from './UserProfileCustomPages';
39
+ export { UserProfileView } from './UserProfileView';
40
+ export type { UserProfileViewProps } from './UserProfileView';
41
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAC;AAC1E,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,YAAY,EAAE,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,YAAY,EAAE,eAAe,EAAE,0BAA0B,EAAE,MAAM,cAAc,CAAC;AAChF,OAAO,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AAC9E,YAAY,EACV,+BAA+B,EAC/B,4BAA4B,EAC5B,qBAAqB,EACrB,yBAAyB,EACzB,8BAA8B,EAC9B,cAAc,EACd,kBAAkB,GACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,37 @@
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
+ let src_UserProfileCustomPages = require("./UserProfileCustomPages");
3
+ let src_AuthView = require("./AuthView");
4
+ let src_useAuthViewState = require("./useAuthViewState");
5
+ let src_UserButton = require("./UserButton");
6
+ let src_UserProfileView = require("./UserProfileView");
7
+
8
+ Object.defineProperty(exports, 'AuthView', {
9
+ enumerable: true,
10
+ get: function () {
11
+ return src_AuthView.AuthView;
12
+ }
13
+ });
14
+ Object.defineProperty(exports, 'UserButton', {
15
+ enumerable: true,
16
+ get: function () {
17
+ return src_UserButton.UserButton;
18
+ }
19
+ });
20
+ Object.defineProperty(exports, 'UserProfileView', {
21
+ enumerable: true,
22
+ get: function () {
23
+ return src_UserProfileView.UserProfileView;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, 'useAuthViewState', {
27
+ enumerable: true,
28
+ get: function () {
29
+ return src_useAuthViewState.useAuthViewState;
30
+ }
31
+ });
32
+ Object.defineProperty(exports, 'useUserProfileCustomPageNavigation', {
33
+ enumerable: true,
34
+ get: function () {
35
+ return src_UserProfileCustomPages.useUserProfileCustomPageNavigation;
36
+ }
37
+ });
@@ -0,0 +1,15 @@
1
+ import type { NativeSyntheticEvent, ViewProps } from 'react-native';
2
+ type AuthEvent = Readonly<{
3
+ type: string;
4
+ }>;
5
+ interface NativeProps extends ViewProps {
6
+ mode?: string;
7
+ isDismissible?: boolean;
8
+ logoMaxHeight?: number;
9
+ hostBackButton?: boolean;
10
+ onAuthEvent?: (event: NativeSyntheticEvent<AuthEvent>) => void;
11
+ onHostBack?: (event: NativeSyntheticEvent<object>) => void;
12
+ }
13
+ declare const _default: import("react").ComponentType<NativeProps>;
14
+ export default _default;
15
+ //# sourceMappingURL=NativeClerkAuthView.android.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeClerkAuthView.android.d.ts","sourceRoot":"","sources":["../../src/specs/NativeClerkAuthView.android.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEpE,KAAK,SAAS,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5C,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CAC5D;;AAED,wBAA+D"}
@@ -0,0 +1,8 @@
1
+ let expo = require("expo");
2
+
3
+ //#region src/specs/NativeClerkAuthView.android.ts
4
+ var NativeClerkAuthView_android_default = (0, expo.requireNativeView)("ClerkAuthView");
5
+
6
+ //#endregion
7
+ module.exports = NativeClerkAuthView_android_default;
8
+ //# sourceMappingURL=NativeClerkAuthView.android.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeClerkAuthView.android.js","names":[],"sources":["../../src/specs/NativeClerkAuthView.android.ts"],"sourcesContent":["import { requireNativeView } from 'expo';\nimport type { NativeSyntheticEvent, ViewProps } from 'react-native';\n\ntype AuthEvent = Readonly<{ type: string }>;\n\ninterface NativeProps extends ViewProps {\n mode?: string;\n isDismissible?: boolean;\n logoMaxHeight?: number;\n hostBackButton?: boolean;\n onAuthEvent?: (event: NativeSyntheticEvent<AuthEvent>) => void;\n onHostBack?: (event: NativeSyntheticEvent<object>) => void;\n}\n\nexport default requireNativeView<NativeProps>('ClerkAuthView');\n"],"mappings":";;;AAcA,sEAA8C,eAAe"}
@@ -0,0 +1,15 @@
1
+ import type { NativeSyntheticEvent, ViewProps } from 'react-native';
2
+ type AuthEvent = Readonly<{
3
+ type: string;
4
+ }>;
5
+ interface NativeProps extends ViewProps {
6
+ mode?: string;
7
+ isDismissible?: boolean;
8
+ logoMaxHeight?: number;
9
+ hostBackButton?: boolean;
10
+ onAuthEvent?: (event: NativeSyntheticEvent<AuthEvent>) => void;
11
+ onHostBack?: (event: NativeSyntheticEvent<object>) => void;
12
+ }
13
+ declare const NativeClerkAuthView: import("react").ComponentType<NativeProps> | null;
14
+ export default NativeClerkAuthView;
15
+ //# sourceMappingURL=NativeClerkAuthView.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"NativeClerkAuthView.d.ts","sourceRoot":"","sources":["../../src/specs/NativeClerkAuthView.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,oBAAoB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAGpE,KAAK,SAAS,GAAG,QAAQ,CAAC;IAAE,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC;AAE5C,UAAU,WAAY,SAAQ,SAAS;IACrC,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,WAAW,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,SAAS,CAAC,KAAK,IAAI,CAAC;IAC/D,UAAU,CAAC,EAAE,CAAC,KAAK,EAAE,oBAAoB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAC;CAC5D;AAED,QAAA,MAAM,mBAAmB,mDACoF,CAAC;AAE9G,eAAe,mBAAmB,CAAC"}