@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,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/Checkbox/Checkbox.styles.ts
|
|
8
7
|
/**
|
|
@@ -14,11 +13,11 @@ __emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
|
14
13
|
* @returns Object containing CSS class names for component styling
|
|
15
14
|
*/
|
|
16
15
|
const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)(() => {
|
|
17
|
-
const containerStyles =
|
|
16
|
+
const containerStyles = require_emotion.css`
|
|
18
17
|
display: flex;
|
|
19
18
|
align-items: center;
|
|
20
19
|
`;
|
|
21
|
-
const inputStyles =
|
|
20
|
+
const inputStyles = require_emotion.css`
|
|
22
21
|
width: calc(${theme.vars.spacing.unit} * 2.5);
|
|
23
22
|
height: calc(${theme.vars.spacing.unit} * 2.5);
|
|
24
23
|
margin-inline-end: ${theme.vars.spacing.unit};
|
|
@@ -35,14 +34,14 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
35
34
|
opacity: 0.6;
|
|
36
35
|
}
|
|
37
36
|
`;
|
|
38
|
-
const errorInputStyles =
|
|
37
|
+
const errorInputStyles = require_emotion.css`
|
|
39
38
|
accent-color: ${theme.vars.colors.error.main};
|
|
40
39
|
|
|
41
40
|
&:focus {
|
|
42
41
|
outline-color: ${theme.vars.colors.error.main};
|
|
43
42
|
}
|
|
44
43
|
`;
|
|
45
|
-
const labelStyles =
|
|
44
|
+
const labelStyles = require_emotion.css`
|
|
46
45
|
color: ${theme.vars.colors.text.primary};
|
|
47
46
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
48
47
|
font-family: ${theme.vars.typography.fontFamily};
|
|
@@ -52,10 +51,10 @@ const useStyles = (theme, colorScheme, hasError, required) => (0, react.useMemo)
|
|
|
52
51
|
color: ${theme.vars.colors.text.primary};
|
|
53
52
|
}
|
|
54
53
|
`;
|
|
55
|
-
const errorLabelStyles =
|
|
54
|
+
const errorLabelStyles = require_emotion.css`
|
|
56
55
|
color: ${theme.vars.colors.error.main};
|
|
57
56
|
`;
|
|
58
|
-
const requiredStyles =
|
|
57
|
+
const requiredStyles = require_emotion.css`
|
|
59
58
|
/* Required indicator styles will be handled by InputLabel */
|
|
60
59
|
`;
|
|
61
60
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.styles.cjs","names":["containerStyles: string","inputStyles: string","errorInputStyles: string","labelStyles: string","errorLabelStyles: string","requiredStyles: string"],"sources":["../../../../../src/components/primitives/Checkbox/Checkbox.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Checkbox.styles.cjs","names":["containerStyles: string","inputStyles: string","errorInputStyles: string","labelStyles: string","errorLabelStyles: string","requiredStyles: string"],"sources":["../../../../../src/components/primitives/Checkbox/Checkbox.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\n/**\n * Creates styles for the Checkbox 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 hasError - Whether the checkbox has an error state\n * @param required - Whether the checkbox is required\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (theme: Theme, colorScheme: string, hasError: boolean, required: boolean): Record<string, string> =>\n useMemo(() => {\n const containerStyles: string = css`\n display: flex;\n align-items: center;\n `;\n\n const inputStyles: string = css`\n width: calc(${theme.vars.spacing.unit} * 2.5);\n height: calc(${theme.vars.spacing.unit} * 2.5);\n margin-inline-end: ${theme.vars.spacing.unit};\n accent-color: ${theme.vars.colors.primary.main};\n cursor: pointer;\n\n &:focus {\n outline: 2px solid ${theme.vars.colors.primary.main};\n outline-offset: 2px;\n }\n\n &:disabled {\n cursor: not-allowed;\n opacity: 0.6;\n }\n `;\n\n const errorInputStyles: string = css`\n accent-color: ${theme.vars.colors.error.main};\n\n &:focus {\n outline-color: ${theme.vars.colors.error.main};\n }\n `;\n\n const labelStyles: string = css`\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 &:hover {\n color: ${theme.vars.colors.text.primary};\n }\n `;\n\n const errorLabelStyles: string = css`\n color: ${theme.vars.colors.error.main};\n `;\n\n const requiredStyles: string = css`\n /* Required indicator styles will be handled by InputLabel */\n `;\n\n return {\n container: containerStyles,\n errorInput: hasError ? errorInputStyles : '',\n errorLabel: hasError ? errorLabelStyles : '',\n input: inputStyles,\n label: labelStyles,\n required: required ? requiredStyles : '',\n };\n }, [theme, colorScheme, hasError, required]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,aAAa,OAAc,aAAqB,UAAmB,sCACzD;CACZ,MAAMA,kBAA0B,mBAAG;;;;CAKnC,MAAMC,cAAsB,mBAAG;oBACf,MAAM,KAAK,QAAQ,KAAK;qBACvB,MAAM,KAAK,QAAQ,KAAK;2BAClB,MAAM,KAAK,QAAQ,KAAK;sBAC7B,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;6BAIxB,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;;;;;;CAUxD,MAAMC,mBAA2B,mBAAG;sBAClB,MAAM,KAAK,OAAO,MAAM,KAAK;;;yBAG1B,MAAM,KAAK,OAAO,MAAM,KAAK;;;CAIlD,MAAMC,cAAsB,mBAAG;eACpB,MAAM,KAAK,OAAO,KAAK,QAAQ;mBAC3B,MAAM,KAAK,WAAW,UAAU,GAAG;qBACjC,MAAM,KAAK,WAAW,WAAW;;;;iBAIrC,MAAM,KAAK,OAAO,KAAK,QAAQ;;;CAI5C,MAAMC,mBAA2B,mBAAG;eACzB,MAAM,KAAK,OAAO,MAAM,KAAK;;CAGxC,MAAMC,iBAAyB,mBAAG;;;AAIlC,QAAO;EACL,WAAW;EACX,YAAY,WAAW,mBAAmB;EAC1C,YAAY,WAAW,mBAAmB;EAC1C,OAAO;EACP,OAAO;EACP,UAAU,WAAW,iBAAiB;EACvC;GACA;CAAC;CAAO;CAAa;CAAU;CAAS,CAAC;AAE9C,8BAAe"}
|
|
@@ -1,27 +1,26 @@
|
|
|
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/CopyableText/CopyableText.styles.ts
|
|
8
7
|
const useStyles = (theme) => (0, react.useMemo)(() => ({
|
|
9
|
-
container:
|
|
8
|
+
container: require_emotion.css`
|
|
10
9
|
display: flex;
|
|
11
10
|
flex-direction: column;
|
|
12
11
|
gap: calc(${theme.vars.spacing.unit} * 0.5);
|
|
13
12
|
width: 100%;
|
|
14
13
|
`,
|
|
15
|
-
copyButton:
|
|
14
|
+
copyButton: require_emotion.css`
|
|
16
15
|
flex-shrink: 0;
|
|
17
16
|
white-space: nowrap;
|
|
18
17
|
`,
|
|
19
|
-
label:
|
|
18
|
+
label: require_emotion.css`
|
|
20
19
|
color: ${theme.vars.colors.text.secondary};
|
|
21
20
|
font-size: 0.875rem;
|
|
22
21
|
font-weight: 500;
|
|
23
22
|
`,
|
|
24
|
-
valueBox:
|
|
23
|
+
valueBox: require_emotion.css`
|
|
25
24
|
align-items: center;
|
|
26
25
|
background-color: ${theme.vars.colors.background.surface};
|
|
27
26
|
border: 1px solid ${theme.vars.colors.border};
|
|
@@ -30,7 +29,7 @@ const useStyles = (theme) => (0, react.useMemo)(() => ({
|
|
|
30
29
|
gap: calc(${theme.vars.spacing.unit} * 1);
|
|
31
30
|
padding: calc(${theme.vars.spacing.unit} * 0.75) calc(${theme.vars.spacing.unit} * 1);
|
|
32
31
|
`,
|
|
33
|
-
valueText:
|
|
32
|
+
valueText: require_emotion.css`
|
|
34
33
|
color: ${theme.vars.colors.text.primary};
|
|
35
34
|
flex: 1;
|
|
36
35
|
font-family: monospace;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CopyableText.styles.cjs","names":[],"sources":["../../../../../src/components/primitives/CopyableText/CopyableText.styles.ts"],"sourcesContent":["// Copyright 2026 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"CopyableText.styles.cjs","names":[],"sources":["../../../../../src/components/primitives/CopyableText/CopyableText.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): Record<string, string> =>\n useMemo(\n () => ({\n container: css`\n display: flex;\n flex-direction: column;\n gap: calc(${theme.vars.spacing.unit} * 0.5);\n width: 100%;\n `,\n copyButton: css`\n flex-shrink: 0;\n white-space: nowrap;\n `,\n label: css`\n color: ${theme.vars.colors.text.secondary};\n font-size: 0.875rem;\n font-weight: 500;\n `,\n valueBox: css`\n align-items: center;\n background-color: ${theme.vars.colors.background.surface};\n border: 1px solid ${theme.vars.colors.border};\n border-radius: ${theme.vars.borderRadius.small};\n display: flex;\n gap: calc(${theme.vars.spacing.unit} * 1);\n padding: calc(${theme.vars.spacing.unit} * 0.75) calc(${theme.vars.spacing.unit} * 1);\n `,\n valueText: css`\n color: ${theme.vars.colors.text.primary};\n flex: 1;\n font-family: monospace;\n font-size: 0.85rem;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n word-break: break-all;\n `,\n }),\n [theme],\n );\n\nexport default useStyles;\n"],"mappings":";;;;;;AAOA,MAAM,aAAa,oCAER;CACL,WAAW,mBAAG;;;oBAGA,MAAM,KAAK,QAAQ,KAAK;;;CAGtC,YAAY,mBAAG;;;;CAIf,OAAO,mBAAG;iBACC,MAAM,KAAK,OAAO,KAAK,UAAU;;;;CAI5C,UAAU,mBAAG;;4BAES,MAAM,KAAK,OAAO,WAAW,QAAQ;4BACrC,MAAM,KAAK,OAAO,OAAO;yBAC5B,MAAM,KAAK,aAAa,MAAM;;oBAEnC,MAAM,KAAK,QAAQ,KAAK;wBACpB,MAAM,KAAK,QAAQ,KAAK,gBAAgB,MAAM,KAAK,QAAQ,KAAK;;CAElF,WAAW,mBAAG;iBACH,MAAM,KAAK,OAAO,KAAK,QAAQ;;;;;;;;;CAS3C,GACD,CAAC,MAAM,CACR;AAEH,kCAAe"}
|
|
@@ -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_FormControl = require('../FormControl/FormControl.cjs');
|
|
4
5
|
const require_InputLabel = require('../InputLabel/InputLabel.cjs');
|
|
@@ -7,8 +8,6 @@ let __thunderid_browser = require("@thunderid/browser");
|
|
|
7
8
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
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/DatePicker/DatePicker.tsx
|
|
14
13
|
const DatePicker = ({ label, error, className, required, disabled, helperText, dateFormat = "yyyy-MM-dd", style = {},...rest }) => {
|
|
@@ -18,18 +17,18 @@ const DatePicker = ({ label, error, className, required, disabled, helperText, d
|
|
|
18
17
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(require_FormControl.default, {
|
|
19
18
|
error,
|
|
20
19
|
helperText,
|
|
21
|
-
className:
|
|
20
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("date-picker")), className),
|
|
22
21
|
style,
|
|
23
22
|
children: [label && /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_InputLabel.default, {
|
|
24
23
|
required,
|
|
25
24
|
error: hasError,
|
|
26
|
-
className:
|
|
25
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("date-picker", "label")), styles["label"]),
|
|
27
26
|
children: label
|
|
28
27
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("input", {
|
|
29
28
|
type: "date",
|
|
30
29
|
pattern: "\\d{4}-\\d{2}-\\d{2}",
|
|
31
30
|
placeholder: dateFormat,
|
|
32
|
-
className:
|
|
31
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("date-picker", "input")), styles["input"], styles["errorInput"], styles["disabledInput"], {
|
|
33
32
|
[(0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("date-picker", "input", "error"))]: hasError,
|
|
34
33
|
[(0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("date-picker", "input", "disabled"))]: disabled
|
|
35
34
|
}),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.cjs","names":["DatePicker: FC<DatePickerProps>","useTheme","styles: Record<string, string>","useStyles","FormControl","InputLabel"],"sources":["../../../../../src/components/primitives/DatePicker/DatePicker.tsx"],"sourcesContent":["// Copyright 2024 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"DatePicker.cjs","names":["DatePicker: FC<DatePickerProps>","useTheme","styles: Record<string, string>","useStyles","FormControl","cx","InputLabel"],"sources":["../../../../../src/components/primitives/DatePicker/DatePicker.tsx"],"sourcesContent":["// Copyright 2024 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 './DatePicker.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\nimport FormControl from '../FormControl/FormControl';\nimport InputLabel from '../InputLabel/InputLabel';\n\nexport interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'className' | 'type'> {\n /**\n * Additional CSS class names\n */\n className?: string;\n /**\n * Custom date format for the regex pattern\n */\n dateFormat?: string;\n /**\n * Whether the field is disabled\n */\n disabled?: boolean;\n /**\n * Error message to display below the input\n */\n error?: string;\n /**\n * Helper text to display below the input\n */\n helperText?: string;\n /**\n * Label text to display above the input\n */\n label?: string;\n /**\n * Whether the field is required\n */\n required?: boolean;\n}\n\nconst DatePicker: FC<DatePickerProps> = ({\n label,\n error,\n className,\n required,\n disabled,\n helperText,\n dateFormat = 'yyyy-MM-dd',\n style = {},\n ...rest\n}: DatePickerProps) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const hasError = !!error;\n const styles: Record<string, string> = useStyles(theme, colorScheme, hasError, !!disabled);\n\n return (\n <FormControl\n error={error}\n helperText={helperText}\n className={cx(withVendorCSSClassPrefix(bem('date-picker')), className)}\n style={style}\n >\n {label && (\n <InputLabel\n required={required}\n error={hasError}\n className={cx(withVendorCSSClassPrefix(bem('date-picker', 'label')), styles['label'])}\n >\n {label}\n </InputLabel>\n )}\n <input\n type=\"date\"\n pattern=\"\\d{4}-\\d{2}-\\d{2}\"\n placeholder={dateFormat}\n className={cx(\n withVendorCSSClassPrefix(bem('date-picker', 'input')),\n styles['input'],\n styles['errorInput'],\n styles['disabledInput'],\n {\n [withVendorCSSClassPrefix(bem('date-picker', 'input', 'error'))]: hasError,\n [withVendorCSSClassPrefix(bem('date-picker', 'input', 'disabled'))]: disabled,\n },\n )}\n disabled={disabled}\n aria-invalid={hasError}\n aria-required={required}\n {...rest}\n />\n </FormControl>\n );\n};\n\nexport default DatePicker;\n"],"mappings":";;;;;;;;;;;;AA0CA,MAAMA,cAAmC,EACvC,OACA,OACA,WACA,UACA,UACA,YACA,aAAa,cACb,QAAQ,EAAE,CACV,GAAG,WACkB;CACrB,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAM,WAAW,CAAC,CAAC;CACnB,MAAMC,SAAiCC,kCAAU,OAAO,aAAa,UAAU,CAAC,CAAC,SAAS;AAE1F,QACE,4CAACC;EACQ;EACK;EACZ,WAAWC,kGAAgC,cAAc,CAAC,EAAE,UAAU;EAC/D;aAEN,SACC,2CAACC;GACW;GACV,OAAO;GACP,WAAWD,kGAAgC,eAAe,QAAQ,CAAC,EAAE,OAAO,SAAS;aAEpF;IACU,EAEf,2CAAC;GACC,MAAK;GACL,SAAQ;GACR,aAAa;GACb,WAAWA,kGACoB,eAAe,QAAQ,CAAC,EACrD,OAAO,UACP,OAAO,eACP,OAAO,kBACP;oFACgC,eAAe,SAAS,QAAQ,CAAC,GAAG;oFACpC,eAAe,SAAS,WAAW,CAAC,GAAG;IACtE,CACF;GACS;GACV,gBAAc;GACd,iBAAe;GACf,GAAI;IACJ;GACU;;AAIlB,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/DatePicker/DatePicker.styles.ts
|
|
8
7
|
/**
|
|
@@ -14,7 +13,7 @@ __emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
|
14
13
|
* @returns Object containing CSS class names for component styling
|
|
15
14
|
*/
|
|
16
15
|
const useStyles = (theme, colorScheme, hasError, disabled) => (0, react.useMemo)(() => {
|
|
17
|
-
const inputStyles =
|
|
16
|
+
const inputStyles = require_emotion.css`
|
|
18
17
|
width: 100%;
|
|
19
18
|
padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5);
|
|
20
19
|
border: 1px solid ${theme.vars.colors.border};
|
|
@@ -41,7 +40,7 @@ const useStyles = (theme, colorScheme, hasError, disabled) => (0, react.useMemo)
|
|
|
41
40
|
color: ${theme.vars.colors.text.secondary};
|
|
42
41
|
}
|
|
43
42
|
`;
|
|
44
|
-
const errorInputStyles =
|
|
43
|
+
const errorInputStyles = require_emotion.css`
|
|
45
44
|
border-color: ${theme.vars.colors.error.main};
|
|
46
45
|
|
|
47
46
|
&:focus {
|
|
@@ -53,7 +52,7 @@ const useStyles = (theme, colorScheme, hasError, disabled) => (0, react.useMemo)
|
|
|
53
52
|
border-color: ${theme.vars.colors.error.main};
|
|
54
53
|
}
|
|
55
54
|
`;
|
|
56
|
-
const disabledInputStyles =
|
|
55
|
+
const disabledInputStyles = require_emotion.css`
|
|
57
56
|
background-color: ${theme.vars.colors.background.disabled};
|
|
58
57
|
color: ${theme.vars.colors.text.secondary};
|
|
59
58
|
cursor: not-allowed;
|
|
@@ -65,7 +64,7 @@ const useStyles = (theme, colorScheme, hasError, disabled) => (0, react.useMemo)
|
|
|
65
64
|
box-shadow: none;
|
|
66
65
|
}
|
|
67
66
|
`;
|
|
68
|
-
const labelStyles =
|
|
67
|
+
const labelStyles = require_emotion.css`
|
|
69
68
|
/* Label styles will be handled by InputLabel component */
|
|
70
69
|
`;
|
|
71
70
|
return {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DatePicker.styles.cjs","names":["inputStyles: string","errorInputStyles: string","disabledInputStyles: string","labelStyles: string"],"sources":["../../../../../src/components/primitives/DatePicker/DatePicker.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"DatePicker.styles.cjs","names":["inputStyles: string","errorInputStyles: string","disabledInputStyles: string","labelStyles: string"],"sources":["../../../../../src/components/primitives/DatePicker/DatePicker.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\n/**\n * Creates styles for the DatePicker 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 hasError - Whether the date picker has an error state\n * @param disabled - Whether the date picker is disabled\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (theme: Theme, colorScheme: string, hasError: boolean, disabled: boolean): Record<string, string> =>\n useMemo(() => {\n const inputStyles: string = css`\n width: 100%;\n padding: ${theme.vars.spacing.unit} calc(${theme.vars.spacing.unit} * 1.5);\n border: 1px solid ${theme.vars.colors.border};\n border-radius: ${theme.vars.components?.Field?.root?.borderRadius || theme.vars.borderRadius.medium};\n font-size: 1rem;\n font-family: ${theme.vars.typography.fontFamily};\n color: ${theme.vars.colors.text.primary};\n background-color: ${theme.vars.colors.background.surface};\n outline: none;\n transition:\n border-color 0.2s ease,\n box-shadow 0.2s ease;\n\n &:focus {\n border-color: ${theme.vars.colors.primary.main};\n box-shadow: 0 0 0 2px ${theme.vars.colors.primary.main}20;\n }\n\n &:hover:not(:disabled) {\n border-color: ${theme.vars.colors.primary.main};\n }\n\n &::placeholder {\n color: ${theme.vars.colors.text.secondary};\n }\n `;\n\n const errorInputStyles: string = css`\n border-color: ${theme.vars.colors.error.main};\n\n &:focus {\n border-color: ${theme.vars.colors.error.main};\n box-shadow: 0 0 0 2px ${theme.vars.colors.error.main}20;\n }\n\n &:hover:not(:disabled) {\n border-color: ${theme.vars.colors.error.main};\n }\n `;\n\n const disabledInputStyles: string = css`\n background-color: ${theme.vars.colors.background.disabled};\n color: ${theme.vars.colors.text.secondary};\n cursor: not-allowed;\n opacity: 0.6;\n\n &:hover,\n &:focus {\n border-color: ${theme.vars.colors.border};\n box-shadow: none;\n }\n `;\n\n const labelStyles: string = css`\n /* Label styles will be handled by InputLabel component */\n `;\n\n return {\n disabledInput: disabled ? disabledInputStyles : '',\n errorInput: hasError ? errorInputStyles : '',\n input: inputStyles,\n label: labelStyles,\n };\n }, [theme, colorScheme, hasError, disabled]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;;;AAeA,MAAM,aAAa,OAAc,aAAqB,UAAmB,sCACzD;CACZ,MAAMA,cAAsB,mBAAG;;iBAElB,MAAM,KAAK,QAAQ,KAAK,QAAQ,MAAM,KAAK,QAAQ,KAAK;0BAC/C,MAAM,KAAK,OAAO,OAAO;uBAC5B,MAAM,KAAK,YAAY,OAAO,MAAM,gBAAgB,MAAM,KAAK,aAAa,OAAO;;qBAErF,MAAM,KAAK,WAAW,WAAW;eACvC,MAAM,KAAK,OAAO,KAAK,QAAQ;0BACpB,MAAM,KAAK,OAAO,WAAW,QAAQ;;;;;;;wBAOvC,MAAM,KAAK,OAAO,QAAQ,KAAK;gCACvB,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;wBAIvC,MAAM,KAAK,OAAO,QAAQ,KAAK;;;;iBAItC,MAAM,KAAK,OAAO,KAAK,UAAU;;;CAI9C,MAAMC,mBAA2B,mBAAG;sBAClB,MAAM,KAAK,OAAO,MAAM,KAAK;;;wBAG3B,MAAM,KAAK,OAAO,MAAM,KAAK;gCACrB,MAAM,KAAK,OAAO,MAAM,KAAK;;;;wBAIrC,MAAM,KAAK,OAAO,MAAM,KAAK;;;CAIjD,MAAMC,sBAA8B,mBAAG;0BACjB,MAAM,KAAK,OAAO,WAAW,SAAS;eACjD,MAAM,KAAK,OAAO,KAAK,UAAU;;;;;;wBAMxB,MAAM,KAAK,OAAO,OAAO;;;;CAK7C,MAAMC,cAAsB,mBAAG;;;AAI/B,QAAO;EACL,eAAe,WAAW,sBAAsB;EAChD,YAAY,WAAW,mBAAmB;EAC1C,OAAO;EACP,OAAO;EACR;GACA;CAAC;CAAO;CAAa;CAAU;CAAS,CAAC;AAE9C,gCAAe"}
|
|
@@ -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_Button = require('../Button/Button.cjs');
|
|
4
5
|
const require_X = require('../Icons/X.cjs');
|
|
@@ -9,8 +10,6 @@ let react = require("react");
|
|
|
9
10
|
react = require_rolldown_runtime.__toESM(react);
|
|
10
11
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
11
12
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
12
|
-
let __emotion_css = require("@emotion/css");
|
|
13
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
14
13
|
let __floating_ui_react = require("@floating-ui/react");
|
|
15
14
|
__floating_ui_react = require_rolldown_runtime.__toESM(__floating_ui_react);
|
|
16
15
|
|
|
@@ -90,14 +89,14 @@ const DialogContent = (0, react.forwardRef)((props, propRef) => {
|
|
|
90
89
|
const ref = (0, __floating_ui_react.useMergeRefs)([context.refs.setFloating, propRef]);
|
|
91
90
|
if (!floatingContext.open) return null;
|
|
92
91
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__floating_ui_react.FloatingPortal, { children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__floating_ui_react.FloatingOverlay, {
|
|
93
|
-
className:
|
|
92
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "overlay")), styles["overlay"]),
|
|
94
93
|
lockScroll: true,
|
|
95
94
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(__floating_ui_react.FloatingFocusManager, {
|
|
96
95
|
context: floatingContext,
|
|
97
96
|
initialFocus: -1,
|
|
98
97
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
99
98
|
ref,
|
|
100
|
-
className:
|
|
99
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "content")), styles["content"], props.className),
|
|
101
100
|
"aria-labelledby": context.labelId,
|
|
102
101
|
"aria-describedby": context.descriptionId,
|
|
103
102
|
...context.getFloatingProps(props),
|
|
@@ -118,12 +117,12 @@ const DialogHeading = (0, react.forwardRef)(({ children,...props }, ref) => {
|
|
|
118
117
|
};
|
|
119
118
|
}, [id, context.setLabelId]);
|
|
120
119
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
121
|
-
className:
|
|
120
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "header")), styles["header"]),
|
|
122
121
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("h2", {
|
|
123
122
|
...props,
|
|
124
123
|
ref,
|
|
125
124
|
id,
|
|
126
|
-
className:
|
|
125
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "title")), styles["headerTitle"]),
|
|
127
126
|
children
|
|
128
127
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Button.default, {
|
|
129
128
|
color: "tertiary",
|
|
@@ -156,7 +155,7 @@ const DialogDescription = (0, react.forwardRef)(({ children,...props }, ref) =>
|
|
|
156
155
|
...props,
|
|
157
156
|
ref,
|
|
158
157
|
id,
|
|
159
|
-
className:
|
|
158
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "description")), styles["description"], props.className),
|
|
160
159
|
children
|
|
161
160
|
});
|
|
162
161
|
});
|
|
@@ -178,7 +177,7 @@ const DialogClose = (0, react.forwardRef)(({ children, asChild = false,...props
|
|
|
178
177
|
...props,
|
|
179
178
|
ref,
|
|
180
179
|
onClick: handleClick,
|
|
181
|
-
className:
|
|
180
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("dialog", "close")), props.className),
|
|
182
181
|
variant: "text",
|
|
183
182
|
children
|
|
184
183
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.cjs","names":["open: boolean","setOpen: (openVal: boolean) => void","data: UseFloatingReturn","interactions: UseInteractionsReturn","DialogContext: Context<DialogContextType>","context: DialogContextType","dialog: DialogHookReturn","DialogTrigger: ForwardRefExoticComponent<\n HTMLProps<HTMLElement> & DialogTriggerProps & RefAttributes<HTMLElement>\n>","context: DialogHookReturn","childrenRef: Ref<HTMLElement>","ref: ReturnType<typeof useMergeRefs>","DialogContent: ForwardRefExoticComponent<HTMLProps<HTMLDivElement> & RefAttributes<HTMLDivElement>>","useTheme","styles: Record<string, string>","useStyles","FloatingPortal","FloatingOverlay","FloatingFocusManager","DialogHeading: ForwardRefExoticComponent<\n HTMLProps<HTMLHeadingElement> & RefAttributes<HTMLHeadingElement>\n>","id: string | undefined","Button","X","DialogDescription: ForwardRefExoticComponent<\n HTMLProps<HTMLParagraphElement> & RefAttributes<HTMLParagraphElement>\n>","DialogClose: ForwardRefExoticComponent<\n ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps & RefAttributes<HTMLButtonElement>\n>","childrenRef: Ref<HTMLButtonElement>"],"sources":["../../../../../src/components/primitives/Dialog/Dialog.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {cx} from '@emotion/css';\nimport {\n useFloating,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n useMergeRefs,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useId,\n UseFloatingReturn,\n UseInteractionsReturn,\n} from '@floating-ui/react';\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {\n type ButtonHTMLAttributes,\n type Context,\n type Dispatch,\n type FC,\n type ForwardRefExoticComponent,\n type HTMLProps,\n type JSX,\n type MouseEvent,\n type ReactNode,\n type Ref,\n type RefAttributes,\n type SetStateAction,\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\nimport useStyles from './Dialog.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport Button from '../Button/Button';\nimport {X} from '../Icons';\n\ninterface DialogOptions {\n initialOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\ninterface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: Dispatch<SetStateAction<string | undefined>>;\n setLabelId: Dispatch<SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function useDialog({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n}: DialogOptions = {}): DialogHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(initialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n\n const open: boolean = controlledOpen ?? uncontrolledOpen;\n const setOpen: (openVal: boolean) => void = setControlledOpen ?? setUncontrolledOpen;\n\n const data: UseFloatingReturn = useFloating({\n onOpenChange: setOpen,\n open,\n });\n\n const {context} = data;\n\n const click: ReturnType<typeof useClick> = useClick(context, {\n enabled: controlledOpen == null,\n });\n const dismiss: ReturnType<typeof useDismiss> = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role: ReturnType<typeof useRole> = useRole(context);\n\n const interactions: UseInteractionsReturn = useInteractions([click, dismiss, role]);\n\n return useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n descriptionId,\n labelId,\n setDescriptionId,\n setLabelId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\ntype DialogContextType =\n | (DialogHookReturn & {\n setDescriptionId: Dispatch<SetStateAction<string | undefined>>;\n setLabelId: Dispatch<SetStateAction<string | undefined>>;\n })\n | null;\n\nconst DialogContext: Context<DialogContextType> = createContext<DialogContextType>(null);\n\nexport const useDialogContext = (): DialogHookReturn => {\n const context: DialogContextType = useContext(DialogContext);\n if (context == null) {\n throw new Error('Dialog components must be wrapped in <Dialog />');\n }\n return context;\n};\n\n// Dialog Components (Modal)\nexport function Dialog({children, ...options}: {children: ReactNode} & DialogOptions): JSX.Element {\n const dialog: DialogHookReturn = useDialog(options);\n return <DialogContext.Provider value={dialog}>{children}</DialogContext.Provider>;\n}\n\ninterface DialogTriggerProps {\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const DialogTrigger: ForwardRefExoticComponent<\n HTMLProps<HTMLElement> & DialogTriggerProps & RefAttributes<HTMLElement>\n> = forwardRef<HTMLElement, HTMLProps<HTMLElement> & DialogTriggerProps>(\n ({children, asChild = false, ...props}: HTMLProps<HTMLElement> & DialogTriggerProps, propRef: Ref<HTMLElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const childrenRef: Ref<HTMLElement> = (children as any).ref;\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && isValidElement(children)) {\n return cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const DialogContent: ForwardRefExoticComponent<HTMLProps<HTMLDivElement> & RefAttributes<HTMLDivElement>> =\n forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(\n (props: HTMLProps<HTMLDivElement>, propRef: Ref<HTMLDivElement>) => {\n const {context: floatingContext, ...context} = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([context.refs.setFloating, propRef]);\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingOverlay\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'overlay')), styles['overlay'])}\n lockScroll\n >\n <FloatingFocusManager context={floatingContext} initialFocus={-1}>\n <div\n ref={ref}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'content')), styles['content'], props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n );\n },\n );\n\nexport const DialogHeading: ForwardRefExoticComponent<\n HTMLProps<HTMLHeadingElement> & RefAttributes<HTMLHeadingElement>\n> = forwardRef<HTMLHeadingElement, HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}: HTMLProps<HTMLHeadingElement>, ref: Ref<HTMLHeadingElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const id: string | undefined = useId();\n\n useLayoutEffect((): (() => void) => {\n context.setLabelId(id);\n return (): void => {\n context.setLabelId(undefined);\n };\n }, [id, context.setLabelId]);\n\n return (\n <div className={cx(withVendorCSSClassPrefix(bem('dialog', 'header')), styles['header'])}>\n <h2\n {...props}\n ref={ref}\n id={id}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'title')), styles['headerTitle'])}\n >\n {children}\n </h2>\n <Button\n color=\"tertiary\"\n variant=\"icon\"\n size=\"small\"\n shape=\"round\"\n onClick={(): void => {\n context.setOpen(false);\n }}\n aria-label=\"Close\"\n >\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const DialogDescription: ForwardRefExoticComponent<\n HTMLProps<HTMLParagraphElement> & RefAttributes<HTMLParagraphElement>\n> = forwardRef<HTMLParagraphElement, HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}: HTMLProps<HTMLParagraphElement>, ref: Ref<HTMLParagraphElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const id: string | undefined = useId();\n\n useLayoutEffect((): (() => void) => {\n context.setDescriptionId(id);\n return (): void => {\n context.setDescriptionId(undefined);\n };\n }, [id, context.setDescriptionId]);\n\n return (\n <p\n {...props}\n ref={ref}\n id={id}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'description')), styles['description'], props.className)}\n >\n {children}\n </p>\n );\n },\n);\n\ninterface DialogCloseProps {\n asChild?: boolean;\n children?: ReactNode;\n}\n\nexport const DialogClose: ForwardRefExoticComponent<\n ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps & RefAttributes<HTMLButtonElement>\n> = forwardRef<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps>(\n (\n {children, asChild = false, ...props}: ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps,\n propRef: Ref<HTMLButtonElement>,\n ) => {\n const context: DialogHookReturn = useDialogContext();\n const childrenRef: Ref<HTMLButtonElement> = (children as any)?.ref;\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([propRef, childrenRef]);\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n context.setOpen(false);\n props.onClick?.(event);\n };\n\n if (asChild && isValidElement(children)) {\n return cloneElement(children, {\n ref,\n ...props,\n ...(children.props as any),\n onClick: handleClick,\n });\n }\n\n return (\n <Button\n {...props}\n ref={ref}\n onClick={handleClick}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'close')), props.className)}\n variant=\"text\"\n >\n {children}\n </Button>\n );\n },\n);\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogContent.displayName = 'DialogContent';\nDialogHeading.displayName = 'DialogHeading';\nDialogDescription.displayName = 'DialogDescription';\nDialogClose.displayName = 'DialogClose';\n\n// Attach subcomponents to Dialog\n(Dialog as any).Trigger = DialogTrigger;\n(Dialog as any).Content = DialogContent;\n(Dialog as any).Heading = DialogHeading;\n(Dialog as any).Description = DialogDescription;\n(Dialog as any).Close = DialogClose;\n\nexport interface DialogComponent extends FC<{children: ReactNode} & DialogOptions> {\n Close: typeof DialogClose;\n Content: typeof DialogContent;\n Description: typeof DialogDescription;\n Heading: typeof DialogHeading;\n Trigger: typeof DialogTrigger;\n}\n\nexport default Dialog as DialogComponent;\n"],"mappings":"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"}
|
|
1
|
+
{"version":3,"file":"Dialog.cjs","names":["open: boolean","setOpen: (openVal: boolean) => void","data: UseFloatingReturn","interactions: UseInteractionsReturn","DialogContext: Context<DialogContextType>","context: DialogContextType","dialog: DialogHookReturn","DialogTrigger: ForwardRefExoticComponent<\n HTMLProps<HTMLElement> & DialogTriggerProps & RefAttributes<HTMLElement>\n>","context: DialogHookReturn","childrenRef: Ref<HTMLElement>","ref: ReturnType<typeof useMergeRefs>","DialogContent: ForwardRefExoticComponent<HTMLProps<HTMLDivElement> & RefAttributes<HTMLDivElement>>","useTheme","styles: Record<string, string>","useStyles","FloatingPortal","FloatingOverlay","cx","FloatingFocusManager","DialogHeading: ForwardRefExoticComponent<\n HTMLProps<HTMLHeadingElement> & RefAttributes<HTMLHeadingElement>\n>","id: string | undefined","Button","X","DialogDescription: ForwardRefExoticComponent<\n HTMLProps<HTMLParagraphElement> & RefAttributes<HTMLParagraphElement>\n>","DialogClose: ForwardRefExoticComponent<\n ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps & RefAttributes<HTMLButtonElement>\n>","childrenRef: Ref<HTMLButtonElement>"],"sources":["../../../../../src/components/primitives/Dialog/Dialog.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {\n useFloating,\n useClick,\n useDismiss,\n useRole,\n useInteractions,\n useMergeRefs,\n FloatingFocusManager,\n FloatingOverlay,\n FloatingPortal,\n useId,\n UseFloatingReturn,\n UseInteractionsReturn,\n} from '@floating-ui/react';\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {\n type ButtonHTMLAttributes,\n type Context,\n type Dispatch,\n type FC,\n type ForwardRefExoticComponent,\n type HTMLProps,\n type JSX,\n type MouseEvent,\n type ReactNode,\n type Ref,\n type RefAttributes,\n type SetStateAction,\n cloneElement,\n createContext,\n forwardRef,\n isValidElement,\n useContext,\n useLayoutEffect,\n useMemo,\n useState,\n} from 'react';\nimport useStyles from './Dialog.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\nimport Button from '../Button/Button';\nimport {X} from '../Icons';\n\ninterface DialogOptions {\n initialOpen?: boolean;\n onOpenChange?: (open: boolean) => void;\n open?: boolean;\n}\n\ninterface DialogHookReturn extends UseFloatingReturn, UseInteractionsReturn {\n descriptionId: string | undefined;\n labelId: string | undefined;\n open: boolean;\n setDescriptionId: Dispatch<SetStateAction<string | undefined>>;\n setLabelId: Dispatch<SetStateAction<string | undefined>>;\n setOpen: (open: boolean) => void;\n}\n\nexport function useDialog({\n initialOpen = false,\n open: controlledOpen,\n onOpenChange: setControlledOpen,\n}: DialogOptions = {}): DialogHookReturn {\n const [uncontrolledOpen, setUncontrolledOpen] = useState(initialOpen);\n const [labelId, setLabelId] = useState<string | undefined>();\n const [descriptionId, setDescriptionId] = useState<string | undefined>();\n\n const open: boolean = controlledOpen ?? uncontrolledOpen;\n const setOpen: (openVal: boolean) => void = setControlledOpen ?? setUncontrolledOpen;\n\n const data: UseFloatingReturn = useFloating({\n onOpenChange: setOpen,\n open,\n });\n\n const {context} = data;\n\n const click: ReturnType<typeof useClick> = useClick(context, {\n enabled: controlledOpen == null,\n });\n const dismiss: ReturnType<typeof useDismiss> = useDismiss(context, {outsidePressEvent: 'mousedown'});\n const role: ReturnType<typeof useRole> = useRole(context);\n\n const interactions: UseInteractionsReturn = useInteractions([click, dismiss, role]);\n\n return useMemo(\n () => ({\n open,\n setOpen,\n ...interactions,\n ...data,\n descriptionId,\n labelId,\n setDescriptionId,\n setLabelId,\n }),\n [open, setOpen, interactions, data, labelId, descriptionId],\n );\n}\n\ntype DialogContextType =\n | (DialogHookReturn & {\n setDescriptionId: Dispatch<SetStateAction<string | undefined>>;\n setLabelId: Dispatch<SetStateAction<string | undefined>>;\n })\n | null;\n\nconst DialogContext: Context<DialogContextType> = createContext<DialogContextType>(null);\n\nexport const useDialogContext = (): DialogHookReturn => {\n const context: DialogContextType = useContext(DialogContext);\n if (context == null) {\n throw new Error('Dialog components must be wrapped in <Dialog />');\n }\n return context;\n};\n\n// Dialog Components (Modal)\nexport function Dialog({children, ...options}: {children: ReactNode} & DialogOptions): JSX.Element {\n const dialog: DialogHookReturn = useDialog(options);\n return <DialogContext.Provider value={dialog}>{children}</DialogContext.Provider>;\n}\n\ninterface DialogTriggerProps {\n asChild?: boolean;\n children: ReactNode;\n}\n\nexport const DialogTrigger: ForwardRefExoticComponent<\n HTMLProps<HTMLElement> & DialogTriggerProps & RefAttributes<HTMLElement>\n> = forwardRef<HTMLElement, HTMLProps<HTMLElement> & DialogTriggerProps>(\n ({children, asChild = false, ...props}: HTMLProps<HTMLElement> & DialogTriggerProps, propRef: Ref<HTMLElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const childrenRef: Ref<HTMLElement> = (children as any).ref;\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([context.refs.setReference, propRef, childrenRef]);\n\n if (asChild && isValidElement(children)) {\n return cloneElement(\n children,\n context.getReferenceProps({\n ref,\n ...props,\n ...(children.props as any),\n 'data-state': context.open ? 'open' : 'closed',\n }),\n );\n }\n\n return (\n <button ref={ref} data-state={context.open ? 'open' : 'closed'} {...context.getReferenceProps(props)}>\n {children}\n </button>\n );\n },\n);\n\nexport const DialogContent: ForwardRefExoticComponent<HTMLProps<HTMLDivElement> & RefAttributes<HTMLDivElement>> =\n forwardRef<HTMLDivElement, HTMLProps<HTMLDivElement>>(\n (props: HTMLProps<HTMLDivElement>, propRef: Ref<HTMLDivElement>) => {\n const {context: floatingContext, ...context} = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([context.refs.setFloating, propRef]);\n\n if (!floatingContext.open) return null;\n\n return (\n <FloatingPortal>\n <FloatingOverlay\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'overlay')), styles['overlay'])}\n lockScroll\n >\n <FloatingFocusManager context={floatingContext} initialFocus={-1}>\n <div\n ref={ref}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'content')), styles['content'], props.className)}\n aria-labelledby={context.labelId}\n aria-describedby={context.descriptionId}\n {...context.getFloatingProps(props)}\n >\n {props.children}\n </div>\n </FloatingFocusManager>\n </FloatingOverlay>\n </FloatingPortal>\n );\n },\n );\n\nexport const DialogHeading: ForwardRefExoticComponent<\n HTMLProps<HTMLHeadingElement> & RefAttributes<HTMLHeadingElement>\n> = forwardRef<HTMLHeadingElement, HTMLProps<HTMLHeadingElement>>(\n ({children, ...props}: HTMLProps<HTMLHeadingElement>, ref: Ref<HTMLHeadingElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const id: string | undefined = useId();\n\n useLayoutEffect((): (() => void) => {\n context.setLabelId(id);\n return (): void => {\n context.setLabelId(undefined);\n };\n }, [id, context.setLabelId]);\n\n return (\n <div className={cx(withVendorCSSClassPrefix(bem('dialog', 'header')), styles['header'])}>\n <h2\n {...props}\n ref={ref}\n id={id}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'title')), styles['headerTitle'])}\n >\n {children}\n </h2>\n <Button\n color=\"tertiary\"\n variant=\"icon\"\n size=\"small\"\n shape=\"round\"\n onClick={(): void => {\n context.setOpen(false);\n }}\n aria-label=\"Close\"\n >\n <X width={16} height={16} />\n </Button>\n </div>\n );\n },\n);\n\nexport const DialogDescription: ForwardRefExoticComponent<\n HTMLProps<HTMLParagraphElement> & RefAttributes<HTMLParagraphElement>\n> = forwardRef<HTMLParagraphElement, HTMLProps<HTMLParagraphElement>>(\n ({children, ...props}: HTMLProps<HTMLParagraphElement>, ref: Ref<HTMLParagraphElement>) => {\n const context: DialogHookReturn = useDialogContext();\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme);\n const id: string | undefined = useId();\n\n useLayoutEffect((): (() => void) => {\n context.setDescriptionId(id);\n return (): void => {\n context.setDescriptionId(undefined);\n };\n }, [id, context.setDescriptionId]);\n\n return (\n <p\n {...props}\n ref={ref}\n id={id}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'description')), styles['description'], props.className)}\n >\n {children}\n </p>\n );\n },\n);\n\ninterface DialogCloseProps {\n asChild?: boolean;\n children?: ReactNode;\n}\n\nexport const DialogClose: ForwardRefExoticComponent<\n ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps & RefAttributes<HTMLButtonElement>\n> = forwardRef<HTMLButtonElement, ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps>(\n (\n {children, asChild = false, ...props}: ButtonHTMLAttributes<HTMLButtonElement> & DialogCloseProps,\n propRef: Ref<HTMLButtonElement>,\n ) => {\n const context: DialogHookReturn = useDialogContext();\n const childrenRef: Ref<HTMLButtonElement> = (children as any)?.ref;\n const ref: ReturnType<typeof useMergeRefs> = useMergeRefs([propRef, childrenRef]);\n\n const handleClick = (event: MouseEvent<HTMLButtonElement>): void => {\n context.setOpen(false);\n props.onClick?.(event);\n };\n\n if (asChild && isValidElement(children)) {\n return cloneElement(children, {\n ref,\n ...props,\n ...(children.props as any),\n onClick: handleClick,\n });\n }\n\n return (\n <Button\n {...props}\n ref={ref}\n onClick={handleClick}\n className={cx(withVendorCSSClassPrefix(bem('dialog', 'close')), props.className)}\n variant=\"text\"\n >\n {children}\n </Button>\n );\n },\n);\n\nDialogTrigger.displayName = 'DialogTrigger';\nDialogContent.displayName = 'DialogContent';\nDialogHeading.displayName = 'DialogHeading';\nDialogDescription.displayName = 'DialogDescription';\nDialogClose.displayName = 'DialogClose';\n\n// Attach subcomponents to Dialog\n(Dialog as any).Trigger = DialogTrigger;\n(Dialog as any).Content = DialogContent;\n(Dialog as any).Heading = DialogHeading;\n(Dialog as any).Description = DialogDescription;\n(Dialog as any).Close = DialogClose;\n\nexport interface DialogComponent extends FC<{children: ReactNode} & DialogOptions> {\n Close: typeof DialogClose;\n Content: typeof DialogContent;\n Description: typeof DialogDescription;\n Heading: typeof DialogHeading;\n Trigger: typeof DialogTrigger;\n}\n\nexport default Dialog as DialogComponent;\n"],"mappings":"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"}
|
|
@@ -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/Dialog/Dialog.styles.ts
|
|
8
7
|
/**
|
|
@@ -12,14 +11,14 @@ __emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
|
12
11
|
* @returns Object containing CSS class names for component styling
|
|
13
12
|
*/
|
|
14
13
|
const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
15
|
-
const overlay =
|
|
14
|
+
const overlay = require_emotion.css`
|
|
16
15
|
background-color: rgba(0, 0, 0, 0.5);
|
|
17
16
|
display: flex;
|
|
18
17
|
align-items: center;
|
|
19
18
|
justify-content: center;
|
|
20
19
|
z-index: 9999;
|
|
21
20
|
`;
|
|
22
|
-
const content =
|
|
21
|
+
const content = require_emotion.css`
|
|
23
22
|
background: ${theme.vars.colors.background.surface};
|
|
24
23
|
border-radius: ${theme.vars.borderRadius.large};
|
|
25
24
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
@@ -28,7 +27,7 @@ const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
|
28
27
|
overflow-y: auto;
|
|
29
28
|
z-index: 10000;
|
|
30
29
|
`;
|
|
31
|
-
const dropdownContent =
|
|
30
|
+
const dropdownContent = require_emotion.css`
|
|
32
31
|
background: ${theme.vars.colors.background.surface};
|
|
33
32
|
border-radius: ${theme.vars.borderRadius.large};
|
|
34
33
|
box-shadow: 0 2px 8px ${colorScheme === "dark" ? "rgba(0, 0, 0, 0.3)" : "rgba(0, 0, 0, 0.15)"};
|
|
@@ -38,14 +37,14 @@ const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
|
38
37
|
overflow-y: auto;
|
|
39
38
|
z-index: 10000;
|
|
40
39
|
`;
|
|
41
|
-
const header =
|
|
40
|
+
const header = require_emotion.css`
|
|
42
41
|
display: flex;
|
|
43
42
|
justify-content: space-between;
|
|
44
43
|
align-items: center;
|
|
45
44
|
padding: calc(${theme.vars.spacing.unit} * 3) calc(${theme.vars.spacing.unit} * 4.5);
|
|
46
45
|
border-bottom: 1px solid ${theme.vars.colors.border};
|
|
47
46
|
`;
|
|
48
|
-
const headerTitle =
|
|
47
|
+
const headerTitle = require_emotion.css`
|
|
49
48
|
margin: 0;
|
|
50
49
|
font-size: 1.2rem;
|
|
51
50
|
font-weight: 600;
|
|
@@ -53,10 +52,10 @@ const useStyles = (theme, colorScheme) => (0, react.useMemo)(() => {
|
|
|
53
52
|
`;
|
|
54
53
|
return {
|
|
55
54
|
content,
|
|
56
|
-
contentBody:
|
|
55
|
+
contentBody: require_emotion.css`
|
|
57
56
|
padding: calc(${theme.vars.spacing.unit} * 2);
|
|
58
57
|
`,
|
|
59
|
-
description:
|
|
58
|
+
description: require_emotion.css`
|
|
60
59
|
margin: 0;
|
|
61
60
|
color: ${theme.vars.colors.text.secondary};
|
|
62
61
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Dialog.styles.cjs","names":["overlay: string","content: string","dropdownContent: string","header: string","headerTitle: string"],"sources":["../../../../../src/components/primitives/Dialog/Dialog.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Dialog.styles.cjs","names":["overlay: string","content: string","dropdownContent: string","header: string","headerTitle: string"],"sources":["../../../../../src/components/primitives/Dialog/Dialog.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\n/**\n * Creates styles for the Dialog component using BEM methodology\n * @param theme - The theme object containing design tokens\n * @param colorScheme - The current color scheme (used for memoization)\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (theme: Theme, colorScheme: string): Record<string, string> =>\n useMemo(() => {\n const overlay: string = css`\n background-color: rgba(0, 0, 0, 0.5);\n display: flex;\n align-items: center;\n justify-content: center;\n z-index: 9999;\n `;\n\n const content: string = css`\n background: ${theme.vars.colors.background.surface};\n border-radius: ${theme.vars.borderRadius.large};\n box-shadow: 0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'};\n font-family: ${theme.vars.typography.fontFamily};\n outline: none;\n overflow-y: auto;\n z-index: 10000;\n `;\n\n const dropdownContent: string = css`\n background: ${theme.vars.colors.background.surface};\n border-radius: ${theme.vars.borderRadius.large};\n box-shadow: 0 2px 8px ${colorScheme === 'dark' ? 'rgba(0, 0, 0, 0.3)' : 'rgba(0, 0, 0, 0.15)'};\n outline: none;\n max-width: 90vw;\n max-height: 90vh;\n overflow-y: auto;\n z-index: 10000;\n `;\n\n const header: string = css`\n display: flex;\n justify-content: space-between;\n align-items: center;\n padding: calc(${theme.vars.spacing.unit} * 3) calc(${theme.vars.spacing.unit} * 4.5);\n border-bottom: 1px solid ${theme.vars.colors.border};\n `;\n\n const headerTitle: string = css`\n margin: 0;\n font-size: 1.2rem;\n font-weight: 600;\n color: ${theme.vars.colors.text.primary};\n `;\n\n const contentBody: string = css`\n padding: calc(${theme.vars.spacing.unit} * 2);\n `;\n\n const description: string = css`\n margin: 0;\n color: ${theme.vars.colors.text.secondary};\n font-size: ${theme.vars.typography.fontSizes.sm};\n line-height: 1.5;\n `;\n\n return {\n content,\n contentBody,\n description,\n dropdownContent,\n header,\n headerTitle,\n overlay,\n };\n }, [theme, colorScheme]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;AAaA,MAAM,aAAa,OAAc,yCACjB;CACZ,MAAMA,UAAkB,mBAAG;;;;;;;CAQ3B,MAAMC,UAAkB,mBAAG;oBACX,MAAM,KAAK,OAAO,WAAW,QAAQ;uBAClC,MAAM,KAAK,aAAa,MAAM;8BACvB,gBAAgB,SAAS,uBAAuB,sBAAsB;qBAC/E,MAAM,KAAK,WAAW,WAAW;;;;;CAMlD,MAAMC,kBAA0B,mBAAG;oBACnB,MAAM,KAAK,OAAO,WAAW,QAAQ;uBAClC,MAAM,KAAK,aAAa,MAAM;8BACvB,gBAAgB,SAAS,uBAAuB,sBAAsB;;;;;;;CAQhG,MAAMC,SAAiB,mBAAG;;;;sBAIR,MAAM,KAAK,QAAQ,KAAK,aAAa,MAAM,KAAK,QAAQ,KAAK;iCAClD,MAAM,KAAK,OAAO,OAAO;;CAGtD,MAAMC,cAAsB,mBAAG;;;;eAIpB,MAAM,KAAK,OAAO,KAAK,QAAQ;;AAc1C,QAAO;EACL;EACA,aAb0B,mBAAG;sBACb,MAAM,KAAK,QAAQ,KAAK;;EAaxC,aAV0B,mBAAG;;eAEpB,MAAM,KAAK,OAAO,KAAK,UAAU;mBAC7B,MAAM,KAAK,WAAW,UAAU,GAAG;;;EAQhD;EACA;EACA;EACA;EACD;GACA,CAAC,OAAO,YAAY,CAAC;AAE1B,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_Typography = require('../Typography/Typography.cjs');
|
|
4
5
|
const require_Divider_styles = require('./Divider.styles.cjs');
|
|
@@ -6,8 +7,6 @@ let __thunderid_browser = require("@thunderid/browser");
|
|
|
6
7
|
__thunderid_browser = require_rolldown_runtime.__toESM(__thunderid_browser);
|
|
7
8
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
8
9
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
9
|
-
let __emotion_css = require("@emotion/css");
|
|
10
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
11
10
|
|
|
12
11
|
//#region src/components/primitives/Divider/Divider.tsx
|
|
13
12
|
/**
|
|
@@ -32,32 +31,32 @@ const Divider = ({ orientation = "horizontal", variant = "solid", children, colo
|
|
|
32
31
|
const { theme, colorScheme } = require_useTheme.default();
|
|
33
32
|
const styles = require_Divider_styles.default(theme, colorScheme, orientation, variant, color, !!children);
|
|
34
33
|
if (orientation === "vertical") return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
35
|
-
className:
|
|
34
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "vertical")), styles["divider"], styles["vertical"], className),
|
|
36
35
|
style,
|
|
37
36
|
role: "separator",
|
|
38
37
|
"aria-orientation": "vertical",
|
|
39
38
|
...rest
|
|
40
39
|
});
|
|
41
40
|
if (children) return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
42
|
-
className:
|
|
41
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "horizontal")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "with-text")), styles["divider"], styles["horizontal"], className),
|
|
43
42
|
style,
|
|
44
43
|
role: "separator",
|
|
45
44
|
"aria-orientation": "horizontal",
|
|
46
45
|
...rest,
|
|
47
46
|
children: [
|
|
48
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className:
|
|
47
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "line")), styles["line"]) }),
|
|
49
48
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Typography.default, {
|
|
50
49
|
variant: "body2",
|
|
51
50
|
color: "textSecondary",
|
|
52
|
-
className:
|
|
51
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "text")), styles["text"]),
|
|
53
52
|
inline: true,
|
|
54
53
|
children
|
|
55
54
|
}),
|
|
56
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className:
|
|
55
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "line")), styles["line"]) })
|
|
57
56
|
]
|
|
58
57
|
});
|
|
59
58
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
60
|
-
className:
|
|
59
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("divider", "horizontal")), styles["divider"], styles["horizontal"], className),
|
|
61
60
|
style,
|
|
62
61
|
role: "separator",
|
|
63
62
|
"aria-orientation": "horizontal",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.cjs","names":["Divider: FC<DividerProps>","useTheme","styles: Record<string, string>","useStyles","Typography"],"sources":["../../../../../src/components/primitives/Divider/Divider.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Divider.cjs","names":["Divider: FC<DividerProps>","useTheme","styles: Record<string, string>","useStyles","cx","Typography"],"sources":["../../../../../src/components/primitives/Divider/Divider.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {FC, HTMLAttributes, ReactNode} from 'react';\nimport useStyles from './Divider.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\nimport Typography from '../Typography/Typography';\n\nexport type DividerOrientation = 'horizontal' | 'vertical';\nexport type DividerVariant = 'solid' | 'dashed' | 'dotted';\n\nexport interface DividerProps extends HTMLAttributes<HTMLDivElement> {\n /**\n * Text to display in the center of the divider\n */\n children?: ReactNode;\n\n /**\n * Custom color for the divider\n */\n color?: string;\n\n /**\n * The orientation of the divider\n */\n orientation?: DividerOrientation;\n\n /**\n * The variant style of the divider\n */\n variant?: DividerVariant;\n}\n\n/**\n * Divider component for separating content sections.\n *\n * @example\n * ```tsx\n * // Basic horizontal divider\n * <Divider />\n *\n * // Divider with text\n * <Divider>OR</Divider>\n *\n * // Vertical divider\n * <Divider orientation=\"vertical\" />\n *\n * // Custom styled divider\n * <Divider variant=\"dashed\" color=\"#ccc\">Continue with</Divider>\n * ```\n */\nconst Divider: FC<DividerProps> = ({\n orientation = 'horizontal',\n variant = 'solid',\n children,\n color,\n className,\n style,\n ...rest\n}: DividerProps) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string> = useStyles(theme, colorScheme, orientation, variant, color, !!children);\n\n if (orientation === 'vertical') {\n return (\n <div\n className={cx(\n withVendorCSSClassPrefix(bem('divider')),\n withVendorCSSClassPrefix(bem('divider', 'vertical')),\n styles['divider'],\n styles['vertical'],\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"vertical\"\n {...rest}\n />\n );\n }\n\n if (children) {\n return (\n <div\n className={cx(\n withVendorCSSClassPrefix(bem('divider')),\n withVendorCSSClassPrefix(bem('divider', 'horizontal')),\n withVendorCSSClassPrefix(bem('divider', 'with-text')),\n styles['divider'],\n styles['horizontal'],\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n >\n <div className={cx(withVendorCSSClassPrefix(bem('divider', 'line')), styles['line'])} />\n <Typography\n variant=\"body2\"\n color=\"textSecondary\"\n className={cx(withVendorCSSClassPrefix(bem('divider', 'text')), styles['text'])}\n inline\n >\n {children}\n </Typography>\n <div className={cx(withVendorCSSClassPrefix(bem('divider', 'line')), styles['line'])} />\n </div>\n );\n }\n\n return (\n <div\n className={cx(\n withVendorCSSClassPrefix(bem('divider')),\n withVendorCSSClassPrefix(bem('divider', 'horizontal')),\n styles['divider'],\n styles['horizontal'],\n className,\n )}\n style={style}\n role=\"separator\"\n aria-orientation=\"horizontal\"\n {...rest}\n />\n );\n};\n\nexport default Divider;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAqDA,MAAMA,WAA6B,EACjC,cAAc,cACd,UAAU,SACV,UACA,OACA,WACA,MACA,GAAG,WACe;CAClB,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAMC,SAAiCC,+BAAU,OAAO,aAAa,aAAa,SAAS,OAAO,CAAC,CAAC,SAAS;AAE7G,KAAI,gBAAgB,WAClB,QACE,2CAAC;EACC,WAAWC,kGACoB,UAAU,CAAC,iFACX,WAAW,WAAW,CAAC,EACpD,OAAO,YACP,OAAO,aACP,UACD;EACM;EACP,MAAK;EACL,oBAAiB;EACjB,GAAI;GACJ;AAIN,KAAI,SACF,QACE,4CAAC;EACC,WAAWA,kGACoB,UAAU,CAAC,iFACX,WAAW,aAAa,CAAC,iFACzB,WAAW,YAAY,CAAC,EACrD,OAAO,YACP,OAAO,eACP,UACD;EACM;EACP,MAAK;EACL,oBAAiB;EACjB,GAAI;;GAEJ,2CAAC,SAAI,WAAWA,kGAAgC,WAAW,OAAO,CAAC,EAAE,OAAO,QAAQ,GAAI;GACxF,2CAACC;IACC,SAAQ;IACR,OAAM;IACN,WAAWD,kGAAgC,WAAW,OAAO,CAAC,EAAE,OAAO,QAAQ;IAC/E;IAEC;KACU;GACb,2CAAC,SAAI,WAAWA,kGAAgC,WAAW,OAAO,CAAC,EAAE,OAAO,QAAQ,GAAI;;GACpF;AAIV,QACE,2CAAC;EACC,WAAWA,kGACoB,UAAU,CAAC,iFACX,WAAW,aAAa,CAAC,EACtD,OAAO,YACP,OAAO,eACP,UACD;EACM;EACP,MAAK;EACL,oBAAiB;EACjB,GAAI;GACJ;;AAIN,sBAAe"}
|