@thunderid/react 0.12.0 → 0.13.0
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/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/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 +5 -6
- 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/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/ThunderIDProvider.cjs +4 -1
- package/dist/cjs/contexts/ThunderID/ThunderIDProvider.cjs.map +1 -1
- 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/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.map +1 -1
- package/dist/components/presentation/UserProfile/BaseUserProfile.js +1 -1
- 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/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/ThunderIDProvider.d.ts.map +1 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js +4 -1
- package/dist/contexts/ThunderID/ThunderIDProvider.js.map +1 -1
- package/dist/models/config.d.ts +10 -1
- package/dist/models/config.d.ts.map +1 -1
- package/dist/styles/emotion.d.ts +36 -0
- package/dist/styles/emotion.d.ts.map +1 -0
- package/dist/styles/emotion.js +58 -0
- package/dist/styles/emotion.js.map +1 -0
- package/package.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.cjs","names":["Avatar: FC<AvatarProps>","useTheme","resolvedIcon: ResolvedLogo | undefined","hasImage: boolean","hash: number","charCode: number","seed: number","hue1: number","hue2: number","saturation: number","styles: ReturnType<typeof useStyles>","useStyles","isDefaultState: boolean"],"sources":["../../../../../src/components/primitives/Avatar/Avatar.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Avatar.cjs","names":["Avatar: FC<AvatarProps>","useTheme","resolvedIcon: ResolvedLogo | undefined","hasImage: boolean","hash: number","charCode: number","seed: number","hue1: number","hue2: number","saturation: number","styles: ReturnType<typeof useStyles>","useStyles","isDefaultState: boolean","cx"],"sources":["../../../../../src/components/primitives/Avatar/Avatar.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem, resolveLogoUri, ResolvedLogo} from '@thunderid/browser';\nimport {FC, JSX, useMemo} from 'react';\nimport useStyles from './Avatar.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\n\nexport interface AvatarProps {\n /**\n * Alternative text for the avatar image\n */\n alt?: string;\n /**\n * Background generation strategy\n * - 'random': Generate background color based on ASCII values of the name\n * - 'none': Use default theme background\n * - string: Use custom background color\n * @default 'random'\n */\n background?: 'random' | 'none' | string;\n /**\n * Optional className for the avatar\n */\n className?: string;\n /**\n * The avatar image. Accepts a plain URL, or any `resolveLogoUri`-compatible\n * spec (`emoji:<glyph>`, or `avatar:shape=...,variant=...,content=...,colors=...,bg=...`).\n */\n imageUrl?: string;\n /**\n * Loading state of the avatar\n */\n isLoading?: boolean;\n /**\n * The name to use for generating initials when no image is provided\n */\n name?: string;\n /**\n * The size of the avatar in pixels\n */\n size?: number;\n /**\n * The variant of the avatar shape\n * @default 'circular'\n */\n variant?: 'circular' | 'square';\n}\n\nexport const Avatar: FC<AvatarProps> = ({\n alt = 'User avatar',\n background = 'random',\n className = '',\n imageUrl,\n name,\n size = 64,\n variant = 'circular',\n isLoading = false,\n}: AvatarProps): JSX.Element => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n\n const resolvedIcon: ResolvedLogo | undefined = useMemo(\n () => (imageUrl ? resolveLogoUri(imageUrl, name ?? alt) : undefined),\n [imageUrl, name, alt],\n );\n\n const hasImage: boolean = resolvedIcon?.kind !== 'emoji' && Boolean(resolvedIcon?.imgSrc);\n\n const generateBackgroundColor = (inputString: string): string => {\n const hash: number = inputString.split('').reduce((acc: number, char: string) => {\n const charCode: number = char.charCodeAt(0);\n\n return ((acc << 5) - acc + charCode) & 0xffffffff;\n }, 0);\n\n const seed: number = Math.abs(hash);\n\n const generateColor = (offset: number): string => {\n const hue1: number = (seed + offset) % 360;\n const hue2: number = (hue1 + 60 + (seed % 120)) % 360;\n\n const saturation: number = 70 + (seed % 20);\n const lightness1: number = 55 + (seed % 15);\n const lightness2: number = 60 + ((seed + offset) % 15);\n\n return `hsl(${hue1}, ${saturation}%, ${lightness1}%), hsl(${hue2}, ${saturation}%, ${lightness2}%)`;\n };\n\n const angle: number = 45 + (seed % 91);\n\n const colors: string = generateColor(seed);\n return `linear-gradient(${angle}deg, ${colors})`;\n };\n\n const backgroundColor: string | undefined = useMemo(() => {\n if (!name || hasImage) {\n return undefined;\n }\n\n if (background === 'random') {\n return generateBackgroundColor(name);\n }\n\n if (background === 'none') {\n return undefined;\n }\n\n return background;\n }, [background, name, hasImage]);\n\n const styles: ReturnType<typeof useStyles> = useStyles(theme, colorScheme, size, variant, backgroundColor);\n\n // Determine if we're in the default state (no image, no name, not loading)\n const isDefaultState: boolean = !imageUrl && !name && !isLoading;\n\n const getInitials = (fullName: string): string =>\n fullName\n .split(' ')\n .map((part: string) => part[0])\n .slice(0, 2)\n .join('')\n .toUpperCase();\n\n const renderContent = (): JSX.Element | string => {\n if (resolvedIcon?.kind === 'emoji') {\n return (\n <span role=\"img\" aria-label={alt}>\n {resolvedIcon.glyph}\n </span>\n );\n }\n\n if (hasImage) {\n return (\n <img\n src={resolvedIcon?.imgSrc}\n alt={alt}\n className={cx(withVendorCSSClassPrefix(bem('avatar', 'image')), styles['image'])}\n />\n );\n }\n\n if (name) {\n return getInitials(name);\n }\n\n if (isLoading) {\n return <div className={cx(withVendorCSSClassPrefix(bem('avatar', 'skeleton')), styles['skeleton'])} />;\n }\n\n // Default user icon\n return (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n viewBox=\"0 0 640 640\"\n className={cx(withVendorCSSClassPrefix(bem('avatar', 'icon')), styles['icon'])}\n >\n <path d=\"M240 192C240 147.8 275.8 112 320 112C364.2 112 400 147.8 400 192C400 236.2 364.2 272 320 272C275.8 272 240 236.2 240 192zM448 192C448 121.3 390.7 64 320 64C249.3 64 192 121.3 192 192C192 262.7 249.3 320 320 320C390.7 320 448 262.7 448 192zM144 544C144 473.3 201.3 416 272 416L368 416C438.7 416 496 473.3 496 544L496 552C496 565.3 506.7 576 520 576C533.3 576 544 565.3 544 552L544 544C544 446.8 465.2 368 368 368L272 368C174.8 368 96 446.8 96 544L96 552C96 565.3 106.7 576 120 576C133.3 576 144 565.3 144 552L144 544z\" />\n </svg>\n );\n };\n\n return (\n <div\n className={cx(\n withVendorCSSClassPrefix(bem('avatar')),\n styles['avatar'],\n styles['variant'],\n withVendorCSSClassPrefix(bem('avatar', null, variant)),\n isDefaultState && withVendorCSSClassPrefix(bem('avatar', 'default')),\n className,\n )}\n >\n {renderContent()}\n </div>\n );\n};\n\nexport default Avatar;\n"],"mappings":";;;;;;;;;;;;AAkDA,MAAaA,UAA2B,EACtC,MAAM,eACN,aAAa,UACb,YAAY,IACZ,UACA,MACA,OAAO,IACP,UAAU,YACV,YAAY,YACkB;CAC9B,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CAEpE,MAAMC,wCACG,mDAA0B,UAAU,QAAQ,IAAI,GAAG,QAC1D;EAAC;EAAU;EAAM;EAAI,CACtB;CAED,MAAMC,WAAoB,cAAc,SAAS,WAAW,QAAQ,cAAc,OAAO;CAEzF,MAAM,2BAA2B,gBAAgC;EAC/D,MAAMC,OAAe,YAAY,MAAM,GAAG,CAAC,QAAQ,KAAa,SAAiB;GAC/E,MAAMC,WAAmB,KAAK,WAAW,EAAE;AAE3C,WAAS,OAAO,KAAK,MAAM,WAAY;KACtC,EAAE;EAEL,MAAMC,OAAe,KAAK,IAAI,KAAK;EAEnC,MAAM,iBAAiB,WAA2B;GAChD,MAAMC,QAAgB,OAAO,UAAU;GACvC,MAAMC,QAAgB,OAAO,KAAM,OAAO,OAAQ;GA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C,EACpE,UACD;YAEA,eAAe;GACZ"}
|
|
@@ -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/Avatar/Avatar.styles.ts
|
|
8
7
|
/**
|
|
@@ -15,7 +14,7 @@ __emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
|
15
14
|
* @returns Object containing CSS class names for component styling
|
|
16
15
|
*/
|
|
17
16
|
const useStyles = (theme, colorScheme, size, variant, backgroundColor) => (0, react.useMemo)(() => {
|
|
18
|
-
const baseAvatar =
|
|
17
|
+
const baseAvatar = require_emotion.css`
|
|
19
18
|
align-items: center;
|
|
20
19
|
background: ${backgroundColor || theme.vars.colors.background.surface};
|
|
21
20
|
border: ${backgroundColor ? "none" : `1px solid ${theme.vars.colors.border}`};
|
|
@@ -32,19 +31,19 @@ const useStyles = (theme, colorScheme, size, variant, backgroundColor) => (0, re
|
|
|
32
31
|
width: ${size}px;
|
|
33
32
|
`;
|
|
34
33
|
const variantStyles = {
|
|
35
|
-
circular:
|
|
34
|
+
circular: require_emotion.css`
|
|
36
35
|
border-radius: 50%;
|
|
37
36
|
`,
|
|
38
|
-
square:
|
|
37
|
+
square: require_emotion.css`
|
|
39
38
|
border-radius: 8px;
|
|
40
39
|
`
|
|
41
40
|
};
|
|
42
|
-
const imageStyles =
|
|
41
|
+
const imageStyles = require_emotion.css`
|
|
43
42
|
height: 100%;
|
|
44
43
|
object-fit: cover;
|
|
45
44
|
width: 100%;
|
|
46
45
|
`;
|
|
47
|
-
const skeletonStyles =
|
|
46
|
+
const skeletonStyles = require_emotion.css`
|
|
48
47
|
width: 100%;
|
|
49
48
|
height: 100%;
|
|
50
49
|
background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
|
|
@@ -63,7 +62,7 @@ const useStyles = (theme, colorScheme, size, variant, backgroundColor) => (0, re
|
|
|
63
62
|
`;
|
|
64
63
|
return {
|
|
65
64
|
avatar: baseAvatar,
|
|
66
|
-
icon:
|
|
65
|
+
icon: require_emotion.css`
|
|
67
66
|
width: 60%;
|
|
68
67
|
height: 60%;
|
|
69
68
|
fill: ${backgroundColor ? "#ffffff" : theme.vars.colors.text.secondary};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Avatar.styles.cjs","names":["baseAvatar: string","variantStyles: Record<string, string>","imageStyles: string","skeletonStyles: string"],"sources":["../../../../../src/components/primitives/Avatar/Avatar.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Avatar.styles.cjs","names":["baseAvatar: string","variantStyles: Record<string, string>","imageStyles: string","skeletonStyles: string"],"sources":["../../../../../src/components/primitives/Avatar/Avatar.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\nimport {css} from '../../../styles/emotion';\n\nexport type AvatarVariant = 'circular' | 'square';\n\n/**\n * Creates styles for the Avatar 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 size - The size of the avatar in pixels\n * @param variant - The avatar variant\n * @param backgroundColor - The background color for the avatar\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (\n theme: Theme,\n colorScheme: string,\n size: number,\n variant: AvatarVariant,\n backgroundColor?: string,\n): Record<string, string> =>\n useMemo(() => {\n const baseAvatar: string = css`\n align-items: center;\n background: ${backgroundColor || theme.vars.colors.background.surface};\n border: ${backgroundColor ? 'none' : `1px solid ${theme.vars.colors.border}`};\n border-radius: ${variant === 'circular' ? '50%' : '8px'};\n color: ${backgroundColor ? '#ffffff' : theme.vars.colors.text.primary};\n display: flex;\n font-size: ${size * 0.4}px;\n font-family: ${theme.vars.typography.fontFamily};\n font-weight: 600;\n height: ${size}px;\n justify-content: center;\n overflow: hidden;\n text-shadow: ${backgroundColor ? '0 1px 2px rgba(0, 0, 0, 0.1)' : 'none'};\n width: ${size}px;\n `;\n\n const variantStyles: Record<string, string> = {\n circular: css`\n border-radius: 50%;\n `,\n square: css`\n border-radius: 8px;\n `,\n };\n\n const imageStyles: string = css`\n height: 100%;\n object-fit: cover;\n width: 100%;\n `;\n\n const skeletonStyles: string = css`\n width: 100%;\n height: 100%;\n background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);\n background-size: 200% 100%;\n animation: skeleton-loading 1.5s infinite;\n border-radius: ${variant === 'circular' ? '50%' : '8px'};\n\n @keyframes skeleton-loading {\n 0% {\n background-position: -200% 0;\n }\n 100% {\n background-position: 200% 0;\n }\n }\n `;\n\n const iconStyles: string = css`\n width: 60%;\n height: 60%;\n fill: ${backgroundColor ? '#ffffff' : theme.vars.colors.text.secondary};\n opacity: 0.8;\n `;\n\n return {\n avatar: baseAvatar,\n icon: iconStyles,\n image: imageStyles,\n skeleton: skeletonStyles,\n variant: variantStyles[variant],\n };\n }, [theme, colorScheme, size, variant, backgroundColor]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;;;;AAkBA,MAAM,aACJ,OACA,aACA,MACA,SACA,6CAEc;CACZ,MAAMA,aAAqB,mBAAG;;oBAEd,mBAAmB,MAAM,KAAK,OAAO,WAAW,QAAQ;gBAC5D,kBAAkB,SAAS,aAAa,MAAM,KAAK,OAAO,SAAS;uBAC5D,YAAY,aAAa,QAAQ,MAAM;eAC/C,kBAAkB,YAAY,MAAM,KAAK,OAAO,KAAK,QAAQ;;mBAEzD,OAAO,GAAI;qBACT,MAAM,KAAK,WAAW,WAAW;;gBAEtC,KAAK;;;qBAGA,kBAAkB,iCAAiC,OAAO;eAChE,KAAK;;CAGhB,MAAMC,gBAAwC;EAC5C,UAAU,mBAAG;;;EAGb,QAAQ,mBAAG;;;EAGZ;CAED,MAAMC,cAAsB,mBAAG;;;;;CAM/B,MAAMC,iBAAyB,mBAAG;;;;;;uBAMf,YAAY,aAAa,QAAQ,MAAM;;;;;;;;;;;AAmB1D,QAAO;EACL,QAAQ;EACR,MATyB,mBAAG;;;cAGpB,kBAAkB,YAAY,MAAM,KAAK,OAAO,KAAK,UAAU;;;EAOvE,OAAO;EACP,UAAU;EACV,SAAS,cAAc;EACxB;GACA;CAAC;CAAO;CAAa;CAAM;CAAS;CAAgB,CAAC;AAE1D,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_Button_styles = require('./Button.styles.cjs');
|
|
4
5
|
const require_Spinner = require('../Spinner/Spinner.cjs');
|
|
@@ -8,8 +9,6 @@ let react = require("react");
|
|
|
8
9
|
react = require_rolldown_runtime.__toESM(react);
|
|
9
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
11
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
11
|
-
let __emotion_css = require("@emotion/css");
|
|
12
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
13
12
|
|
|
14
13
|
//#region src/components/primitives/Button/Button.tsx
|
|
15
14
|
const getSpinnerWidth = (sizeVal, spacingUnit) => {
|
|
@@ -55,35 +54,32 @@ const Button = (0, react.forwardRef)(({ color = "primary", variant = "solid", si
|
|
|
55
54
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("button", {
|
|
56
55
|
ref,
|
|
57
56
|
style,
|
|
58
|
-
className:
|
|
57
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button")), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", variant)), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", color)), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", size)), (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", shape)), fullWidth ? (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "fullWidth")) : void 0, loading ? (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "loading")) : void 0, disabled || loading ? (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "disabled")) : void 0, styles["button"], styles["size"], styles["variant"], styles["fullWidth"], styles["loading"], styles["shape"], className),
|
|
59
58
|
disabled: disabled || loading,
|
|
60
59
|
...rest,
|
|
61
60
|
children: [
|
|
62
61
|
loading && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
63
|
-
className:
|
|
62
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "spinner")), styles["spinner"]),
|
|
64
63
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(require_Spinner.default, {
|
|
65
64
|
size,
|
|
66
65
|
color: "currentColor",
|
|
67
|
-
|
|
68
|
-
height: spinnerWidth,
|
|
69
|
-
width: spinnerWidth
|
|
70
|
-
}
|
|
66
|
+
widthOverride: spinnerWidth
|
|
71
67
|
})
|
|
72
68
|
}),
|
|
73
69
|
!loading && isIconVariant && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
74
|
-
className:
|
|
70
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "icon")), styles["icon"]),
|
|
75
71
|
children: children || startIcon || endIcon
|
|
76
72
|
}),
|
|
77
73
|
!loading && !isIconVariant && startIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
78
|
-
className:
|
|
74
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "start-icon")), styles["startIcon"]),
|
|
79
75
|
children: startIcon
|
|
80
76
|
}),
|
|
81
77
|
!isIconVariant && children && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
82
|
-
className:
|
|
78
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "content")), styles["content"]),
|
|
83
79
|
children
|
|
84
80
|
}),
|
|
85
81
|
!loading && !isIconVariant && endIcon && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
86
|
-
className:
|
|
82
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("button", "end-icon")), styles["endIcon"]),
|
|
87
83
|
children: endIcon
|
|
88
84
|
})
|
|
89
85
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.cjs","names":["Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>","useTheme","styles: Record<string, string | null>","useStyles","isIconVariant: boolean","spinnerWidth: string","Spinner"],"sources":["../../../../../src/components/primitives/Button/Button.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {
|
|
1
|
+
{"version":3,"file":"Button.cjs","names":["Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>","useTheme","styles: Record<string, string | null>","useStyles","isIconVariant: boolean","spinnerWidth: string","cx","Spinner"],"sources":["../../../../../src/components/primitives/Button/Button.tsx"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {withVendorCSSClassPrefix, bem} from '@thunderid/browser';\nimport {ButtonHTMLAttributes, forwardRef, ReactNode, ForwardRefExoticComponent, RefAttributes, Ref} from 'react';\nimport useStyles from './Button.styles';\nimport useTheme from '../../../contexts/Theme/useTheme';\nimport {cx} from '../../../styles/emotion';\nimport Spinner, {SpinnerSize} from '../Spinner/Spinner';\n\nexport type ButtonColor = 'primary' | 'secondary' | 'tertiary' | string;\nexport type ButtonVariant = 'solid' | 'outline' | 'text' | 'icon';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\nexport interface ButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'color'> {\n /**\n * The button color that determines the color scheme\n */\n color?: ButtonColor;\n /**\n * Icon to display after the button text\n */\n endIcon?: ReactNode;\n /**\n * Whether the button should take the full width of its container\n */\n fullWidth?: boolean;\n /**\n * Whether the button is in a loading state\n */\n loading?: boolean;\n /**\n * The shape of the button: square or round\n */\n shape?: 'square' | 'round';\n /**\n * The size of the button\n */\n size?: ButtonSize;\n /**\n * Icon to display before the button text\n */\n startIcon?: ReactNode;\n /**\n * The button variant that determines the visual style\n */\n variant?: ButtonVariant;\n}\n\nconst getSpinnerWidth = (sizeVal: ButtonSize, spacingUnit: string): string => {\n if (sizeVal === 'small') {\n return `calc(${spacingUnit} * 1.5)`;\n }\n if (sizeVal === 'medium') {\n return `calc(${spacingUnit} * 2)`;\n }\n return `calc(${spacingUnit} * 2.5)`;\n};\n\n/**\n * Button component with multiple variants and types.\n *\n * @example\n * ```tsx\n * // Primary solid button\n * <Button color=\"primary\" variant=\"solid\">\n * Click me\n * </Button>\n *\n * // Secondary outline button\n * <Button color=\"secondary\" variant=\"outline\" size=\"large\">\n * Cancel\n * </Button>\n *\n * // Text button with loading state\n * <Button color=\"tertiary\" variant=\"text\" loading>\n * Loading...\n * </Button>\n *\n * // Button with icons\n * <Button\n * color=\"primary\"\n * startIcon={<Icon />}\n * endIcon={<Arrow />}\n * >\n * Save and Continue\n * </Button>\n * ```\n */\nconst Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>> = forwardRef<\n HTMLButtonElement,\n ButtonProps\n>(\n (\n {\n color = 'primary',\n variant = 'solid',\n size = 'medium',\n fullWidth = false,\n loading = false,\n startIcon,\n endIcon,\n children,\n className,\n disabled,\n style,\n shape = 'square',\n ...rest\n }: ButtonProps,\n ref: Ref<HTMLButtonElement>,\n ) => {\n const {theme, colorScheme}: ReturnType<typeof useTheme> = useTheme();\n const styles: Record<string, string | null> = useStyles(\n theme,\n colorScheme,\n color,\n variant,\n size,\n fullWidth,\n disabled || false,\n loading,\n shape,\n );\n\n const isIconVariant: boolean = variant === 'icon';\n\n const spinnerWidth: string = getSpinnerWidth(size, theme.vars.spacing.unit);\n\n return (\n <button\n ref={ref}\n style={style}\n className={cx(\n withVendorCSSClassPrefix(bem('button')),\n withVendorCSSClassPrefix(bem('button', variant)),\n withVendorCSSClassPrefix(bem('button', color)),\n withVendorCSSClassPrefix(bem('button', size)),\n withVendorCSSClassPrefix(bem('button', shape)),\n fullWidth ? withVendorCSSClassPrefix(bem('button', 'fullWidth')) : undefined,\n loading ? withVendorCSSClassPrefix(bem('button', 'loading')) : undefined,\n disabled || loading ? withVendorCSSClassPrefix(bem('button', 'disabled')) : undefined,\n styles['button'],\n styles['size'],\n styles['variant'],\n styles['fullWidth'],\n styles['loading'],\n styles['shape'],\n className,\n )}\n disabled={disabled || loading}\n {...rest}\n >\n {loading && (\n <span className={cx(withVendorCSSClassPrefix(bem('button', 'spinner')), styles['spinner'])}>\n <Spinner size={size as SpinnerSize} color=\"currentColor\" widthOverride={spinnerWidth} />\n </span>\n )}\n {!loading && isIconVariant && (\n <span className={cx(withVendorCSSClassPrefix(bem('button', 'icon')), styles['icon'])}>\n {children || startIcon || endIcon}\n </span>\n )}\n {!loading && !isIconVariant && startIcon && (\n <span className={cx(withVendorCSSClassPrefix(bem('button', 'start-icon')), styles['startIcon'])}>\n {startIcon}\n </span>\n )}\n {!isIconVariant && children && (\n <span className={cx(withVendorCSSClassPrefix(bem('button', 'content')), styles['content'])}>{children}</span>\n )}\n {!loading && !isIconVariant && endIcon && (\n <span className={cx(withVendorCSSClassPrefix(bem('button', 'end-icon')), styles['endIcon'])}>{endIcon}</span>\n )}\n </button>\n );\n },\n);\n\nButton.displayName = 'Button';\n\nexport default Button;\n"],"mappings":";;;;;;;;;;;;;AAiDA,MAAM,mBAAmB,SAAqB,gBAAgC;AAC5E,KAAI,YAAY,QACd,QAAO,QAAQ,YAAY;AAE7B,KAAI,YAAY,SACd,QAAO,QAAQ,YAAY;AAE7B,QAAO,QAAQ,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiC7B,MAAMA,gCAKF,EACE,QAAQ,WACR,UAAU,SACV,OAAO,UACP,YAAY,OACZ,UAAU,OACV,WACA,SACA,UACA,WACA,UACA,OACA,QAAQ,SACR,GAAG,QAEL,QACG;CACH,MAAM,EAAC,OAAO,gBAA4CC,0BAAU;CACpE,MAAMC,SAAwCC,8BAC5C,OACA,aACA,OACA,SACA,MACA,WACA,YAAY,OACZ,SACA,MACD;CAED,MAAMC,gBAAyB,YAAY;CAE3C,MAAMC,eAAuB,gBAAgB,MAAM,MAAM,KAAK,QAAQ,KAAK;AAE3E,QACE,4CAAC;EACM;EACE;EACP,WAAWC,kGACoB,SAAS,CAAC,iFACV,UAAU,QAAQ,CAAC,iFACnB,UAAU,MAAM,CAAC,iFACjB,UAAU,KAAK,CAAC,iFAChB,UAAU,MAAM,CAAC,EAC9C,2FAAyC,UAAU,YAAY,CAAC,GAAG,QACnE,yFAAuC,UAAU,UAAU,CAAC,GAAG,QAC/D,YAAY,yFAAuC,UAAU,WAAW,CAAC,GAAG,QAC5E,OAAO,WACP,OAAO,SACP,OAAO,YACP,OAAO,cACP,OAAO,YACP,OAAO,UACP,UACD;EACD,UAAU,YAAY;EACtB,GAAI;;GAEH,WACC,2CAAC;IAAK,WAAWA,kGAAgC,UAAU,UAAU,CAAC,EAAE,OAAO,WAAW;cACxF,2CAACC;KAAc;KAAqB,OAAM;KAAe,eAAe;MAAgB;KACnF;GAER,CAAC,WAAW,iBACX,2CAAC;IAAK,WAAWD,kGAAgC,UAAU,OAAO,CAAC,EAAE,OAAO,QAAQ;cACjF,YAAY,aAAa;KACrB;GAER,CAAC,WAAW,CAAC,iBAAiB,aAC7B,2CAAC;IAAK,WAAWA,kGAAgC,UAAU,aAAa,CAAC,EAAE,OAAO,aAAa;cAC5F;KACI;GAER,CAAC,iBAAiB,YACjB,2CAAC;IAAK,WAAWA,kGAAgC,UAAU,UAAU,CAAC,EAAE,OAAO,WAAW;IAAG;KAAgB;GAE9G,CAAC,WAAW,CAAC,iBAAiB,WAC7B,2CAAC;IAAK,WAAWA,kGAAgC,UAAU,WAAW,CAAC,EAAE,OAAO,WAAW;cAAG;KAAe;;GAExG;EAGd;AAED,OAAO,cAAc;AAErB,qBAAe"}
|
|
@@ -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/Button/Button.styles.ts
|
|
8
7
|
/**
|
|
@@ -24,7 +23,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
24
23
|
small: `calc(${theme.vars.spacing.unit} * 3)`
|
|
25
24
|
};
|
|
26
25
|
const iconDimension = iconSizeMap[size] || iconSizeMap["medium"];
|
|
27
|
-
const baseButton =
|
|
26
|
+
const baseButton = require_emotion.css`
|
|
28
27
|
display: inline-flex;
|
|
29
28
|
align-items: center;
|
|
30
29
|
justify-content: center;
|
|
@@ -51,24 +50,24 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
51
50
|
` : ""}
|
|
52
51
|
`;
|
|
53
52
|
const sizeStyles = {
|
|
54
|
-
large:
|
|
53
|
+
large: require_emotion.css`
|
|
55
54
|
${variant === "icon" ? `font-size: ${theme.vars.typography.fontSizes.lg};` : `padding: calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3);
|
|
56
55
|
font-size: ${theme.vars.typography.fontSizes.lg};
|
|
57
56
|
min-height: calc(${theme.vars.spacing.unit} * 5);`}
|
|
58
57
|
`,
|
|
59
|
-
medium:
|
|
58
|
+
medium: require_emotion.css`
|
|
60
59
|
${variant === "icon" ? `font-size: ${theme.vars.typography.fontSizes.md};` : `padding: calc(${theme.vars.spacing.unit} * 1) calc(${theme.vars.spacing.unit} * 2);
|
|
61
60
|
font-size: ${theme.vars.typography.fontSizes.md};
|
|
62
61
|
min-height: calc(${theme.vars.spacing.unit} * 4);`}
|
|
63
62
|
`,
|
|
64
|
-
small:
|
|
63
|
+
small: require_emotion.css`
|
|
65
64
|
${variant === "icon" ? `font-size: ${theme.vars.typography.fontSizes.sm};` : `padding: calc(${theme.vars.spacing.unit} * 0.5) calc(${theme.vars.spacing.unit} * 1);
|
|
66
65
|
font-size: ${theme.vars.typography.fontSizes.sm};
|
|
67
66
|
min-height: calc(${theme.vars.spacing.unit} * 3);`}
|
|
68
67
|
`
|
|
69
68
|
};
|
|
70
69
|
const variantStyles = {
|
|
71
|
-
"primary-icon":
|
|
70
|
+
"primary-icon": require_emotion.css`
|
|
72
71
|
background-color: transparent;
|
|
73
72
|
color: ${theme.vars.colors.primary.main};
|
|
74
73
|
border-color: transparent;
|
|
@@ -89,7 +88,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
89
88
|
outline: none;
|
|
90
89
|
}
|
|
91
90
|
`,
|
|
92
|
-
"primary-outline":
|
|
91
|
+
"primary-outline": require_emotion.css`
|
|
93
92
|
background-color: transparent;
|
|
94
93
|
color: ${theme.vars.colors.primary.main};
|
|
95
94
|
border-color: ${theme.vars.colors.primary.main};
|
|
@@ -108,7 +107,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
108
107
|
opacity: 0.9;
|
|
109
108
|
}
|
|
110
109
|
`,
|
|
111
|
-
"primary-solid":
|
|
110
|
+
"primary-solid": require_emotion.css`
|
|
112
111
|
background-color: ${theme.vars.colors.primary.main};
|
|
113
112
|
color: ${theme.vars.colors.primary.contrastText};
|
|
114
113
|
border-color: ${theme.vars.colors.primary.main};
|
|
@@ -125,7 +124,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
125
124
|
opacity: 0.8;
|
|
126
125
|
}
|
|
127
126
|
`,
|
|
128
|
-
"primary-text":
|
|
127
|
+
"primary-text": require_emotion.css`
|
|
129
128
|
background-color: transparent;
|
|
130
129
|
color: ${theme.vars.colors.primary.main};
|
|
131
130
|
border-color: transparent;
|
|
@@ -143,7 +142,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
143
142
|
outline: none;
|
|
144
143
|
}
|
|
145
144
|
`,
|
|
146
|
-
"secondary-icon":
|
|
145
|
+
"secondary-icon": require_emotion.css`
|
|
147
146
|
background-color: transparent;
|
|
148
147
|
color: ${theme.vars.colors.secondary.main};
|
|
149
148
|
border-color: transparent;
|
|
@@ -164,7 +163,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
164
163
|
outline: none;
|
|
165
164
|
}
|
|
166
165
|
`,
|
|
167
|
-
"secondary-outline":
|
|
166
|
+
"secondary-outline": require_emotion.css`
|
|
168
167
|
background-color: transparent;
|
|
169
168
|
color: ${theme.vars.colors.secondary.main};
|
|
170
169
|
border-color: ${theme.vars.colors.secondary.main};
|
|
@@ -183,7 +182,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
183
182
|
opacity: 0.9;
|
|
184
183
|
}
|
|
185
184
|
`,
|
|
186
|
-
"secondary-solid":
|
|
185
|
+
"secondary-solid": require_emotion.css`
|
|
187
186
|
background-color: ${theme.vars.colors.secondary.main};
|
|
188
187
|
color: ${theme.vars.colors.secondary.contrastText};
|
|
189
188
|
border-color: ${theme.vars.colors.secondary.main};
|
|
@@ -200,7 +199,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
200
199
|
opacity: 0.8;
|
|
201
200
|
}
|
|
202
201
|
`,
|
|
203
|
-
"secondary-text":
|
|
202
|
+
"secondary-text": require_emotion.css`
|
|
204
203
|
background-color: transparent;
|
|
205
204
|
color: ${theme.vars.colors.secondary.main};
|
|
206
205
|
border-color: transparent;
|
|
@@ -218,7 +217,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
218
217
|
outline: none;
|
|
219
218
|
}
|
|
220
219
|
`,
|
|
221
|
-
"tertiary-icon":
|
|
220
|
+
"tertiary-icon": require_emotion.css`
|
|
222
221
|
background-color: transparent;
|
|
223
222
|
color: ${theme.vars.colors.text.secondary};
|
|
224
223
|
border-color: transparent;
|
|
@@ -239,7 +238,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
239
238
|
outline: none;
|
|
240
239
|
}
|
|
241
240
|
`,
|
|
242
|
-
"tertiary-outline":
|
|
241
|
+
"tertiary-outline": require_emotion.css`
|
|
243
242
|
background-color: transparent;
|
|
244
243
|
color: ${theme.vars.colors.text.secondary};
|
|
245
244
|
border-color: ${theme.vars.colors.border};
|
|
@@ -256,7 +255,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
256
255
|
border-color: ${theme.vars.colors.text.primary};
|
|
257
256
|
}
|
|
258
257
|
`,
|
|
259
|
-
"tertiary-solid":
|
|
258
|
+
"tertiary-solid": require_emotion.css`
|
|
260
259
|
background-color: ${theme.vars.colors.text.secondary};
|
|
261
260
|
color: ${theme.vars.colors.background.surface};
|
|
262
261
|
border-color: ${theme.vars.colors.text.secondary};
|
|
@@ -275,7 +274,7 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
275
274
|
opacity: 0.9;
|
|
276
275
|
}
|
|
277
276
|
`,
|
|
278
|
-
"tertiary-text":
|
|
277
|
+
"tertiary-text": require_emotion.css`
|
|
279
278
|
background-color: transparent;
|
|
280
279
|
color: ${theme.vars.colors.text.secondary};
|
|
281
280
|
border-color: transparent;
|
|
@@ -297,32 +296,32 @@ const useStyles = (theme, colorScheme, color, variant, size, fullWidth, disabled
|
|
|
297
296
|
}
|
|
298
297
|
`
|
|
299
298
|
};
|
|
300
|
-
const spinnerStyles =
|
|
299
|
+
const spinnerStyles = require_emotion.css`
|
|
301
300
|
display: flex;
|
|
302
301
|
align-items: center;
|
|
303
302
|
justify-content: center;
|
|
304
303
|
`;
|
|
305
|
-
const iconStyles =
|
|
304
|
+
const iconStyles = require_emotion.css`
|
|
306
305
|
display: flex;
|
|
307
306
|
align-items: center;
|
|
308
307
|
justify-content: center;
|
|
309
308
|
`;
|
|
310
309
|
return {
|
|
311
310
|
button: baseButton,
|
|
312
|
-
content:
|
|
311
|
+
content: require_emotion.css`
|
|
313
312
|
display: flex;
|
|
314
313
|
align-items: center;
|
|
315
314
|
justify-content: center;
|
|
316
315
|
`,
|
|
317
316
|
endIcon: iconStyles,
|
|
318
|
-
fullWidth: fullWidth ?
|
|
317
|
+
fullWidth: fullWidth ? require_emotion.css`
|
|
319
318
|
width: 100%;
|
|
320
319
|
` : null,
|
|
321
320
|
icon: iconStyles,
|
|
322
|
-
loading: loading ?
|
|
321
|
+
loading: loading ? require_emotion.css`
|
|
323
322
|
pointer-events: none;
|
|
324
323
|
` : null,
|
|
325
|
-
shape: shape === "round" ?
|
|
324
|
+
shape: shape === "round" ? require_emotion.css`
|
|
326
325
|
border-radius: 50%;
|
|
327
326
|
` : null,
|
|
328
327
|
size: sizeStyles[size],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Button.styles.cjs","names":["iconSizeMap: Record<string, string>","iconDimension: string","baseButton: string","sizeStyles: Record<string, string>","variantStyles: Record<string, string>","spinnerStyles: string","iconStyles: string"],"sources":["../../../../../src/components/primitives/Button/Button.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {css} from '@emotion/css';\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\n\nexport type ButtonColor = 'primary' | 'secondary' | 'tertiary' | string;\nexport type ButtonVariant = 'solid' | 'outline' | 'text' | 'icon';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\n/**\n * Creates styles for the Button 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 color - The button color\n * @param variant - The button variant\n * @param size - The button size\n * @param fullWidth - Whether the button should take full width\n * @param disabled - Whether the button is disabled\n * @param loading - Whether the button is in loading state\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (\n theme: Theme,\n colorScheme: string,\n color: ButtonColor,\n variant: ButtonVariant,\n size: ButtonSize,\n fullWidth: boolean,\n disabled: boolean,\n loading: boolean,\n shape: 'square' | 'round' = 'square',\n): Record<string, string | null> =>\n useMemo(() => {\n const iconSizeMap: Record<string, string> = {\n large: `calc(${theme.vars.spacing.unit} * 5)`,\n medium: `calc(${theme.vars.spacing.unit} * 4)`,\n small: `calc(${theme.vars.spacing.unit} * 3)`,\n };\n\n const iconDimension: string = iconSizeMap[size] || iconSizeMap['medium'];\n\n const baseButton: string = css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: calc(${theme.vars.spacing.unit} * 1);\n border-radius: ${shape === 'round'\n ? '50%'\n : theme.vars.components?.Button?.root?.borderRadius || theme.vars.borderRadius.medium};\n font-weight: 500;\n cursor: ${disabled || loading ? 'not-allowed' : 'pointer'};\n outline: none;\n text-decoration: none;\n white-space: nowrap;\n width: ${fullWidth ? '100%' : 'auto'};\n opacity: ${disabled || loading ? 0.6 : 1};\n font-family: ${theme.vars.typography.fontFamily};\n border-width: 1px;\n border-style: solid;\n ${variant === 'icon'\n ? `\n padding: 0;\n min-width: unset;\n min-height: unset;\n width: ${iconDimension};\n height: ${iconDimension};\n justify-content: center;\n align-items: center;\n `\n : ''}\n `;\n\n const sizeStyles: Record<string, string> = {\n large: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.lg};`\n : `padding: calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3);\n font-size: ${theme.vars.typography.fontSizes.lg};\n min-height: calc(${theme.vars.spacing.unit} * 5);`}\n `,\n medium: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.md};`\n : `padding: calc(${theme.vars.spacing.unit} * 1) calc(${theme.vars.spacing.unit} * 2);\n font-size: ${theme.vars.typography.fontSizes.md};\n min-height: calc(${theme.vars.spacing.unit} * 4);`}\n `,\n small: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.sm};`\n : `padding: calc(${theme.vars.spacing.unit} * 0.5) calc(${theme.vars.spacing.unit} * 1);\n font-size: ${theme.vars.typography.fontSizes.sm};\n min-height: calc(${theme.vars.spacing.unit} * 3);`}\n `,\n };\n\n const variantStyles: Record<string, string> = {\n 'primary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.primary.dark};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.primary.dark};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.primary.dark};\n outline: none;\n }\n `,\n 'primary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: ${theme.vars.colors.primary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n opacity: 0.9;\n }\n `,\n 'primary-solid': css`\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n border-color: ${theme.vars.colors.primary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.9;\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.8;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.8;\n }\n `,\n 'primary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n outline: none;\n }\n `,\n 'secondary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.secondary.dark};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.secondary.dark};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.secondary.dark};\n outline: none;\n }\n `,\n 'secondary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: ${theme.vars.colors.secondary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n opacity: 0.9;\n }\n `,\n 'secondary-solid': css`\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n border-color: ${theme.vars.colors.secondary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.9;\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.8;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.8;\n }\n `,\n 'secondary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n outline: none;\n }\n `,\n 'tertiary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.text.primary};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.text.primary};\n outline: none;\n }\n `,\n 'tertiary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: ${theme.vars.colors.border};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.action.hover};\n border-color: ${theme.vars.colors.text.secondary};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.action.selected};\n border-color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.action.focus};\n border-color: ${theme.vars.colors.text.primary};\n }\n `,\n 'tertiary-solid': css`\n background-color: ${theme.vars.colors.text.secondary};\n color: ${theme.vars.colors.background.surface};\n border-color: ${theme.vars.colors.text.secondary};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n opacity: 0.9;\n }\n `,\n 'tertiary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.text.primary};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.text.primary};\n outline: none;\n }\n `,\n };\n\n const spinnerStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const iconStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const contentStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n return {\n button: baseButton,\n content: contentStyles,\n endIcon: iconStyles,\n fullWidth: fullWidth\n ? css`\n width: 100%;\n `\n : null,\n icon: iconStyles,\n loading: loading\n ? css`\n pointer-events: none;\n `\n : null,\n shape:\n shape === 'round'\n ? css`\n border-radius: 50%;\n `\n : null,\n size: sizeStyles[size],\n spinner: spinnerStyles,\n startIcon: iconStyles,\n variant: variantStyles[`${color}-${variant}`] || variantStyles['primary-solid'],\n };\n }, [theme, colorScheme, color, variant, size, fullWidth, disabled, loading]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAuBA,MAAM,aACJ,OACA,aACA,OACA,SACA,MACA,WACA,UACA,SACA,QAA4B,sCAEd;CACZ,MAAMA,cAAsC;EAC1C,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACvC,QAAQ,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACxC,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACxC;CAED,MAAMC,gBAAwB,YAAY,SAAS,YAAY;CAE/D,MAAMC,aAAqB,iBAAG;;;;kBAIhB,MAAM,KAAK,QAAQ,KAAK;uBACnB,UAAU,UACvB,QACA,MAAM,KAAK,YAAY,QAAQ,MAAM,gBAAgB,MAAM,KAAK,aAAa,OAAO;;gBAE9E,YAAY,UAAU,gBAAgB,UAAU;;;;eAIjD,YAAY,SAAS,OAAO;iBAC1B,YAAY,UAAU,KAAM,EAAE;qBAC1B,MAAM,KAAK,WAAW,WAAW;;;QAG9C,YAAY,SACV;;;;iBAIO,cAAc;kBACb,cAAc;;;UAItB,GAAG;;CAGT,MAAMC,aAAqC;EACzC,OAAO,iBAAG;UACN,YAAY,SACV,cAAc,MAAM,KAAK,WAAW,UAAU,GAAG,KACjD,iBAAiB,MAAM,KAAK,QAAQ,KAAK,eAAe,MAAM,KAAK,QAAQ,KAAK;0BAClE,MAAM,KAAK,WAAW,UAAU,GAAG;gCAC7B,MAAM,KAAK,QAAQ,KAAK,QAAQ;;EAE1D,QAAQ,iBAAG;UACP,YAAY,SACV,cAAc,MAAM,KAAK,WAAW,UAAU,GAAG,KACjD,iBAAiB,MAAM,KAAK,QAAQ,KAAK,aAAa,MAAM,KAAK,QAAQ,KAAK;0BAChE,MAAM,KAAK,WAAW,UAAU,GAAG;gCAC7B,MAAM,KAAK,QAAQ,KA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BAC7C,MAAM,KAAK,OAAO,KAAK,QAAQ;;;;8BAIpB,MAAM,KAAK,OAAO,OAAO,MAAM;mBAC1C,MAAM,KAAK,OAAO,KAAK,QAAQ;;;;EAI7C;CAED,MAAMC,gBAAwB,iBAAG;;;;;CAMjC,MAAMC,aAAqB,iBAAG;;;;;AAY9B,QAAO;EACL,QAAQ;EACR,SAR4B,iBAAG;;;;;EAS/B,SAAS;EACT,WAAW,YACP,iBAAG;;cAGH;EACJ,MAAM;EACN,SAAS,UACL,iBAAG;;cAGH;EACJ,OACE,UAAU,UACN,iBAAG;;gBAGH;EACN,MAAM,WAAW;EACjB,SAAS;EACT,WAAW;EACX,SAAS,cAAc,GAAG,MAAM,GAAG,cAAc,cAAc;EAChE;GACA;CAAC;CAAO;CAAa;CAAO;CAAS;CAAM;CAAW;CAAU;CAAQ,CAAC;AAE9E,4BAAe"}
|
|
1
|
+
{"version":3,"file":"Button.styles.cjs","names":["iconSizeMap: Record<string, string>","iconDimension: string","baseButton: string","sizeStyles: Record<string, string>","variantStyles: Record<string, string>","spinnerStyles: string","iconStyles: string"],"sources":["../../../../../src/components/primitives/Button/Button.styles.ts"],"sourcesContent":["// Copyright 2025 The ThunderID Authors\n// SPDX-License-Identifier: Apache-2.0\n\nimport {Theme} from '@thunderid/browser';\nimport {useMemo} from 'react';\nimport {css} from '../../../styles/emotion';\n\nexport type ButtonColor = 'primary' | 'secondary' | 'tertiary' | string;\nexport type ButtonVariant = 'solid' | 'outline' | 'text' | 'icon';\nexport type ButtonSize = 'small' | 'medium' | 'large';\n\n/**\n * Creates styles for the Button 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 color - The button color\n * @param variant - The button variant\n * @param size - The button size\n * @param fullWidth - Whether the button should take full width\n * @param disabled - Whether the button is disabled\n * @param loading - Whether the button is in loading state\n * @returns Object containing CSS class names for component styling\n */\nconst useStyles = (\n theme: Theme,\n colorScheme: string,\n color: ButtonColor,\n variant: ButtonVariant,\n size: ButtonSize,\n fullWidth: boolean,\n disabled: boolean,\n loading: boolean,\n shape: 'square' | 'round' = 'square',\n): Record<string, string | null> =>\n useMemo(() => {\n const iconSizeMap: Record<string, string> = {\n large: `calc(${theme.vars.spacing.unit} * 5)`,\n medium: `calc(${theme.vars.spacing.unit} * 4)`,\n small: `calc(${theme.vars.spacing.unit} * 3)`,\n };\n\n const iconDimension: string = iconSizeMap[size] || iconSizeMap['medium'];\n\n const baseButton: string = css`\n display: inline-flex;\n align-items: center;\n justify-content: center;\n gap: calc(${theme.vars.spacing.unit} * 1);\n border-radius: ${shape === 'round'\n ? '50%'\n : theme.vars.components?.Button?.root?.borderRadius || theme.vars.borderRadius.medium};\n font-weight: 500;\n cursor: ${disabled || loading ? 'not-allowed' : 'pointer'};\n outline: none;\n text-decoration: none;\n white-space: nowrap;\n width: ${fullWidth ? '100%' : 'auto'};\n opacity: ${disabled || loading ? 0.6 : 1};\n font-family: ${theme.vars.typography.fontFamily};\n border-width: 1px;\n border-style: solid;\n ${variant === 'icon'\n ? `\n padding: 0;\n min-width: unset;\n min-height: unset;\n width: ${iconDimension};\n height: ${iconDimension};\n justify-content: center;\n align-items: center;\n `\n : ''}\n `;\n\n const sizeStyles: Record<string, string> = {\n large: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.lg};`\n : `padding: calc(${theme.vars.spacing.unit} * 1.5) calc(${theme.vars.spacing.unit} * 3);\n font-size: ${theme.vars.typography.fontSizes.lg};\n min-height: calc(${theme.vars.spacing.unit} * 5);`}\n `,\n medium: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.md};`\n : `padding: calc(${theme.vars.spacing.unit} * 1) calc(${theme.vars.spacing.unit} * 2);\n font-size: ${theme.vars.typography.fontSizes.md};\n min-height: calc(${theme.vars.spacing.unit} * 4);`}\n `,\n small: css`\n ${variant === 'icon'\n ? `font-size: ${theme.vars.typography.fontSizes.sm};`\n : `padding: calc(${theme.vars.spacing.unit} * 0.5) calc(${theme.vars.spacing.unit} * 1);\n font-size: ${theme.vars.typography.fontSizes.sm};\n min-height: calc(${theme.vars.spacing.unit} * 3);`}\n `,\n };\n\n const variantStyles: Record<string, string> = {\n 'primary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.primary.dark};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.primary.dark};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.primary.dark};\n outline: none;\n }\n `,\n 'primary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: ${theme.vars.colors.primary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n opacity: 0.9;\n }\n `,\n 'primary-solid': css`\n background-color: ${theme.vars.colors.primary.main};\n color: ${theme.vars.colors.primary.contrastText};\n border-color: ${theme.vars.colors.primary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.9;\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.8;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.primary.main};\n opacity: 0.8;\n }\n `,\n 'primary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.primary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n outline: none;\n }\n `,\n 'secondary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.secondary.dark};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.secondary.dark};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.secondary.dark};\n outline: none;\n }\n `,\n 'secondary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: ${theme.vars.colors.secondary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n opacity: 0.9;\n }\n `,\n 'secondary-solid': css`\n background-color: ${theme.vars.colors.secondary.main};\n color: ${theme.vars.colors.secondary.contrastText};\n border-color: ${theme.vars.colors.secondary.main};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.9;\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.8;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.secondary.main};\n opacity: 0.8;\n }\n `,\n 'secondary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.secondary.main};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n outline: none;\n }\n `,\n 'tertiary-icon': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.text.primary};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.text.primary};\n outline: none;\n }\n `,\n 'tertiary-outline': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: ${theme.vars.colors.border};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.action.hover};\n border-color: ${theme.vars.colors.text.secondary};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.action.selected};\n border-color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.action.focus};\n border-color: ${theme.vars.colors.text.primary};\n }\n `,\n 'tertiary-solid': css`\n background-color: ${theme.vars.colors.text.secondary};\n color: ${theme.vars.colors.background.surface};\n border-color: ${theme.vars.colors.text.secondary};\n &:hover:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n }\n &:active:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n opacity: 0.9;\n }\n &:focus:not(:disabled) {\n background-color: ${theme.vars.colors.text.primary};\n color: ${theme.vars.colors.background.surface};\n opacity: 0.9;\n }\n `,\n 'tertiary-text': css`\n background-color: transparent;\n color: ${theme.vars.colors.text.secondary};\n border-color: transparent;\n &:hover:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.hover};\n color: ${theme.vars.colors.text.primary};\n }\n &:active:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.selected};\n color: ${theme.vars.colors.text.primary};\n }\n &:focus:not(:disabled) {\n border-color: transparent;\n background-color: ${theme.vars.colors.action.focus};\n color: ${theme.vars.colors.text.primary};\n outline: none;\n }\n `,\n };\n\n const spinnerStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const iconStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n const contentStyles: string = css`\n display: flex;\n align-items: center;\n justify-content: center;\n `;\n\n return {\n button: baseButton,\n content: contentStyles,\n endIcon: iconStyles,\n fullWidth: fullWidth\n ? css`\n width: 100%;\n `\n : null,\n icon: iconStyles,\n loading: loading\n ? css`\n pointer-events: none;\n `\n : null,\n shape:\n shape === 'round'\n ? css`\n border-radius: 50%;\n `\n : null,\n size: sizeStyles[size],\n spinner: spinnerStyles,\n startIcon: iconStyles,\n variant: variantStyles[`${color}-${variant}`] || variantStyles['primary-solid'],\n };\n }, [theme, colorScheme, color, variant, size, fullWidth, disabled, loading]);\n\nexport default useStyles;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAuBA,MAAM,aACJ,OACA,aACA,OACA,SACA,MACA,WACA,UACA,SACA,QAA4B,sCAEd;CACZ,MAAMA,cAAsC;EAC1C,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACvC,QAAQ,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACxC,OAAO,QAAQ,MAAM,KAAK,QAAQ,KAAK;EACxC;CAED,MAAMC,gBAAwB,YAAY,SAAS,YAAY;CAE/D,MAAMC,aAAqB,mBAAG;;;;kBAIhB,MAAM,KAAK,QAAQ,KAAK;uBACnB,UAAU,UACvB,QACA,MAAM,KAAK,YAAY,QAAQ,MAAM,gBAAgB,MAAM,KAAK,aAAa,OAAO;;gBAE9E,YAAY,UAAU,gBAAgB,UAAU;;;;eAIjD,YAAY,SAAS,OAAO;iBAC1B,YAAY,UAAU,KAAM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
3
|
const require_useTheme = require('../../../contexts/Theme/useTheme.cjs');
|
|
3
4
|
const require_Typography = require('../Typography/Typography.cjs');
|
|
4
5
|
const require_Card_styles = require('./Card.styles.cjs');
|
|
@@ -8,8 +9,6 @@ let react = require("react");
|
|
|
8
9
|
react = require_rolldown_runtime.__toESM(react);
|
|
9
10
|
let react_jsx_runtime = require("react/jsx-runtime");
|
|
10
11
|
react_jsx_runtime = require_rolldown_runtime.__toESM(react_jsx_runtime);
|
|
11
|
-
let __emotion_css = require("@emotion/css");
|
|
12
|
-
__emotion_css = require_rolldown_runtime.__toESM(__emotion_css);
|
|
13
12
|
|
|
14
13
|
//#region src/components/primitives/Card/Card.tsx
|
|
15
14
|
/**
|
|
@@ -41,7 +40,7 @@ const Card = (0, react.forwardRef)(({ variant = "default", clickable = false, ch
|
|
|
41
40
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
42
41
|
ref,
|
|
43
42
|
style,
|
|
44
|
-
className:
|
|
43
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card")), styles["card"], styles["variant"], styles["clickable"], (0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", null, variant)), { [(0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", null, "clickable"))]: clickable }, className),
|
|
45
44
|
...rest,
|
|
46
45
|
children
|
|
47
46
|
});
|
|
@@ -55,7 +54,7 @@ const CardHeader = (0, react.forwardRef)(({ children, className, style,...rest }
|
|
|
55
54
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
56
55
|
ref,
|
|
57
56
|
style,
|
|
58
|
-
className:
|
|
57
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "header")), styles["header"], className),
|
|
59
58
|
...rest,
|
|
60
59
|
children
|
|
61
60
|
});
|
|
@@ -93,7 +92,7 @@ const CardTitle = ({ children, level = 3, className, style,...rest }) => {
|
|
|
93
92
|
component: getComponentFromLevel(level),
|
|
94
93
|
variant: getVariantFromLevel(level),
|
|
95
94
|
style,
|
|
96
|
-
className:
|
|
95
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "title")), styles["title"], className),
|
|
97
96
|
fontWeight: 600,
|
|
98
97
|
...filteredRest,
|
|
99
98
|
children
|
|
@@ -111,7 +110,7 @@ const CardDescription = ({ children, className, style,...rest }) => {
|
|
|
111
110
|
variant: "body2",
|
|
112
111
|
color: "textSecondary",
|
|
113
112
|
style,
|
|
114
|
-
className:
|
|
113
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "description")), styles["description"], className),
|
|
115
114
|
...filteredRest,
|
|
116
115
|
children
|
|
117
116
|
});
|
|
@@ -125,7 +124,7 @@ const CardAction = (0, react.forwardRef)(({ children, className, style,...rest }
|
|
|
125
124
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
126
125
|
ref,
|
|
127
126
|
style,
|
|
128
|
-
className:
|
|
127
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "action")), styles["action"], className),
|
|
129
128
|
...rest,
|
|
130
129
|
children
|
|
131
130
|
});
|
|
@@ -139,7 +138,7 @@ const CardContent = (0, react.forwardRef)(({ children, className, style,...rest
|
|
|
139
138
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
140
139
|
ref,
|
|
141
140
|
style,
|
|
142
|
-
className:
|
|
141
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "content")), styles["content"], className),
|
|
143
142
|
...rest,
|
|
144
143
|
children
|
|
145
144
|
});
|
|
@@ -153,7 +152,7 @@ const CardFooter = (0, react.forwardRef)(({ children, className, style,...rest }
|
|
|
153
152
|
return /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
154
153
|
ref,
|
|
155
154
|
style,
|
|
156
|
-
className:
|
|
155
|
+
className: require_emotion.cx((0, __thunderid_browser.withVendorCSSClassPrefix)((0, __thunderid_browser.bem)("card", "footer")), styles["footer"], className),
|
|
157
156
|
...rest,
|
|
158
157
|
children
|
|
159
158
|
});
|