@thunderid/react 0.12.0 → 0.13.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/dist/api/getUsersMeMeta.d.ts +22 -0
- package/dist/api/getUsersMeMeta.d.ts.map +1 -0
- package/dist/api/getUsersMeMeta.js +32 -0
- package/dist/api/getUsersMeMeta.js.map +1 -0
- package/dist/cjs/api/getUsersMeMeta.cjs +34 -0
- package/dist/cjs/api/getUsersMeMeta.cjs.map +1 -0
- package/dist/cjs/components/actions/SignInButton/BaseSignInButton.cjs +2 -3
- package/dist/cjs/components/actions/SignInButton/BaseSignInButton.cjs.map +1 -1
- package/dist/cjs/components/actions/SignOutButton/BaseSignOutButton.cjs +2 -3
- package/dist/cjs/components/actions/SignOutButton/BaseSignOutButton.cjs.map +1 -1
- package/dist/cjs/components/actions/SignUpButton/BaseSignUpButton.cjs +2 -3
- package/dist/cjs/components/actions/SignUpButton/BaseSignUpButton.cjs.map +1 -1
- package/dist/cjs/components/adapters/Consent.cjs +34 -27
- package/dist/cjs/components/adapters/Consent.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs +7 -8
- package/dist/cjs/components/adapters/ConsentCheckboxList.cjs.map +1 -1
- package/dist/cjs/components/adapters/ConsentCheckboxList.styles.cjs +8 -9
- package/dist/cjs/components/adapters/ConsentCheckboxList.styles.cjs.map +1 -1
- package/dist/cjs/components/adapters/GoogleButton.cjs +425 -31
- package/dist/cjs/components/adapters/GoogleButton.cjs.map +1 -1
- package/dist/cjs/components/adapters/ImageComponent.cjs +13 -9
- package/dist/cjs/components/adapters/ImageComponent.cjs.map +1 -1
- package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.cjs +3 -4
- package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.cjs.map +1 -1
- package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.cjs +11 -12
- package/dist/cjs/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs +12 -16
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.styles.cjs +18 -15
- package/dist/cjs/components/presentation/UserDropdown/BaseUserDropdown.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs +96 -41
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.styles.cjs +25 -26
- package/dist/cjs/components/presentation/UserProfile/BaseUserProfile.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/UserProfile/UserProfile.cjs +4 -2
- package/dist/cjs/components/presentation/UserProfile/UserProfile.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs +10 -31
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs +41 -9
- package/dist/cjs/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs +75 -71
- package/dist/cjs/components/presentation/auth/AuthOptionFactory.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs +9 -22
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs +22 -9
- package/dist/cjs/components/presentation/auth/InviteUser/BaseInviteUser.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs +11 -12
- package/dist/cjs/components/presentation/auth/Recovery/BaseRecovery.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs +11 -16
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.styles.cjs +32 -27
- package/dist/cjs/components/presentation/auth/SignIn/BaseSignIn.styles.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs +11 -12
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.cjs.map +1 -1
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.styles.cjs +25 -26
- package/dist/cjs/components/presentation/auth/SignUp/BaseSignUp.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/AffixedField/AffixedField.cjs +6 -7
- package/dist/cjs/components/primitives/AffixedField/AffixedField.cjs.map +1 -1
- package/dist/cjs/components/primitives/AffixedField/AffixedField.styles.cjs +9 -10
- package/dist/cjs/components/primitives/AffixedField/AffixedField.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Alert/Alert.cjs +6 -7
- package/dist/cjs/components/primitives/Alert/Alert.cjs.map +1 -1
- package/dist/cjs/components/primitives/Alert/Alert.styles.cjs +10 -11
- package/dist/cjs/components/primitives/Alert/Alert.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Avatar/Avatar.cjs +5 -6
- package/dist/cjs/components/primitives/Avatar/Avatar.cjs.map +1 -1
- package/dist/cjs/components/primitives/Avatar/Avatar.styles.cjs +7 -8
- package/dist/cjs/components/primitives/Avatar/Avatar.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Button/Button.cjs +8 -12
- package/dist/cjs/components/primitives/Button/Button.cjs.map +1 -1
- package/dist/cjs/components/primitives/Button/Button.styles.cjs +23 -24
- package/dist/cjs/components/primitives/Button/Button.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Card/Card.cjs +8 -9
- package/dist/cjs/components/primitives/Card/Card.cjs.map +1 -1
- package/dist/cjs/components/primitives/Card/Card.styles.cjs +12 -13
- package/dist/cjs/components/primitives/Card/Card.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs +5 -6
- package/dist/cjs/components/primitives/Checkbox/Checkbox.cjs.map +1 -1
- package/dist/cjs/components/primitives/Checkbox/Checkbox.styles.cjs +7 -8
- package/dist/cjs/components/primitives/Checkbox/Checkbox.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/CopyableText/CopyableText.styles.cjs +6 -7
- package/dist/cjs/components/primitives/CopyableText/CopyableText.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/DatePicker/DatePicker.cjs +4 -5
- package/dist/cjs/components/primitives/DatePicker/DatePicker.cjs.map +1 -1
- package/dist/cjs/components/primitives/DatePicker/DatePicker.styles.cjs +5 -6
- package/dist/cjs/components/primitives/DatePicker/DatePicker.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Dialog/Dialog.cjs +7 -8
- package/dist/cjs/components/primitives/Dialog/Dialog.cjs.map +1 -1
- package/dist/cjs/components/primitives/Dialog/Dialog.styles.cjs +8 -9
- package/dist/cjs/components/primitives/Dialog/Dialog.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Divider/Divider.cjs +7 -8
- package/dist/cjs/components/primitives/Divider/Divider.cjs.map +1 -1
- package/dist/cjs/components/primitives/Divider/Divider.styles.cjs +7 -8
- package/dist/cjs/components/primitives/Divider/Divider.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/FormControl/FormControl.cjs +3 -4
- package/dist/cjs/components/primitives/FormControl/FormControl.cjs.map +1 -1
- package/dist/cjs/components/primitives/FormControl/FormControl.styles.cjs +4 -5
- package/dist/cjs/components/primitives/FormControl/FormControl.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/InputLabel/InputLabel.cjs +3 -4
- package/dist/cjs/components/primitives/InputLabel/InputLabel.cjs.map +1 -1
- package/dist/cjs/components/primitives/InputLabel/InputLabel.styles.cjs +6 -7
- package/dist/cjs/components/primitives/InputLabel/InputLabel.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.cjs +19 -20
- package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.cjs.map +1 -1
- package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.styles.cjs +16 -17
- package/dist/cjs/components/primitives/KeyValueInput/KeyValueInput.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Logo/Logo.cjs +3 -4
- package/dist/cjs/components/primitives/Logo/Logo.cjs.map +1 -1
- package/dist/cjs/components/primitives/Logo/Logo.styles.cjs +9 -10
- package/dist/cjs/components/primitives/Logo/Logo.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/MultiInput/MultiInput.cjs +11 -12
- package/dist/cjs/components/primitives/MultiInput/MultiInput.cjs.map +1 -1
- package/dist/cjs/components/primitives/MultiInput/MultiInput.styles.cjs +10 -11
- package/dist/cjs/components/primitives/MultiInput/MultiInput.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/OtpField/OtpField.cjs +4 -5
- package/dist/cjs/components/primitives/OtpField/OtpField.cjs.map +1 -1
- package/dist/cjs/components/primitives/OtpField/OtpField.styles.cjs +5 -6
- package/dist/cjs/components/primitives/OtpField/OtpField.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/PasswordField/PasswordField.cjs +3 -4
- package/dist/cjs/components/primitives/PasswordField/PasswordField.cjs.map +1 -1
- package/dist/cjs/components/primitives/PasswordField/PasswordField.styles.cjs +4 -5
- package/dist/cjs/components/primitives/PasswordField/PasswordField.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Select/Select.cjs +3 -4
- package/dist/cjs/components/primitives/Select/Select.cjs.map +1 -1
- package/dist/cjs/components/primitives/Select/Select.styles.cjs +5 -6
- package/dist/cjs/components/primitives/Select/Select.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Spinner/Spinner.cjs +4 -6
- package/dist/cjs/components/primitives/Spinner/Spinner.cjs.map +1 -1
- package/dist/cjs/components/primitives/Spinner/Spinner.styles.cjs +20 -12
- package/dist/cjs/components/primitives/Spinner/Spinner.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/TextField/TextField.cjs +6 -7
- package/dist/cjs/components/primitives/TextField/TextField.cjs.map +1 -1
- package/dist/cjs/components/primitives/TextField/TextField.styles.cjs +8 -9
- package/dist/cjs/components/primitives/TextField/TextField.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Toggle/Toggle.cjs +7 -8
- package/dist/cjs/components/primitives/Toggle/Toggle.cjs.map +1 -1
- package/dist/cjs/components/primitives/Toggle/Toggle.styles.cjs +7 -8
- package/dist/cjs/components/primitives/Toggle/Toggle.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Tooltip/Tooltip.cjs +4 -5
- package/dist/cjs/components/primitives/Tooltip/Tooltip.cjs.map +1 -1
- package/dist/cjs/components/primitives/Tooltip/Tooltip.styles.cjs +13 -14
- package/dist/cjs/components/primitives/Tooltip/Tooltip.styles.cjs.map +1 -1
- package/dist/cjs/components/primitives/Typography/Typography.cjs +2 -3
- package/dist/cjs/components/primitives/Typography/Typography.cjs.map +1 -1
- package/dist/cjs/components/primitives/Typography/Typography.styles.cjs +18 -19
- package/dist/cjs/components/primitives/Typography/Typography.styles.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs +1 -0
- package/dist/cjs/contexts/ThunderID/ThunderIDContext.cjs.map +1 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs +36 -14
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
- package/dist/cjs/contexts/User/UserContext.cjs +2 -1
- package/dist/cjs/contexts/User/UserContext.cjs.map +1 -1
- package/dist/cjs/contexts/User/UserProvider.cjs +5 -3
- package/dist/cjs/contexts/User/UserProvider.cjs.map +1 -1
- package/dist/cjs/index.cjs +2 -0
- package/dist/cjs/styles/emotion.cjs +64 -0
- package/dist/cjs/styles/emotion.cjs.map +1 -0
- package/dist/components/actions/SignInButton/BaseSignInButton.d.ts.map +1 -1
- package/dist/components/actions/SignInButton/BaseSignInButton.js +1 -1
- package/dist/components/actions/SignInButton/BaseSignInButton.js.map +1 -1
- package/dist/components/actions/SignOutButton/BaseSignOutButton.d.ts.map +1 -1
- package/dist/components/actions/SignOutButton/BaseSignOutButton.js +1 -1
- package/dist/components/actions/SignOutButton/BaseSignOutButton.js.map +1 -1
- package/dist/components/actions/SignUpButton/BaseSignUpButton.d.ts.map +1 -1
- package/dist/components/actions/SignUpButton/BaseSignUpButton.js +1 -1
- package/dist/components/actions/SignUpButton/BaseSignUpButton.js.map +1 -1
- package/dist/components/adapters/Consent.d.ts.map +1 -1
- package/dist/components/adapters/Consent.js +34 -27
- package/dist/components/adapters/Consent.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js +1 -1
- package/dist/components/adapters/ConsentCheckboxList.js.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.styles.d.ts.map +1 -1
- package/dist/components/adapters/ConsentCheckboxList.styles.js +1 -1
- package/dist/components/adapters/ConsentCheckboxList.styles.js.map +1 -1
- package/dist/components/adapters/GoogleButton.d.ts.map +1 -1
- package/dist/components/adapters/GoogleButton.js +425 -31
- package/dist/components/adapters/GoogleButton.js.map +1 -1
- package/dist/components/adapters/ImageComponent.d.ts.map +1 -1
- package/dist/components/adapters/ImageComponent.js +13 -9
- package/dist/components/adapters/ImageComponent.js.map +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.d.ts.map +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.js +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.js.map +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.d.ts.map +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.js +1 -1
- package/dist/components/presentation/LanguageSwitcher/BaseLanguageSwitcher.styles.js.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.d.ts.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.js +5 -8
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.js.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.d.ts.map +1 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.js +5 -1
- package/dist/components/presentation/UserDropdown/BaseUserDropdown.styles.js.map +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts +2 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.d.ts.map +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.js +92 -36
- package/dist/components/presentation/UserProfile/BaseUserProfile.js.map +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.d.ts.map +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.js +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.styles.js.map +1 -1
- package/dist/components/presentation/UserProfile/UserProfile.d.ts.map +1 -1
- package/dist/components/presentation/UserProfile/UserProfile.js +5 -3
- package/dist/components/presentation/UserProfile/UserProfile.js.map +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.d.ts.map +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js +7 -27
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.js.map +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.d.ts.map +1 -1
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js +38 -5
- package/dist/components/presentation/auth/AcceptInvite/BaseAcceptInvite.styles.js.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.d.ts.map +1 -1
- package/dist/components/presentation/auth/AuthOptionFactory.js +68 -63
- package/dist/components/presentation/auth/AuthOptionFactory.js.map +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.d.ts.map +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js +5 -17
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.js.map +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.d.ts.map +1 -1
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js +19 -5
- package/dist/components/presentation/auth/InviteUser/BaseInviteUser.styles.js.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.d.ts.map +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js +1 -1
- package/dist/components/presentation/auth/Recovery/BaseRecovery.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js +2 -6
- package/dist/components/presentation/auth/SignIn/BaseSignIn.js.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.js +7 -1
- package/dist/components/presentation/auth/SignIn/BaseSignIn.styles.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.js.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.d.ts.map +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.js +1 -1
- package/dist/components/presentation/auth/SignUp/BaseSignUp.styles.js.map +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.d.ts.map +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.js +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.js.map +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.styles.d.ts.map +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.styles.js +1 -1
- package/dist/components/primitives/AffixedField/AffixedField.styles.js.map +1 -1
- package/dist/components/primitives/Alert/Alert.d.ts.map +1 -1
- package/dist/components/primitives/Alert/Alert.js +1 -1
- package/dist/components/primitives/Alert/Alert.js.map +1 -1
- package/dist/components/primitives/Alert/Alert.styles.d.ts.map +1 -1
- package/dist/components/primitives/Alert/Alert.styles.js +1 -1
- package/dist/components/primitives/Alert/Alert.styles.js.map +1 -1
- package/dist/components/primitives/Avatar/Avatar.d.ts.map +1 -1
- package/dist/components/primitives/Avatar/Avatar.js +1 -1
- package/dist/components/primitives/Avatar/Avatar.js.map +1 -1
- package/dist/components/primitives/Avatar/Avatar.styles.d.ts.map +1 -1
- package/dist/components/primitives/Avatar/Avatar.styles.js +1 -1
- package/dist/components/primitives/Avatar/Avatar.styles.js.map +1 -1
- package/dist/components/primitives/Button/Button.d.ts.map +1 -1
- package/dist/components/primitives/Button/Button.js +2 -5
- package/dist/components/primitives/Button/Button.js.map +1 -1
- package/dist/components/primitives/Button/Button.styles.d.ts.map +1 -1
- package/dist/components/primitives/Button/Button.styles.js +1 -1
- package/dist/components/primitives/Button/Button.styles.js.map +1 -1
- package/dist/components/primitives/Card/Card.d.ts.map +1 -1
- package/dist/components/primitives/Card/Card.js +1 -1
- package/dist/components/primitives/Card/Card.js.map +1 -1
- package/dist/components/primitives/Card/Card.styles.d.ts.map +1 -1
- package/dist/components/primitives/Card/Card.styles.js +1 -1
- package/dist/components/primitives/Card/Card.styles.js.map +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.d.ts.map +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.js +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.js.map +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.styles.d.ts.map +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.styles.js +1 -1
- package/dist/components/primitives/Checkbox/Checkbox.styles.js.map +1 -1
- package/dist/components/primitives/CopyableText/CopyableText.styles.d.ts.map +1 -1
- package/dist/components/primitives/CopyableText/CopyableText.styles.js +1 -1
- package/dist/components/primitives/CopyableText/CopyableText.styles.js.map +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.d.ts.map +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.js +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.js.map +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.styles.d.ts.map +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.styles.js +1 -1
- package/dist/components/primitives/DatePicker/DatePicker.styles.js.map +1 -1
- package/dist/components/primitives/Dialog/Dialog.d.ts.map +1 -1
- package/dist/components/primitives/Dialog/Dialog.js +1 -1
- package/dist/components/primitives/Dialog/Dialog.js.map +1 -1
- package/dist/components/primitives/Dialog/Dialog.styles.d.ts.map +1 -1
- package/dist/components/primitives/Dialog/Dialog.styles.js +1 -1
- package/dist/components/primitives/Dialog/Dialog.styles.js.map +1 -1
- package/dist/components/primitives/Divider/Divider.d.ts.map +1 -1
- package/dist/components/primitives/Divider/Divider.js +1 -1
- package/dist/components/primitives/Divider/Divider.js.map +1 -1
- package/dist/components/primitives/Divider/Divider.styles.d.ts.map +1 -1
- package/dist/components/primitives/Divider/Divider.styles.js +1 -1
- package/dist/components/primitives/Divider/Divider.styles.js.map +1 -1
- package/dist/components/primitives/FormControl/FormControl.d.ts.map +1 -1
- package/dist/components/primitives/FormControl/FormControl.js +1 -1
- package/dist/components/primitives/FormControl/FormControl.js.map +1 -1
- package/dist/components/primitives/FormControl/FormControl.styles.d.ts.map +1 -1
- package/dist/components/primitives/FormControl/FormControl.styles.js +1 -1
- package/dist/components/primitives/FormControl/FormControl.styles.js.map +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.d.ts.map +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.js +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.js.map +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.styles.d.ts.map +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.styles.js +1 -1
- package/dist/components/primitives/InputLabel/InputLabel.styles.js.map +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.d.ts.map +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.js +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.js.map +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.d.ts.map +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.js +1 -1
- package/dist/components/primitives/KeyValueInput/KeyValueInput.styles.js.map +1 -1
- package/dist/components/primitives/Logo/Logo.d.ts.map +1 -1
- package/dist/components/primitives/Logo/Logo.js +1 -1
- package/dist/components/primitives/Logo/Logo.js.map +1 -1
- package/dist/components/primitives/Logo/Logo.styles.d.ts.map +1 -1
- package/dist/components/primitives/Logo/Logo.styles.js +1 -1
- package/dist/components/primitives/Logo/Logo.styles.js.map +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.d.ts.map +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.js +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.js.map +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.styles.d.ts.map +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.styles.js +1 -1
- package/dist/components/primitives/MultiInput/MultiInput.styles.js.map +1 -1
- package/dist/components/primitives/OtpField/OtpField.d.ts.map +1 -1
- package/dist/components/primitives/OtpField/OtpField.js +1 -1
- package/dist/components/primitives/OtpField/OtpField.js.map +1 -1
- package/dist/components/primitives/OtpField/OtpField.styles.d.ts.map +1 -1
- package/dist/components/primitives/OtpField/OtpField.styles.js +1 -1
- package/dist/components/primitives/OtpField/OtpField.styles.js.map +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.d.ts.map +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.js +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.js.map +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.styles.d.ts.map +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.styles.js +1 -1
- package/dist/components/primitives/PasswordField/PasswordField.styles.js.map +1 -1
- package/dist/components/primitives/Select/Select.d.ts.map +1 -1
- package/dist/components/primitives/Select/Select.js +1 -1
- package/dist/components/primitives/Select/Select.js.map +1 -1
- package/dist/components/primitives/Select/Select.styles.d.ts.map +1 -1
- package/dist/components/primitives/Select/Select.styles.js +1 -1
- package/dist/components/primitives/Select/Select.styles.js.map +1 -1
- package/dist/components/primitives/Spinner/Spinner.d.ts +5 -3
- package/dist/components/primitives/Spinner/Spinner.d.ts.map +1 -1
- package/dist/components/primitives/Spinner/Spinner.js +4 -5
- package/dist/components/primitives/Spinner/Spinner.js.map +1 -1
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts +4 -1
- package/dist/components/primitives/Spinner/Spinner.styles.d.ts.map +1 -1
- package/dist/components/primitives/Spinner/Spinner.styles.js +16 -7
- package/dist/components/primitives/Spinner/Spinner.styles.js.map +1 -1
- package/dist/components/primitives/TextField/TextField.d.ts.map +1 -1
- package/dist/components/primitives/TextField/TextField.js +1 -1
- package/dist/components/primitives/TextField/TextField.js.map +1 -1
- package/dist/components/primitives/TextField/TextField.styles.d.ts.map +1 -1
- package/dist/components/primitives/TextField/TextField.styles.js +1 -1
- package/dist/components/primitives/TextField/TextField.styles.js.map +1 -1
- package/dist/components/primitives/Toggle/Toggle.d.ts.map +1 -1
- package/dist/components/primitives/Toggle/Toggle.js +1 -1
- package/dist/components/primitives/Toggle/Toggle.js.map +1 -1
- package/dist/components/primitives/Toggle/Toggle.styles.d.ts.map +1 -1
- package/dist/components/primitives/Toggle/Toggle.styles.js +1 -1
- package/dist/components/primitives/Toggle/Toggle.styles.js.map +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.d.ts.map +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.js +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.js.map +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.styles.d.ts.map +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.styles.js +1 -1
- package/dist/components/primitives/Tooltip/Tooltip.styles.js.map +1 -1
- package/dist/components/primitives/Typography/Typography.d.ts.map +1 -1
- package/dist/components/primitives/Typography/Typography.js +1 -1
- package/dist/components/primitives/Typography/Typography.js.map +1 -1
- package/dist/components/primitives/Typography/Typography.styles.d.ts.map +1 -1
- package/dist/components/primitives/Typography/Typography.styles.js +1 -1
- package/dist/components/primitives/Typography/Typography.styles.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts +5 -1
- package/dist/contexts/ThunderID/ThunderIDContext.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDContext.js +1 -0
- package/dist/contexts/ThunderID/ThunderIDContext.js.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js +36 -14
- package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
- package/dist/contexts/User/UserContext.d.ts +2 -1
- package/dist/contexts/User/UserContext.d.ts.map +1 -1
- package/dist/contexts/User/UserContext.js +2 -1
- package/dist/contexts/User/UserContext.js.map +1 -1
- package/dist/contexts/User/UserProvider.d.ts +5 -2
- package/dist/contexts/User/UserProvider.d.ts.map +1 -1
- package/dist/contexts/User/UserProvider.js +5 -3
- package/dist/contexts/User/UserProvider.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/models/config.d.ts +10 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/styles/emotion.d.ts +36 -0
- package/dist/styles/emotion.d.ts.map +1 -0
- package/dist/styles/emotion.js +58 -0
- package/dist/styles/emotion.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.cjs","names":["Toggle: FC<ToggleProps>","useTheme","styles: Record<string, string>","useStyles","FormControl","InputLabel"],"sources":["../../../../../src/components/primitives/Toggle/Toggle.tsx"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Toggle.cjs","names":["Toggle: FC<ToggleProps>","useTheme","styles: Record<string, string>","useStyles","FormControl","cx","InputLabel"],"sources":["../../../../../src/components/primitives/Toggle/Toggle.tsx"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {FC, InputHTMLAttributes} from 'react';\nimport useStyles from './Toggle.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\n\n/**\n * Props for the Toggle component.\n */\nexport interface ToggleProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n className?: string;\n error?: string;\n helperText?: string;\n label?: string;\n required?: boolean;\n}\n\n/**\n * A Toggle component that represents a boolean input. It is built on top of a hidden checkbox input\n * and styled to look like a switch.\n *\n * The component is wrapped in a FormControl to display error messages and helper text.\n * The label is associated with the input for accessibility.\n *\n * @param props - Props for the Toggle component\n * @returns A JSX element representing the Toggle\n */\nconst Toggle: FC<ToggleProps> = ({label, error, className, required, helperText, style = {}, ...rest}: ToggleProps) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const hasError = !!error;\n const styles: Record<string, string> = useStyles(theme, colorScheme, hasError, !!required);\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={cx(withVendorCSSClassPrefix(bem('toggle')), className)}\n helperTextMarginLeft={`calc(${theme.vars.spacing.unit} * 5.5)`}\n >\n <label style={style} className={cx(withVendorCSSClassPrefix(bem('toggle', 'container')), styles['container'])}>\n <input\n type=\"checkbox\"\n role=\"switch\"\n className={cx(withVendorCSSClassPrefix(bem('toggle', 'input')), styles['input'])}\n aria-invalid={hasError}\n aria-required={required}\n {...rest}\n />\n <div className={cx(withVendorCSSClassPrefix(bem('toggle', 'track')), styles['track'])}>\n <span className={cx(withVendorCSSClassPrefix(bem('toggle', 'thumb')), styles['thumb'])} />\n </div>\n {label && (\n <InputLabel\n required={required}\n error={hasError}\n variant=\"inline\"\n className={cx(withVendorCSSClassPrefix(bem('toggle', 'label')), styles['label'], styles['errorLabel'], {\n [withVendorCSSClassPrefix(bem('toggle', 'label', 'error'))]: hasError,\n })}\n >\n {label}\n </InputLabel>\n )}\n </label>\n </FormControl>\n );\n};\n\nexport default Toggle;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAgCA,MAAMA,UAA2B,EAAC,OAAO,OAAO,WAAW,UAAU,YAAY,QAAQ,EAAE,CAAE,GAAG,WAAuB;CACrH,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAM,WAAW,CAAC,CAAC;CACnB,MAAMC,SAAiCC,8BAAU,OAAO,aAAa,UAAU,CAAC,CAAC,SAAS;AAE1F,QACE,2CAACC;EACQ;EACK;EACZ,WAAWC,kGAAgC,SAAS,CAAC,EAAE,UAAU;EACjE,sBAAsB,QAAQ,MAAM,KAAK,QAAQ,KAAK;YAEtD,4CAAC;GAAa;GAAO,WAAWA,kGAAgC,UAAU,YAAY,CAAC,EAAE,OAAO,aAAa;;IAC3G,2CAAC;KACC,MAAK;KACL,MAAK;KACL,WAAWA,kGAAgC,UAAU,QAAQ,CAAC,EAAE,OAAO,SAAS;KAChF,gBAAc;KACd,iBAAe;KACf,GAAI;MACJ;IACF,2CAAC;KAAI,WAAWA,kGAAgC,UAAU,QAAQ,CAAC,EAAE,OAAO,SAAS;eACnF,2CAAC,UAAK,WAAWA,kGAAgC,UAAU,QAAQ,CAAC,EAAE,OAAO,SAAS,GAAI;MACtF;IACL,SACC,2CAACC;KACW;KACV,OAAO;KACP,SAAQ;KACR,WAAWD,kGAAgC,UAAU,QAAQ,CAAC,EAAE,OAAO,UAAU,OAAO,eAAe,kFACvE,UAAU,SAAS,QAAQ,CAAC,GAAG,UAC9D,CAAC;eAED;MACU;;IAET;GACI;;AAIlB,qBAAe"}
|
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_emotion = require('../../../styles/emotion.cjs');
|
|
2
3
|
let react = require("react");
|
|
3
4
|
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
-
let __emotion_css = require("@emotion/css");
|
|
5
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
6
5
|
|
|
7
6
|
//#region src/components/primitives/Toggle/Toggle.styles.ts
|
|
8
7
|
const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)(() => {
|
|
9
|
-
const containerStyles =
|
|
8
|
+
const containerStyles = require_emotion.css`
|
|
10
9
|
display: inline-flex;
|
|
11
10
|
align-items: center;
|
|
12
11
|
cursor: pointer;
|
|
13
12
|
`;
|
|
14
|
-
const inputStyles =
|
|
13
|
+
const inputStyles = require_emotion.css`
|
|
15
14
|
border: 0;
|
|
16
15
|
clip: rect(0 0 0 0);
|
|
17
16
|
height: 1px;
|
|
@@ -32,7 +31,7 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
32
31
|
opacity: 0.6;
|
|
33
32
|
}
|
|
34
33
|
`;
|
|
35
|
-
const trackStyles =
|
|
34
|
+
const trackStyles = require_emotion.css`
|
|
36
35
|
position: relative;
|
|
37
36
|
display: inline-flex;
|
|
38
37
|
align-items: center;
|
|
@@ -52,7 +51,7 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
52
51
|
opacity: 0.4;
|
|
53
52
|
}
|
|
54
53
|
`;
|
|
55
|
-
const thumbStyles =
|
|
54
|
+
const thumbStyles = require_emotion.css`
|
|
56
55
|
position: absolute;
|
|
57
56
|
left: 2px;
|
|
58
57
|
width: 16px;
|
|
@@ -65,7 +64,7 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
65
64
|
transform: translateX(16px);
|
|
66
65
|
}
|
|
67
66
|
`;
|
|
68
|
-
const labelStyles =
|
|
67
|
+
const labelStyles = require_emotion.css`
|
|
69
68
|
margin-left: calc(${theme.vars.spacing.unit} * 1.5);
|
|
70
69
|
color: ${theme.vars.colors.text.primary};
|
|
71
70
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
@@ -77,7 +76,7 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
77
76
|
opacity: 0.6;
|
|
78
77
|
}
|
|
79
78
|
`;
|
|
80
|
-
const errorLabelStyles =
|
|
79
|
+
const errorLabelStyles = require_emotion.css`
|
|
81
80
|
color: ${theme.vars.colors.error.main};
|
|
82
81
|
`;
|
|
83
82
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toggle.styles.cjs","names":["containerStyles: string","inputStyles: string","trackStyles: string","thumbStyles: string","labelStyles: string","errorLabelStyles: string"],"sources":["../../../../../src/components/primitives/Toggle/Toggle.styles.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Toggle.styles.cjs","names":["containerStyles: string","inputStyles: string","trackStyles: string","thumbStyles: string","labelStyles: string","errorLabelStyles: string"],"sources":["../../../../../src/components/primitives/Toggle/Toggle.styles.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\nimport {css} from '../../../styles/emotion';\n\nconst useStyles = (theme: Theme, colorScheme: string, hasError: boolean, required: boolean): Record<string, string> =>\n useMemo(() => {\n const containerStyles: string = css`\n display: inline-flex;\n align-items: center;\n cursor: pointer;\n `;\n\n const inputStyles: string = css`\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n white-space: nowrap;\n\n &:focus-visible + div {\n outline: 2px solid ${theme.vars.colors.primary.main};\n outline-offset: 2px;\n }\n\n &:disabled + div {\n cursor: not-allowed;\n opacity: 0.6;\n }\n `;\n\n const trackStyles: string = css`\n position: relative;\n display: inline-flex;\n align-items: center;\n width: 36px;\n height: 20px;\n background-color: ${theme.vars.colors.text.secondary};\n opacity: 0.2;\n border-radius: 9999px;\n transition: all 0.2s ease-in-out;\n\n input:checked + & {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 1;\n }\n\n input:disabled + & {\n opacity: 0.4;\n }\n `;\n\n const thumbStyles: string = css`\n position: absolute;\n left: 2px;\n width: 16px;\n height: 16px;\n background-color: #fff;\n border-radius: 50%;\n transition: transform 0.2s ease-in-out;\n\n input:checked + * > & {\n transform: translateX(16px);\n }\n `;\n\n const labelStyles: string = css`\n margin-left: calc(${theme.vars.spacing.unit} * 1.5);\n color: ${theme.vars.colors.text.primary};\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-family: ${theme.vars.typography.fontFamily};\n cursor: pointer;\n\n input:disabled ~ & {\n cursor: not-allowed;\n opacity: 0.6;\n }\n `;\n\n const errorLabelStyles: string = css`\n color: ${theme.vars.colors.error.main};\n `;\n\n return {\n container: containerStyles,\n errorLabel: hasError ? errorLabelStyles : '',\n input: inputStyles,\n label: labelStyles,\n thumb: thumbStyles,\n track: trackStyles,\n };\n }, [theme, colorScheme, hasError, required]);\n\nexport default useStyles;\n"],"mappings":";;;;;;AAOA,MAAM,aAAa,OAAc,aAAqB,UAAmB,sCACzD;CACZ,MAAMA,kBAA0B,mBAAG;;;;;CAMnC,MAAMC,cAAsB,mBAAG;;;;;;;;;;;;6BAYN,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;;;;;;CAUxD,MAAMC,cAAsB,mBAAG;;;;;;0BAMT,MAAM,KAAK,OAAO,KAAK,UAAU;;;;;;4BAM/B,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;;;;;CASvD,MAAMC,cAAsB,mBAAG;;;;;;;;;;;;;CAc/B,MAAMC,cAAsB,mBAAG;0BACT,MAAM,KAAK,QAAQ,KAAK;eACnC,MAAM,KAAK,OAAO,KAAK,QAAQ;mBAC3B,MAAM,KAAK,WAAW,UAAU,GAAG;qBACjC,MAAM,KAAK,WAAW,WAAW;;;;;;;;CASlD,MAAMC,mBAA2B,mBAAG;eACzB,MAAM,KAAK,OAAO,MAAM,KAAK;;AAGxC,QAAO;EACL,WAAW;EACX,YAAY,WAAW,mBAAmB;EAC1C,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;EACR;GACA;CAAC;CAAO;CAAa;CAAU;CAAS,CAAC;AAE9C,4BAAe"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_emotion = require('../../../styles/emotion.cjs');
|
|
2
3
|
const require_useTheme = require('../../../contexts/Theme/useTheme.cjs');
|
|
3
4
|
const require_Tooltip_styles = require('./Tooltip.styles.cjs');
|
|
4
5
|
let __thunderid_browser = require("@thunderid/browser");
|
|
@@ -7,8 +8,6 @@ let react = require("react");
|
|
|
7
8
|
react = require_rolldown_runtime.__toESM(react);
|
|
8
9
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
9
10
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
10
|
-
let __emotion_css = require("@emotion/css");
|
|
11
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
12
11
|
|
|
13
12
|
//#region src/components/primitives/Tooltip/Tooltip.tsx
|
|
14
13
|
/**
|
|
@@ -37,7 +36,7 @@ const Tooltip = ({ className = "", helperText = "", style = {}, position = "bott
|
|
|
37
36
|
role: "button",
|
|
38
37
|
"aria-label": ariaLabel,
|
|
39
38
|
"aria-describedby": isVisible && helperText ? tooltipId : void 0,
|
|
40
|
-
className:
|
|
39
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("tooltip", "container")), className, styles["container"]),
|
|
41
40
|
style,
|
|
42
41
|
onMouseEnter: () => setIsVisible(true),
|
|
43
42
|
onMouseLeave: () => setIsVisible(false),
|
|
@@ -48,8 +47,8 @@ const Tooltip = ({ className = "", helperText = "", style = {}, position = "bott
|
|
|
48
47
|
children: [children, isVisible && helperText && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
49
48
|
id: tooltipId,
|
|
50
49
|
role: "tooltip",
|
|
51
|
-
className:
|
|
52
|
-
children: [helperText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className:
|
|
50
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("tooltip", "box")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("tooltip", position)), styles["box"], styles[position || "bottom"]),
|
|
51
|
+
children: [helperText, /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", { className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("tooltip", "arrow")), styles["arrow"], styles[`${position}-arrow`]) })]
|
|
53
52
|
})]
|
|
54
53
|
});
|
|
55
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.cjs","names":["Tooltip: FC<Tooltiprops>","useTheme","styles: Record<string, string>","useStyles"],"sources":["../../../../../src/components/primitives/Tooltip/Tooltip.tsx"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.cjs","names":["Tooltip: FC<Tooltiprops>","useTheme","styles: Record<string, string>","useStyles","cx"],"sources":["../../../../../src/components/primitives/Tooltip/Tooltip.tsx"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {FC, InputHTMLAttributes, ReactNode, useId, useState, KeyboardEvent} from 'react';\nimport useStyles from './Tooltip.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\n\n/**\n * Props for the Tooltip component.\n */\nexport interface Tooltiprops extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n className?: string;\n helperText?: string;\n position?: 'top' | 'bottom' | 'left' | 'right';\n children?: ReactNode;\n ariaLabel?: string;\n}\n\n/**\n * A Tooltip component that convert any react or html element to a tooltip.\n * When a user hover on it, they will see a small tooltip with some info.\n *\n * It will take a children, which can be a react element or html element.\n *\n * @param props - Props for the Tooltip component\n * @returns A JSX element representing the Tooltip\n */\nconst Tooltip: FC<Tooltiprops> = ({\n className = '',\n helperText = '',\n style = {},\n position = 'bottom',\n children = null,\n ariaLabel = 'More Info',\n ...rest\n}: Tooltiprops) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const [isVisible, setIsVisible] = useState<boolean>(false);\n\n // Unique ID to connect trigger button to tooltip box via ARIA\n const tooltipId = useId();\n\n // Close tooltip if user presses ESC while focused\n const handleKeyDown = (e: KeyboardEvent<HTMLDivElement>) => {\n if (e.key === 'Escape' && isVisible) {\n setIsVisible(false);\n }\n\n // Optional: Prevent Space key from scrolling the page\n if (e.key === ' ' || e.key === 'Enter') {\n e.preventDefault();\n setIsVisible((prev) => !prev);\n }\n };\n return (\n <div\n tabIndex={0}\n role=\"button\"\n aria-label={ariaLabel}\n aria-describedby={isVisible && helperText ? tooltipId : undefined}\n className={cx(withVendorCSSClassPrefix(bem('tooltip', 'container')), className, styles['container'])}\n style={style}\n onMouseEnter={() => setIsVisible(true)}\n onMouseLeave={() => setIsVisible(false)}\n onFocus={() => setIsVisible(true)} /* Trigger on Tab Focus */\n onBlur={() => setIsVisible(false)} /* Hide on Tab Blur */\n onKeyDown={handleKeyDown} /* Allow ESC to dismiss */\n {...rest}\n >\n {children}\n {isVisible && helperText && (\n <div\n id={tooltipId}\n role=\"tooltip\"\n className={cx(\n withVendorCSSClassPrefix(bem('tooltip', 'box')),\n withVendorCSSClassPrefix(bem('tooltip', position)),\n styles['box'],\n styles[position || 'bottom'],\n )}\n >\n {helperText}\n <span\n className={cx(\n withVendorCSSClassPrefix(bem('tooltip', 'arrow')),\n styles['arrow'],\n styles[`${position}-arrow`],\n )}\n />\n </div>\n )}\n </div>\n );\n};\n\nexport default Tooltip;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AA6BA,MAAMA,WAA4B,EAChC,YAAY,IACZ,aAAa,IACb,QAAQ,EAAE,EACV,WAAW,UACX,WAAW,MACX,YAAY,YACZ,GAAG,WACc;CACjB,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAMC,SAAiCC,+BAAU,OAAO,YAAY;CACpE,MAAM,CAAC,WAAW,oCAAkC,MAAM;CAG1D,MAAM,8BAAmB;CAGzB,MAAM,iBAAiB,MAAqC;AAC1D,MAAI,EAAE,QAAQ,YAAY,UACxB,cAAa,MAAM;AAIrB,MAAI,EAAE,QAAQ,OAAO,EAAE,QAAQ,SAAS;AACtC,KAAE,gBAAgB;AAClB,iBAAc,SAAS,CAAC,KAAK;;;AAGjC,QACE,4CAAC;EACC,UAAU;EACV,MAAK;EACL,cAAY;EACZ,oBAAkB,aAAa,aAAa,YAAY;EACxD,WAAWC,kGAAgC,WAAW,YAAY,CAAC,EAAE,WAAW,OAAO,aAAa;EAC7F;EACP,oBAAoB,aAAa,KAAK;EACtC,oBAAoB,aAAa,MAAM;EACvC,eAAe,aAAa,KAAK;EACjC,cAAc,aAAa,MAAM;EACjC,WAAW;EACX,GAAI;aAEH,UACA,aAAa,cACZ,4CAAC;GACC,IAAI;GACJ,MAAK;GACL,WAAWA,kGACoB,WAAW,MAAM,CAAC,iFAClB,WAAW,SAAS,CAAC,EAClD,OAAO,QACP,OAAO,YAAY,UACpB;cAEA,YACD,2CAAC,UACC,WAAWA,kGACoB,WAAW,QAAQ,CAAC,EACjD,OAAO,UACP,OAAO,GAAG,SAAS,SACpB,GACD;IACE;GAEJ;;AAIV,sBAAe"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_emotion = require('../../../styles/emotion.cjs');
|
|
2
3
|
let react = require("react");
|
|
3
4
|
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
-
let __emotion_css = require("@emotion/css");
|
|
5
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
6
5
|
|
|
7
6
|
//#region src/components/primitives/Tooltip/Tooltip.styles.ts
|
|
8
7
|
const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
9
|
-
const fadeInAnimation =
|
|
8
|
+
const fadeInAnimation = require_emotion.keyframes`
|
|
10
9
|
from { opacity: 0; }
|
|
11
10
|
to { opacity: 1; }
|
|
12
11
|
`;
|
|
13
|
-
const containerStyles =
|
|
12
|
+
const containerStyles = require_emotion.css`
|
|
14
13
|
position: relative;
|
|
15
14
|
display: inline-block;
|
|
16
15
|
`;
|
|
17
|
-
const boxStyles =
|
|
16
|
+
const boxStyles = require_emotion.css`
|
|
18
17
|
position: absolute;
|
|
19
18
|
background-color: #333;
|
|
20
19
|
color: #fff;
|
|
@@ -31,58 +30,58 @@ const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
|
31
30
|
overflow-wrap: break-word;
|
|
32
31
|
text-align: start;
|
|
33
32
|
`;
|
|
34
|
-
const topStyles =
|
|
33
|
+
const topStyles = require_emotion.css`
|
|
35
34
|
bottom: 100%;
|
|
36
35
|
left: 50%;
|
|
37
36
|
transform: translateX(-50%);
|
|
38
37
|
margin-bottom: 8px;
|
|
39
38
|
`;
|
|
40
|
-
const bottomStyles =
|
|
39
|
+
const bottomStyles = require_emotion.css`
|
|
41
40
|
top: 100%;
|
|
42
41
|
left: 50%;
|
|
43
42
|
transform: translateX(-50%);
|
|
44
43
|
margin-top: 8px;
|
|
45
44
|
`;
|
|
46
|
-
const leftStyles =
|
|
45
|
+
const leftStyles = require_emotion.css`
|
|
47
46
|
right: 100%;
|
|
48
47
|
top: 50%;
|
|
49
48
|
transform: translateY(-50%);
|
|
50
49
|
margin-right: 8px;
|
|
51
50
|
`;
|
|
52
|
-
const rightStyles =
|
|
51
|
+
const rightStyles = require_emotion.css`
|
|
53
52
|
left: 100%;
|
|
54
53
|
top: 50%;
|
|
55
54
|
transform: translateY(-50%);
|
|
56
55
|
margin-left: 8px;
|
|
57
56
|
`;
|
|
58
|
-
const arrowStyles =
|
|
57
|
+
const arrowStyles = require_emotion.css`
|
|
59
58
|
position: absolute;
|
|
60
59
|
width: 0;
|
|
61
60
|
height: 0;
|
|
62
61
|
border-style: solid;
|
|
63
62
|
`;
|
|
64
|
-
const topArrowStyles =
|
|
63
|
+
const topArrowStyles = require_emotion.css`
|
|
65
64
|
top: 100%;
|
|
66
65
|
left: 50%;
|
|
67
66
|
transform: translateX(-50%);
|
|
68
67
|
border-width: 5px 5px 0 5px;
|
|
69
68
|
border-color: #333 transparent transparent transparent;
|
|
70
69
|
`;
|
|
71
|
-
const bottomArrowStyles =
|
|
70
|
+
const bottomArrowStyles = require_emotion.css`
|
|
72
71
|
bottom: 100%;
|
|
73
72
|
left: 50%;
|
|
74
73
|
transform: translateX(-50%);
|
|
75
74
|
border-width: 0 5px 5px 5px;
|
|
76
75
|
border-color: transparent transparent #333 transparent;
|
|
77
76
|
`;
|
|
78
|
-
const leftArrowStyles =
|
|
77
|
+
const leftArrowStyles = require_emotion.css`
|
|
79
78
|
left: 100%;
|
|
80
79
|
top: 50%;
|
|
81
80
|
transform: translateY(-50%);
|
|
82
81
|
border-width: 5px 0 5px 5px;
|
|
83
82
|
border-color: transparent transparent transparent #333;
|
|
84
83
|
`;
|
|
85
|
-
const rightArrowStyles =
|
|
84
|
+
const rightArrowStyles = require_emotion.css`
|
|
86
85
|
right: 100%;
|
|
87
86
|
top: 50%;
|
|
88
87
|
transform: translateY(-50%);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tooltip.styles.cjs","names":["containerStyles: string","boxStyles: string","topStyles: string","bottomStyles: string","leftStyles: string","rightStyles: string","arrowStyles: string","topArrowStyles: string","bottomArrowStyles: string","leftArrowStyles: string","rightArrowStyles: string"],"sources":["../../../../../src/components/primitives/Tooltip/Tooltip.styles.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Tooltip.styles.cjs","names":["containerStyles: string","boxStyles: string","topStyles: string","bottomStyles: string","leftStyles: string","rightStyles: string","arrowStyles: string","topArrowStyles: string","bottomArrowStyles: string","leftArrowStyles: string","rightArrowStyles: string"],"sources":["../../../../../src/components/primitives/Tooltip/Tooltip.styles.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\nimport {css, keyframes} from '../../../styles/emotion';\n\nconst useStyles = (theme: Theme, colorScheme: string): Record<string, string> =>\n useMemo(() => {\n const fadeInAnimation = keyframes`\n from { opacity: 0; }\n to { opacity: 1; }\n `;\n\n const containerStyles: string = css`\n position: relative;\n display: inline-block;\n `;\n\n // white-space: nowrap;\n const boxStyles: string = css`\n position: absolute;\n background-color: #333;\n color: #fff;\n padding: 6px 12px;\n border-radius: 6px;\n font-size: 0.85rem;\n z-index: 1000;\n box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.15);\n animation: ${fadeInAnimation} 0.15s ease-in-out;\n\n min-width: 250px;\n white-space: normal;\n word-break: break-word;\n overflow-wrap: break-word;\n text-align: start;\n `;\n\n const topStyles: string = css`\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-bottom: 8px;\n `;\n\n const bottomStyles: string = css`\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n margin-top: 8px;\n `;\n\n const leftStyles: string = css`\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-right: 8px;\n `;\n\n const rightStyles: string = css`\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n margin-left: 8px;\n `;\n\n const arrowStyles: string = css`\n position: absolute;\n width: 0;\n height: 0;\n border-style: solid;\n `;\n\n const topArrowStyles: string = css`\n top: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-width: 5px 5px 0 5px;\n border-color: #333 transparent transparent transparent;\n `;\n\n const bottomArrowStyles: string = css`\n bottom: 100%;\n left: 50%;\n transform: translateX(-50%);\n border-width: 0 5px 5px 5px;\n border-color: transparent transparent #333 transparent;\n `;\n\n const leftArrowStyles: string = css`\n left: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-width: 5px 0 5px 5px;\n border-color: transparent transparent transparent #333;\n `;\n\n const rightArrowStyles: string = css`\n right: 100%;\n top: 50%;\n transform: translateY(-50%);\n border-width: 5px 5px 5px 0;\n border-color: transparent #333 transparent transparent;\n `;\n\n return {\n container: containerStyles,\n box: boxStyles,\n top: topStyles,\n bottom: bottomStyles,\n left: leftStyles,\n right: rightStyles,\n arrow: arrowStyles,\n 'top-arrow': topArrowStyles,\n 'bottom-arrow': bottomArrowStyles,\n 'left-arrow': leftArrowStyles,\n 'right-arrow': rightArrowStyles,\n };\n }, [theme, colorScheme]);\n\nexport default useStyles;\n"],"mappings":";;;;;;AAOA,MAAM,aAAa,OAAc,yCACjB;CACZ,MAAM,kBAAkB,yBAAS;;;;CAKjC,MAAMA,kBAA0B,mBAAG;;;;CAMnC,MAAMC,YAAoB,mBAAG;;;;;;;;;mBASd,gBAAgB;;;;;;;;CAS/B,MAAMC,YAAoB,mBAAG;;;;;;CAO7B,MAAMC,eAAuB,mBAAG;;;;;;CAOhC,MAAMC,aAAqB,mBAAG;;;;;;CAO9B,MAAMC,cAAsB,mBAAG;;;;;;CAO/B,MAAMC,cAAsB,mBAAG;;;;;;CAO/B,MAAMC,iBAAyB,mBAAG;;;;;;;CAQlC,MAAMC,oBAA4B,mBAAG;;;;;;;CAQrC,MAAMC,kBAA0B,mBAAG;;;;;;;CAQnC,MAAMC,mBAA2B,mBAAG;;;;;;;AAQpC,QAAO;EACL,WAAW;EACX,KAAK;EACL,KAAK;EACL,QAAQ;EACR,MAAM;EACN,OAAO;EACP,OAAO;EACP,aAAa;EACb,gBAAgB;EAChB,cAAc;EACd,eAAe;EAChB;GACA,CAAC,OAAO,YAAY,CAAC;AAE1B,6BAAe"}
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_emotion = require('../../../styles/emotion.cjs');
|
|
2
3
|
const require_useTheme = require('../../../contexts/Theme/useTheme.cjs');
|
|
3
4
|
const require_Typography_styles = require('./Typography.styles.cjs');
|
|
4
5
|
let __thunderid_browser = require("@thunderid/browser");
|
|
5
6
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
6
7
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
7
8
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
8
|
-
let __emotion_css = require("@emotion/css");
|
|
9
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
10
9
|
|
|
11
10
|
//#region src/components/primitives/Typography/Typography.tsx
|
|
12
11
|
const variantMapping = {
|
|
@@ -51,7 +50,7 @@ const Typography = ({ children, variant = "body1", component, align = "left", co
|
|
|
51
50
|
}
|
|
52
51
|
};
|
|
53
52
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(Component, {
|
|
54
|
-
className:
|
|
53
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("typography")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("typography", variant)), styles["typography"], getVariantClass(variant), noWrap && styles["typographyNoWrap"], inline && styles["typographyInline"], gutterBottom && styles["typographyGutterBottom"], className),
|
|
55
54
|
style,
|
|
56
55
|
...rest,
|
|
57
56
|
children
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.cjs","names":["variantMapping: Record<TypographyVariant, ElementType>","Typography: FC<TypographyProps>","useTheme","styles: Record<string, string>","useStyles","Component: ElementType"],"sources":["../../../../../src/components/primitives/Typography/Typography.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Typography.cjs","names":["variantMapping: Record<TypographyVariant, ElementType>","Typography: FC<TypographyProps>","useTheme","styles: Record<string, string>","useStyles","Component: ElementType","cx"],"sources":["../../../../../src/components/primitives/Typography/Typography.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {CSSProperties, FC, ReactNode, ElementType} from 'react';\nimport useStyles, {TypographyVariant, TypographyAlign, TypographyColor} from './Typography.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\n\nexport interface TypographyProps {\n /**\n * Text alignment\n */\n align?: TypographyAlign;\n /**\n * The content to be rendered\n */\n children: ReactNode;\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Color variant\n */\n color?: TypographyColor;\n /**\n * The HTML element or React component to render\n */\n component?: ElementType;\n /**\n * Custom font size (overrides variant sizing)\n */\n fontSize?: string | number;\n /**\n * Custom font weight\n */\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number;\n /**\n * Whether to disable gutters (margin bottom)\n */\n gutterBottom?: boolean;\n /**\n * HTML id attribute\n */\n id?: string;\n /**\n * Whether the text should be displayed inline\n */\n inline?: boolean;\n /**\n * Line height\n */\n lineHeight?: string | number;\n /**\n * Whether the text should be clipped with ellipsis when it overflows\n */\n noWrap?: boolean;\n /**\n * Custom styles\n */\n style?: CSSProperties;\n /**\n * The typography variant to apply\n */\n variant?: TypographyVariant;\n}\n\n// Default component mapping for variants\nconst variantMapping: Record<TypographyVariant, ElementType> = {\n body1: 'p',\n body2: 'p',\n button: 'span',\n caption: 'span',\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n overline: 'span',\n subtitle1: 'h6',\n subtitle2: 'h6',\n};\n\n/**\n * Typography component for consistent text rendering throughout the application.\n * Integrates with the theme system and provides semantic HTML elements.\n */\nconst Typography: FC<TypographyProps> = ({\n children,\n variant = 'body1',\n component,\n align = 'left',\n color = 'textPrimary',\n noWrap = false,\n className,\n style = {},\n inline = false,\n fontWeight,\n fontSize,\n lineHeight,\n gutterBottom = false,\n ...rest\n}: TypographyProps) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(\n theme,\n colorScheme,\n variant,\n align,\n color,\n noWrap,\n inline,\n gutterBottom,\n fontWeight,\n fontSize,\n lineHeight,\n );\n\n const Component: ElementType = component || variantMapping[variant] || 'span';\n\n const getVariantClass = (variantName: TypographyVariant): string => {\n switch (variantName) {\n case 'h1':\n return styles['typographyH1'];\n case 'h2':\n return styles['typographyH2'];\n case 'h3':\n return styles['typographyH3'];\n case 'h4':\n return styles['typographyH4'];\n case 'h5':\n return styles['typographyH5'];\n case 'h6':\n return styles['typographyH6'];\n case 'subtitle1':\n return styles['typographySubtitle1'];\n case 'subtitle2':\n return styles['typographySubtitle2'];\n case 'body1':\n return styles['typographyBody1'];\n case 'body2':\n return styles['typographyBody2'];\n case 'caption':\n return styles['typographyCaption'];\n case 'overline':\n return styles['typographyOverline'];\n case 'button':\n return styles['typographyButton'];\n default:\n return '';\n }\n };\n\n const typographyClassName: string = cx(\n withVendorCSSClassPrefix(bem('typography')),\n withVendorCSSClassPrefix(bem('typography', variant)),\n styles['typography'],\n getVariantClass(variant),\n noWrap && styles['typographyNoWrap'],\n inline && styles['typographyInline'],\n gutterBottom && styles['typographyGutterBottom'],\n className,\n );\n\n return (\n <Component className={typographyClassName} style={style} {...rest}>\n {children}\n </Component>\n );\n};\n\nexport default Typography;\n"],"mappings":";;;;;;;;;;AAqEA,MAAMA,iBAAyD;CAC7D,OAAO;CACP,OAAO;CACP,QAAQ;CACR,SAAS;CACT,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,IAAI;CACJ,UAAU;CACV,WAAW;CACX,WAAW;CACZ;;;;;AAMD,MAAMC,cAAmC,EACvC,UACA,UAAU,SACV,WACA,QAAQ,QACR,QAAQ,eACR,SAAS,OACT,WACA,QAAQ,EAAE,EACV,SAAS,OACT,YACA,UACA,YACA,eAAe,MACf,GAAG,WACkB;CACrB,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAMC,SAAiCC,kCACrC,OACA,aACA,SACA,OACA,OACA,QACA,QACA,cACA,YACA,UACA,WACD;CAED,MAAMC,YAAyB,aAAa,eAAe,YAAY;CAEvE,MAAM,mBAAmB,gBAA2C;AAClE,UAAQ,aAAR;GACE,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,KACH,QAAO,OAAO;GAChB,KAAK,YACH,QAAO,OAAO;GAChB,KAAK,YACH,QAAO,OAAO;GAChB,KAAK,QACH,QAAO,OAAO;GAChB,KAAK,QACH,QAAO,OAAO;GAChB,KAAK,UACH,QAAO,OAAO;GAChB,KAAK,WACH,QAAO,OAAO;GAChB,KAAK,SACH,QAAO,OAAO;GAChB,QACE,QAAO;;;AAeb,QACE,2CAAC;EAAU,WAZuBC,kGACL,aAAa,CAAC,iFACd,cAAc,QAAQ,CAAC,EACpD,OAAO,eACP,gBAAgB,QAAQ,EACxB,UAAU,OAAO,qBACjB,UAAU,OAAO,qBACjB,gBAAgB,OAAO,2BACvB,UACD;EAGmD;EAAO,GAAI;EAC1D;GACS;;AAIhB,yBAAe"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
const require_rolldown_runtime = require('../../../_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const require_emotion = require('../../../styles/emotion.cjs');
|
|
2
3
|
let react = require("react");
|
|
3
4
|
react = require_rolldown_runtime.__toESM(react);
|
|
4
|
-
let __emotion_css = require("@emotion/css");
|
|
5
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
6
5
|
|
|
7
6
|
//#region src/components/primitives/Typography/Typography.styles.ts
|
|
8
7
|
/**
|
|
@@ -119,7 +118,7 @@ const useStyles = (theme, colorScheme, variant, align, color, noWrap, inline, gu
|
|
|
119
118
|
};
|
|
120
119
|
const variantStyles = getVariantStyles(variant);
|
|
121
120
|
const colorValue = getColorValue(color);
|
|
122
|
-
const typography =
|
|
121
|
+
const typography = require_emotion.css`
|
|
123
122
|
margin: 0;
|
|
124
123
|
font-family: ${theme.vars.typography.fontFamily};
|
|
125
124
|
color: ${colorValue};
|
|
@@ -147,84 +146,84 @@ const useStyles = (theme, colorScheme, variant, align, color, noWrap, inline, gu
|
|
|
147
146
|
margin-bottom: ${theme.spacing.unit}px;
|
|
148
147
|
` : ""}
|
|
149
148
|
`;
|
|
150
|
-
const typographyNoWrap =
|
|
149
|
+
const typographyNoWrap = require_emotion.css`
|
|
151
150
|
overflow: hidden;
|
|
152
151
|
text-overflow: ellipsis;
|
|
153
152
|
white-space: nowrap;
|
|
154
153
|
`;
|
|
155
|
-
const typographyInline =
|
|
154
|
+
const typographyInline = require_emotion.css`
|
|
156
155
|
display: inline;
|
|
157
156
|
`;
|
|
158
|
-
const typographyGutterBottom =
|
|
157
|
+
const typographyGutterBottom = require_emotion.css`
|
|
159
158
|
margin-bottom: ${theme.spacing.unit}px;
|
|
160
159
|
`;
|
|
161
|
-
const typographyH1 =
|
|
160
|
+
const typographyH1 = require_emotion.css`
|
|
162
161
|
font-size: ${theme.vars.typography.fontSizes["3xl"]};
|
|
163
162
|
font-weight: 600;
|
|
164
163
|
line-height: 1.235;
|
|
165
164
|
letter-spacing: -0.00735em;
|
|
166
165
|
`;
|
|
167
|
-
const typographyH2 =
|
|
166
|
+
const typographyH2 = require_emotion.css`
|
|
168
167
|
font-size: ${theme.vars.typography.fontSizes["2xl"]};
|
|
169
168
|
font-weight: 600;
|
|
170
169
|
line-height: 1.334;
|
|
171
170
|
letter-spacing: 0em;
|
|
172
171
|
`;
|
|
173
|
-
const typographyH3 =
|
|
172
|
+
const typographyH3 = require_emotion.css`
|
|
174
173
|
font-size: ${theme.vars.typography.fontSizes.xl};
|
|
175
174
|
font-weight: 600;
|
|
176
175
|
line-height: 1.6;
|
|
177
176
|
letter-spacing: 0.0075em;
|
|
178
177
|
`;
|
|
179
|
-
const typographyH4 =
|
|
178
|
+
const typographyH4 = require_emotion.css`
|
|
180
179
|
font-size: ${theme.vars.typography.fontSizes.lg};
|
|
181
180
|
font-weight: 600;
|
|
182
181
|
line-height: 1.5;
|
|
183
182
|
letter-spacing: 0.00938em;
|
|
184
183
|
`;
|
|
185
|
-
const typographyH5 =
|
|
184
|
+
const typographyH5 = require_emotion.css`
|
|
186
185
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
187
186
|
font-weight: 600;
|
|
188
187
|
line-height: 1.334;
|
|
189
188
|
letter-spacing: 0em;
|
|
190
189
|
`;
|
|
191
|
-
const typographyH6 =
|
|
190
|
+
const typographyH6 = require_emotion.css`
|
|
192
191
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
193
192
|
font-weight: 500;
|
|
194
193
|
line-height: 1.6;
|
|
195
194
|
letter-spacing: 0.0075em;
|
|
196
195
|
`;
|
|
197
|
-
const typographySubtitle1 =
|
|
196
|
+
const typographySubtitle1 = require_emotion.css`
|
|
198
197
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
199
198
|
font-weight: 400;
|
|
200
199
|
line-height: 1.75;
|
|
201
200
|
letter-spacing: 0.00938em;
|
|
202
201
|
`;
|
|
203
|
-
const typographySubtitle2 =
|
|
202
|
+
const typographySubtitle2 = require_emotion.css`
|
|
204
203
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
205
204
|
font-weight: 500;
|
|
206
205
|
line-height: 1.57;
|
|
207
206
|
letter-spacing: 0.00714em;
|
|
208
207
|
`;
|
|
209
|
-
const typographyBody1 =
|
|
208
|
+
const typographyBody1 = require_emotion.css`
|
|
210
209
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
211
210
|
font-weight: 400;
|
|
212
211
|
line-height: 1.5;
|
|
213
212
|
letter-spacing: 0.00938em;
|
|
214
213
|
`;
|
|
215
|
-
const typographyBody2 =
|
|
214
|
+
const typographyBody2 = require_emotion.css`
|
|
216
215
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
217
216
|
font-weight: 400;
|
|
218
217
|
line-height: 1.43;
|
|
219
218
|
letter-spacing: 0.01071em;
|
|
220
219
|
`;
|
|
221
|
-
const typographyCaption =
|
|
220
|
+
const typographyCaption = require_emotion.css`
|
|
222
221
|
font-size: ${theme.vars.typography.fontSizes.xs};
|
|
223
222
|
font-weight: 400;
|
|
224
223
|
line-height: 1.66;
|
|
225
224
|
letter-spacing: 0.03333em;
|
|
226
225
|
`;
|
|
227
|
-
const typographyOverline =
|
|
226
|
+
const typographyOverline = require_emotion.css`
|
|
228
227
|
font-size: ${theme.vars.typography.fontSizes.xs};
|
|
229
228
|
font-weight: 400;
|
|
230
229
|
line-height: 2.66;
|
|
@@ -235,7 +234,7 @@ const useStyles = (theme, colorScheme, variant, align, color, noWrap, inline, gu
|
|
|
235
234
|
typography,
|
|
236
235
|
typographyBody1,
|
|
237
236
|
typographyBody2,
|
|
238
|
-
typographyButton:
|
|
237
|
+
typographyButton: require_emotion.css`
|
|
239
238
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
240
239
|
font-weight: 500;
|
|
241
240
|
line-height: 1.75;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Typography.styles.cjs","names":["variantStyles: Record<string, string | number>","colorValue: string","typography: string","typographyNoWrap: string","typographyInline: string","typographyGutterBottom: string","typographyH1: string","typographyH2: string","typographyH3: string","typographyH4: string","typographyH5: string","typographyH6: string","typographySubtitle1: string","typographySubtitle2: string","typographyBody1: string","typographyBody2: string","typographyCaption: string","typographyOverline: string"],"sources":["../../../../../src/components/primitives/Typography/Typography.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {css} from '@emotion/css';\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption'\n | 'overline'\n | 'button';\n\nexport type TypographyAlign = 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'success'\n | 'warning'\n | 'info'\n | 'textPrimary'\n | 'textSecondary'\n | 'inherit';\n\n/**\n * Creates styles for the Typography component using BEM methodology\n * @param theme - The theme object containing design tokens\n * @param colorScheme - The current color scheme (used for memoization)\n * @param variant - The typography variant\n * @param align - Text alignment\n * @param color - Color variant\n * @param noWrap - Whether text should be truncated with ellipsis\n * @param inline - Whether text should be displayed inline\n * @param gutterBottom - Whether to add bottom margin\n * @param fontWeight - Custom font weight\n * @param fontSize - Custom font size\n * @param lineHeight - Custom line height\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (\n theme: Theme,\n colorScheme: string,\n variant: TypographyVariant,\n align: TypographyAlign,\n color: TypographyColor,\n noWrap: boolean,\n inline: boolean,\n gutterBottom: boolean,\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number,\n fontSize?: string | number,\n lineHeight?: string | number,\n): Record<string, string> =>\n useMemo(() => {\n const getColorValue = (colorVariant: TypographyColor): string => {\n switch (colorVariant) {\n case 'primary':\n return theme.colors.primary.main;\n case 'secondary':\n return theme.colors.secondary.main;\n case 'error':\n return theme.colors.error.main;\n case 'textPrimary':\n return theme.colors.text.primary;\n case 'textSecondary':\n return theme.colors.text.secondary;\n case 'inherit':\n return 'inherit';\n default:\n return theme.colors.text.primary;\n }\n };\n\n const getVariantStyles = (variantName: TypographyVariant): Record<string, string | number> => {\n switch (variantName) {\n case 'h1':\n return {\n fontSize: theme.vars.typography.fontSizes['3xl'],\n fontWeight: 600,\n letterSpacing: '-0.00735em',\n lineHeight: 1.235,\n };\n case 'h2':\n return {\n fontSize: theme.vars.typography.fontSizes['2xl'],\n fontWeight: 600,\n letterSpacing: '0em',\n lineHeight: 1.334,\n };\n case 'h3':\n return {\n fontSize: theme.vars.typography.fontSizes.xl,\n fontWeight: 600,\n letterSpacing: '0.0075em',\n lineHeight: 1.6,\n };\n case 'h4':\n return {\n fontSize: theme.vars.typography.fontSizes.lg,\n fontWeight: 600,\n letterSpacing: '0.00938em',\n lineHeight: 1.5,\n };\n case 'h5':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 600,\n letterSpacing: '0em',\n lineHeight: 1.334,\n };\n case 'h6':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.0075em',\n lineHeight: 1.6,\n };\n case 'subtitle1':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 400,\n letterSpacing: '0.00938em',\n lineHeight: 1.75,\n };\n case 'subtitle2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.00714em',\n lineHeight: 1.57,\n };\n case 'body1':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 400,\n letterSpacing: '0.00938em',\n lineHeight: 1.5,\n };\n case 'body2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 400,\n letterSpacing: '0.01071em',\n lineHeight: 1.43,\n };\n case 'caption':\n return {\n fontSize: theme.vars.typography.fontSizes.xs,\n fontWeight: 400,\n letterSpacing: '0.03333em',\n lineHeight: 1.66,\n };\n case 'overline':\n return {\n fontSize: theme.vars.typography.fontSizes.xs,\n fontWeight: 400,\n letterSpacing: '0.08333em',\n lineHeight: 2.66,\n textTransform: 'uppercase' as const,\n };\n case 'button':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.02857em',\n lineHeight: 1.75,\n textTransform: 'uppercase' as const,\n };\n default:\n return {};\n }\n };\n\n const variantStyles: Record<string, string | number> = getVariantStyles(variant);\n const colorValue: string = getColorValue(color);\n\n const typography: string = css`\n margin: 0;\n font-family: ${theme.vars.typography.fontFamily};\n color: ${colorValue};\n text-align: ${align};\n display: ${inline ? 'inline' : 'block'};\n ${variantStyles['fontSize'] ? `font-size: ${variantStyles['fontSize']};` : ''}\n ${variantStyles['fontWeight'] ? `font-weight: ${variantStyles['fontWeight']};` : ''}\n ${variantStyles['lineHeight'] ? `line-height: ${variantStyles['lineHeight']};` : ''}\n ${variantStyles['letterSpacing'] ? `letter-spacing: ${variantStyles['letterSpacing']};` : ''}\n ${variantStyles['textTransform'] ? `text-transform: ${variantStyles['textTransform']};` : ''}\n\n /* Custom overrides */\n ${fontWeight ? `font-weight: ${fontWeight} !important;` : ''}\n ${fontSize ? `font-size: ${typeof fontSize === 'number' ? `${fontSize}px` : fontSize} !important;` : ''}\n ${lineHeight ? `line-height: ${lineHeight} !important;` : ''}\n\n /* Conditional styles */\n ${noWrap\n ? `\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `\n : ''}\n\n ${gutterBottom\n ? `\n margin-bottom: ${theme.spacing.unit}px;\n `\n : ''}\n `;\n\n const typographyNoWrap: string = css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n\n const typographyInline: string = css`\n display: inline;\n `;\n\n const typographyGutterBottom: string = css`\n margin-bottom: ${theme.spacing.unit}px;\n `;\n\n const typographyH1: string = css`\n font-size: ${theme.vars.typography.fontSizes['3xl']};\n font-weight: 600;\n line-height: 1.235;\n letter-spacing: -0.00735em;\n `;\n\n const typographyH2: string = css`\n font-size: ${theme.vars.typography.fontSizes['2xl']};\n font-weight: 600;\n line-height: 1.334;\n letter-spacing: 0em;\n `;\n\n const typographyH3: string = css`\n font-size: ${theme.vars.typography.fontSizes.xl};\n font-weight: 600;\n line-height: 1.6;\n letter-spacing: 0.0075em;\n `;\n\n const typographyH4: string = css`\n font-size: ${theme.vars.typography.fontSizes.lg};\n font-weight: 600;\n line-height: 1.5;\n letter-spacing: 0.00938em;\n `;\n\n const typographyH5: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 600;\n line-height: 1.334;\n letter-spacing: 0em;\n `;\n\n const typographyH6: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.6;\n letter-spacing: 0.0075em;\n `;\n\n const typographySubtitle1: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 400;\n line-height: 1.75;\n letter-spacing: 0.00938em;\n `;\n\n const typographySubtitle2: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.57;\n letter-spacing: 0.00714em;\n `;\n\n const typographyBody1: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 400;\n line-height: 1.5;\n letter-spacing: 0.00938em;\n `;\n\n const typographyBody2: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 400;\n line-height: 1.43;\n letter-spacing: 0.01071em;\n `;\n\n const typographyCaption: string = css`\n font-size: ${theme.vars.typography.fontSizes.xs};\n font-weight: 400;\n line-height: 1.66;\n letter-spacing: 0.03333em;\n `;\n\n const typographyOverline: string = css`\n font-size: ${theme.vars.typography.fontSizes.xs};\n font-weight: 400;\n line-height: 2.66;\n letter-spacing: 0.08333em;\n text-transform: uppercase;\n `;\n\n const typographyButton: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.75;\n letter-spacing: 0.02857em;\n text-transform: uppercase;\n `;\n\n return {\n typography,\n typographyBody1,\n typographyBody2,\n typographyButton,\n typographyCaption,\n typographyGutterBottom,\n typographyH1,\n typographyH2,\n typographyH3,\n typographyH4,\n typographyH5,\n typographyH6,\n typographyInline,\n typographyNoWrap,\n typographyOverline,\n typographySubtitle1,\n typographySubtitle2,\n };\n }, [theme, colorScheme, variant, align, color, noWrap, inline, gutterBottom, fontWeight, fontSize, lineHeight]);\n\nexport default useStyles;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Typography.styles.cjs","names":["variantStyles: Record<string, string | number>","colorValue: string","typography: string","typographyNoWrap: string","typographyInline: string","typographyGutterBottom: string","typographyH1: string","typographyH2: string","typographyH3: string","typographyH4: string","typographyH5: string","typographyH6: string","typographySubtitle1: string","typographySubtitle2: string","typographyBody1: string","typographyBody2: string","typographyCaption: string","typographyOverline: string"],"sources":["../../../../../src/components/primitives/Typography/Typography.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\nimport {css} from '../../../styles/emotion';\n\nexport type TypographyVariant =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'subtitle1'\n | 'subtitle2'\n | 'body1'\n | 'body2'\n | 'caption'\n | 'overline'\n | 'button';\n\nexport type TypographyAlign = 'left' | 'center' | 'right' | 'justify';\n\nexport type TypographyColor =\n | 'primary'\n | 'secondary'\n | 'error'\n | 'success'\n | 'warning'\n | 'info'\n | 'textPrimary'\n | 'textSecondary'\n | 'inherit';\n\n/**\n * Creates styles for the Typography component using BEM methodology\n * @param theme - The theme object containing design tokens\n * @param colorScheme - The current color scheme (used for memoization)\n * @param variant - The typography variant\n * @param align - Text alignment\n * @param color - Color variant\n * @param noWrap - Whether text should be truncated with ellipsis\n * @param inline - Whether text should be displayed inline\n * @param gutterBottom - Whether to add bottom margin\n * @param fontWeight - Custom font weight\n * @param fontSize - Custom font size\n * @param lineHeight - Custom line height\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (\n theme: Theme,\n colorScheme: string,\n variant: TypographyVariant,\n align: TypographyAlign,\n color: TypographyColor,\n noWrap: boolean,\n inline: boolean,\n gutterBottom: boolean,\n fontWeight?: 'normal' | 'medium' | 'semibold' | 'bold' | number,\n fontSize?: string | number,\n lineHeight?: string | number,\n): Record<string, string> =>\n useMemo(() => {\n const getColorValue = (colorVariant: TypographyColor): string => {\n switch (colorVariant) {\n case 'primary':\n return theme.colors.primary.main;\n case 'secondary':\n return theme.colors.secondary.main;\n case 'error':\n return theme.colors.error.main;\n case 'textPrimary':\n return theme.colors.text.primary;\n case 'textSecondary':\n return theme.colors.text.secondary;\n case 'inherit':\n return 'inherit';\n default:\n return theme.colors.text.primary;\n }\n };\n\n const getVariantStyles = (variantName: TypographyVariant): Record<string, string | number> => {\n switch (variantName) {\n case 'h1':\n return {\n fontSize: theme.vars.typography.fontSizes['3xl'],\n fontWeight: 600,\n letterSpacing: '-0.00735em',\n lineHeight: 1.235,\n };\n case 'h2':\n return {\n fontSize: theme.vars.typography.fontSizes['2xl'],\n fontWeight: 600,\n letterSpacing: '0em',\n lineHeight: 1.334,\n };\n case 'h3':\n return {\n fontSize: theme.vars.typography.fontSizes.xl,\n fontWeight: 600,\n letterSpacing: '0.0075em',\n lineHeight: 1.6,\n };\n case 'h4':\n return {\n fontSize: theme.vars.typography.fontSizes.lg,\n fontWeight: 600,\n letterSpacing: '0.00938em',\n lineHeight: 1.5,\n };\n case 'h5':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 600,\n letterSpacing: '0em',\n lineHeight: 1.334,\n };\n case 'h6':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.0075em',\n lineHeight: 1.6,\n };\n case 'subtitle1':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 400,\n letterSpacing: '0.00938em',\n lineHeight: 1.75,\n };\n case 'subtitle2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.00714em',\n lineHeight: 1.57,\n };\n case 'body1':\n return {\n fontSize: theme.vars.typography.fontSizes.md,\n fontWeight: 400,\n letterSpacing: '0.00938em',\n lineHeight: 1.5,\n };\n case 'body2':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 400,\n letterSpacing: '0.01071em',\n lineHeight: 1.43,\n };\n case 'caption':\n return {\n fontSize: theme.vars.typography.fontSizes.xs,\n fontWeight: 400,\n letterSpacing: '0.03333em',\n lineHeight: 1.66,\n };\n case 'overline':\n return {\n fontSize: theme.vars.typography.fontSizes.xs,\n fontWeight: 400,\n letterSpacing: '0.08333em',\n lineHeight: 2.66,\n textTransform: 'uppercase' as const,\n };\n case 'button':\n return {\n fontSize: theme.vars.typography.fontSizes.sm,\n fontWeight: 500,\n letterSpacing: '0.02857em',\n lineHeight: 1.75,\n textTransform: 'uppercase' as const,\n };\n default:\n return {};\n }\n };\n\n const variantStyles: Record<string, string | number> = getVariantStyles(variant);\n const colorValue: string = getColorValue(color);\n\n const typography: string = css`\n margin: 0;\n font-family: ${theme.vars.typography.fontFamily};\n color: ${colorValue};\n text-align: ${align};\n display: ${inline ? 'inline' : 'block'};\n ${variantStyles['fontSize'] ? `font-size: ${variantStyles['fontSize']};` : ''}\n ${variantStyles['fontWeight'] ? `font-weight: ${variantStyles['fontWeight']};` : ''}\n ${variantStyles['lineHeight'] ? `line-height: ${variantStyles['lineHeight']};` : ''}\n ${variantStyles['letterSpacing'] ? `letter-spacing: ${variantStyles['letterSpacing']};` : ''}\n ${variantStyles['textTransform'] ? `text-transform: ${variantStyles['textTransform']};` : ''}\n\n /* Custom overrides */\n ${fontWeight ? `font-weight: ${fontWeight} !important;` : ''}\n ${fontSize ? `font-size: ${typeof fontSize === 'number' ? `${fontSize}px` : fontSize} !important;` : ''}\n ${lineHeight ? `line-height: ${lineHeight} !important;` : ''}\n\n /* Conditional styles */\n ${noWrap\n ? `\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `\n : ''}\n\n ${gutterBottom\n ? `\n margin-bottom: ${theme.spacing.unit}px;\n `\n : ''}\n `;\n\n const typographyNoWrap: string = css`\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n `;\n\n const typographyInline: string = css`\n display: inline;\n `;\n\n const typographyGutterBottom: string = css`\n margin-bottom: ${theme.spacing.unit}px;\n `;\n\n const typographyH1: string = css`\n font-size: ${theme.vars.typography.fontSizes['3xl']};\n font-weight: 600;\n line-height: 1.235;\n letter-spacing: -0.00735em;\n `;\n\n const typographyH2: string = css`\n font-size: ${theme.vars.typography.fontSizes['2xl']};\n font-weight: 600;\n line-height: 1.334;\n letter-spacing: 0em;\n `;\n\n const typographyH3: string = css`\n font-size: ${theme.vars.typography.fontSizes.xl};\n font-weight: 600;\n line-height: 1.6;\n letter-spacing: 0.0075em;\n `;\n\n const typographyH4: string = css`\n font-size: ${theme.vars.typography.fontSizes.lg};\n font-weight: 600;\n line-height: 1.5;\n letter-spacing: 0.00938em;\n `;\n\n const typographyH5: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 600;\n line-height: 1.334;\n letter-spacing: 0em;\n `;\n\n const typographyH6: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.6;\n letter-spacing: 0.0075em;\n `;\n\n const typographySubtitle1: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 400;\n line-height: 1.75;\n letter-spacing: 0.00938em;\n `;\n\n const typographySubtitle2: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.57;\n letter-spacing: 0.00714em;\n `;\n\n const typographyBody1: string = css`\n font-size: ${theme.vars.typography.fontSizes.md};\n font-weight: 400;\n line-height: 1.5;\n letter-spacing: 0.00938em;\n `;\n\n const typographyBody2: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 400;\n line-height: 1.43;\n letter-spacing: 0.01071em;\n `;\n\n const typographyCaption: string = css`\n font-size: ${theme.vars.typography.fontSizes.xs};\n font-weight: 400;\n line-height: 1.66;\n letter-spacing: 0.03333em;\n `;\n\n const typographyOverline: string = css`\n font-size: ${theme.vars.typography.fontSizes.xs};\n font-weight: 400;\n line-height: 2.66;\n letter-spacing: 0.08333em;\n text-transform: uppercase;\n `;\n\n const typographyButton: string = css`\n font-size: ${theme.vars.typography.fontSizes.sm};\n font-weight: 500;\n line-height: 1.75;\n letter-spacing: 0.02857em;\n text-transform: uppercase;\n `;\n\n return {\n typography,\n typographyBody1,\n typographyBody2,\n typographyButton,\n typographyCaption,\n typographyGutterBottom,\n typographyH1,\n typographyH2,\n typographyH3,\n typographyH4,\n typographyH5,\n typographyH6,\n typographyInline,\n typographyNoWrap,\n typographyOverline,\n typographySubtitle1,\n typographySubtitle2,\n };\n }, [theme, colorScheme, variant, align, color, noWrap, inline, gutterBottom, fontWeight, fontSize, lineHeight]);\n\nexport default useStyles;\n"],"mappings":"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"}
|
|
@@ -43,6 +43,7 @@ const ThunderIDContext = (0, react.createContext)({
|
|
|
43
43
|
signUp: () => Promise.resolve({}),
|
|
44
44
|
signUpUrl: void 0,
|
|
45
45
|
user: null,
|
|
46
|
+
userSchema: null,
|
|
46
47
|
vendor: __thunderid_browser.VendorConstants.VENDOR_PREFIX
|
|
47
48
|
});
|
|
48
49
|
ThunderIDContext.displayName = "ThunderIDContext";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ThunderIDContext.cjs","names":["ThunderIDContext: Context<ThunderIDContextProps | null>","VendorConstants"],"sources":["../../../../src/contexts/ThunderID/ThunderIDContext.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowMetadataResponse,\n HttpRequestConfig,\n HttpResponse,\n IdToken,\n OIDCDiscoveryApiResponse,\n SignInOptions,\n TokenExchangeRequestConfig,\n TokenResponse,\n VendorConstants,\n} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\nimport {ThunderIDReactConfig} from '../../models/config';\nimport ThunderIDReactClient from '../../ThunderIDReactClient';\n\n/**\n * Props interface of {@link ThunderIDContext}\n */\nexport type ThunderIDContextProps = {\n afterSignInUrl: string | undefined;\n applicationId: string | undefined;\n baseUrl: string | undefined;\n clientId: string | undefined;\n /**\n * Optional endpoint URL overrides from the client config. Used to resolve resource-server\n * endpoints (e.g. flow/user-management) independently of `baseUrl` — see `resolveResourceEndpoint`.\n */\n endpoints?: ThunderIDReactConfig['endpoints'];\n preferences?: ThunderIDReactConfig['preferences'];\n scopes: string | string[] | undefined;\n /**\n * OIDC discovery data.\n */\n discovery: {\n /**\n * The response from the `.well-known/openid-configuration` endpoint.\n * Contains server capabilities, supported endpoints, and metadata.\n * `null` while loading or when discovery has not been fetched.\n */\n wellKnown: OIDCDiscoveryApiResponse | null;\n };\n /**\n * Swaps the current access token with a new one based on the provided configuration (with a grant type).\n * @param config - Configuration for the token exchange request.\n * @returns A promise that resolves to the token response or the raw response.\n */\n exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;\n /**\n * Retrieves the access token stored in the storage.\n * This function retrieves the access token and returns it.\n * @remarks This does not work in the `webWorker` or any other worker environment.\n * @returns A promise that resolves to the access token.\n */\n getAccessToken: () => Promise<string>;\n /**\n * Function to retrieve the decoded ID token.\n * This function decodes the ID token and returns its payload.\n * It can be used to access user claims and other information contained in the ID token.\n *\n * @returns A promise that resolves to the decoded ID token payload.\n */\n getDecodedIdToken: () => Promise<IdToken>;\n /**\n * Function to retrieve the ID token.\n * This function retrieves the ID token and returns it.\n *\n * @returns A promise that resolves to the ID token.\n */\n getIdToken: () => Promise<string>;\n /**\n * Returns the underlying StorageManager instance for reading and writing SDK-managed storage.\n */\n getStorageManager: () => Promise<any>;\n /**\n * HTTP request function to make API calls.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n http: {\n /**\n * Makes an HTTP request using the provided configuration.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n request: (requestConfig?: HttpRequestConfig) => Promise<HttpResponse<any>>;\n /**\n * Makes multiple HTTP requests based on the provided configuration.\n * @param requestConfigs - Set of configurations for the HTTP requests.\n * @returns A promise that resolves to an array of HTTP responses.\n */\n requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;\n };\n /**\n * Instance ID for multi-instance support.\n */\n instanceId: number;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether flow metadata is currently being fetched.\n */\n isMetaLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n\n /**\n * Flow metadata returned by `GET /flow/meta` (v2 platform only).\n * `null` while loading or when `resolveFromMeta` is disabled.\n */\n meta: FlowMetadataResponse | null;\n\n organizationHandle: string | undefined;\n\n /**\n * Re-initializes the client with a new configuration.\n *\n * @remarks\n * This can be partial configuration to update only specific fields.\n *\n * @param config - New configuration to re-initialize the client with.\n * @returns Promise resolving to boolean indicating success.\n */\n reInitialize: (config: Partial<ThunderIDReactConfig>) => Promise<boolean>;\n\n /**\n * Recovery function to initiate the account/password recovery flow.\n */\n recover: (...args: any[]) => Promise<any>;\n\n /**\n * Resolves `{{ t(key) }}` and `{{ meta(path) }}` template expressions in a string,\n * using the current i18n translation function and flow metadata from context.\n *\n * Useful in render-props patterns where consumers need to expand template strings\n * that come from the server (e.g. component labels, placeholders, headings).\n *\n * @example\n * const {resolveFlowTemplateLiterals} = useThunderID();\n * resolveFlowTemplateLiterals('{{ t(signin.heading.label) }}') // → 'Sign In'\n * resolveFlowTemplateLiterals('Login to {{ meta(application.name) }}') // → 'Login to My App'\n */\n resolveFlowTemplateLiterals: (text: string | undefined) => string;\n\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: (...args: any) => Promise<any>;\n\n /**\n * Optional additional parameters to be sent in the sign-in request.\n * This can include custom parameters that your authorization server supports.\n * These parameters will be included in the authorization request sent to the server.\n * If not provided, no additional parameters will be sent.\n *\n * @example\n * signInOptions: { prompt: \"login\", fidp: \"OrganizationSSO\" }\n */\n signInOptions?: SignInOptions;\n\n /**\n * Optional token request configuration. params are appended to the token endpoint POST body.\n *\n * @example\n * tokenRequest: { params: { resource: \"https://api.example.com\" } }\n */\n tokenRequest?: {\n params?: Record<string, unknown>;\n };\n\n /**\n * Silent sign-in function to re-authenticate the user without user interaction.\n * @remark This is the programmatic version of the `SilentSignIn` component.\n */\n signInSilently: ThunderIDReactClient['signInSilently'];\n\n signInUrl: string | undefined;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n */\n signUp: (...args: any[]) => Promise<any>;\n\n signUpUrl: string | undefined;\n\n user: any;\n\n /**\n * Vendor/brand namespace used to prefix storage keys, cookie names, and CSS class names.\n * Resolved from the `vendor` config option, defaulting to `'thunderid'`.\n */\n vendor: string;\n} & Pick<ThunderIDReactClient, 'clearSession'>;\n\n/**\n * Context object for managing the Authentication flow builder core context.\n */\nconst ThunderIDContext: Context<ThunderIDContextProps | null> = createContext<null | ThunderIDContextProps>({\n afterSignInUrl: undefined,\n applicationId: undefined,\n baseUrl: undefined,\n clearSession: () => {},\n clientId: undefined,\n preferences: undefined,\n scopes: undefined,\n discovery: {\n wellKnown: null,\n },\n exchangeToken: null as unknown as ThunderIDContextProps['exchangeToken'],\n getAccessToken: null as unknown as ThunderIDContextProps['getAccessToken'],\n getDecodedIdToken: null as unknown as ThunderIDContextProps['getDecodedIdToken'],\n getIdToken: null as unknown as ThunderIDContextProps['getIdToken'],\n getStorageManager: () => Promise.resolve(null),\n http: {\n request: () => null as unknown as Promise<HttpResponse<any>>,\n requestAll: () => null as unknown as Promise<HttpResponse<any>[]>,\n },\n instanceId: 0,\n isInitialized: false,\n isLoading: true,\n isMetaLoading: false,\n isSignedIn: false,\n meta: null,\n organizationHandle: undefined,\n reInitialize: null as unknown as ThunderIDContextProps['reInitialize'],\n recover: () => Promise.resolve({} as any),\n resolveFlowTemplateLiterals: (text: string | undefined) => text ?? '',\n signIn: () => Promise.resolve({} as any),\n signInSilently: () => Promise.resolve({} as any),\n signInUrl: undefined,\n signOut: () => Promise.resolve({} as any),\n signUp: () => Promise.resolve({} as any),\n signUpUrl: undefined,\n user: null,\n vendor: VendorConstants.VENDOR_PREFIX,\n});\n\nThunderIDContext.displayName = 'ThunderIDContext';\n\nexport default ThunderIDContext;\n"],"mappings":";;;;;;;;;;AAqNA,MAAMA,4CAAsG;CAC1G,gBAAgB;CAChB,eAAe;CACf,SAAS;CACT,oBAAoB;CACpB,UAAU;CACV,aAAa;CACb,QAAQ;CACR,WAAW,EACT,WAAW,MACZ;CACD,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,YAAY;CACZ,yBAAyB,QAAQ,QAAQ,KAAK;CAC9C,MAAM;EACJ,eAAe;EACf,kBAAkB;EACnB;CACD,YAAY;CACZ,eAAe;CACf,WAAW;CACX,eAAe;CACf,YAAY;CACZ,MAAM;CACN,oBAAoB;CACpB,cAAc;CACd,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,8BAA8B,SAA6B,QAAQ;CACnE,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,sBAAsB,QAAQ,QAAQ,EAAE,CAAQ;CAChD,WAAW;CACX,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,WAAW;CACX,MAAM;CACN,QAAQC,oCAAgB;CACzB,CAAC;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}
|
|
1
|
+
{"version":3,"file":"ThunderIDContext.cjs","names":["ThunderIDContext: Context<ThunderIDContextProps | null>","VendorConstants"],"sources":["../../../../src/contexts/ThunderID/ThunderIDContext.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n FlowMetadataResponse,\n HttpRequestConfig,\n HttpResponse,\n IdToken,\n OIDCDiscoveryApiResponse,\n SignInOptions,\n TokenExchangeRequestConfig,\n TokenResponse,\n VendorConstants,\n AttributeSchema,\n} from '@thunderid/browser';\nimport {Context, createContext} from 'react';\nimport {ThunderIDReactConfig} from '../../models/config';\nimport ThunderIDReactClient from '../../ThunderIDReactClient';\n\n/**\n * Props interface of {@link ThunderIDContext}\n */\nexport type ThunderIDContextProps = {\n afterSignInUrl: string | undefined;\n applicationId: string | undefined;\n baseUrl: string | undefined;\n clientId: string | undefined;\n /**\n * Optional endpoint URL overrides from the client config. Used to resolve resource-server\n * endpoints (e.g. flow/user-management) independently of `baseUrl` — see `resolveResourceEndpoint`.\n */\n endpoints?: ThunderIDReactConfig['endpoints'];\n preferences?: ThunderIDReactConfig['preferences'];\n scopes: string | string[] | undefined;\n /**\n * OIDC discovery data.\n */\n discovery: {\n /**\n * The response from the `.well-known/openid-configuration` endpoint.\n * Contains server capabilities, supported endpoints, and metadata.\n * `null` while loading or when discovery has not been fetched.\n */\n wellKnown: OIDCDiscoveryApiResponse | null;\n };\n /**\n * Swaps the current access token with a new one based on the provided configuration (with a grant type).\n * @param config - Configuration for the token exchange request.\n * @returns A promise that resolves to the token response or the raw response.\n */\n exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;\n /**\n * Retrieves the access token stored in the storage.\n * This function retrieves the access token and returns it.\n * @remarks This does not work in the `webWorker` or any other worker environment.\n * @returns A promise that resolves to the access token.\n */\n getAccessToken: () => Promise<string>;\n /**\n * Function to retrieve the decoded ID token.\n * This function decodes the ID token and returns its payload.\n * It can be used to access user claims and other information contained in the ID token.\n *\n * @returns A promise that resolves to the decoded ID token payload.\n */\n getDecodedIdToken: () => Promise<IdToken>;\n /**\n * Function to retrieve the ID token.\n * This function retrieves the ID token and returns it.\n *\n * @returns A promise that resolves to the ID token.\n */\n getIdToken: () => Promise<string>;\n /**\n * Returns the underlying StorageManager instance for reading and writing SDK-managed storage.\n */\n getStorageManager: () => Promise<any>;\n /**\n * HTTP request function to make API calls.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n http: {\n /**\n * Makes an HTTP request using the provided configuration.\n * @param requestConfig - Configuration for the HTTP request.\n * @returns A promise that resolves to the HTTP response.\n */\n request: (requestConfig?: HttpRequestConfig) => Promise<HttpResponse<any>>;\n /**\n * Makes multiple HTTP requests based on the provided configuration.\n * @param requestConfigs - Set of configurations for the HTTP requests.\n * @returns A promise that resolves to an array of HTTP responses.\n */\n requestAll: (requestConfigs?: HttpRequestConfig[]) => Promise<HttpResponse<any>[]>;\n };\n /**\n * Instance ID for multi-instance support.\n */\n instanceId: number;\n isInitialized: boolean;\n /**\n * Flag indicating whether the SDK is working in the background.\n */\n isLoading: boolean;\n /**\n * Flag indicating whether flow metadata is currently being fetched.\n */\n isMetaLoading: boolean;\n /**\n * Flag indicating whether the user is signed in or not.\n */\n isSignedIn: boolean;\n\n /**\n * Flow metadata returned by `GET /flow/meta` (v2 platform only).\n * `null` while loading or when `resolveFromMeta` is disabled.\n */\n meta: FlowMetadataResponse | null;\n\n organizationHandle: string | undefined;\n\n /**\n * Re-initializes the client with a new configuration.\n *\n * @remarks\n * This can be partial configuration to update only specific fields.\n *\n * @param config - New configuration to re-initialize the client with.\n * @returns Promise resolving to boolean indicating success.\n */\n reInitialize: (config: Partial<ThunderIDReactConfig>) => Promise<boolean>;\n\n /**\n * Recovery function to initiate the account/password recovery flow.\n */\n recover: (...args: any[]) => Promise<any>;\n\n /**\n * Resolves `{{ t(key) }}` and `{{ meta(path) }}` template expressions in a string,\n * using the current i18n translation function and flow metadata from context.\n *\n * Useful in render-props patterns where consumers need to expand template strings\n * that come from the server (e.g. component labels, placeholders, headings).\n *\n * @example\n * const {resolveFlowTemplateLiterals} = useThunderID();\n * resolveFlowTemplateLiterals('{{ t(signin.heading.label) }}') // → 'Sign In'\n * resolveFlowTemplateLiterals('Login to {{ meta(application.name) }}') // → 'Login to My App'\n */\n resolveFlowTemplateLiterals: (text: string | undefined) => string;\n\n /**\n * Sign-in function to initiate the authentication process.\n * @remark This is the programmatic version of the `SignInButton` component.\n * TODO: Fix the types.\n */\n signIn: (...args: any) => Promise<any>;\n\n /**\n * Optional additional parameters to be sent in the sign-in request.\n * This can include custom parameters that your authorization server supports.\n * These parameters will be included in the authorization request sent to the server.\n * If not provided, no additional parameters will be sent.\n *\n * @example\n * signInOptions: { prompt: \"login\", fidp: \"OrganizationSSO\" }\n */\n signInOptions?: SignInOptions;\n\n /**\n * Optional token request configuration. params are appended to the token endpoint POST body.\n *\n * @example\n * tokenRequest: { params: { resource: \"https://api.example.com\" } }\n */\n tokenRequest?: {\n params?: Record<string, unknown>;\n };\n\n /**\n * Silent sign-in function to re-authenticate the user without user interaction.\n * @remark This is the programmatic version of the `SilentSignIn` component.\n */\n signInSilently: ThunderIDReactClient['signInSilently'];\n\n signInUrl: string | undefined;\n /**\n * Sign-out function to terminate the authentication session.\n * @remark This is the programmatic version of the `SignOutButton` component.\n * FIXME: Fix the types.\n */\n signOut: any;\n\n /**\n * Sign-up function to initiate the registration process.\n * @remark This is the programmatic version of the `SignUpButton` component.\n */\n signUp: (...args: any[]) => Promise<any>;\n\n signUpUrl: string | undefined;\n\n user: any;\n\n /**\n * Schema metadata for the user type returned by GET /users/me/meta.\n */\n userSchema: Record<string, AttributeSchema> | null;\n\n /**\n * Vendor/brand namespace used to prefix storage keys, cookie names, and CSS class names.\n * Resolved from the `vendor` config option, defaulting to `'thunderid'`.\n */\n vendor: string;\n} & Pick<ThunderIDReactClient, 'clearSession'>;\n\n/**\n * Context object for managing the Authentication flow builder core context.\n */\nconst ThunderIDContext: Context<ThunderIDContextProps | null> = createContext<null | ThunderIDContextProps>({\n afterSignInUrl: undefined,\n applicationId: undefined,\n baseUrl: undefined,\n clearSession: () => {},\n clientId: undefined,\n preferences: undefined,\n scopes: undefined,\n discovery: {\n wellKnown: null,\n },\n exchangeToken: null as unknown as ThunderIDContextProps['exchangeToken'],\n getAccessToken: null as unknown as ThunderIDContextProps['getAccessToken'],\n getDecodedIdToken: null as unknown as ThunderIDContextProps['getDecodedIdToken'],\n getIdToken: null as unknown as ThunderIDContextProps['getIdToken'],\n getStorageManager: () => Promise.resolve(null),\n http: {\n request: () => null as unknown as Promise<HttpResponse<any>>,\n requestAll: () => null as unknown as Promise<HttpResponse<any>[]>,\n },\n instanceId: 0,\n isInitialized: false,\n isLoading: true,\n isMetaLoading: false,\n isSignedIn: false,\n meta: null,\n organizationHandle: undefined,\n reInitialize: null as unknown as ThunderIDContextProps['reInitialize'],\n recover: () => Promise.resolve({} as any),\n resolveFlowTemplateLiterals: (text: string | undefined) => text ?? '',\n signIn: () => Promise.resolve({} as any),\n signInSilently: () => Promise.resolve({} as any),\n signInUrl: undefined,\n signOut: () => Promise.resolve({} as any),\n signUp: () => Promise.resolve({} as any),\n signUpUrl: undefined,\n user: null,\n userSchema: null,\n vendor: VendorConstants.VENDOR_PREFIX,\n});\n\nThunderIDContext.displayName = 'ThunderIDContext';\n\nexport default ThunderIDContext;\n"],"mappings":";;;;;;;;;;AA2NA,MAAMA,4CAAsG;CAC1G,gBAAgB;CAChB,eAAe;CACf,SAAS;CACT,oBAAoB;CACpB,UAAU;CACV,aAAa;CACb,QAAQ;CACR,WAAW,EACT,WAAW,MACZ;CACD,eAAe;CACf,gBAAgB;CAChB,mBAAmB;CACnB,YAAY;CACZ,yBAAyB,QAAQ,QAAQ,KAAK;CAC9C,MAAM;EACJ,eAAe;EACf,kBAAkB;EACnB;CACD,YAAY;CACZ,eAAe;CACf,WAAW;CACX,eAAe;CACf,YAAY;CACZ,MAAM;CACN,oBAAoB;CACpB,cAAc;CACd,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,8BAA8B,SAA6B,QAAQ;CACnE,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,sBAAsB,QAAQ,QAAQ,EAAE,CAAQ;CAChD,WAAW;CACX,eAAe,QAAQ,QAAQ,EAAE,CAAQ;CACzC,cAAc,QAAQ,QAAQ,EAAE,CAAQ;CACxC,WAAW;CACX,MAAM;CACN,YAAY;CACZ,QAAQC,oCAAgB;CACzB,CAAC;AAEF,iBAAiB,cAAc;AAE/B,+BAAe"}
|