@hanwenbo/x-taro-ui 0.0.1 → 0.0.3
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.
- package/es/adapters/miniapp/overlayHost.js +14 -8
- package/es/auth/components.d.ts +17 -15
- package/es/auth/components.js +253 -133
- package/es/auth/entries/locales.d.ts +2 -0
- package/es/auth/entries/locales.js +1 -0
- package/es/auth/index.d.ts +1 -0
- package/es/auth/index.js +2 -1
- package/es/auth/internal.d.ts +17 -11
- package/es/auth/internal.js +107 -42
- package/es/auth/phoneNumberInput.d.ts +4 -2
- package/es/auth/phoneNumberInput.js +27 -8
- package/es/auth/provider.d.ts +2 -2
- package/es/auth/styles.css +161 -99
- package/es/auth/theme.js +20 -4
- package/es/components/_shared/render.d.ts +1 -1
- package/es/components/button/button.js +23 -3
- package/es/components/button/types.d.ts +6 -0
- package/es/components/capsuleTabs/capsuleTabs.js +4 -0
- package/es/components/icon/lucide.generated.d.ts +10 -0
- package/es/components/icon/lucide.generated.js +10 -0
- package/es/components/inputItem/inputItem.js +5 -2
- package/es/components/list/list.d.ts +1 -1
- package/es/components/pagination/pagination.js +18 -5
- package/es/components/searchBar/searchBar.js +4 -0
- package/es/components/sectionList/sectionList.d.ts +1 -2
- package/es/components/segmented/segmented.js +10 -2
- package/es/components/touchableOpacity/touchableOpacity.js +1 -0
- package/es/taro-components.d.ts +6 -0
- package/lib/adapters/miniapp/overlayHost.js +13 -6
- package/lib/auth/components.d.ts +17 -15
- package/lib/auth/components.js +257 -125
- package/lib/auth/entries/locales.d.ts +2 -0
- package/lib/auth/entries/locales.js +33 -0
- package/lib/auth/index.d.ts +1 -0
- package/lib/auth/index.js +13 -0
- package/lib/auth/internal.d.ts +17 -11
- package/lib/auth/internal.js +76 -31
- package/lib/auth/phoneNumberInput.d.ts +4 -2
- package/lib/auth/phoneNumberInput.js +65 -45
- package/lib/auth/provider.d.ts +2 -2
- package/lib/auth/styles.css +161 -99
- package/lib/auth/theme.js +7 -4
- package/lib/components/_shared/render.d.ts +1 -1
- package/lib/components/button/button.js +7 -0
- package/lib/components/button/types.d.ts +6 -0
- package/lib/components/capsuleTabs/capsuleTabs.js +1 -0
- package/lib/components/icon/lucide.generated.d.ts +10 -0
- package/lib/components/icon/lucide.generated.js +24 -0
- package/lib/components/inputItem/inputItem.js +3 -0
- package/lib/components/list/list.d.ts +1 -1
- package/lib/components/pagination/pagination.js +19 -5
- package/lib/components/searchBar/searchBar.js +4 -0
- package/lib/components/sectionList/sectionList.d.ts +1 -2
- package/lib/components/segmented/segmented.js +6 -1
- package/lib/components/touchableOpacity/touchableOpacity.js +1 -0
- package/lib/taro-components.d.ts +6 -0
- package/package.json +4 -4
|
@@ -58,15 +58,21 @@ export var OverlayHost = function OverlayHost(_ref) {
|
|
|
58
58
|
mounted = _useOverlayTransition.mounted,
|
|
59
59
|
settled = _useOverlayTransition.settled;
|
|
60
60
|
var previousVisibleRef = useRef(visible);
|
|
61
|
+
var afterCloseRef = useRef(afterClose);
|
|
61
62
|
useEffect(function () {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
63
|
+
afterCloseRef.current = afterClose;
|
|
64
|
+
}, [afterClose]);
|
|
65
|
+
useEffect(function () {
|
|
66
|
+
var _afterCloseRef$curren;
|
|
67
|
+
if (visible) {
|
|
68
|
+
previousVisibleRef.current = true;
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
// The transition owns completion; changing callbacks must not cancel it.
|
|
72
|
+
if (shouldRender || !previousVisibleRef.current) return;
|
|
73
|
+
previousVisibleRef.current = false;
|
|
74
|
+
(_afterCloseRef$curren = afterCloseRef.current) === null || _afterCloseRef$curren === void 0 || _afterCloseRef$curren.call(afterCloseRef);
|
|
75
|
+
}, [shouldRender, visible]);
|
|
70
76
|
useEffect(function () {
|
|
71
77
|
var runtimeDocument = globalThis['document'];
|
|
72
78
|
if (!visible || !disableBodyScroll || !(runtimeDocument !== null && runtimeDocument !== void 0 && runtimeDocument.body)) return undefined;
|
package/es/auth/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
2
|
import type { AccountSecurityState, AuthSession, ContactIdentifierType, SignInContextField, SignInMethod, ThirdPartyAuthProvider, ThirdPartySignInHandler, ThirdPartySignInResult } from '@hanwenbo/x-auth-core/types';
|
|
3
3
|
import { type ModalProps } from '../components/modal';
|
|
4
|
-
import { type AuthSurface } from './internal';
|
|
4
|
+
import { type AuthSurface, type AuthHeaderAlign } from './internal';
|
|
5
5
|
import type { AuthComponentProps } from './types';
|
|
6
6
|
import './styles.css';
|
|
7
7
|
export interface ThirdPartySignInProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
@@ -10,8 +10,9 @@ export interface ThirdPartySignInProps<Session extends AuthSession = AuthSession
|
|
|
10
10
|
onSuccess?: (session: Session) => void;
|
|
11
11
|
providers?: ThirdPartyAuthProvider[];
|
|
12
12
|
}
|
|
13
|
-
export declare function ThirdPartySignIn<Session extends AuthSession = AuthSession>({ className, config, onAuthError, onProviderSignIn, onReauthenticationRequired, onResult, onSuccess, providers, services, style, testID, tokens }: ThirdPartySignInProps<Session>):
|
|
13
|
+
export declare function ThirdPartySignIn<Session extends AuthSession = AuthSession>({ className, config, onAuthError, onProviderSignIn, onReauthenticationRequired, onResult, onSuccess, providers, services, style, testID, tokens }: ThirdPartySignInProps<Session>): import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
export interface SignInProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
15
|
+
headerAlign?: AuthHeaderAlign;
|
|
15
16
|
contextFields?: SignInContextFieldProps[];
|
|
16
17
|
defaultMethod?: SignInMethod;
|
|
17
18
|
description?: ReactNode;
|
|
@@ -33,7 +34,7 @@ export interface SignInProps<Session extends AuthSession = AuthSession> extends
|
|
|
33
34
|
export interface SignInContextFieldProps extends SignInContextField {
|
|
34
35
|
prefix?: ReactNode;
|
|
35
36
|
}
|
|
36
|
-
export declare function SignIn<Session extends AuthSession = AuthSession>({ className, config, contextFields, defaultMethod, description, logo, methods, onAuthError, onForgotPassword, onMethodChange, onProviderResult, onProviderSignIn, onReauthenticationRequired, onSignUp, onSuccess, providers, services, showFieldLabels, showRemember, style, surface, testID, title, tokens }: SignInProps<Session>):
|
|
37
|
+
export declare function SignIn<Session extends AuthSession = AuthSession>({ className, config, contextFields, defaultMethod, description, headerAlign, logo, methods, onAuthError, onForgotPassword, onMethodChange, onProviderResult, onProviderSignIn, onReauthenticationRequired, onSignUp, onSuccess, providers, services, showFieldLabels, showRemember, style, surface, testID, title, tokens }: SignInProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
37
38
|
export interface SignUpProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
38
39
|
defaultIdentifier?: ContactIdentifierType;
|
|
39
40
|
description?: ReactNode;
|
|
@@ -44,8 +45,9 @@ export interface SignUpProps<Session extends AuthSession = AuthSession> extends
|
|
|
44
45
|
surface?: AuthSurface;
|
|
45
46
|
title?: ReactNode;
|
|
46
47
|
}
|
|
47
|
-
export declare function SignUp<Session extends AuthSession = AuthSession>({ className, config, defaultIdentifier, description, identifiers, logo, onAuthError, onReauthenticationRequired, onSignIn, onSuccess, services, style, surface, testID, title, tokens }: SignUpProps<Session>):
|
|
48
|
+
export declare function SignUp<Session extends AuthSession = AuthSession>({ className, config, defaultIdentifier, description, identifiers, logo, onAuthError, onReauthenticationRequired, onSignIn, onSuccess, services, style, surface, testID, title, tokens }: SignUpProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
48
49
|
export interface ForgotPasswordProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
50
|
+
description?: ReactNode;
|
|
49
51
|
defaultIdentifier?: ContactIdentifierType;
|
|
50
52
|
identifiers?: ContactIdentifierType[];
|
|
51
53
|
onBackToSignIn?: () => void;
|
|
@@ -53,7 +55,7 @@ export interface ForgotPasswordProps<Session extends AuthSession = AuthSession>
|
|
|
53
55
|
surface?: AuthSurface;
|
|
54
56
|
title?: ReactNode;
|
|
55
57
|
}
|
|
56
|
-
export declare function ForgotPassword<Session extends AuthSession = AuthSession>({ className, config, defaultIdentifier, identifiers, onAuthError, onBackToSignIn, onReauthenticationRequired, onSuccess, services, style, surface, testID, title, tokens }: ForgotPasswordProps<Session>):
|
|
58
|
+
export declare function ForgotPassword<Session extends AuthSession = AuthSession>({ className, config, description, defaultIdentifier, identifiers, onAuthError, onBackToSignIn, onReauthenticationRequired, onSuccess, services, style, surface, testID, title, tokens }: ForgotPasswordProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
57
59
|
export interface QuickSignInProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
58
60
|
autoContinuePhone?: boolean;
|
|
59
61
|
autoSubmitCode?: boolean;
|
|
@@ -70,7 +72,7 @@ export interface QuickSignInProps<Session extends AuthSession = AuthSession> ext
|
|
|
70
72
|
surface?: AuthSurface;
|
|
71
73
|
title?: ReactNode;
|
|
72
74
|
}
|
|
73
|
-
export declare function QuickSignIn<Session extends AuthSession = AuthSession>({ autoSubmitCode, className, config, description, footer, identifierSubmitText, identifierType, initialIdentifier, onAuthError, onClose, onReauthenticationRequired, onStepChange, onSuccess, services, showHeader, style, submitText, surface, testID, title, tokens }: QuickSignInProps<Session>):
|
|
75
|
+
export declare function QuickSignIn<Session extends AuthSession = AuthSession>({ autoSubmitCode, className, config, description, footer, identifierSubmitText, identifierType, initialIdentifier, onAuthError, onClose, onReauthenticationRequired, onStepChange, onSuccess, services, showHeader, style, submitText, surface, testID, title, tokens }: QuickSignInProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
74
76
|
export interface QuickSignInDialogProps<Session extends AuthSession = AuthSession> extends Omit<QuickSignInProps<Session>, 'onClose' | 'showHeader' | 'surface'> {
|
|
75
77
|
closeOnSuccess?: boolean;
|
|
76
78
|
modalProps?: Omit<ModalProps, 'afterClose' | 'body' | 'onClose' | 'visible'> & {
|
|
@@ -79,7 +81,7 @@ export interface QuickSignInDialogProps<Session extends AuthSession = AuthSessio
|
|
|
79
81
|
onClose: () => void;
|
|
80
82
|
visible: boolean;
|
|
81
83
|
}
|
|
82
|
-
export declare function QuickSignInDialog<Session extends AuthSession = AuthSession>({ closeOnSuccess, modalProps, onClose, onSuccess, visible, ...props }: QuickSignInDialogProps<Session>):
|
|
84
|
+
export declare function QuickSignInDialog<Session extends AuthSession = AuthSession>({ closeOnSuccess, modalProps, onClose, onSuccess, visible, ...props }: QuickSignInDialogProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
83
85
|
export declare type IdentifierBindingAction = 'bind' | 'change';
|
|
84
86
|
export interface IdentifierBindingProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
85
87
|
action?: IdentifierBindingAction;
|
|
@@ -91,7 +93,7 @@ export interface IdentifierBindingProps<Session extends AuthSession = AuthSessio
|
|
|
91
93
|
surface?: AuthSurface;
|
|
92
94
|
title?: ReactNode;
|
|
93
95
|
}
|
|
94
|
-
export declare function IdentifierBinding<Session extends AuthSession = AuthSession>({ action, className, config, currentDisplayValue, identifierType, onAuthError, onCancel, onReauthenticationRequired, onSuccess, requireReauthentication, services, style, surface, testID, title, tokens }: IdentifierBindingProps<Session>):
|
|
96
|
+
export declare function IdentifierBinding<Session extends AuthSession = AuthSession>({ action, className, config, currentDisplayValue, identifierType, onAuthError, onCancel, onReauthenticationRequired, onSuccess, requireReauthentication, services, style, surface, testID, title, tokens }: IdentifierBindingProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
95
97
|
export interface ChangePasswordProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
96
98
|
description?: ReactNode;
|
|
97
99
|
onCancel?: () => void;
|
|
@@ -100,18 +102,18 @@ export interface ChangePasswordProps<Session extends AuthSession = AuthSession>
|
|
|
100
102
|
surface?: AuthSurface;
|
|
101
103
|
title?: ReactNode;
|
|
102
104
|
}
|
|
103
|
-
export declare function ChangePassword<Session extends AuthSession = AuthSession>({ className, config, description, onAuthError, onCancel, onReauthenticationRequired, onSuccess, requireCurrentPassword, services, style, surface, testID, title, tokens }: ChangePasswordProps<Session>):
|
|
105
|
+
export declare function ChangePassword<Session extends AuthSession = AuthSession>({ className, config, description, onAuthError, onCancel, onReauthenticationRequired, onSuccess, requireCurrentPassword, services, style, surface, testID, title, tokens }: ChangePasswordProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
104
106
|
export interface AccountSecurityProps<Session extends AuthSession = AuthSession> extends AuthComponentProps<Session> {
|
|
105
107
|
description?: ReactNode;
|
|
106
108
|
onStateChange?: (state: AccountSecurityState) => void;
|
|
107
109
|
state?: AccountSecurityState;
|
|
108
110
|
title?: ReactNode;
|
|
109
111
|
}
|
|
110
|
-
export declare function AccountSecurity<Session extends AuthSession = AuthSession>({ className, config, description, onAuthError, onReauthenticationRequired, onStateChange, services, state, style, testID, title, tokens }: AccountSecurityProps<Session>):
|
|
112
|
+
export declare function AccountSecurity<Session extends AuthSession = AuthSession>({ className, config, description, onAuthError, onReauthenticationRequired, onStateChange, services, state, style, testID, title, tokens }: AccountSecurityProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
111
113
|
declare type IdentifierShortcutProps<Session extends AuthSession> = Omit<IdentifierBindingProps<Session>, 'action' | 'identifierType'>;
|
|
112
|
-
export declare function BindPhone<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>):
|
|
113
|
-
export declare function BindEmail<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>):
|
|
114
|
-
export declare function ChangePhone<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>):
|
|
115
|
-
export declare function ChangeEmail<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>):
|
|
114
|
+
export declare function BindPhone<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
115
|
+
export declare function BindEmail<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
116
|
+
export declare function ChangePhone<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
117
|
+
export declare function ChangeEmail<Session extends AuthSession = AuthSession>(props: IdentifierShortcutProps<Session>): import("react/jsx-runtime").JSX.Element;
|
|
116
118
|
export {};
|
|
117
119
|
//# sourceMappingURL=components.d.ts.map
|