@thunderid/react 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.
- package/LICENSE +201 -0
- package/dist/ThunderIDReactClient.d.ts +87 -0
- package/dist/ThunderIDReactClient.d.ts.map +1 -0
- package/dist/__temp__/api.d.ts +258 -0
- package/dist/__temp__/api.d.ts.map +1 -0
- package/dist/__temp__/models.d.ts +98 -0
- package/dist/__temp__/models.d.ts.map +1 -0
- package/dist/api/createOrganization.d.ts +86 -0
- package/dist/api/createOrganization.d.ts.map +1 -0
- package/dist/api/getAllOrganizations.d.ts +78 -0
- package/dist/api/getAllOrganizations.d.ts.map +1 -0
- package/dist/api/getMeOrganizations.d.ts +82 -0
- package/dist/api/getMeOrganizations.d.ts.map +1 -0
- package/dist/api/getOrganization.d.ts +74 -0
- package/dist/api/getOrganization.d.ts.map +1 -0
- package/dist/api/getSchemas.d.ts +72 -0
- package/dist/api/getSchemas.d.ts.map +1 -0
- package/dist/api/getScim2Me.d.ts +72 -0
- package/dist/api/getScim2Me.d.ts.map +1 -0
- package/dist/api/updateMeProfile.d.ts +60 -0
- package/dist/api/updateMeProfile.d.ts.map +1 -0
- package/dist/api/updateOrganization.d.ts +81 -0
- package/dist/api/updateOrganization.d.ts.map +1 -0
- package/dist/cjs/index.js +20320 -0
- package/dist/cjs/index.js.map +1 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts +71 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts.map +1 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts +71 -0
- package/dist/components/actions/SignInButton/SignInButton.d.ts.map +1 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts +71 -0
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts.map +1 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts +66 -0
- package/dist/components/actions/SignOutButton/SignOutButton.d.ts.map +1 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts +71 -0
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts.map +1 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts +67 -0
- package/dist/components/actions/SignUpButton/SignUpButton.d.ts.map +1 -0
- package/dist/components/adapters/CheckboxInput.d.ts +25 -0
- package/dist/components/adapters/CheckboxInput.d.ts.map +1 -0
- package/dist/components/adapters/Consent.d.ts +80 -0
- package/dist/components/adapters/Consent.d.ts.map +1 -0
- package/dist/components/adapters/ConsentCheckboxList.d.ts +95 -0
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -0
- package/dist/components/adapters/ConsentCheckboxList.styles.d.ts +21 -0
- package/dist/components/adapters/ConsentCheckboxList.styles.d.ts.map +1 -0
- package/dist/components/adapters/DateInput.d.ts +25 -0
- package/dist/components/adapters/DateInput.d.ts.map +1 -0
- package/dist/components/adapters/DividerComponent.d.ts +25 -0
- package/dist/components/adapters/DividerComponent.d.ts.map +1 -0
- package/dist/components/adapters/EmailInput.d.ts +25 -0
- package/dist/components/adapters/EmailInput.d.ts.map +1 -0
- package/dist/components/adapters/FacebookButton.d.ts +32 -0
- package/dist/components/adapters/FacebookButton.d.ts.map +1 -0
- package/dist/components/adapters/FlowTimer.d.ts +63 -0
- package/dist/components/adapters/FlowTimer.d.ts.map +1 -0
- package/dist/components/adapters/FormContainer.d.ts +25 -0
- package/dist/components/adapters/FormContainer.d.ts.map +1 -0
- package/dist/components/adapters/GitHubButton.d.ts +32 -0
- package/dist/components/adapters/GitHubButton.d.ts.map +1 -0
- package/dist/components/adapters/GoogleButton.d.ts +32 -0
- package/dist/components/adapters/GoogleButton.d.ts.map +1 -0
- package/dist/components/adapters/ImageComponent.d.ts +25 -0
- package/dist/components/adapters/ImageComponent.d.ts.map +1 -0
- package/dist/components/adapters/LinkedInButton.d.ts +32 -0
- package/dist/components/adapters/LinkedInButton.d.ts.map +1 -0
- package/dist/components/adapters/MicrosoftButton.d.ts +32 -0
- package/dist/components/adapters/MicrosoftButton.d.ts.map +1 -0
- package/dist/components/adapters/NumberInput.d.ts +25 -0
- package/dist/components/adapters/NumberInput.d.ts.map +1 -0
- package/dist/components/adapters/PasswordInput.d.ts +25 -0
- package/dist/components/adapters/PasswordInput.d.ts.map +1 -0
- package/dist/components/adapters/SelectInput.d.ts +25 -0
- package/dist/components/adapters/SelectInput.d.ts.map +1 -0
- package/dist/components/adapters/SignInWithEthereumButton.d.ts +32 -0
- package/dist/components/adapters/SignInWithEthereumButton.d.ts.map +1 -0
- package/dist/components/adapters/SmsOtpButton.d.ts +32 -0
- package/dist/components/adapters/SmsOtpButton.d.ts.map +1 -0
- package/dist/components/adapters/SocialButton.d.ts +25 -0
- package/dist/components/adapters/SocialButton.d.ts.map +1 -0
- package/dist/components/adapters/SubmitButton.d.ts +25 -0
- package/dist/components/adapters/SubmitButton.d.ts.map +1 -0
- package/dist/components/adapters/TelephoneInput.d.ts +25 -0
- package/dist/components/adapters/TelephoneInput.d.ts.map +1 -0
- package/dist/components/adapters/TextInput.d.ts +25 -0
- package/dist/components/adapters/TextInput.d.ts.map +1 -0
- package/dist/components/adapters/Typography.d.ts +25 -0
- package/dist/components/adapters/Typography.d.ts.map +1 -0
- package/dist/components/auth/Callback/Callback.d.ts +52 -0
- package/dist/components/auth/Callback/Callback.d.ts.map +1 -0
- package/dist/components/control/Loading.d.ts +48 -0
- package/dist/components/control/Loading.d.ts.map +1 -0
- package/dist/components/control/OrganizationContext/OrganizationContext.d.ts +40 -0
- package/dist/components/control/OrganizationContext/OrganizationContext.d.ts.map +1 -0
- package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts +35 -0
- package/dist/components/control/OrganizationContext/OrganizationContextController.d.ts.map +1 -0
- package/dist/components/control/SignedIn.d.ts +48 -0
- package/dist/components/control/SignedIn.d.ts.map +1 -0
- package/dist/components/control/SignedOut.d.ts +48 -0
- package/dist/components/control/SignedOut.d.ts.map +1 -0
- package/dist/components/factories/FieldFactory.d.ts +107 -0
- package/dist/components/factories/FieldFactory.d.ts.map +1 -0
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts +60 -0
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.d.ts.map +1 -0
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts +27 -0
- package/dist/components/presentation/CreateOrganization/BaseCreateOrganization.styles.d.ts.map +1 -0
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts +68 -0
- package/dist/components/presentation/CreateOrganization/CreateOrganization.d.ts.map +1 -0
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.d.ts +80 -0
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.d.ts.map +1 -0
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.d.ts +21 -0
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.d.ts.map +1 -0
- package/dist/components/presentation/LanguageSwitcher/LanguageSwitcher.d.ts +78 -0
- package/dist/components/presentation/LanguageSwitcher/LanguageSwitcher.d.ts.map +1 -0
- package/dist/components/presentation/Organization/BaseOrganization.d.ts +67 -0
- package/dist/components/presentation/Organization/BaseOrganization.d.ts.map +1 -0
- package/dist/components/presentation/Organization/Organization.d.ts +67 -0
- package/dist/components/presentation/Organization/Organization.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts +135 -0
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts +27 -0
- package/dist/components/presentation/OrganizationList/BaseOrganizationList.styles.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationList/OrganizationList.d.ts +93 -0
- package/dist/components/presentation/OrganizationList/OrganizationList.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts +27 -0
- package/dist/components/presentation/OrganizationList/OrganizationList.styles.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts +160 -0
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts +27 -0
- package/dist/components/presentation/OrganizationProfile/BaseOrganizationProfile.styles.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts +120 -0
- package/dist/components/presentation/OrganizationProfile/OrganizationProfile.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts +149 -0
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts +27 -0
- package/dist/components/presentation/OrganizationSwitcher/BaseOrganizationSwitcher.styles.d.ts.map +1 -0
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts +71 -0
- package/dist/components/presentation/OrganizationSwitcher/OrganizationSwitcher.d.ts.map +1 -0
- package/dist/components/presentation/User/BaseUser.d.ts +67 -0
- package/dist/components/presentation/User/BaseUser.d.ts.map +1 -0
- package/dist/components/presentation/User/User.d.ts +63 -0
- package/dist/components/presentation/User/User.d.ts.map +1 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts +89 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts.map +1 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts +27 -0
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts.map +1 -0
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts +109 -0
- package/dist/components/presentation/UserDropdown/UserDropdown.d.ts.map +1 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +73 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts.map +1 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts +27 -0
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts.map +1 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts +60 -0
- package/dist/components/presentation/UserProfile/UserProfile.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts +22 -0
- package/dist/components/presentation/auth/AcceptInvite/index.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts +125 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/AcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts +202 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.d.ts.map +1 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts +27 -0
- package/dist/components/presentation/auth/AcceptInvite/v2/BaseAcceptInvite.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts +114 -0
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts +22 -0
- package/dist/components/presentation/auth/InviteUser/index.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts +191 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts +27 -0
- package/dist/components/presentation/auth/InviteUser/v2/BaseInviteUser.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts +104 -0
- package/dist/components/presentation/auth/InviteUser/v2/InviteUser.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts +20 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/index.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.d.ts +30 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.d.ts.map +1 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.d.ts +21 -0
- package/dist/components/presentation/auth/OrganizationUnitPicker/v2/OrganizationUnitPicker.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts +24 -0
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts +57 -0
- package/dist/components/presentation/auth/Recovery/Recovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts +74 -0
- package/dist/components/presentation/auth/Recovery/v1/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts +26 -0
- package/dist/components/presentation/auth/Recovery/v1/Recovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts +46 -0
- package/dist/components/presentation/auth/Recovery/v1/RecoveryOptionFactory.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts +83 -0
- package/dist/components/presentation/auth/Recovery/v2/BaseRecovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts +56 -0
- package/dist/components/presentation/auth/Recovery/v2/Recovery.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts +28 -0
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts +27 -0
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts +63 -0
- package/dist/components/presentation/auth/SignIn/SignIn.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts +131 -0
- package/dist/components/presentation/auth/SignIn/v1/BaseSignIn.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/EmailOtp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/IdentifierFirst.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts +27 -0
- package/dist/components/presentation/auth/SignIn/v1/options/MultiOptionButton.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts +77 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SignInOptionFactory.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SmsOtp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/SocialButton.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/Totp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts +26 -0
- package/dist/components/presentation/auth/SignIn/v1/options/UsernamePassword.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts +125 -0
- package/dist/components/presentation/auth/SignIn/v1/types.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts +222 -0
- package/dist/components/presentation/auth/SignIn/v2/BaseSignIn.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts +165 -0
- package/dist/components/presentation/auth/SignIn/v2/SignIn.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts +28 -0
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts +27 -0
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts +98 -0
- package/dist/components/presentation/auth/SignUp/SignUp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts +174 -0
- package/dist/components/presentation/auth/SignUp/v1/BaseSignUp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts +39 -0
- package/dist/components/presentation/auth/SignUp/v1/SignUp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts +46 -0
- package/dist/components/presentation/auth/SignUp/v1/SignUpOptionFactory.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts +186 -0
- package/dist/components/presentation/auth/SignUp/v2/BaseSignUp.d.ts.map +1 -0
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts +39 -0
- package/dist/components/presentation/auth/SignUp/v2/SignUp.d.ts.map +1 -0
- package/dist/components/primitives/Alert/Alert.d.ts +76 -0
- package/dist/components/primitives/Alert/Alert.d.ts.map +1 -0
- package/dist/components/primitives/Alert/Alert.styles.d.ts +29 -0
- package/dist/components/primitives/Alert/Alert.styles.d.ts.map +1 -0
- package/dist/components/primitives/Avatar/Avatar.d.ts +60 -0
- package/dist/components/primitives/Avatar/Avatar.d.ts.map +1 -0
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts +31 -0
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts.map +1 -0
- package/dist/components/primitives/Button/Button.d.ts +88 -0
- package/dist/components/primitives/Button/Button.d.ts.map +1 -0
- package/dist/components/primitives/Button/Button.styles.d.ts +36 -0
- package/dist/components/primitives/Button/Button.styles.d.ts.map +1 -0
- package/dist/components/primitives/Card/Card.d.ts +133 -0
- package/dist/components/primitives/Card/Card.d.ts.map +1 -0
- package/dist/components/primitives/Card/Card.styles.d.ts +30 -0
- package/dist/components/primitives/Card/Card.styles.d.ts.map +1 -0
- package/dist/components/primitives/Checkbox/Checkbox.d.ts +43 -0
- package/dist/components/primitives/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts +29 -0
- package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/CopyableText.d.ts +37 -0
- package/dist/components/primitives/CopyableText/CopyableText.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/CopyableText.styles.d.ts +21 -0
- package/dist/components/primitives/CopyableText/CopyableText.styles.d.ts.map +1 -0
- package/dist/components/primitives/CopyableText/index.d.ts +20 -0
- package/dist/components/primitives/CopyableText/index.d.ts.map +1 -0
- package/dist/components/primitives/DatePicker/DatePicker.d.ts +51 -0
- package/dist/components/primitives/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts +29 -0
- package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts.map +1 -0
- package/dist/components/primitives/Dialog/Dialog.d.ts +62 -0
- package/dist/components/primitives/Dialog/Dialog.d.ts.map +1 -0
- package/dist/components/primitives/Dialog/Dialog.styles.d.ts +27 -0
- package/dist/components/primitives/Dialog/Dialog.styles.d.ts.map +1 -0
- package/dist/components/primitives/Divider/Divider.d.ts +59 -0
- package/dist/components/primitives/Divider/Divider.d.ts.map +1 -0
- package/dist/components/primitives/Divider/Divider.styles.d.ts +33 -0
- package/dist/components/primitives/Divider/Divider.styles.d.ts.map +1 -0
- package/dist/components/primitives/FormControl/FormControl.d.ts +52 -0
- package/dist/components/primitives/FormControl/FormControl.d.ts.map +1 -0
- package/dist/components/primitives/FormControl/FormControl.styles.d.ts +31 -0
- package/dist/components/primitives/FormControl/FormControl.styles.d.ts.map +1 -0
- package/dist/components/primitives/Icons/ArrowLeftRight.d.ts +30 -0
- package/dist/components/primitives/Icons/ArrowLeftRight.d.ts.map +1 -0
- package/dist/components/primitives/Icons/ArrowRightLeft.d.ts +30 -0
- package/dist/components/primitives/Icons/ArrowRightLeft.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Building.d.ts +41 -0
- package/dist/components/primitives/Icons/Building.d.ts.map +1 -0
- package/dist/components/primitives/Icons/BuildingAlt.d.ts +41 -0
- package/dist/components/primitives/Icons/BuildingAlt.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Check.d.ts +41 -0
- package/dist/components/primitives/Icons/Check.d.ts.map +1 -0
- package/dist/components/primitives/Icons/ChevronDown.d.ts +41 -0
- package/dist/components/primitives/Icons/ChevronDown.d.ts.map +1 -0
- package/dist/components/primitives/Icons/CircleAlert.d.ts +24 -0
- package/dist/components/primitives/Icons/CircleAlert.d.ts.map +1 -0
- package/dist/components/primitives/Icons/CircleCheck.d.ts +24 -0
- package/dist/components/primitives/Icons/CircleCheck.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Eye.d.ts +24 -0
- package/dist/components/primitives/Icons/Eye.d.ts.map +1 -0
- package/dist/components/primitives/Icons/EyeOff.d.ts +24 -0
- package/dist/components/primitives/Icons/EyeOff.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Info.d.ts +24 -0
- package/dist/components/primitives/Icons/Info.d.ts.map +1 -0
- package/dist/components/primitives/Icons/LogOut.d.ts +24 -0
- package/dist/components/primitives/Icons/LogOut.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Plus.d.ts +24 -0
- package/dist/components/primitives/Icons/Plus.d.ts.map +1 -0
- package/dist/components/primitives/Icons/Settings.d.ts +1 -0
- package/dist/components/primitives/Icons/Settings.d.ts.map +1 -0
- package/dist/components/primitives/Icons/TriangleAlert.d.ts +24 -0
- package/dist/components/primitives/Icons/TriangleAlert.d.ts.map +1 -0
- package/dist/components/primitives/Icons/User.d.ts +24 -0
- package/dist/components/primitives/Icons/User.d.ts.map +1 -0
- package/dist/components/primitives/Icons/X.d.ts +24 -0
- package/dist/components/primitives/Icons/X.d.ts.map +1 -0
- package/dist/components/primitives/Icons/flowIconRegistry.d.ts +29 -0
- package/dist/components/primitives/Icons/flowIconRegistry.d.ts.map +1 -0
- package/dist/components/primitives/Icons/index.d.ts +29 -0
- package/dist/components/primitives/Icons/index.d.ts.map +1 -0
- package/dist/components/primitives/InputLabel/InputLabel.d.ts +52 -0
- package/dist/components/primitives/InputLabel/InputLabel.d.ts.map +1 -0
- package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts +31 -0
- package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts +124 -0
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts.map +1 -0
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts +30 -0
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts.map +1 -0
- package/dist/components/primitives/Logo/Logo.d.ts +53 -0
- package/dist/components/primitives/Logo/Logo.d.ts.map +1 -0
- package/dist/components/primitives/Logo/Logo.styles.d.ts +29 -0
- package/dist/components/primitives/Logo/Logo.styles.d.ts.map +1 -0
- package/dist/components/primitives/MultiInput/MultiInput.d.ts +89 -0
- package/dist/components/primitives/MultiInput/MultiInput.d.ts.map +1 -0
- package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts +33 -0
- package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts.map +1 -0
- package/dist/components/primitives/OtpField/OtpField.d.ts +88 -0
- package/dist/components/primitives/OtpField/OtpField.d.ts.map +1 -0
- package/dist/components/primitives/OtpField/OtpField.styles.d.ts +31 -0
- package/dist/components/primitives/OtpField/OtpField.styles.d.ts.map +1 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts +32 -0
- package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -0
- package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts +30 -0
- package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts.map +1 -0
- package/dist/components/primitives/Select/Select.d.ts +65 -0
- package/dist/components/primitives/Select/Select.d.ts.map +1 -0
- package/dist/components/primitives/Select/Select.styles.d.ts +29 -0
- package/dist/components/primitives/Select/Select.styles.d.ts.map +1 -0
- package/dist/components/primitives/Spinner/Spinner.d.ts +55 -0
- package/dist/components/primitives/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts +30 -0
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts.map +1 -0
- package/dist/components/primitives/TextField/TextField.d.ts +63 -0
- package/dist/components/primitives/TextField/TextField.d.ts.map +1 -0
- package/dist/components/primitives/TextField/TextField.styles.d.ts +31 -0
- package/dist/components/primitives/TextField/TextField.styles.d.ts.map +1 -0
- package/dist/components/primitives/Toggle/Toggle.d.ts +41 -0
- package/dist/components/primitives/Toggle/Toggle.d.ts.map +1 -0
- package/dist/components/primitives/Toggle/Toggle.styles.d.ts +21 -0
- package/dist/components/primitives/Toggle/Toggle.styles.d.ts.map +1 -0
- package/dist/components/primitives/Typography/Typography.d.ts +80 -0
- package/dist/components/primitives/Typography/Typography.d.ts.map +1 -0
- package/dist/components/primitives/Typography/Typography.styles.d.ts +39 -0
- package/dist/components/primitives/Typography/Typography.styles.d.ts.map +1 -0
- package/dist/contexts/Branding/BrandingContext.d.ts +53 -0
- package/dist/contexts/Branding/BrandingContext.d.ts.map +1 -0
- package/dist/contexts/Branding/BrandingProvider.d.ts +89 -0
- package/dist/contexts/Branding/BrandingProvider.d.ts.map +1 -0
- package/dist/contexts/Branding/useBrandingContext.d.ts +45 -0
- package/dist/contexts/Branding/useBrandingContext.d.ts.map +1 -0
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts +37 -0
- package/dist/contexts/ComponentRenderer/ComponentRendererContext.d.ts.map +1 -0
- package/dist/contexts/ComponentRenderer/ComponentRendererProvider.d.ts +25 -0
- package/dist/contexts/ComponentRenderer/ComponentRendererProvider.d.ts.map +1 -0
- package/dist/contexts/Flow/FlowContext.d.ts +75 -0
- package/dist/contexts/Flow/FlowContext.d.ts.map +1 -0
- package/dist/contexts/Flow/FlowProvider.d.ts +47 -0
- package/dist/contexts/Flow/FlowProvider.d.ts.map +1 -0
- package/dist/contexts/Flow/useFlow.d.ts +49 -0
- package/dist/contexts/Flow/useFlow.d.ts.map +1 -0
- package/dist/contexts/FlowMeta/FlowMetaContext.d.ts +45 -0
- package/dist/contexts/FlowMeta/FlowMetaContext.d.ts.map +1 -0
- package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts +51 -0
- package/dist/contexts/FlowMeta/FlowMetaProvider.d.ts.map +1 -0
- package/dist/contexts/FlowMeta/useFlowMeta.d.ts +21 -0
- package/dist/contexts/FlowMeta/useFlowMeta.d.ts.map +1 -0
- package/dist/contexts/I18n/ComponentPreferencesContext.d.ts +27 -0
- package/dist/contexts/I18n/ComponentPreferencesContext.d.ts.map +1 -0
- package/dist/contexts/I18n/I18nContext.d.ts +49 -0
- package/dist/contexts/I18n/I18nContext.d.ts.map +1 -0
- package/dist/contexts/I18n/I18nProvider.d.ts +32 -0
- package/dist/contexts/I18n/I18nProvider.d.ts.map +1 -0
- package/dist/contexts/I18n/useI18n.d.ts +28 -0
- package/dist/contexts/I18n/useI18n.d.ts.map +1 -0
- package/dist/contexts/Organization/OrganizationContext.d.ts +41 -0
- package/dist/contexts/Organization/OrganizationContext.d.ts.map +1 -0
- package/dist/contexts/Organization/OrganizationProvider.d.ts +94 -0
- package/dist/contexts/Organization/OrganizationProvider.d.ts.map +1 -0
- package/dist/contexts/Organization/useOrganization.d.ts +105 -0
- package/dist/contexts/Organization/useOrganization.d.ts.map +1 -0
- package/dist/contexts/Theme/ThemeContext.d.ts +43 -0
- package/dist/contexts/Theme/ThemeContext.d.ts.map +1 -0
- package/dist/contexts/Theme/ThemeProvider.d.ts +86 -0
- package/dist/contexts/Theme/ThemeProvider.d.ts.map +1 -0
- package/dist/contexts/Theme/types.d.ts +131 -0
- package/dist/contexts/Theme/types.d.ts.map +1 -0
- package/dist/contexts/Theme/useTheme.d.ts +21 -0
- package/dist/contexts/Theme/useTheme.d.ts.map +1 -0
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts +89 -0
- package/dist/contexts/Theme/v1/ThemeProvider.d.ts.map +1 -0
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts +58 -0
- package/dist/contexts/Theme/v2/ThemeProvider.d.ts.map +1 -0
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +184 -0
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -0
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts +26 -0
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -0
- package/dist/contexts/ThunderID/useThunderID.d.ts +21 -0
- package/dist/contexts/ThunderID/useThunderID.d.ts.map +1 -0
- package/dist/contexts/User/UserContext.d.ts +42 -0
- package/dist/contexts/User/UserContext.d.ts.map +1 -0
- package/dist/contexts/User/UserProvider.d.ts +65 -0
- package/dist/contexts/User/UserProvider.d.ts.map +1 -0
- package/dist/contexts/User/useUser.d.ts +95 -0
- package/dist/contexts/User/useUser.d.ts.map +1 -0
- package/dist/hooks/useBranding.d.ts +128 -0
- package/dist/hooks/useBranding.d.ts.map +1 -0
- package/dist/hooks/useBrowserUrl.d.ts +56 -0
- package/dist/hooks/useBrowserUrl.d.ts.map +1 -0
- package/dist/hooks/useForm.d.ts +194 -0
- package/dist/hooks/useForm.d.ts.map +1 -0
- package/dist/hooks/useTranslation.d.ts +53 -0
- package/dist/hooks/useTranslation.d.ts.map +1 -0
- package/dist/hooks/v2/useOAuthCallback.d.ts +83 -0
- package/dist/hooks/v2/useOAuthCallback.d.ts.map +1 -0
- package/dist/index.d.ts +206 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +20044 -0
- package/dist/index.js.map +1 -0
- package/dist/models/adapters.d.ts +69 -0
- package/dist/models/adapters.d.ts.map +1 -0
- package/dist/models/config.d.ts +20 -0
- package/dist/models/config.d.ts.map +1 -0
- package/dist/utils/applyThemeToDOM.d.ts +25 -0
- package/dist/utils/applyThemeToDOM.d.ts.map +1 -0
- package/dist/utils/getDisplayName.d.ts +44 -0
- package/dist/utils/getDisplayName.d.ts.map +1 -0
- package/dist/utils/getMappedUserProfileValue.d.ts +52 -0
- package/dist/utils/getMappedUserProfileValue.d.ts.map +1 -0
- package/dist/utils/normalizeThemeConfig.d.ts +31 -0
- package/dist/utils/normalizeThemeConfig.d.ts.map +1 -0
- package/dist/utils/oauth.d.ts +25 -0
- package/dist/utils/oauth.d.ts.map +1 -0
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts +34 -0
- package/dist/utils/v2/buildThemeConfigFromFlowMeta.d.ts.map +1 -0
- package/dist/utils/v2/flowTransformer.d.ts +121 -0
- package/dist/utils/v2/flowTransformer.d.ts.map +1 -0
- package/dist/utils/v2/getAuthComponentHeadings.d.ts +70 -0
- package/dist/utils/v2/getAuthComponentHeadings.d.ts.map +1 -0
- package/dist/utils/v2/passkey.d.ts +32 -0
- package/dist/utils/v2/passkey.d.ts.map +1 -0
- package/dist/utils/v2/resolveTranslationsInArray.d.ts +30 -0
- package/dist/utils/v2/resolveTranslationsInArray.d.ts.map +1 -0
- package/dist/utils/v2/resolveTranslationsInObject.d.ts +30 -0
- package/dist/utils/v2/resolveTranslationsInObject.d.ts.map +1 -0
- package/package.json +75 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThunderIDProvider.d.ts","sourceRoot":"","sources":["../../../src/contexts/ThunderID/ThunderIDProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAsBH,OAAO,EAAC,EAAE,EAAa,iBAAiB,EAAkE,MAAM,OAAO,CAAC;AAGxH,OAAO,EAAC,oBAAoB,EAAC,MAAM,qBAAqB,CAAC;AAgBzD;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,oBAAoB,CAAC;AAE1D,QAAA,MAAM,iBAAiB,EAAE,EAAE,CAAC,iBAAiB,CAAC,sBAAsB,CAAC,CA6pBpE,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { ThunderIDContextProps } from './ThunderIDContext';
|
|
19
|
+
declare const useThunderID: () => ThunderIDContextProps;
|
|
20
|
+
export default useThunderID;
|
|
21
|
+
//# sourceMappingURL=useThunderID.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useThunderID.d.ts","sourceRoot":"","sources":["../../../src/contexts/ThunderID/useThunderID.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH,OAAyB,EAAC,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AAI3E,QAAA,MAAM,YAAY,QAAO,qBA6BxB,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { User, Schema, UpdateMeProfileConfig } from '@thunderid/browser';
|
|
19
|
+
import { Context } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Props interface of {@link UserContext}
|
|
22
|
+
*/
|
|
23
|
+
export interface UserContextProps {
|
|
24
|
+
flattenedProfile: User | null;
|
|
25
|
+
onUpdateProfile: (payload: User) => void;
|
|
26
|
+
profile: User | null;
|
|
27
|
+
revalidateProfile: () => Promise<void>;
|
|
28
|
+
schemas: Schema[] | null;
|
|
29
|
+
updateProfile: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
|
|
30
|
+
data: {
|
|
31
|
+
user: User;
|
|
32
|
+
};
|
|
33
|
+
error: string;
|
|
34
|
+
success: boolean;
|
|
35
|
+
}>;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Context object for managing user profile data and related operations.
|
|
39
|
+
*/
|
|
40
|
+
declare const UserContext: Context<UserContextProps | null>;
|
|
41
|
+
export default UserContext;
|
|
42
|
+
//# sourceMappingURL=UserContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserContext.d.ts","sourceRoot":"","sources":["../../../src/contexts/User/UserContext.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,IAAI,EAAE,MAAM,EAAE,qBAAqB,EAAC,MAAM,oBAAoB,CAAC;AACvE,OAAO,EAAC,OAAO,EAAgB,MAAM,OAAO,CAAC;AAE7C;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,gBAAgB,EAAE,IAAI,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IACzC,OAAO,EAAE,IAAI,GAAG,IAAI,CAAC;IACrB,iBAAiB,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACvC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,CAAC;IACzB,aAAa,EAAE,CACb,aAAa,EAAE,qBAAqB,EACpC,SAAS,CAAC,EAAE,MAAM,KACf,OAAO,CAAC;QAAC,IAAI,EAAE;YAAC,IAAI,EAAE,IAAI,CAAA;SAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;CACrE;AAED;;GAEG;AACH,QAAA,MAAM,WAAW,EAAE,OAAO,CAAC,gBAAgB,GAAG,IAAI,CAOhD,CAAC;AAIH,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { UpdateMeProfileConfig, User, UserProfile } from '@thunderid/browser';
|
|
19
|
+
import { FC, PropsWithChildren } from 'react';
|
|
20
|
+
/**
|
|
21
|
+
* Props interface of {@link UserProvider}
|
|
22
|
+
*/
|
|
23
|
+
export interface UserProviderProps {
|
|
24
|
+
onUpdateProfile?: (payload: User) => void;
|
|
25
|
+
profile: UserProfile;
|
|
26
|
+
revalidateProfile?: () => Promise<void>;
|
|
27
|
+
updateProfile?: (requestConfig: UpdateMeProfileConfig, sessionId?: string) => Promise<{
|
|
28
|
+
data: {
|
|
29
|
+
user: User;
|
|
30
|
+
};
|
|
31
|
+
error: string;
|
|
32
|
+
success: boolean;
|
|
33
|
+
}>;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* UserProvider component that manages user profile data and provides it through UserContext.
|
|
37
|
+
*
|
|
38
|
+
* This provider:
|
|
39
|
+
* - Fetches user profile data from the ME endpoint
|
|
40
|
+
* - Retrieves SCIM2 schemas for profile structure
|
|
41
|
+
* - Generates both nested and flattened user profiles
|
|
42
|
+
* - Provides functions for refreshing and updating user data
|
|
43
|
+
* - Handles loading states and errors
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```tsx
|
|
47
|
+
* // Basic usage
|
|
48
|
+
* <UserProvider>
|
|
49
|
+
* <App />
|
|
50
|
+
* </UserProvider>
|
|
51
|
+
*
|
|
52
|
+
* // With custom error handling
|
|
53
|
+
* <UserProvider onError={(error) => console.error('User error:', error)}>
|
|
54
|
+
* <App />
|
|
55
|
+
* </UserProvider>
|
|
56
|
+
*
|
|
57
|
+
* // Disable auto-fetch (fetch manually using refreshUser)
|
|
58
|
+
* <UserProvider autoFetch={false}>
|
|
59
|
+
* <App />
|
|
60
|
+
* </UserProvider>
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
declare const UserProvider: FC<PropsWithChildren<UserProviderProps>>;
|
|
64
|
+
export default UserProvider;
|
|
65
|
+
//# sourceMappingURL=UserProvider.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UserProvider.d.ts","sourceRoot":"","sources":["../../../src/contexts/User/UserProvider.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,qBAAqB,EAAE,IAAI,EAAE,WAAW,EAAC,MAAM,oBAAoB,CAAC;AAC5E,OAAO,EAAC,EAAE,EAAE,iBAAiB,EAAwB,MAAM,OAAO,CAAC;AAGnE;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,IAAI,KAAK,IAAI,CAAC;IAC1C,OAAO,EAAE,WAAW,CAAC;IACrB,iBAAiB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACxC,aAAa,CAAC,EAAE,CACd,aAAa,EAAE,qBAAqB,EACpC,SAAS,CAAC,EAAE,MAAM,KACf,OAAO,CAAC;QAAC,IAAI,EAAE;YAAC,IAAI,EAAE,IAAI,CAAA;SAAC,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAC,CAAC,CAAC;CACrE;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,QAAA,MAAM,YAAY,EAAE,EAAE,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,CAoB1D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { UserContextProps } from './UserContext';
|
|
19
|
+
/**
|
|
20
|
+
* Hook to access the User context.
|
|
21
|
+
*
|
|
22
|
+
* This hook provides access to user profile data including:
|
|
23
|
+
* - Raw profile API response
|
|
24
|
+
* - SCIM2 schemas
|
|
25
|
+
* - Nested user object
|
|
26
|
+
* - Flattened user profile
|
|
27
|
+
* - Functions to refresh and update user data
|
|
28
|
+
* - Loading states and error handling
|
|
29
|
+
*
|
|
30
|
+
* @returns {UserContextProps} The user context value containing all user-related data and functions
|
|
31
|
+
* @throws {Error} Throws an error if used outside of UserProvider
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```tsx
|
|
35
|
+
* import {useUser} from '@thunderid/react';
|
|
36
|
+
*
|
|
37
|
+
* function ProfileComponent() {
|
|
38
|
+
* const {
|
|
39
|
+
* isLoading,
|
|
40
|
+
* profile,
|
|
41
|
+
* schemas,
|
|
42
|
+
* user,
|
|
43
|
+
* flattenedUser,
|
|
44
|
+
* refreshUser,
|
|
45
|
+
* updateUser,
|
|
46
|
+
* error
|
|
47
|
+
* } = useUser();
|
|
48
|
+
*
|
|
49
|
+
* if (isLoading) {
|
|
50
|
+
* return <div>Loading user data...</div>;
|
|
51
|
+
* }
|
|
52
|
+
*
|
|
53
|
+
* if (error) {
|
|
54
|
+
* return <div>Error: {error.message}</div>;
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* return (
|
|
58
|
+
* <div>
|
|
59
|
+
* <h1>Welcome {user?.name?.givenName}!</h1>
|
|
60
|
+
* <p>Email: {flattenedUser?.emails}</p>
|
|
61
|
+
* <button onClick={refreshUser}>Refresh Profile</button>
|
|
62
|
+
* </div>
|
|
63
|
+
* );
|
|
64
|
+
* }
|
|
65
|
+
*
|
|
66
|
+
* // Access specific user properties
|
|
67
|
+
* function UserEmail() {
|
|
68
|
+
* const {flattenedUser} = useUser();
|
|
69
|
+
* return <span>{flattenedUser?.emails?.[0]}</span>;
|
|
70
|
+
* }
|
|
71
|
+
*
|
|
72
|
+
* // Update user profile
|
|
73
|
+
* function EditProfile() {
|
|
74
|
+
* const {updateUser, user} = useUser();
|
|
75
|
+
*
|
|
76
|
+
* const handleUpdate = async () => {
|
|
77
|
+
* try {
|
|
78
|
+
* await updateUser({
|
|
79
|
+
* name: {
|
|
80
|
+
* givenName: 'John',
|
|
81
|
+
* familyName: 'Doe'
|
|
82
|
+
* }
|
|
83
|
+
* });
|
|
84
|
+
* } catch (error) {
|
|
85
|
+
* console.error('Update failed:', error);
|
|
86
|
+
* }
|
|
87
|
+
* };
|
|
88
|
+
*
|
|
89
|
+
* return <button onClick={handleUpdate}>Update Name</button>;
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
declare const useUser: () => UserContextProps;
|
|
94
|
+
export default useUser;
|
|
95
|
+
//# sourceMappingURL=useUser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUser.d.ts","sourceRoot":"","sources":["../../../src/contexts/User/useUser.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAGH,OAAoB,EAAC,gBAAgB,EAAC,MAAM,eAAe,CAAC;AAE5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyEG;AACH,QAAA,MAAM,OAAO,QAAO,gBAQnB,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { BrandingPreference, Theme } from '@thunderid/browser';
|
|
19
|
+
/**
|
|
20
|
+
* Configuration options for the useBranding hook
|
|
21
|
+
* @deprecated Use BrandingProvider instead for better performance and consistency
|
|
22
|
+
*/
|
|
23
|
+
export interface UseBrandingConfig {
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
26
|
+
*/
|
|
27
|
+
autoFetch?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
30
|
+
*/
|
|
31
|
+
fetcher?: (url: string, config: RequestInit) => Promise<Response>;
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
34
|
+
*/
|
|
35
|
+
forceTheme?: 'light' | 'dark';
|
|
36
|
+
/**
|
|
37
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
38
|
+
*/
|
|
39
|
+
locale?: string;
|
|
40
|
+
/**
|
|
41
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
42
|
+
*/
|
|
43
|
+
name?: string;
|
|
44
|
+
/**
|
|
45
|
+
* @deprecated This configuration is now handled by BrandingProvider
|
|
46
|
+
*/
|
|
47
|
+
type?: string;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Return type of the useBranding hook
|
|
51
|
+
*/
|
|
52
|
+
export interface UseBrandingReturn {
|
|
53
|
+
/**
|
|
54
|
+
* The active theme mode from branding preference ('light' | 'dark')
|
|
55
|
+
*/
|
|
56
|
+
activeTheme: 'light' | 'dark' | null;
|
|
57
|
+
/**
|
|
58
|
+
* The raw branding preference data
|
|
59
|
+
*/
|
|
60
|
+
brandingPreference: BrandingPreference | null;
|
|
61
|
+
/**
|
|
62
|
+
* Error state
|
|
63
|
+
*/
|
|
64
|
+
error: Error | null;
|
|
65
|
+
/**
|
|
66
|
+
* Function to manually fetch branding preference
|
|
67
|
+
*/
|
|
68
|
+
fetchBranding: () => Promise<void>;
|
|
69
|
+
/**
|
|
70
|
+
* Loading state
|
|
71
|
+
*/
|
|
72
|
+
isLoading: boolean;
|
|
73
|
+
/**
|
|
74
|
+
* Function to refetch branding preference
|
|
75
|
+
* This bypasses the single-call restriction and forces a new API call
|
|
76
|
+
*/
|
|
77
|
+
refetch: () => Promise<void>;
|
|
78
|
+
/**
|
|
79
|
+
* The transformed theme object
|
|
80
|
+
*/
|
|
81
|
+
theme: Theme | null;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* React hook for accessing branding preferences from the BrandingProvider context.
|
|
85
|
+
* This hook provides access to branding preferences, theme data, and loading states.
|
|
86
|
+
*
|
|
87
|
+
* @deprecated Consider using useBrandingContext directly for better performance.
|
|
88
|
+
* This hook is maintained for backward compatibility.
|
|
89
|
+
*
|
|
90
|
+
* @param config - Configuration options (deprecated, use BrandingProvider props instead)
|
|
91
|
+
* @returns Object containing branding preference data, theme, loading state, error, and refetch function
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* Basic usage:
|
|
95
|
+
* ```tsx
|
|
96
|
+
* function MyComponent() {
|
|
97
|
+
* const { theme, activeTheme, isLoading, error } = useBranding();
|
|
98
|
+
*
|
|
99
|
+
* if (isLoading) return <div>Loading branding...</div>;
|
|
100
|
+
* if (error) return <div>Error: {error.message}</div>;
|
|
101
|
+
*
|
|
102
|
+
* return (
|
|
103
|
+
* <div style={{ color: theme?.colors?.primary?.main }}>
|
|
104
|
+
* <p>Active theme mode: {activeTheme}</p>
|
|
105
|
+
* <p>Styled with ThunderID branding</p>
|
|
106
|
+
* </div>
|
|
107
|
+
* );
|
|
108
|
+
* }
|
|
109
|
+
* ```
|
|
110
|
+
*
|
|
111
|
+
* @example
|
|
112
|
+
* For new implementations, use BrandingProvider with useBrandingContext:
|
|
113
|
+
* ```tsx
|
|
114
|
+
* // In your root component
|
|
115
|
+
* <BrandingProvider baseUrl="https://api.asgardeo.io/t/your-org">
|
|
116
|
+
* <App />
|
|
117
|
+
* </BrandingProvider>
|
|
118
|
+
*
|
|
119
|
+
* // In your component
|
|
120
|
+
* function MyComponent() {
|
|
121
|
+
* const { theme, activeTheme, isLoading, error } = useBrandingContext();
|
|
122
|
+
* // ... rest of your component
|
|
123
|
+
* }
|
|
124
|
+
* ```
|
|
125
|
+
*/
|
|
126
|
+
export declare const useBranding: () => UseBrandingReturn;
|
|
127
|
+
export default useBranding;
|
|
128
|
+
//# sourceMappingURL=useBranding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBranding.d.ts","sourceRoot":"","sources":["../../src/hooks/useBranding.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAC,kBAAkB,EAAE,KAAK,EAA+B,MAAM,oBAAoB,CAAC;AAQ3F;;;GAGG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB;;OAEG;IACH,OAAO,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;IAClE;;OAEG;IACH,UAAU,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAC9B;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC;;OAEG;IACH,WAAW,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CAAC;IACrC;;OAEG;IACH,kBAAkB,EAAE,kBAAkB,GAAG,IAAI,CAAC;IAC9C;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;IACpB;;OAEG;IACH,aAAa,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IACnC;;OAEG;IACH,SAAS,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,OAAO,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;IAC7B;;OAEG;IACH,KAAK,EAAE,KAAK,GAAG,IAAI,CAAC;CACrB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,eAAO,MAAM,WAAW,QAAO,iBAmB9B,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
/**
|
|
19
|
+
* Interface for the useBrowserUrl hook return value.
|
|
20
|
+
*/
|
|
21
|
+
export interface UseBrowserUrl {
|
|
22
|
+
/**
|
|
23
|
+
* Checks if the current URL contains authentication parameters.
|
|
24
|
+
*
|
|
25
|
+
* @param url - The URL object to check for authentication parameters
|
|
26
|
+
* @param afterSignInUrl - The URL where the authorization server should redirect after authentication
|
|
27
|
+
* @returns True if the URL contains authentication parameters and matches the afterSignInUrl, or if it contains an error parameter
|
|
28
|
+
*/
|
|
29
|
+
hasAuthParams: (url: URL, afterSignInUrl: string) => boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Checks if the URL indicates that the authentication flow has been called for this instance.
|
|
32
|
+
*
|
|
33
|
+
* @param url - The URL object to check
|
|
34
|
+
* @param instanceId - The instance ID to check against
|
|
35
|
+
* @returns True if the URL indicates the flow has been called for this instance
|
|
36
|
+
*/
|
|
37
|
+
hasCalledForThisInstance: (url: URL, instanceId: number) => boolean;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Hook that provides utilities for handling browser URLs in authentication flows.
|
|
41
|
+
*
|
|
42
|
+
* @returns An object containing URL utility functions
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* const { hasAuthParams } = useBrowserUrl();
|
|
47
|
+
* const url = new URL(window.location.href);
|
|
48
|
+
*
|
|
49
|
+
* if (hasAuthParams(url, "/after-signin")) {
|
|
50
|
+
* // Handle authentication callback
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
declare const useBrowserUrl: () => UseBrowserUrl;
|
|
55
|
+
export default useBrowserUrl;
|
|
56
|
+
//# sourceMappingURL=useBrowserUrl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBrowserUrl.d.ts","sourceRoot":"","sources":["../../src/hooks/useBrowserUrl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAIH;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;;;;;OAMG;IACH,aAAa,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,cAAc,EAAE,MAAM,KAAK,OAAO,CAAC;IAE7D;;;;;;OAMG;IACH,wBAAwB,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,KAAK,OAAO,CAAC;CACrE;AAED;;;;;;;;;;;;;;GAcG;AACH,QAAA,MAAM,aAAa,QAAO,aAUzB,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,194 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
|
|
3
|
+
*
|
|
4
|
+
* WSO2 LLC. licenses this file to you under the Apache License,
|
|
5
|
+
* Version 2.0 (the "License"); you may not use this file except
|
|
6
|
+
* in compliance with the License.
|
|
7
|
+
* You may obtain a copy of the License at
|
|
8
|
+
*
|
|
9
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
10
|
+
*
|
|
11
|
+
* Unless required by applicable law or agreed to in writing,
|
|
12
|
+
* software distributed under the License is distributed on an
|
|
13
|
+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
|
|
14
|
+
* KIND, either express or implied. See the License for the
|
|
15
|
+
* specific language governing permissions and limitations
|
|
16
|
+
* under the License.
|
|
17
|
+
*/
|
|
18
|
+
import { FormEvent } from 'react';
|
|
19
|
+
/**
|
|
20
|
+
* Generic form field configuration
|
|
21
|
+
*/
|
|
22
|
+
export interface FormField {
|
|
23
|
+
initialValue?: string;
|
|
24
|
+
name: string;
|
|
25
|
+
required?: boolean;
|
|
26
|
+
validator?: (value: string) => string | null;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Form validation result
|
|
30
|
+
*/
|
|
31
|
+
export interface ValidationResult {
|
|
32
|
+
errors: Record<string, string>;
|
|
33
|
+
isValid: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Configuration for the useForm hook
|
|
37
|
+
*/
|
|
38
|
+
export interface UseFormConfig<T extends Record<string, string>> {
|
|
39
|
+
/**
|
|
40
|
+
* Form field definitions
|
|
41
|
+
*/
|
|
42
|
+
fields?: FormField[];
|
|
43
|
+
/**
|
|
44
|
+
* Initial form values
|
|
45
|
+
*/
|
|
46
|
+
initialValues?: Partial<T>;
|
|
47
|
+
/**
|
|
48
|
+
* Custom required field validation message
|
|
49
|
+
*/
|
|
50
|
+
requiredMessage?: string;
|
|
51
|
+
/**
|
|
52
|
+
* Whether to validate on blur (default: true)
|
|
53
|
+
*/
|
|
54
|
+
validateOnBlur?: boolean;
|
|
55
|
+
/**
|
|
56
|
+
* Whether to validate on change (default: false)
|
|
57
|
+
*/
|
|
58
|
+
validateOnChange?: boolean;
|
|
59
|
+
/**
|
|
60
|
+
* Global form validator function
|
|
61
|
+
*/
|
|
62
|
+
validator?: (values: T) => Record<string, string>;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* Return type for the useForm hook
|
|
66
|
+
*/
|
|
67
|
+
export interface UseFormReturn<T extends Record<string, string>> {
|
|
68
|
+
/**
|
|
69
|
+
* Clear all errors
|
|
70
|
+
*/
|
|
71
|
+
clearErrors: () => void;
|
|
72
|
+
/**
|
|
73
|
+
* Current validation errors
|
|
74
|
+
*/
|
|
75
|
+
errors: Record<keyof T, string>;
|
|
76
|
+
/**
|
|
77
|
+
* Get field props for easy integration with form components
|
|
78
|
+
*/
|
|
79
|
+
getFieldProps: (name: keyof T) => {
|
|
80
|
+
error: string | undefined;
|
|
81
|
+
name: keyof T;
|
|
82
|
+
onBlur: () => void;
|
|
83
|
+
onChange: (value: string) => void;
|
|
84
|
+
required: boolean;
|
|
85
|
+
touched: boolean;
|
|
86
|
+
value: string;
|
|
87
|
+
};
|
|
88
|
+
/**
|
|
89
|
+
* Handle form submission
|
|
90
|
+
*/
|
|
91
|
+
handleSubmit: (onSubmit: (values: T) => void | Promise<void>) => (e?: FormEvent) => Promise<void>;
|
|
92
|
+
/**
|
|
93
|
+
* Whether the form has been submitted
|
|
94
|
+
*/
|
|
95
|
+
isSubmitted: boolean;
|
|
96
|
+
/**
|
|
97
|
+
* Whether the form is currently valid
|
|
98
|
+
*/
|
|
99
|
+
isValid: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Reset the form to initial values
|
|
102
|
+
*/
|
|
103
|
+
reset: () => void;
|
|
104
|
+
/**
|
|
105
|
+
* Set a field error
|
|
106
|
+
*/
|
|
107
|
+
setError: (name: keyof T, error: string) => void;
|
|
108
|
+
/**
|
|
109
|
+
* Set multiple field errors
|
|
110
|
+
*/
|
|
111
|
+
setErrors: (errors: Partial<Record<keyof T, string>>) => void;
|
|
112
|
+
/**
|
|
113
|
+
* Mark a field as touched
|
|
114
|
+
*/
|
|
115
|
+
setTouched: (name: keyof T, touched?: boolean) => void;
|
|
116
|
+
/**
|
|
117
|
+
* Mark multiple fields as touched
|
|
118
|
+
*/
|
|
119
|
+
setTouchedFields: (touched: Partial<Record<keyof T, boolean>>) => void;
|
|
120
|
+
/**
|
|
121
|
+
* Set a single field value
|
|
122
|
+
*/
|
|
123
|
+
setValue: (name: keyof T, value: string) => void;
|
|
124
|
+
/**
|
|
125
|
+
* Set multiple field values
|
|
126
|
+
*/
|
|
127
|
+
setValues: (values: Partial<T>) => void;
|
|
128
|
+
/**
|
|
129
|
+
* Mark all fields as touched
|
|
130
|
+
*/
|
|
131
|
+
touchAllFields: () => void;
|
|
132
|
+
/**
|
|
133
|
+
* Fields that have been touched by the user
|
|
134
|
+
*/
|
|
135
|
+
touched: Record<keyof T, boolean>;
|
|
136
|
+
/**
|
|
137
|
+
* Validate a single field
|
|
138
|
+
*/
|
|
139
|
+
validateField: (name: keyof T) => string | null;
|
|
140
|
+
/**
|
|
141
|
+
* Validate all fields
|
|
142
|
+
*/
|
|
143
|
+
validateForm: () => ValidationResult;
|
|
144
|
+
/**
|
|
145
|
+
* Current form values
|
|
146
|
+
*/
|
|
147
|
+
values: T;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Generic form hook that provides comprehensive form state management and validation.
|
|
151
|
+
*
|
|
152
|
+
* @template T - The type of form values (must extend Record<string, string>)
|
|
153
|
+
* @param config - Configuration options for the form
|
|
154
|
+
* @returns Form state and methods
|
|
155
|
+
*
|
|
156
|
+
* @example
|
|
157
|
+
* ```tsx
|
|
158
|
+
* interface LoginForm {
|
|
159
|
+
* username: string;
|
|
160
|
+
* password: string;
|
|
161
|
+
* }
|
|
162
|
+
*
|
|
163
|
+
* const {
|
|
164
|
+
* values,
|
|
165
|
+
* touched,
|
|
166
|
+
* errors,
|
|
167
|
+
* isValid,
|
|
168
|
+
* setValue,
|
|
169
|
+
* handleSubmit,
|
|
170
|
+
* getFieldProps
|
|
171
|
+
* } = useForm<LoginForm>({
|
|
172
|
+
* initialValues: { username: '', password: '' },
|
|
173
|
+
* fields: [
|
|
174
|
+
* { name: 'username', required: true },
|
|
175
|
+
* { name: 'password', required: true }
|
|
176
|
+
* ]
|
|
177
|
+
* });
|
|
178
|
+
*
|
|
179
|
+
* const onSubmit = handleSubmit((values) => {
|
|
180
|
+
* console.log('Form submitted:', values);
|
|
181
|
+
* });
|
|
182
|
+
*
|
|
183
|
+
* return (
|
|
184
|
+
* <form onSubmit={onSubmit}>
|
|
185
|
+
* <input {...getFieldProps('username')} />
|
|
186
|
+
* <input {...getFieldProps('password')} type="password" />
|
|
187
|
+
* <button type="submit" disabled={!isValid}>Submit</button>
|
|
188
|
+
* </form>
|
|
189
|
+
* );
|
|
190
|
+
* ```
|
|
191
|
+
*/
|
|
192
|
+
export declare const useForm: <T extends Record<string, string>>(config?: UseFormConfig<T>) => UseFormReturn<T>;
|
|
193
|
+
export default useForm;
|
|
194
|
+
//# sourceMappingURL=useForm.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useForm.d.ts","sourceRoot":"","sources":["../../src/hooks/useForm.ts"],"names":[],"mappings":"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"}
|