@tern-secure/auth 1.1.0-canary.v20251108045933 → 1.1.0-canary.v20251125170702
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/dist/492_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/687_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/68_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/framework_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signin_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.css +2 -0
- package/dist/signup_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/ternsecure.browser.js +30 -0
- package/dist/ternsecure.css +2 -0
- package/dist/ternsecure.js +17 -0
- package/dist/ternsecure.mjs +17 -0
- package/dist/types/auth/AuthCookieManager.d.ts +0 -1
- package/dist/types/auth/cookies/authTime_cookie.d.ts +0 -1
- package/dist/types/index.browser.d.ts +1 -0
- package/dist/types/index.d.ts +3 -10
- package/dist/types/instance/c_coreApiClient.d.ts +2 -2
- package/dist/types/instance/constants.d.ts +3 -0
- package/dist/types/instance/coreApiClient.d.ts +0 -1
- package/dist/types/instance/events.d.ts +0 -1
- package/dist/types/instance/{TernAuth.d.ts → ternsecure.d.ts} +31 -7
- package/dist/types/lib/utils.d.ts +2 -0
- package/dist/types/resources/Base.d.ts +16 -3
- package/dist/types/resources/Error.d.ts +0 -1
- package/dist/types/resources/Session.d.ts +2 -2
- package/dist/types/resources/SignIn.d.ts +27 -10
- package/dist/types/resources/SignUp.d.ts +12 -10
- package/dist/types/resources/internal.d.ts +1 -2
- package/dist/types/ui/Renderer.d.ts +26 -0
- package/dist/types/ui/common/ProviderInitialIcon.d.ts +6 -0
- package/dist/types/ui/common/VerificationCodeCard.d.ts +12 -0
- package/dist/types/ui/common/VerificationLinkCard.d.ts +7 -0
- package/dist/types/ui/common/constants.d.ts +8 -0
- package/dist/types/ui/common/index.d.ts +3 -0
- package/dist/types/ui/components/sign-in/ResetPassword.d.ts +1 -0
- package/dist/types/ui/components/sign-in/ResetPasswordSuccess.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignIn.d.ts +4 -0
- package/dist/types/ui/components/sign-in/SignInEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-in/SignInFactorOne.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInFactorOneCodeForm.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePasswordCard.d.ts +6 -0
- package/dist/types/ui/components/sign-in/SignInFactorOnePhoneCodeCard.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInPassword.d.ts +8 -0
- package/dist/types/ui/components/sign-in/SignInSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-in/SignInStart.d.ts +7 -0
- package/dist/types/ui/components/sign-in/SignInVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-in/index.d.ts +4 -0
- package/dist/types/ui/components/sign-up/SignUp.d.ts +8 -0
- package/dist/types/ui/components/sign-up/SignUpEmailLinkCard.d.ts +2 -0
- package/dist/types/ui/components/sign-up/SignUpSocialButtons.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpStart.d.ts +1 -0
- package/dist/types/ui/components/sign-up/SignUpVerifyEmail.d.ts +1 -0
- package/dist/types/ui/components/sign-up/index.d.ts +2 -0
- package/dist/types/ui/components/sign-up/util.d.ts +14 -0
- package/dist/types/ui/components/user-button/index.d.ts +1 -0
- package/dist/types/ui/components/user-button/userButton.d.ts +1 -0
- package/dist/types/ui/ctx/TernAuthContext.d.ts +4 -0
- package/dist/types/ui/ctx/TernAuthUIComponentCtx.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureContextWrapper.d.ts +8 -0
- package/dist/types/ui/ctx/TernSecureOptions.d.ts +10 -0
- package/dist/types/ui/ctx/components/SignIn.d.ts +21 -0
- package/dist/types/ui/ctx/components/SignUp.d.ts +14 -0
- package/dist/types/ui/ctx/components/UserButton.d.ts +10 -0
- package/dist/types/ui/ctx/components/index.d.ts +3 -0
- package/dist/types/ui/ctx/index.d.ts +4 -0
- package/dist/types/ui/ctx/utils.d.ts +3 -0
- package/dist/types/ui/customize/FieldControl.d.ts +15 -0
- package/dist/types/ui/customize/FieldLabelControl.d.ts +11 -0
- package/dist/types/ui/customize/Form.d.ts +36 -0
- package/dist/types/ui/elements/CodeControl.d.ts +47 -0
- package/dist/types/ui/elements/ErrorCard.d.ts +10 -0
- package/dist/types/ui/elements/LoadingCard.d.ts +1 -0
- package/dist/types/ui/elements/RouterLink.d.ts +42 -0
- package/dist/types/ui/elements/SocialButtons.d.ts +6 -0
- package/dist/types/ui/elements/TimerButton.d.ts +9 -0
- package/dist/types/ui/elements/alert.d.ts +8 -0
- package/dist/types/ui/elements/avatar.d.ts +6 -0
- package/dist/types/ui/elements/button.d.ts +10 -0
- package/dist/types/ui/elements/card.d.ts +9 -0
- package/dist/types/ui/elements/ctx/CardStateCtx.d.ts +26 -0
- package/dist/types/ui/elements/ctx/index.d.ts +1 -0
- package/dist/types/ui/elements/field.d.ts +24 -0
- package/dist/types/ui/elements/index.d.ts +16 -0
- package/dist/types/ui/elements/input.d.ts +3 -0
- package/dist/types/ui/elements/label.d.ts +4 -0
- package/dist/types/ui/elements/separator.d.ts +4 -0
- package/dist/types/ui/hooks/index.d.ts +6 -0
- package/dist/types/ui/hooks/useEmailLink.d.ts +11 -0
- package/dist/types/ui/hooks/useFetch.d.ts +44 -0
- package/dist/types/ui/hooks/useLoadingStatus.d.ts +14 -0
- package/dist/types/ui/hooks/useNavigateToFlowStart.d.ts +3 -0
- package/dist/types/ui/hooks/useSafeState.d.ts +9 -0
- package/dist/types/ui/hooks/useWindowEventListener.d.ts +3 -0
- package/dist/types/ui/icons/index.d.ts +13 -0
- package/dist/types/ui/lazyLoading/common.d.ts +2 -0
- package/dist/types/ui/lazyLoading/components.d.ts +11 -0
- package/dist/types/ui/lazyLoading/providersCtx.d.ts +26 -0
- package/dist/types/ui/portal/index.d.ts +12 -0
- package/dist/types/ui/router/BaseRouter.d.ts +21 -0
- package/dist/types/ui/router/HashRouter.d.ts +8 -0
- package/dist/types/ui/router/PathRouter.d.ts +8 -0
- package/dist/types/ui/router/Route.d.ts +19 -0
- package/dist/types/ui/router/RouterCtx.d.ts +32 -0
- package/dist/types/ui/router/Switch.d.ts +4 -0
- package/dist/types/ui/router/index.d.ts +7 -0
- package/dist/types/ui/router/newPaths.d.ts +1 -0
- package/dist/types/ui/router/pathToRegexp.d.ts +127 -0
- package/dist/types/ui/types.d.ts +18 -0
- package/dist/types/ui/utils/form.d.ts +19 -0
- package/dist/types/ui/utils/index.d.ts +1 -0
- package/dist/types/ui/utils/sleep.d.ts +1 -0
- package/dist/types/utils/construct.d.ts +3 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/normalizeRoutingOptions.d.ts +6 -0
- package/dist/types/utils/path.d.ts +0 -1
- package/dist/types/utils/querystring.d.ts +0 -1
- package/dist/types/utils/redirectUrls.d.ts +4 -9
- package/dist/types/utils/windowNavigate.d.ts +0 -1
- package/dist/ui-common_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/userbutton_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/dist/vendors_ternsecure_f36de9_1.1.0-canary.v20251125170702.js +1 -0
- package/package.json +63 -24
- package/dist/cjs/auth/AuthCookieManager.js +0 -113
- package/dist/cjs/auth/AuthCookieManager.js.map +0 -1
- package/dist/cjs/auth/cookies/authTime_cookie.js +0 -62
- package/dist/cjs/auth/cookies/authTime_cookie.js.map +0 -1
- package/dist/cjs/auth/request.js +0 -159
- package/dist/cjs/auth/request.js.map +0 -1
- package/dist/cjs/global.d.js +0 -2
- package/dist/cjs/global.d.js.map +0 -1
- package/dist/cjs/index.js +0 -47
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/instance/TernAuth.js +0 -524
- package/dist/cjs/instance/TernAuth.js.map +0 -1
- package/dist/cjs/instance/TernAuthServer.js +0 -95
- package/dist/cjs/instance/TernAuthServer.js.map +0 -1
- package/dist/cjs/instance/c_coreApiClient.js +0 -264
- package/dist/cjs/instance/c_coreApiClient.js.map +0 -1
- package/dist/cjs/instance/coreApiClient.js +0 -255
- package/dist/cjs/instance/coreApiClient.js.map +0 -1
- package/dist/cjs/instance/events.js +0 -39
- package/dist/cjs/instance/events.js.map +0 -1
- package/dist/cjs/instance/jwtClient.js +0 -72
- package/dist/cjs/instance/jwtClient.js.map +0 -1
- package/dist/cjs/resources/Base.js +0 -137
- package/dist/cjs/resources/Base.js.map +0 -1
- package/dist/cjs/resources/Error.js +0 -31
- package/dist/cjs/resources/Error.js.map +0 -1
- package/dist/cjs/resources/Session.js +0 -105
- package/dist/cjs/resources/Session.js.map +0 -1
- package/dist/cjs/resources/SignIn.js +0 -256
- package/dist/cjs/resources/SignIn.js.map +0 -1
- package/dist/cjs/resources/SignUp.js +0 -72
- package/dist/cjs/resources/SignUp.js.map +0 -1
- package/dist/cjs/resources/Token.js +0 -32
- package/dist/cjs/resources/Token.js.map +0 -1
- package/dist/cjs/resources/UserData.js +0 -43
- package/dist/cjs/resources/UserData.js.map +0 -1
- package/dist/cjs/resources/cookie.js +0 -154
- package/dist/cjs/resources/cookie.js.map +0 -1
- package/dist/cjs/resources/index.js +0 -23
- package/dist/cjs/resources/index.js.map +0 -1
- package/dist/cjs/resources/internal.js +0 -35
- package/dist/cjs/resources/internal.js.map +0 -1
- package/dist/cjs/utils/construct.js +0 -253
- package/dist/cjs/utils/construct.js.map +0 -1
- package/dist/cjs/utils/index.js +0 -29
- package/dist/cjs/utils/index.js.map +0 -1
- package/dist/cjs/utils/jwt.js +0 -46
- package/dist/cjs/utils/jwt.js.map +0 -1
- package/dist/cjs/utils/mapDecode.js +0 -33
- package/dist/cjs/utils/mapDecode.js.map +0 -1
- package/dist/cjs/utils/path.js +0 -33
- package/dist/cjs/utils/path.js.map +0 -1
- package/dist/cjs/utils/querystring.js +0 -70
- package/dist/cjs/utils/querystring.js.map +0 -1
- package/dist/cjs/utils/redirectUrls.js +0 -156
- package/dist/cjs/utils/redirectUrls.js.map +0 -1
- package/dist/cjs/utils/windowNavigate.js +0 -45
- package/dist/cjs/utils/windowNavigate.js.map +0 -1
- package/dist/esm/auth/AuthCookieManager.js +0 -89
- package/dist/esm/auth/AuthCookieManager.js.map +0 -1
- package/dist/esm/auth/cookies/authTime_cookie.js +0 -38
- package/dist/esm/auth/cookies/authTime_cookie.js.map +0 -1
- package/dist/esm/auth/request.js +0 -134
- package/dist/esm/auth/request.js.map +0 -1
- package/dist/esm/global.d.js +0 -1
- package/dist/esm/global.d.js.map +0 -1
- package/dist/esm/index.js +0 -16
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/instance/TernAuth.js +0 -510
- package/dist/esm/instance/TernAuth.js.map +0 -1
- package/dist/esm/instance/TernAuthServer.js +0 -73
- package/dist/esm/instance/TernAuthServer.js.map +0 -1
- package/dist/esm/instance/c_coreApiClient.js +0 -236
- package/dist/esm/instance/c_coreApiClient.js.map +0 -1
- package/dist/esm/instance/coreApiClient.js +0 -226
- package/dist/esm/instance/coreApiClient.js.map +0 -1
- package/dist/esm/instance/events.js +0 -14
- package/dist/esm/instance/events.js.map +0 -1
- package/dist/esm/instance/jwtClient.js +0 -47
- package/dist/esm/instance/jwtClient.js.map +0 -1
- package/dist/esm/resources/Base.js +0 -113
- package/dist/esm/resources/Base.js.map +0 -1
- package/dist/esm/resources/Error.js +0 -9
- package/dist/esm/resources/Error.js.map +0 -1
- package/dist/esm/resources/Session.js +0 -81
- package/dist/esm/resources/Session.js.map +0 -1
- package/dist/esm/resources/SignIn.js +0 -240
- package/dist/esm/resources/SignIn.js.map +0 -1
- package/dist/esm/resources/SignUp.js +0 -48
- package/dist/esm/resources/SignUp.js.map +0 -1
- package/dist/esm/resources/Token.js +0 -8
- package/dist/esm/resources/Token.js.map +0 -1
- package/dist/esm/resources/UserData.js +0 -19
- package/dist/esm/resources/UserData.js.map +0 -1
- package/dist/esm/resources/cookie.js +0 -130
- package/dist/esm/resources/cookie.js.map +0 -1
- package/dist/esm/resources/index.js +0 -2
- package/dist/esm/resources/index.js.map +0 -1
- package/dist/esm/resources/internal.js +0 -8
- package/dist/esm/resources/internal.js.map +0 -1
- package/dist/esm/utils/construct.js +0 -215
- package/dist/esm/utils/construct.js.map +0 -1
- package/dist/esm/utils/index.js +0 -5
- package/dist/esm/utils/index.js.map +0 -1
- package/dist/esm/utils/jwt.js +0 -22
- package/dist/esm/utils/jwt.js.map +0 -1
- package/dist/esm/utils/mapDecode.js +0 -9
- package/dist/esm/utils/mapDecode.js.map +0 -1
- package/dist/esm/utils/path.js +0 -9
- package/dist/esm/utils/path.js.map +0 -1
- package/dist/esm/utils/querystring.js +0 -45
- package/dist/esm/utils/querystring.js.map +0 -1
- package/dist/esm/utils/redirectUrls.js +0 -132
- package/dist/esm/utils/redirectUrls.js.map +0 -1
- package/dist/esm/utils/windowNavigate.js +0 -19
- package/dist/esm/utils/windowNavigate.js.map +0 -1
- package/dist/types/auth/AuthCookieManager.d.ts.map +0 -1
- package/dist/types/auth/cookies/authTime_cookie.d.ts.map +0 -1
- package/dist/types/auth/request.d.ts +0 -49
- package/dist/types/auth/request.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/instance/TernAuth.d.ts.map +0 -1
- package/dist/types/instance/TernAuthServer.d.ts +0 -32
- package/dist/types/instance/TernAuthServer.d.ts.map +0 -1
- package/dist/types/instance/c_coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/coreApiClient.d.ts.map +0 -1
- package/dist/types/instance/events.d.ts.map +0 -1
- package/dist/types/instance/jwtClient.d.ts +0 -22
- package/dist/types/instance/jwtClient.d.ts.map +0 -1
- package/dist/types/resources/Base.d.ts.map +0 -1
- package/dist/types/resources/Error.d.ts.map +0 -1
- package/dist/types/resources/Session.d.ts.map +0 -1
- package/dist/types/resources/SignIn.d.ts.map +0 -1
- package/dist/types/resources/SignUp.d.ts.map +0 -1
- package/dist/types/resources/Token.d.ts +0 -5
- package/dist/types/resources/Token.d.ts.map +0 -1
- package/dist/types/resources/UserData.d.ts +0 -8
- package/dist/types/resources/UserData.d.ts.map +0 -1
- package/dist/types/resources/cookie.d.ts +0 -24
- package/dist/types/resources/cookie.d.ts.map +0 -1
- package/dist/types/resources/index.d.ts +0 -2
- package/dist/types/resources/index.d.ts.map +0 -1
- package/dist/types/resources/internal.d.ts.map +0 -1
- package/dist/types/utils/construct.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/jwt.d.ts +0 -12
- package/dist/types/utils/jwt.d.ts.map +0 -1
- package/dist/types/utils/mapDecode.d.ts +0 -4
- package/dist/types/utils/mapDecode.d.ts.map +0 -1
- package/dist/types/utils/path.d.ts.map +0 -1
- package/dist/types/utils/querystring.d.ts.map +0 -1
- package/dist/types/utils/redirectUrls.d.ts.map +0 -1
- package/dist/types/utils/windowNavigate.d.ts.map +0 -1
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { UserButtonCtx } from '../../types';
|
|
2
|
+
export declare const UserButtonContext: import("react").Context<UserButtonCtx | null>;
|
|
3
|
+
export declare const useUserButtonContext: () => {
|
|
4
|
+
componentName: "UserButton";
|
|
5
|
+
navigateAfterSignOut: () => Promise<unknown>;
|
|
6
|
+
signInUrl: string | undefined;
|
|
7
|
+
showName?: boolean;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
mode?: "modal" | "mounted";
|
|
10
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SignInFactor } from '@tern-secure/types';
|
|
2
|
+
export declare function getInitialValuesFromQueryParams(queryString: string, params: string[]): Record<string, string>;
|
|
3
|
+
export declare function determineCurrentFactor(selectedFactor: SignInFactor | null, supportedFirstFactors: SignInFactor[] | null | undefined): SignInFactor | null;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface FieldProps {
|
|
2
|
+
field?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface PasswordFieldProps extends FieldProps {
|
|
9
|
+
onForgotPassword?: () => void;
|
|
10
|
+
}
|
|
11
|
+
declare const TernFieldErrors: () => import("react/jsx-runtime").JSX.Element | null;
|
|
12
|
+
declare const TernTextField: ({ label, placeholder, disabled, required }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare const TernPasswordField: ({ label, placeholder, disabled, required, onForgotPassword, }: PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare const TernEmailField: ({ label, placeholder, disabled, required }: FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export { TernTextField, TernPasswordField, TernEmailField, TernFieldErrors };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface FieldProps {
|
|
2
|
+
field?: string;
|
|
3
|
+
label?: string;
|
|
4
|
+
placeholder?: string;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare function FieldErrors(): import("react/jsx-runtime").JSX.Element | null;
|
|
9
|
+
export declare function TextField({ label, placeholder, disabled, required }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function PasswordField({ label, placeholder, disabled, required }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
export declare function EmailField({ label, placeholder, disabled, required }: FieldProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { EmailField, PasswordField } from './FieldLabelControl';
|
|
2
|
+
declare const fieldContext: import("react").Context<import("@tanstack/react-form").AnyFieldApi>, useFieldContext: <TData>() => import("@tanstack/react-form").FieldApi<any, string, TData, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any, any>, formContext: import("react").Context<import("@tanstack/react-form").AnyFormApi>, useFormContext: () => import("@tanstack/react-form").ReactFormExtendedApi<Record<string, never>, any, any, any, any, any, any, any, any, any, any, any>;
|
|
3
|
+
declare const useAppForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta>(props: import("@tanstack/react-form").FormOptions<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta>) => import("@tanstack/react-form").AppFieldExtendedReactFormApi<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
4
|
+
readonly EmailField: typeof EmailField;
|
|
5
|
+
readonly PasswordField: typeof PasswordField;
|
|
6
|
+
readonly TernEmailField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
readonly TernPasswordField: ({ label, placeholder, disabled, required, onForgotPassword, }: import("./FieldControl").PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
readonly TernTextField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
}, {
|
|
10
|
+
readonly SubscribeButton: ({ label }: {
|
|
11
|
+
label: string;
|
|
12
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
}>, withForm: <TFormData, TOnMount extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChange extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnChangeAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnBlur extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnBlurAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnSubmit extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnSubmitAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnDynamic extends import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined, TOnDynamicAsync extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TOnServer extends import("@tanstack/react-form").FormAsyncValidateOrFn<TFormData> | undefined, TSubmitMeta, TRenderProps extends object = {}>({ render, props, }: import("@tanstack/react-form").WithFormProps<TFormData, TOnMount, TOnChange, TOnChangeAsync, TOnBlur, TOnBlurAsync, TOnSubmit, TOnSubmitAsync, TOnDynamic, TOnDynamicAsync, TOnServer, TSubmitMeta, {
|
|
14
|
+
readonly EmailField: typeof EmailField;
|
|
15
|
+
readonly PasswordField: typeof PasswordField;
|
|
16
|
+
readonly TernEmailField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
readonly TernPasswordField: ({ label, placeholder, disabled, required, onForgotPassword, }: import("./FieldControl").PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
readonly TernTextField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
}, {
|
|
20
|
+
readonly SubscribeButton: ({ label }: {
|
|
21
|
+
label: string;
|
|
22
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
}, TRenderProps>) => (props: import("react").PropsWithChildren<NoInfer<[unknown] extends [TRenderProps] ? any : TRenderProps> & {
|
|
24
|
+
form: import("@tanstack/react-form").AppFieldExtendedReactFormApi<[unknown] extends [TFormData] ? any : TFormData, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnMount] ? [TOnMount] extends [TOnMount & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnMount : TOnMount, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChange] ? [TOnChange] extends [TOnChange & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChange : TOnChange, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnChangeAsync] ? [TOnChangeAsync] extends [TOnChangeAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnChangeAsync : TOnChangeAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlur] ? [TOnBlur] extends [TOnBlur & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlur : TOnBlur, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnBlurAsync] ? [TOnBlurAsync] extends [TOnBlurAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnBlurAsync : TOnBlurAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmit] ? [TOnSubmit] extends [TOnSubmit & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmit : TOnSubmit, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnSubmitAsync] ? [TOnSubmitAsync] extends [TOnSubmitAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnSubmitAsync : TOnSubmitAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamic] ? [TOnDynamic] extends [TOnDynamic & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamic : TOnDynamic, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnDynamicAsync] ? [TOnDynamicAsync] extends [TOnDynamicAsync & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnDynamicAsync : TOnDynamicAsync, [import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined] extends [TOnServer] ? [TOnServer] extends [TOnServer & (import("@tanstack/react-form").FormValidateOrFn<TFormData> | undefined)] ? any : TOnServer : TOnServer, [unknown] extends [TSubmitMeta] ? any : TSubmitMeta, {
|
|
25
|
+
readonly EmailField: typeof EmailField;
|
|
26
|
+
readonly PasswordField: typeof PasswordField;
|
|
27
|
+
readonly TernEmailField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
28
|
+
readonly TernPasswordField: ({ label, placeholder, disabled, required, onForgotPassword, }: import("./FieldControl").PasswordFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
readonly TernTextField: ({ label, placeholder, disabled, required }: import("./FieldControl").FieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
}, {
|
|
31
|
+
readonly SubscribeButton: ({ label }: {
|
|
32
|
+
label: string;
|
|
33
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
}>;
|
|
35
|
+
}>) => import("react").ReactNode;
|
|
36
|
+
export { fieldContext, useFieldContext, formContext, useAppForm, withForm, useFormContext };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
type onCodeEntryFinishedCallback = (code: string) => unknown;
|
|
4
|
+
type onCodeEntryFinished = (cb: onCodeEntryFinishedCallback) => void;
|
|
5
|
+
type onCodeEntryFinishedActionCallback<R = unknown> = (code: string, resolve: (params?: R) => Promise<void>, reject: (err: unknown) => Promise<void>) => void;
|
|
6
|
+
type OTPControl = {
|
|
7
|
+
otpInputProps: {
|
|
8
|
+
length: number;
|
|
9
|
+
values: string[];
|
|
10
|
+
setValues: React.Dispatch<React.SetStateAction<string[]>>;
|
|
11
|
+
feedback: string | null;
|
|
12
|
+
feedbackType: 'error' | 'success' | null;
|
|
13
|
+
clearFeedback: () => void;
|
|
14
|
+
ref: React.MutableRefObject<any>;
|
|
15
|
+
};
|
|
16
|
+
onCodeEntryFinished: onCodeEntryFinished;
|
|
17
|
+
reset: () => void;
|
|
18
|
+
setError: (msg: string) => void;
|
|
19
|
+
};
|
|
20
|
+
type UseFieldOTP = <R = unknown>(params: {
|
|
21
|
+
id?: 'code';
|
|
22
|
+
onCodeEntryFinished: onCodeEntryFinishedActionCallback<R>;
|
|
23
|
+
onResendCodeClicked?: React.MouseEventHandler;
|
|
24
|
+
onResolve?: (a?: R) => Promise<void> | void;
|
|
25
|
+
}) => {
|
|
26
|
+
isLoading: boolean;
|
|
27
|
+
onResendCode: React.MouseEventHandler<HTMLButtonElement> | undefined;
|
|
28
|
+
onFakeContinue: () => void;
|
|
29
|
+
otpControl: OTPControl;
|
|
30
|
+
};
|
|
31
|
+
export declare const useFieldOTP: UseFieldOTP;
|
|
32
|
+
export type OTPInputProps = {
|
|
33
|
+
label?: string;
|
|
34
|
+
resendButton?: string;
|
|
35
|
+
description?: string;
|
|
36
|
+
isLoading: boolean;
|
|
37
|
+
isDisabled?: boolean;
|
|
38
|
+
onResendCode?: React.MouseEventHandler<HTMLButtonElement>;
|
|
39
|
+
otpControl: ReturnType<typeof useFieldOTP>['otpControl'];
|
|
40
|
+
centerAlign?: boolean;
|
|
41
|
+
};
|
|
42
|
+
export declare const OTPRoot: ({ children, ...props }: PropsWithChildren<OTPInputProps>) => import("react/jsx-runtime").JSX.Element;
|
|
43
|
+
export declare const OTPResendButton: () => import("react/jsx-runtime").JSX.Element | null;
|
|
44
|
+
export declare const OTPCodeControl: React.ForwardRefExoticComponent<React.RefAttributes<{
|
|
45
|
+
reset: any;
|
|
46
|
+
}>>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ErrorCardProps = {
|
|
3
|
+
cardTitle?: string;
|
|
4
|
+
cardSubtitle?: string;
|
|
5
|
+
message?: string;
|
|
6
|
+
onBackLinkClick?: React.MouseEventHandler | undefined;
|
|
7
|
+
shouldNavigateBack?: boolean;
|
|
8
|
+
};
|
|
9
|
+
export declare const ErrorCard: (props: ErrorCardProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const LoadingCard: (props: unknown) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type ElementProps = {
|
|
3
|
+
div: React.JSX.IntrinsicElements['div'];
|
|
4
|
+
input: React.JSX.IntrinsicElements['input'];
|
|
5
|
+
button: React.JSX.IntrinsicElements['button'];
|
|
6
|
+
heading: React.JSX.IntrinsicElements['h1'];
|
|
7
|
+
p: React.JSX.IntrinsicElements['p'];
|
|
8
|
+
a: React.JSX.IntrinsicElements['a'];
|
|
9
|
+
label: React.JSX.IntrinsicElements['label'];
|
|
10
|
+
img: React.JSX.IntrinsicElements['img'];
|
|
11
|
+
form: React.JSX.IntrinsicElements['form'];
|
|
12
|
+
table: React.JSX.IntrinsicElements['table'];
|
|
13
|
+
thead: React.JSX.IntrinsicElements['thead'];
|
|
14
|
+
tbody: React.JSX.IntrinsicElements['tbody'];
|
|
15
|
+
th: React.JSX.IntrinsicElements['th'];
|
|
16
|
+
tr: React.JSX.IntrinsicElements['tr'];
|
|
17
|
+
td: React.JSX.IntrinsicElements['td'];
|
|
18
|
+
dl: React.JSX.IntrinsicElements['dl'];
|
|
19
|
+
dt: React.JSX.IntrinsicElements['dt'];
|
|
20
|
+
dd: React.JSX.IntrinsicElements['dd'];
|
|
21
|
+
hr: React.JSX.IntrinsicElements['hr'];
|
|
22
|
+
};
|
|
23
|
+
type PrimitiveProps<HtmlT extends keyof ElementProps> = ElementProps[HtmlT];
|
|
24
|
+
type OwnProps = {
|
|
25
|
+
isExternal?: boolean;
|
|
26
|
+
isDisabled?: boolean;
|
|
27
|
+
};
|
|
28
|
+
type LinkProps = PrimitiveProps<'a'> & OwnProps;
|
|
29
|
+
export declare const applyDataStateProps: (props: any) => {
|
|
30
|
+
'data-error': any;
|
|
31
|
+
'data-disabled': any;
|
|
32
|
+
'data-loading': any;
|
|
33
|
+
'data-open': any;
|
|
34
|
+
'data-active': any;
|
|
35
|
+
};
|
|
36
|
+
export declare const Link: (props: LinkProps) => React.JSX.Element;
|
|
37
|
+
type PropsOfComponent<C extends (...args: any[]) => any> = Parameters<C>[0];
|
|
38
|
+
type RouterLinkProps = PropsOfComponent<typeof Link> & {
|
|
39
|
+
to?: string;
|
|
40
|
+
};
|
|
41
|
+
export declare const RouterLink: (props: RouterLinkProps) => import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Button } from './button';
|
|
3
|
+
type TimerButtonProps = React.ComponentProps<typeof Button> & {
|
|
4
|
+
throttleTimeInSec?: number;
|
|
5
|
+
startDisabled?: boolean;
|
|
6
|
+
showCounter?: boolean;
|
|
7
|
+
};
|
|
8
|
+
export declare const TimerButton: ({ onClick: onClickProp, children, startDisabled, throttleTimeInSec, showCounter, ...props }: TimerButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const Alert: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & VariantProps<(props?: ({
|
|
4
|
+
variant?: "default" | "destructive" | null | undefined;
|
|
5
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string> & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
7
|
+
declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLParagraphElement> & React.RefAttributes<HTMLParagraphElement>>;
|
|
8
|
+
export { Alert, AlertTitle, AlertDescription };
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import * as AvatarPrimitive from "@radix-ui/react-avatar";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Avatar({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function AvatarFallback({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Fallback>): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export { Avatar, AvatarImage, AvatarFallback };
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare const buttonVariants: (props?: ({
|
|
4
|
+
variant?: "default" | "link" | "destructive" | "outline" | "secondary" | "ghost" | null | undefined;
|
|
5
|
+
size?: "default" | "sm" | "lg" | "icon" | null | undefined;
|
|
6
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
|
+
asChild?: boolean;
|
|
9
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export { Button, buttonVariants };
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { AuthErrorTree, SignInResponse } from '@tern-secure/types';
|
|
2
|
+
import React, { type ReactNode } from 'react';
|
|
3
|
+
type CardStatus = 'idle' | 'loading' | 'error' | 'success';
|
|
4
|
+
type CardState = {
|
|
5
|
+
status: CardStatus;
|
|
6
|
+
error: SignInResponse | AuthErrorTree | null;
|
|
7
|
+
};
|
|
8
|
+
interface CardStateCtxValue extends CardState {
|
|
9
|
+
setCardState: (state: Partial<CardState>) => void;
|
|
10
|
+
setStatus: (status: CardStatus) => void;
|
|
11
|
+
setLoading: () => void;
|
|
12
|
+
setError: (error: SignInResponse | AuthErrorTree) => void;
|
|
13
|
+
setIdle: () => void;
|
|
14
|
+
clearError: () => void;
|
|
15
|
+
isLoading: boolean;
|
|
16
|
+
isError: boolean;
|
|
17
|
+
isSuccess: boolean;
|
|
18
|
+
isIdle: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const useCardState: () => CardStateCtxValue;
|
|
21
|
+
type CardStateProviderProps = {
|
|
22
|
+
children: ReactNode;
|
|
23
|
+
};
|
|
24
|
+
declare function CardStateProvider({ children }: CardStateProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
export { CardStateProvider, useCardState };
|
|
26
|
+
export declare const withCardStateProvider: <T>(Component: React.ComponentType<T>) => (props: T) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './CardStateCtx';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type VariantProps } from "class-variance-authority";
|
|
2
|
+
import { Label } from "./label";
|
|
3
|
+
declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
declare function FieldLegend({ className, variant, ...props }: React.ComponentProps<"legend"> & {
|
|
5
|
+
variant?: "legend" | "label";
|
|
6
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
declare const fieldVariants: (props?: ({
|
|
9
|
+
orientation?: "vertical" | "horizontal" | "responsive" | null | undefined;
|
|
10
|
+
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
|
+
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>): import("react/jsx-runtime").JSX.Element;
|
|
14
|
+
declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare function FieldSeparator({ children, className, ...props }: React.ComponentProps<"div"> & {
|
|
17
|
+
children?: React.ReactNode;
|
|
18
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
declare function FieldError({ className, children, errors, ...props }: React.ComponentProps<"div"> & {
|
|
20
|
+
errors?: Array<{
|
|
21
|
+
message?: string;
|
|
22
|
+
} | undefined>;
|
|
23
|
+
}): import("react/jsx-runtime").JSX.Element | null;
|
|
24
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldLegend, FieldSeparator, FieldSet, FieldContent, FieldTitle, };
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export * from '../customize/FieldLabelControl';
|
|
2
|
+
export * from '../customize/Form';
|
|
3
|
+
export * from './card';
|
|
4
|
+
export * from './ctx';
|
|
5
|
+
export * from './field';
|
|
6
|
+
export * from './separator';
|
|
7
|
+
export * from './button';
|
|
8
|
+
export * from './avatar';
|
|
9
|
+
export * from './alert';
|
|
10
|
+
export * from './input';
|
|
11
|
+
export * from './label';
|
|
12
|
+
export * from './LoadingCard';
|
|
13
|
+
export * from './ErrorCard';
|
|
14
|
+
export * from './SocialButtons';
|
|
15
|
+
export * from './TimerButton';
|
|
16
|
+
export * from './CodeControl';
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import * as SeparatorPrimitive from "@radix-ui/react-separator";
|
|
2
|
+
import * as React from "react";
|
|
3
|
+
declare function Separator({ className, orientation, decorative, ...props }: React.ComponentProps<typeof SeparatorPrimitive.Root>): import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export { Separator };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export type VerificationStatus = 'unverified' | 'verified' | 'transferable' | 'failed' | 'expired';
|
|
2
|
+
export interface SignInStartEmailLinkFlowParams extends StartEmailLinkFlowParams {
|
|
3
|
+
emailAddressId: string;
|
|
4
|
+
}
|
|
5
|
+
export interface StartEmailLinkFlowParams {
|
|
6
|
+
redirectUrl: string;
|
|
7
|
+
}
|
|
8
|
+
export type CreateEmailLinkFlowReturn<Params, Resource> = {
|
|
9
|
+
startEmailLinkFlow: (params: Params) => Promise<Resource>;
|
|
10
|
+
cancelEmailLinkFlow: () => void;
|
|
11
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type State<Data = any, Error = any> = {
|
|
2
|
+
data: Data | null;
|
|
3
|
+
error: Error | null;
|
|
4
|
+
/**
|
|
5
|
+
* if there's an ongoing request and no "loaded data"
|
|
6
|
+
*/
|
|
7
|
+
isLoading: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* if there's a request or revalidation loading
|
|
10
|
+
*/
|
|
11
|
+
isValidating: boolean;
|
|
12
|
+
cachedAt?: number;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* This utility should only be used in tests to clear previously fetched data
|
|
16
|
+
*/
|
|
17
|
+
export declare const clearFetchCache: () => void;
|
|
18
|
+
export declare const useCache: <K = any, V = any>(key: K, serializer?: (key: unknown) => string) => {
|
|
19
|
+
getCache: () => State<V> | undefined;
|
|
20
|
+
setCache: (state: State<V> | ((params: State<V>) => State<V>)) => void;
|
|
21
|
+
clearCache: () => void;
|
|
22
|
+
subscribeCache: (callback: () => void) => () => void;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* An in-house simpler alternative to useSWR
|
|
26
|
+
* @param fetcher If fetcher is undefined no action will be performed
|
|
27
|
+
* @param params
|
|
28
|
+
* @param options
|
|
29
|
+
* @param resourceId
|
|
30
|
+
*/
|
|
31
|
+
export declare const useFetch: <K, T>(fetcher: ((...args: any) => Promise<T>) | undefined, params: K, options?: {
|
|
32
|
+
throttleTime?: number;
|
|
33
|
+
onSuccess?: (data: T) => void;
|
|
34
|
+
staleTime?: number;
|
|
35
|
+
}, resourceId?: string) => {
|
|
36
|
+
setCache: (state: State<T, any> | ((params: State<T, any>) => State<T, any>)) => void;
|
|
37
|
+
invalidate: () => void;
|
|
38
|
+
revalidate: () => void;
|
|
39
|
+
data?: T | null | undefined;
|
|
40
|
+
error?: any;
|
|
41
|
+
isLoading?: boolean | undefined;
|
|
42
|
+
isValidating?: boolean | undefined;
|
|
43
|
+
cachedAt?: number;
|
|
44
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
type Status = 'idle' | 'loading' | 'error';
|
|
2
|
+
export declare const useLoadingStatus: <Metadata>(initialState?: {
|
|
3
|
+
status: Status;
|
|
4
|
+
metadata?: Metadata | undefined;
|
|
5
|
+
}) => {
|
|
6
|
+
status: Status;
|
|
7
|
+
setIdle: (metadata?: Metadata) => void;
|
|
8
|
+
setError: (metadata?: Metadata) => void;
|
|
9
|
+
setLoading: (metadata?: Metadata) => void;
|
|
10
|
+
loadingMetadata: Metadata | undefined;
|
|
11
|
+
isLoading: boolean;
|
|
12
|
+
isIdle: boolean;
|
|
13
|
+
};
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Solves/ hides the "setState on unmounted component" warning
|
|
4
|
+
* In 99% of cases, there is no memory leak involved, but still an annoying warning
|
|
5
|
+
* For more info:
|
|
6
|
+
* https://github.com/reactwg/react-18/discussions/82
|
|
7
|
+
*/
|
|
8
|
+
export declare function useSafeState<S>(initialState: S | (() => S)): [S, React.Dispatch<React.SetStateAction<S>>];
|
|
9
|
+
export declare function useSafeState<S = undefined>(): [S | undefined, React.Dispatch<React.SetStateAction<S | undefined>>];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TypeScript configuration (typings) is not correctly configured for all projects.
|
|
3
|
+
* Consequently, the files are correctly imported but the TS checker emits errors.
|
|
4
|
+
* The above no-check is safe, as webpack will not allow compilation if for example a file is not resolved.
|
|
5
|
+
*/
|
|
6
|
+
export { default as LoaderCircle } from './loader-circle.svg';
|
|
7
|
+
export { default as MailCheck } from './mail-check.svg';
|
|
8
|
+
export { default as ArrowRight } from './arrow-right.svg';
|
|
9
|
+
export { default as ChevronLeft } from './chevron-left.svg';
|
|
10
|
+
export { default as RefreshCw } from './refresh-cw.svg';
|
|
11
|
+
export { default as AlertCircle } from './alert-circle.svg';
|
|
12
|
+
export { default as Eye } from './eye.svg';
|
|
13
|
+
export { default as EyeOff } from './eye-off.svg';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SignIn: import("react").LazyExoticComponent<import("react").ComponentType<import("@tern-secure/types").SignInProps>>;
|
|
2
|
+
export declare const SignInModal: import("react").LazyExoticComponent<(props: import("@tern-secure/types").SignInModalProps) => React.JSX.Element>;
|
|
3
|
+
export declare const SignUp: import("react").LazyExoticComponent<import("react").ComponentType<import("@tern-secure/types").SignUpProps>>;
|
|
4
|
+
export declare const UserButton: import("react").LazyExoticComponent<typeof import("../components/user-button").UserButton>;
|
|
5
|
+
export declare const preloadComponent: (component: unknown) => Promise<typeof import("../components/sign-in") | typeof import("../components/sign-up") | typeof import("../components/user-button")>;
|
|
6
|
+
export declare const TernSecureComponents: {
|
|
7
|
+
SignIn: import("react").LazyExoticComponent<import("react").ComponentType<import("@tern-secure/types").SignInProps>>;
|
|
8
|
+
SignUp: import("react").LazyExoticComponent<import("react").ComponentType<import("@tern-secure/types").SignUpProps>>;
|
|
9
|
+
UserButton: import("react").LazyExoticComponent<typeof import("../components/user-button").UserButton>;
|
|
10
|
+
};
|
|
11
|
+
export type TernSecureComponentName = keyof typeof TernSecureComponents;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
declare const Portal: React.LazyExoticComponent<typeof import("../portal").Portal>;
|
|
3
|
+
type LazyComponentRendererProps = React.PropsWithChildren<{
|
|
4
|
+
node: PortalProps['node'];
|
|
5
|
+
componentName: any;
|
|
6
|
+
componentProps: any;
|
|
7
|
+
componentKey: string;
|
|
8
|
+
}>;
|
|
9
|
+
type PortalProps = Parameters<typeof Portal>[0];
|
|
10
|
+
/**
|
|
11
|
+
* LazyProviders handles UI-specific context for lazily loaded components.
|
|
12
|
+
* This separates the UI rendering context from the instance context,
|
|
13
|
+
* making it easier to manage UI-specific concerns.
|
|
14
|
+
*/
|
|
15
|
+
type LazyProvidersProps = React.PropsWithChildren<{
|
|
16
|
+
ternsecure: any;
|
|
17
|
+
children: any;
|
|
18
|
+
options: any;
|
|
19
|
+
}>;
|
|
20
|
+
export declare const LazyProviders: (props: LazyProvidersProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
/**
|
|
22
|
+
* LazyComponentRenderer handles rendering a single component through a portal
|
|
23
|
+
* with proper Suspense and error boundaries.
|
|
24
|
+
*/
|
|
25
|
+
export declare const LazyComponentRenderer: (props: LazyComponentRendererProps) => import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { RoutingOptions } from '@tern-secure/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import type { AvailableComponentCtx, AvailableComponentName } from '../types';
|
|
4
|
+
type PortalProps<CtxType extends AvailableComponentCtx, PropsType = Omit<CtxType, 'componentName'>> = {
|
|
5
|
+
node: HTMLDivElement;
|
|
6
|
+
component: React.FunctionComponent<PropsType> | React.ComponentClass<PropsType, any>;
|
|
7
|
+
props?: PropsType & RoutingOptions;
|
|
8
|
+
} & {
|
|
9
|
+
componentName: AvailableComponentName;
|
|
10
|
+
};
|
|
11
|
+
export declare function Portal<CtxType extends AvailableComponentCtx>({ props, component, componentName, node, }: PortalProps<CtxType>): React.ReactPortal;
|
|
12
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { NavigateOptions } from '@tern-secure/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface BaseRouterProps {
|
|
4
|
+
basePath: string;
|
|
5
|
+
startPath: string;
|
|
6
|
+
getPath: () => string;
|
|
7
|
+
getQueryString: () => string;
|
|
8
|
+
internalNavigate: (toURL: URL, options?: NavigateOptions) => Promise<any> | any;
|
|
9
|
+
refreshEvents?: Array<keyof WindowEventMap>;
|
|
10
|
+
preservedParams?: string[];
|
|
11
|
+
urlStateParam?: {
|
|
12
|
+
startPath: string;
|
|
13
|
+
path: string;
|
|
14
|
+
componentName: string;
|
|
15
|
+
clearUrlStateParam: () => void;
|
|
16
|
+
socialProvider: string;
|
|
17
|
+
};
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const BaseRouter: ({ basePath, startPath, getPath, getQueryString, internalNavigate, refreshEvents, preservedParams, urlStateParam, children, }: BaseRouterProps) => React.JSX.Element;
|
|
21
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export declare const hashRouterBase = "TERNSECURE-ROUTER/HASH";
|
|
3
|
+
interface HashRouterProps {
|
|
4
|
+
preservedParams?: string[];
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const HashRouter: ({ preservedParams, children }: HashRouterProps) => React.JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface PathRouterProps {
|
|
3
|
+
basePath: string;
|
|
4
|
+
preservedParams?: string[];
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const PathRouter: ({ basePath, preservedParams, children, }: PathRouterProps) => React.JSX.Element | null;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { TernSecureAuth } from '@tern-secure/types';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
interface RouteGuardProps {
|
|
4
|
+
canActivate: (ternsecure: TernSecureAuth) => boolean;
|
|
5
|
+
}
|
|
6
|
+
interface UnSecureRooteProps {
|
|
7
|
+
path?: string;
|
|
8
|
+
index?: boolean;
|
|
9
|
+
flowStart?: boolean;
|
|
10
|
+
canActivate?: never;
|
|
11
|
+
}
|
|
12
|
+
type SecureRouteProps = {
|
|
13
|
+
path?: string;
|
|
14
|
+
index?: boolean;
|
|
15
|
+
flowStart?: boolean;
|
|
16
|
+
} & RouteGuardProps;
|
|
17
|
+
export type RouteProps = React.PropsWithChildren<UnSecureRooteProps | SecureRouteProps>;
|
|
18
|
+
export declare function Route(props: RouteProps): React.JSX.Element | null;
|
|
19
|
+
export {};
|