@razorpay/blade 11.8.1 → 11.9.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/build/lib/native/components/Checkbox/Checkbox.js +4 -3
- package/build/lib/native/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js +1 -1
- package/build/lib/native/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js +1 -1
- package/build/lib/native/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/native/components/Checkbox/checkboxTokens.js +1 -1
- package/build/lib/native/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js +2 -1
- package/build/lib/native/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/native/components/Form/FormHint.js +2 -1
- package/build/lib/native/components/Form/FormHint.js.map +1 -1
- package/build/lib/native/components/Form/FormLabel.js +3 -1
- package/build/lib/native/components/Form/FormLabel.js.map +1 -1
- package/build/lib/native/components/Form/Selector/SelectorSupportText.js +1 -1
- package/build/lib/native/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/native/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/native/components/Form/formTokens.js +8 -0
- package/build/lib/native/components/Form/formTokens.js.map +1 -0
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +5 -3
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +8 -2
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +2 -2
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js +4 -2
- package/build/lib/native/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js +2 -3
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +2 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +6 -3
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js +8 -0
- package/build/lib/native/components/Input/BaseInput/baseInputTokens.js.map +1 -0
- package/build/lib/native/components/Input/BaseInput/getBaseInputBorderStyles.native.js +4 -0
- package/build/lib/native/components/Input/BaseInput/getBaseInputBorderStyles.native.js.map +1 -0
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +1 -1
- package/build/lib/native/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js +1 -1
- package/build/lib/native/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js +1 -1
- package/build/lib/native/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js +2 -1
- package/build/lib/native/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js +2 -1
- package/build/lib/native/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/native/components/Radio/Radio.js +4 -3
- package/build/lib/native/components/Radio/Radio.js.map +1 -1
- package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js +1 -1
- package/build/lib/native/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/build/lib/native/components/Radio/radioTokens.js +1 -1
- package/build/lib/native/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/native/components/Tag/Tag.js +1 -1
- package/build/lib/native/components/Tag/Tag.js.map +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/native/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/native/components/Typography/Heading/Heading.js +2 -2
- package/build/lib/native/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/native/components/Typography/Heading/getHeadingStyles.js +7 -0
- package/build/lib/native/components/Typography/Heading/getHeadingStyles.js.map +1 -0
- package/build/lib/native/components/Typography/Text/Text.js +1 -1
- package/build/lib/native/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/native/components/index.js +1 -1
- package/build/lib/native/tokens/global/size.js +1 -1
- package/build/lib/native/tokens/global/size.js.map +1 -1
- package/build/lib/native/utils/getFocusRingStyles/getFocusRingStyles.native.js.map +1 -1
- package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js +7 -12
- package/build/lib/web/development/components/ButtonGroup/StyledButtonGroup.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/Checkbox.js +17 -3
- package/build/lib/web/development/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -0
- package/build/lib/web/development/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js +4 -0
- package/build/lib/web/development/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/web/development/components/Checkbox/checkboxTokens.js +12 -4
- package/build/lib/web/development/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js +5 -1
- package/build/lib/web/development/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/development/components/Form/FormHint.js +34 -17
- package/build/lib/web/development/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/development/components/Form/FormLabel.js +10 -7
- package/build/lib/web/development/components/Form/FormLabel.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js +8 -2
- package/build/lib/web/development/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/web/development/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/web/development/components/Form/formTokens.js +53 -0
- package/build/lib/web/development/components/Form/formTokens.js.map +1 -0
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +23 -37
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +200 -155
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -3
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js +101 -34
- package/build/lib/web/development/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js +3 -7
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +14 -5
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +119 -67
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js +88 -0
- package/build/lib/web/development/components/Input/BaseInput/baseInputTokens.js.map +1 -0
- package/build/lib/web/development/components/Input/BaseInput/getBaseInputBorderStyles.web.js +23 -0
- package/build/lib/web/development/components/Input/BaseInput/getBaseInputBorderStyles.web.js.map +1 -0
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +11 -6
- package/build/lib/web/development/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js +9 -3
- package/build/lib/web/development/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js +5 -2
- package/build/lib/web/development/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +7 -3
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +17 -6
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Radio/Radio.js +10 -3
- package/build/lib/web/development/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js +2 -0
- package/build/lib/web/development/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/build/lib/web/development/components/Radio/radioTokens.js +13 -4
- package/build/lib/web/development/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js +4 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js +2 -2
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js +4 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/development/components/Typography/Heading/Heading.js +3 -3
- package/build/lib/web/development/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/web/development/components/Typography/Heading/getHeadingStyles.js +22 -0
- package/build/lib/web/development/components/Typography/Heading/getHeadingStyles.js.map +1 -0
- package/build/lib/web/development/components/Typography/Heading/index.js +1 -1
- package/build/lib/web/development/components/Typography/Text/Text.js +8 -3
- package/build/lib/web/development/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/development/components/index.js +1 -1
- package/build/lib/web/development/tokens/global/size.js +2 -0
- package/build/lib/web/development/tokens/global/size.js.map +1 -1
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -0
- package/build/lib/web/development/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
- package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js +7 -12
- package/build/lib/web/production/components/ButtonGroup/StyledButtonGroup.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/Checkbox.js +17 -3
- package/build/lib/web/production/components/Checkbox/Checkbox.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js +2 -0
- package/build/lib/web/production/components/Checkbox/CheckboxGroup/CheckboxGroup.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js +4 -0
- package/build/lib/web/production/components/Checkbox/CheckboxIcon/CheckboxIcon.js.map +1 -1
- package/build/lib/web/production/components/Checkbox/checkboxTokens.js +12 -4
- package/build/lib/web/production/components/Checkbox/checkboxTokens.js.map +1 -1
- package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js +5 -1
- package/build/lib/web/production/components/Form/CharacterCounter/CharacterCounter.js.map +1 -1
- package/build/lib/web/production/components/Form/FormHint.js +34 -17
- package/build/lib/web/production/components/Form/FormHint.js.map +1 -1
- package/build/lib/web/production/components/Form/FormLabel.js +10 -7
- package/build/lib/web/production/components/Form/FormLabel.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js +8 -2
- package/build/lib/web/production/components/Form/Selector/SelectorSupportText.js.map +1 -1
- package/build/lib/web/production/components/Form/Selector/SelectorTitle.js.map +1 -1
- package/build/lib/web/production/components/Form/formTokens.js +53 -0
- package/build/lib/web/production/components/Form/formTokens.js.map +1 -0
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +23 -37
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +200 -155
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +4 -3
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js +101 -34
- package/build/lib/web/production/components/Input/BaseInput/BaseInputVisuals.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js +3 -7
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +14 -5
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +119 -67
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js +88 -0
- package/build/lib/web/production/components/Input/BaseInput/baseInputTokens.js.map +1 -0
- package/build/lib/web/production/components/Input/BaseInput/getBaseInputBorderStyles.web.js +23 -0
- package/build/lib/web/production/components/Input/BaseInput/getBaseInputBorderStyles.web.js.map +1 -0
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js +11 -6
- package/build/lib/web/production/components/Input/DropdownInputTriggers/BaseDropdownInputTrigger.js.map +1 -1
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js +9 -3
- package/build/lib/web/production/components/Input/OTPInput/OTPInput.js.map +1 -1
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js +5 -2
- package/build/lib/web/production/components/Input/PasswordInput/PasswordInput.js.map +1 -1
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +7 -3
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +17 -6
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Radio/Radio.js +10 -3
- package/build/lib/web/production/components/Radio/Radio.js.map +1 -1
- package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js +2 -0
- package/build/lib/web/production/components/Radio/RadioGroup/RadioGroup.js.map +1 -1
- package/build/lib/web/production/components/Radio/radioTokens.js +13 -4
- package/build/lib/web/production/components/Radio/radioTokens.js.map +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js +4 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js +2 -2
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js +4 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/production/components/Typography/Heading/Heading.js +3 -3
- package/build/lib/web/production/components/Typography/Heading/Heading.js.map +1 -1
- package/build/lib/web/production/components/Typography/Heading/getHeadingStyles.js +22 -0
- package/build/lib/web/production/components/Typography/Heading/getHeadingStyles.js.map +1 -0
- package/build/lib/web/production/components/Typography/Heading/index.js +1 -1
- package/build/lib/web/production/components/Typography/Text/Text.js +8 -3
- package/build/lib/web/production/components/Typography/Text/Text.js.map +1 -1
- package/build/lib/web/production/components/index.js +1 -1
- package/build/lib/web/production/tokens/global/size.js +2 -0
- package/build/lib/web/production/tokens/global/size.js.map +1 -1
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js +1 -0
- package/build/lib/web/production/utils/getFocusRingStyles/getFocusRingStyles.web.js.map +1 -1
- package/build/types/components/index.d.ts +36 -15
- package/build/types/components/index.native.d.ts +36 -15
- package/build/types/tokens/index.d.ts +2 -0
- package/build/types/tokens/index.native.d.ts +2 -0
- package/package.json +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js +0 -16
- package/build/lib/native/components/Input/BaseInput/BaseInputAnimatedBorder.native.js.map +0 -1
- package/build/lib/native/components/Input/BaseInput/baseInputConfig.js +0 -8
- package/build/lib/native/components/Input/BaseInput/baseInputConfig.js.map +0 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +0 -43
- package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +0 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputConfig.js +0 -26
- package/build/lib/web/development/components/Input/BaseInput/baseInputConfig.js.map +0 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js +0 -43
- package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map +0 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputConfig.js +0 -26
- package/build/lib/web/production/components/Input/BaseInput/baseInputConfig.js.map +0 -1
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
|
+
import React__default from 'react';
|
|
2
3
|
import '../../Box/BaseBox/index.js';
|
|
3
4
|
import '../../Typography/index.js';
|
|
5
|
+
import '../../../utils/isValidAllowedChildren/index.js';
|
|
6
|
+
import '../../../utils/logger/index.js';
|
|
4
7
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
8
|
+
import { isValidAllowedChildren } from '../../../utils/isValidAllowedChildren/isValidAllowedChildren.js';
|
|
9
|
+
import { throwBladeError } from '../../../utils/logger/logger.js';
|
|
5
10
|
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
6
11
|
import { Text } from '../../Typography/Text/Text.js';
|
|
7
12
|
|
|
@@ -15,12 +20,25 @@ var getVisualContainerStyles = function getVisualContainerStyles() {
|
|
|
15
20
|
alignSelf: 'center'
|
|
16
21
|
};
|
|
17
22
|
};
|
|
23
|
+
var trailingIconColor = {
|
|
24
|
+
none: 'surface.icon.gray.subtle',
|
|
25
|
+
error: 'feedback.icon.negative.intense',
|
|
26
|
+
success: 'feedback.icon.positive.intense'
|
|
27
|
+
};
|
|
28
|
+
var iconSize = {
|
|
29
|
+
medium: 'medium',
|
|
30
|
+
large: 'large'
|
|
31
|
+
};
|
|
32
|
+
var textSize = {
|
|
33
|
+
medium: 'medium',
|
|
34
|
+
large: 'large'
|
|
35
|
+
};
|
|
18
36
|
var getPrefixStyles = function getPrefixStyles(_ref) {
|
|
19
37
|
var hasLeadingIcon = _ref.hasLeadingIcon,
|
|
20
38
|
hasPrefix = _ref.hasPrefix;
|
|
21
39
|
if (hasPrefix && hasLeadingIcon) {
|
|
22
40
|
return {
|
|
23
|
-
paddingLeft: 'spacing.
|
|
41
|
+
paddingLeft: 'spacing.3'
|
|
24
42
|
};
|
|
25
43
|
}
|
|
26
44
|
if (hasPrefix && !hasLeadingIcon) {
|
|
@@ -35,13 +53,14 @@ var getPrefixStyles = function getPrefixStyles(_ref) {
|
|
|
35
53
|
var getInteractionElementStyles = function getInteractionElementStyles(_ref2) {
|
|
36
54
|
var hasTrailingIcon = _ref2.hasTrailingIcon,
|
|
37
55
|
hasInteractionElement = _ref2.hasInteractionElement,
|
|
38
|
-
hasSuffix = _ref2.hasSuffix
|
|
39
|
-
|
|
56
|
+
hasSuffix = _ref2.hasSuffix,
|
|
57
|
+
hasTrailingButton = _ref2.hasTrailingButton;
|
|
58
|
+
if (hasInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {
|
|
40
59
|
return {
|
|
41
60
|
paddingRight: 'spacing.2'
|
|
42
61
|
};
|
|
43
62
|
}
|
|
44
|
-
if (hasInteractionElement && !hasSuffix && !hasTrailingIcon) {
|
|
63
|
+
if (hasInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {
|
|
45
64
|
return {
|
|
46
65
|
paddingRight: 'spacing.4'
|
|
47
66
|
};
|
|
@@ -52,13 +71,14 @@ var getInteractionElementStyles = function getInteractionElementStyles(_ref2) {
|
|
|
52
71
|
};
|
|
53
72
|
var getSuffixStyles = function getSuffixStyles(_ref3) {
|
|
54
73
|
var hasTrailingIcon = _ref3.hasTrailingIcon,
|
|
55
|
-
hasSuffix = _ref3.hasSuffix
|
|
56
|
-
|
|
74
|
+
hasSuffix = _ref3.hasSuffix,
|
|
75
|
+
hasTrailingButton = _ref3.hasTrailingButton;
|
|
76
|
+
if (hasSuffix && (hasTrailingIcon || hasTrailingButton)) {
|
|
57
77
|
return {
|
|
58
|
-
paddingRight: 'spacing.
|
|
78
|
+
paddingRight: 'spacing.3'
|
|
59
79
|
};
|
|
60
80
|
}
|
|
61
|
-
if (hasSuffix && !hasTrailingIcon) {
|
|
81
|
+
if (hasSuffix && !hasTrailingIcon && !hasTrailingButton) {
|
|
62
82
|
return {
|
|
63
83
|
paddingRight: 'spacing.4'
|
|
64
84
|
};
|
|
@@ -67,48 +87,82 @@ var getSuffixStyles = function getSuffixStyles(_ref3) {
|
|
|
67
87
|
paddingRight: 'spacing.0'
|
|
68
88
|
};
|
|
69
89
|
};
|
|
70
|
-
var
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
90
|
+
var getTrailingIconStyles = function getTrailingIconStyles(_ref4) {
|
|
91
|
+
var hasTrailingIcon = _ref4.hasTrailingIcon,
|
|
92
|
+
hasTrailingButton = _ref4.hasTrailingButton;
|
|
93
|
+
if (hasTrailingIcon && hasTrailingButton) {
|
|
94
|
+
return {
|
|
95
|
+
paddingRight: 'spacing.3'
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
if (hasTrailingIcon && !hasTrailingButton) {
|
|
99
|
+
return {
|
|
100
|
+
paddingRight: 'spacing.4'
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
return {
|
|
104
|
+
paddingRight: 'spacing.0'
|
|
105
|
+
};
|
|
106
|
+
};
|
|
107
|
+
var getInputVisualsToBeRendered = function getInputVisualsToBeRendered(_ref5) {
|
|
108
|
+
var leadingIcon = _ref5.leadingIcon,
|
|
109
|
+
prefix = _ref5.prefix,
|
|
110
|
+
interactionElement = _ref5.interactionElement,
|
|
111
|
+
suffix = _ref5.suffix,
|
|
112
|
+
trailingIcon = _ref5.trailingIcon,
|
|
113
|
+
trailingButton = _ref5.trailingButton;
|
|
76
114
|
return {
|
|
77
115
|
hasLeadingIcon: Boolean(leadingIcon),
|
|
78
116
|
hasPrefix: Boolean(prefix),
|
|
79
117
|
hasInteractionElement: Boolean(interactionElement),
|
|
80
118
|
hasSuffix: Boolean(suffix),
|
|
81
|
-
hasTrailingIcon: Boolean(trailingIcon)
|
|
119
|
+
hasTrailingIcon: Boolean(trailingIcon),
|
|
120
|
+
hasTrailingButton: Boolean(trailingButton)
|
|
82
121
|
};
|
|
83
122
|
};
|
|
84
|
-
var BaseInputVisuals = function BaseInputVisuals(
|
|
85
|
-
var LeadingIcon =
|
|
86
|
-
prefix =
|
|
87
|
-
interactionElement =
|
|
88
|
-
suffix =
|
|
89
|
-
TrailingIcon =
|
|
90
|
-
isDisabled =
|
|
123
|
+
var BaseInputVisuals = function BaseInputVisuals(_ref6) {
|
|
124
|
+
var LeadingIcon = _ref6.leadingIcon,
|
|
125
|
+
prefix = _ref6.prefix,
|
|
126
|
+
interactionElement = _ref6.interactionElement,
|
|
127
|
+
suffix = _ref6.suffix,
|
|
128
|
+
TrailingIcon = _ref6.trailingIcon,
|
|
129
|
+
isDisabled = _ref6.isDisabled,
|
|
130
|
+
_ref6$validationState = _ref6.validationState,
|
|
131
|
+
validationState = _ref6$validationState === void 0 ? 'none' : _ref6$validationState,
|
|
132
|
+
size = _ref6.size,
|
|
133
|
+
TrailingButton = _ref6.trailingButton;
|
|
91
134
|
var _getInputVisualsToBeR = getInputVisualsToBeRendered({
|
|
92
135
|
leadingIcon: LeadingIcon,
|
|
93
136
|
prefix: prefix,
|
|
94
137
|
interactionElement: interactionElement,
|
|
95
138
|
suffix: suffix,
|
|
96
|
-
trailingIcon: TrailingIcon
|
|
139
|
+
trailingIcon: TrailingIcon,
|
|
140
|
+
trailingButton: TrailingButton,
|
|
141
|
+
size: size
|
|
97
142
|
}),
|
|
98
143
|
hasLeadingIcon = _getInputVisualsToBeR.hasLeadingIcon,
|
|
99
144
|
hasPrefix = _getInputVisualsToBeR.hasPrefix,
|
|
100
145
|
hasInteractionElement = _getInputVisualsToBeR.hasInteractionElement,
|
|
101
146
|
hasSuffix = _getInputVisualsToBeR.hasSuffix,
|
|
102
|
-
hasTrailingIcon = _getInputVisualsToBeR.hasTrailingIcon
|
|
147
|
+
hasTrailingIcon = _getInputVisualsToBeR.hasTrailingIcon,
|
|
148
|
+
hasTrailingButton = _getInputVisualsToBeR.hasTrailingButton;
|
|
103
149
|
var hasLeadingVisuals = hasLeadingIcon || hasPrefix;
|
|
104
|
-
var hasTrailingVisuals = hasInteractionElement || hasSuffix || hasTrailingIcon;
|
|
150
|
+
var hasTrailingVisuals = hasInteractionElement || hasSuffix || hasTrailingIcon || hasTrailingButton;
|
|
151
|
+
if (true) {
|
|
152
|
+
if (hasTrailingButton && !isValidAllowedChildren(TrailingButton, 'Link')) {
|
|
153
|
+
throwBladeError({
|
|
154
|
+
message: 'trailingButton must be a valid Blade Link component',
|
|
155
|
+
moduleName: 'BaseInput'
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
}
|
|
105
159
|
if (hasLeadingVisuals) {
|
|
106
160
|
return /*#__PURE__*/jsxs(BaseBox, _objectSpread(_objectSpread({}, getVisualContainerStyles()), {}, {
|
|
107
161
|
children: [LeadingIcon ? /*#__PURE__*/jsx(BaseBox, {
|
|
108
162
|
paddingLeft: "spacing.4",
|
|
109
163
|
display: "flex",
|
|
110
164
|
children: /*#__PURE__*/jsx(LeadingIcon, {
|
|
111
|
-
size:
|
|
165
|
+
size: iconSize[size],
|
|
112
166
|
color: isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.subtle'
|
|
113
167
|
})
|
|
114
168
|
}) : null, hasPrefix ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getPrefixStyles({
|
|
@@ -116,7 +170,7 @@ var BaseInputVisuals = function BaseInputVisuals(_ref5) {
|
|
|
116
170
|
hasPrefix: hasPrefix
|
|
117
171
|
})), {}, {
|
|
118
172
|
children: /*#__PURE__*/jsx(Text, {
|
|
119
|
-
size:
|
|
173
|
+
size: textSize[size],
|
|
120
174
|
variant: "body",
|
|
121
175
|
weight: "regular",
|
|
122
176
|
color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',
|
|
@@ -133,7 +187,8 @@ var BaseInputVisuals = function BaseInputVisuals(_ref5) {
|
|
|
133
187
|
children: [hasInteractionElement ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getInteractionElementStyles({
|
|
134
188
|
hasTrailingIcon: hasTrailingIcon,
|
|
135
189
|
hasInteractionElement: hasInteractionElement,
|
|
136
|
-
hasSuffix: hasSuffix
|
|
190
|
+
hasSuffix: hasSuffix,
|
|
191
|
+
hasTrailingButton: hasTrailingButton
|
|
137
192
|
})), {}, {
|
|
138
193
|
display: "flex",
|
|
139
194
|
alignItems: "stretch",
|
|
@@ -141,21 +196,33 @@ var BaseInputVisuals = function BaseInputVisuals(_ref5) {
|
|
|
141
196
|
children: interactionElement
|
|
142
197
|
})) : null, hasSuffix ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({}, getSuffixStyles({
|
|
143
198
|
hasTrailingIcon: hasTrailingIcon,
|
|
144
|
-
hasSuffix: hasSuffix
|
|
199
|
+
hasSuffix: hasSuffix,
|
|
200
|
+
hasTrailingButton: hasTrailingButton
|
|
145
201
|
})), {}, {
|
|
146
202
|
children: /*#__PURE__*/jsx(Text, {
|
|
147
|
-
size:
|
|
203
|
+
size: textSize[size],
|
|
148
204
|
variant: "body",
|
|
149
205
|
weight: "regular",
|
|
150
206
|
color: isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle',
|
|
151
207
|
children: suffix
|
|
152
208
|
})
|
|
153
|
-
})) : null, TrailingIcon ? /*#__PURE__*/jsx(BaseBox, {
|
|
209
|
+
})) : null, TrailingIcon ? /*#__PURE__*/jsx(BaseBox, _objectSpread(_objectSpread({
|
|
210
|
+
display: "flex"
|
|
211
|
+
}, getTrailingIconStyles({
|
|
212
|
+
hasTrailingIcon: hasTrailingIcon,
|
|
213
|
+
hasTrailingButton: hasTrailingButton
|
|
214
|
+
})), {}, {
|
|
215
|
+
children: /*#__PURE__*/jsx(TrailingIcon, {
|
|
216
|
+
size: iconSize[size],
|
|
217
|
+
color: isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]
|
|
218
|
+
})
|
|
219
|
+
})) : null, TrailingButton ? /*#__PURE__*/jsx(BaseBox, {
|
|
154
220
|
paddingRight: "spacing.4",
|
|
155
221
|
display: "flex",
|
|
156
|
-
children: /*#__PURE__*/
|
|
157
|
-
size:
|
|
158
|
-
|
|
222
|
+
children: /*#__PURE__*/React__default.cloneElement(TrailingButton, {
|
|
223
|
+
size: size,
|
|
224
|
+
variant: 'button',
|
|
225
|
+
isDisabled: isDisabled
|
|
159
226
|
})
|
|
160
227
|
}) : null]
|
|
161
228
|
}));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n 'leadingIcon' | 'prefix' | 'interactionElement' | 'suffix' | 'trailingIcon' | 'isDisabled'\n>;\n\nconst getVisualContainerStyles = (): Pick<\n BaseBoxProps,\n 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'\n> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n});\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.2',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n}: {\n hasTrailingIcon: boolean;\n hasInteractionElement: boolean;\n hasSuffix: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasInteractionElement && (hasSuffix || hasTrailingIcon)) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasInteractionElement && !hasSuffix && !hasTrailingIcon) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && hasTrailingIcon) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasInteractionElement: Boolean(interactionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n});\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n });\n\n const hasLeadingVisuals = hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals = hasInteractionElement || hasSuffix || hasTrailingIcon;\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size=\"medium\"\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.subtle'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size=\"medium\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox alignSelf=\"stretch\" alignItems=\"stretch\" {...getVisualContainerStyles()}>\n {hasInteractionElement ? (\n <BaseBox\n {...getInteractionElementStyles({ hasTrailingIcon, hasInteractionElement, hasSuffix })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {interactionElement}\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix })}>\n <Text\n size=\"medium\"\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {\n <TrailingIcon\n size=\"medium\"\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : 'interactive.icon.gray.muted'\n }\n />\n }\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","display","flexDirection","alignItems","alignSelf","getPrefixStyles","_ref","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref2","hasTrailingIcon","hasInteractionElement","hasSuffix","paddingRight","getSuffixStyles","_ref3","getInputVisualsToBeRendered","_ref4","leadingIcon","prefix","interactionElement","suffix","trailingIcon","Boolean","BaseInputVisuals","_ref5","LeadingIcon","TrailingIcon","isDisabled","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","_jsxs","BaseBox","_objectSpread","children","_jsx","size","color","Text","variant","weight"],"mappings":";;;;;;;;;AAYA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,GAAA;EAAA,OAGxB;AACJC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,SAAS,EAAE,QAAA;GACZ,CAAA;AAAA,CAAC,CAAA;AAEF,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAAC,IAAA,EAMoB;AAAA,EAAA,IALvCC,cAAc,GAAAD,IAAA,CAAdC,cAAc;IACdC,SAAS,GAAAF,IAAA,CAATE,SAAS,CAAA;EAKT,IAAIA,SAAS,IAAID,cAAc,EAAE;IAC/B,OAAO;AACLE,MAAAA,WAAW,EAAE,WAAA;KACd,CAAA;AACH,GAAA;AAEA,EAAA,IAAID,SAAS,IAAI,CAACD,cAAc,EAAE;IAChC,OAAO;AACLE,MAAAA,WAAW,EAAE,WAAA;KACd,CAAA;AACH,GAAA;EAEA,OAAO;AACLA,IAAAA,WAAW,EAAE,WAAA;GACd,CAAA;AACH,CAAC,CAAA;AAED,IAAMC,2BAA2B,GAAG,SAA9BA,2BAA2BA,CAAAC,KAAA,EAQS;AAAA,EAAA,IAPxCC,eAAe,GAAAD,KAAA,CAAfC,eAAe;IACfC,qBAAqB,GAAAF,KAAA,CAArBE,qBAAqB;IACrBC,SAAS,GAAAH,KAAA,CAATG,SAAS,CAAA;AAMT,EAAA,IAAID,q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AAA,SAAS,EAATA,SAAAA;AAAU,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACtFb,QAAAA,OAAO,EAAC,MAAM;AACdE,QAAAA,UAAU,EAAC,SAAS;AACpBC,QAAAA,SAAS,EAAC,SAAS;AAAAiC,QAAAA,QAAA,EAElBf,kBAAAA;AAAkB,OAAA,CACZ,CAAC,GACR,IAAI,EACPR,SAAS,gBACRwB,GAAA,CAACH,OAAO,EAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EAAKpB,eAAe,CAAC;AAAEJ,QAAAA,eAAe,EAAfA,eAAe;AAAEE,QAAAA,SAAS,EAATA,SAAAA;AAAU,OAAC,CAAC,CAAA,EAAA,EAAA,EAAA;QAAAuB,QAAA,eAC1DC,GAAA,CAACG,IAAI,EAAA;AACHF,UAAAA,IAAI,EAAC,QAAQ;AACbG,UAAAA,OAAO,EAAC,MAAM;AACdC,UAAAA,MAAM,EAAC,SAAS;AAChBH,UAAAA,KAAK,EAAEV,UAAU,GAAG,4BAA4B,GAAG,0BAA2B;AAAAO,UAAAA,QAAA,EAE7Ed,MAAAA;SACG,CAAA;OACC,CAAA,CAAC,GACR,IAAI,EACPM,YAAY,gBACXS,GAAA,CAACH,OAAO,EAAA;AAACpB,QAAAA,YAAY,EAAC,WAAW;AAACd,QAAAA,OAAO,EAAC,MAAM;QAAAoC,QAAA,eAE5CC,GAAA,CAACT,YAAY,EAAA;AACXU,UAAAA,IAAI,EAAC,QAAQ;AACbC,UAAAA,KAAK,EACHV,UAAU,GAAG,gCAAgC,GAAG,6BAAA;SAEnD,CAAA;OAEI,CAAC,GACR,IAAI,CAAA;AAAA,KAAA,CACD,CAAC,CAAA;AAEd,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
1
|
+
{"version":3,"file":"BaseInputVisuals.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputVisuals.tsx"],"sourcesContent":["/* eslint-disable @typescript-eslint/explicit-function-return-type */\nimport React from 'react';\nimport type { ReactElement } from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { Text } from '~components/Typography';\nimport type { BaseBoxProps } from '~components/Box/BaseBox';\nimport type { IconColors } from '~components/Icons';\nimport { isValidAllowedChildren } from '~utils/isValidAllowedChildren';\nimport { throwBladeError } from '~utils/logger';\n\ntype InputVisuals = Pick<\n BaseInputProps,\n | 'leadingIcon'\n | 'prefix'\n | 'interactionElement'\n | 'suffix'\n | 'trailingIcon'\n | 'isDisabled'\n | 'validationState'\n | 'size'\n | 'trailingButton'\n> & {\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst getVisualContainerStyles = (): Pick<\n BaseBoxProps,\n 'display' | 'flexDirection' | 'alignItems' | 'alignSelf'\n> => ({\n display: 'flex',\n flexDirection: 'row',\n alignItems: 'center',\n alignSelf: 'center',\n});\n\nconst trailingIconColor: Record<NonNullable<InputVisuals['validationState']>, IconColors> = {\n none: 'surface.icon.gray.subtle',\n error: 'feedback.icon.negative.intense',\n success: 'feedback.icon.positive.intense',\n};\n\nconst iconSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst textSize = {\n medium: 'medium',\n large: 'large',\n} as const;\n\nconst getPrefixStyles = ({\n hasLeadingIcon,\n hasPrefix,\n}: {\n hasLeadingIcon: boolean;\n hasPrefix: boolean;\n}): Pick<BaseBoxProps, 'paddingLeft'> => {\n if (hasPrefix && hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.3',\n };\n }\n\n if (hasPrefix && !hasLeadingIcon) {\n return {\n paddingLeft: 'spacing.4',\n };\n }\n\n return {\n paddingLeft: 'spacing.0',\n };\n};\n\nconst getInteractionElementStyles = ({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasInteractionElement: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasInteractionElement && (hasSuffix || hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.2',\n };\n }\n\n if (hasInteractionElement && !hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getSuffixStyles = ({\n hasTrailingIcon,\n hasSuffix,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasSuffix: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasSuffix && (hasTrailingIcon || hasTrailingButton)) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasSuffix && !hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nconst getTrailingIconStyles = ({\n hasTrailingIcon,\n hasTrailingButton,\n}: {\n hasTrailingIcon: boolean;\n hasTrailingButton: boolean;\n}): Pick<BaseBoxProps, 'paddingRight'> => {\n if (hasTrailingIcon && hasTrailingButton) {\n return {\n paddingRight: 'spacing.3',\n };\n }\n\n if (hasTrailingIcon && !hasTrailingButton) {\n return {\n paddingRight: 'spacing.4',\n };\n }\n\n return {\n paddingRight: 'spacing.0',\n };\n};\n\nexport const getInputVisualsToBeRendered = ({\n leadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon,\n trailingButton,\n}: InputVisuals) => ({\n hasLeadingIcon: Boolean(leadingIcon),\n hasPrefix: Boolean(prefix),\n hasInteractionElement: Boolean(interactionElement),\n hasSuffix: Boolean(suffix),\n hasTrailingIcon: Boolean(trailingIcon),\n hasTrailingButton: Boolean(trailingButton),\n});\n\nexport const BaseInputVisuals = ({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n isDisabled,\n validationState = 'none',\n size,\n trailingButton: TrailingButton,\n}: InputVisuals): ReactElement | null => {\n const {\n hasLeadingIcon,\n hasPrefix,\n hasInteractionElement,\n hasSuffix,\n hasTrailingIcon,\n hasTrailingButton,\n } = getInputVisualsToBeRendered({\n leadingIcon: LeadingIcon,\n prefix,\n interactionElement,\n suffix,\n trailingIcon: TrailingIcon,\n trailingButton: TrailingButton,\n size,\n });\n\n const hasLeadingVisuals = hasLeadingIcon || hasPrefix;\n const hasTrailingVisuals =\n hasInteractionElement || hasSuffix || hasTrailingIcon || hasTrailingButton;\n\n if (__DEV__) {\n if (hasTrailingButton && !isValidAllowedChildren(TrailingButton, 'Link')) {\n throwBladeError({\n message: 'trailingButton must be a valid Blade Link component',\n moduleName: 'BaseInput',\n });\n }\n }\n\n if (hasLeadingVisuals) {\n return (\n <BaseBox {...getVisualContainerStyles()}>\n {LeadingIcon ? (\n <BaseBox paddingLeft=\"spacing.4\" display=\"flex\">\n <LeadingIcon\n size={iconSize[size]}\n color={isDisabled ? 'surface.icon.gray.disabled' : 'surface.icon.gray.subtle'}\n />\n </BaseBox>\n ) : null}\n {hasPrefix ? (\n <BaseBox {...getPrefixStyles({ hasLeadingIcon, hasPrefix })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {prefix}\n </Text>\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n if (hasTrailingVisuals) {\n return (\n <BaseBox alignSelf=\"stretch\" alignItems=\"stretch\" {...getVisualContainerStyles()}>\n {hasInteractionElement ? (\n <BaseBox\n {...getInteractionElementStyles({\n hasTrailingIcon,\n hasInteractionElement,\n hasSuffix,\n hasTrailingButton,\n })}\n display=\"flex\"\n alignItems=\"stretch\"\n alignSelf=\"stretch\"\n >\n {interactionElement}\n </BaseBox>\n ) : null}\n {hasSuffix ? (\n <BaseBox {...getSuffixStyles({ hasTrailingIcon, hasSuffix, hasTrailingButton })}>\n <Text\n size={textSize[size]}\n variant=\"body\"\n weight=\"regular\"\n color={isDisabled ? 'surface.text.gray.disabled' : 'surface.text.gray.subtle'}\n >\n {suffix}\n </Text>\n </BaseBox>\n ) : null}\n {TrailingIcon ? (\n <BaseBox\n display=\"flex\"\n {...getTrailingIconStyles({ hasTrailingIcon, hasTrailingButton })}\n >\n {\n <TrailingIcon\n size={iconSize[size]}\n color={\n isDisabled ? 'interactive.icon.gray.disabled' : trailingIconColor[validationState]\n }\n />\n }\n </BaseBox>\n ) : null}\n {TrailingButton ? (\n <BaseBox paddingRight=\"spacing.4\" display=\"flex\">\n {React.cloneElement(TrailingButton, {\n size,\n variant: 'button',\n isDisabled,\n })}\n </BaseBox>\n ) : null}\n </BaseBox>\n );\n }\n\n return null;\n};\n"],"names":["getVisualContainerStyles","display","flexDirection","alignItems","alignSelf","trailingIconColor","none","error","success","iconSize","medium","large","textSize","getPrefixStyles","_ref","hasLeadingIcon","hasPrefix","paddingLeft","getInteractionElementStyles","_ref2","hasTrailingIcon","hasInteractionElement","hasSuffix","hasTrailingButton","paddingRight","getSuffixStyles","_ref3","getTrailingIconStyles","_ref4","getInputVisualsToBeRendered","_ref5","leadingIcon","prefix","interactionElement","suffix","trailingIcon","trailingButton","Boolean","BaseInputVisuals","_ref6","LeadingIcon","TrailingIcon","isDisabled","_ref6$validationState","validationState","size","TrailingButton","_getInputVisualsToBeR","hasLeadingVisuals","hasTrailingVisuals","isValidAllowedChildren","throwBladeError","message","moduleName","_jsxs","BaseBox","_objectSpread","children","_jsx","color","Text","variant","weight","React","cloneElement"],"mappings":";;;;;;;;;;;;;;AA0BA,IAAMA,wBAAwB,GAAG,SAA3BA,wBAAwBA,GAAA;EAAA,OAGxB;AACJC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,aAAa,EAAE,KAAK;AACpBC,IAAAA,UAAU,EAAE,QAAQ;AACpBC,IAAAA,SAAS,EAAE,QAAA;GACZ,CAAA;AAAA,CAAC,CAAA;AAEF,IAAMC,iBAAmF,GAAG;AAC1FC,EAAAA,IAAI,EAAE,0BAA0B;AAChCC,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EAAC,WAAW;AAACvB,QAAAA,OAAO,EAAC,MAAM;AAAAwD,QAAAA,QAAA,eAC7CM,cAAK,CAACC,YAAY,CAAClB,cAAc,EAAE;AAClCD,UAAAA,IAAI,EAAJA,IAAI;AACJgB,UAAAA,OAAO,EAAE,QAAQ;AACjBnB,UAAAA,UAAU,EAAVA,UAAAA;SACD,CAAA;OACM,CAAC,GACR,IAAI,CAAA;AAAA,KAAA,CACD,CAAC,CAAA;AAEd,GAAA;AAEA,EAAA,OAAO,IAAI,CAAA;AACb;;;;"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
2
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import { BaseInputAnimatedBorder } from './BaseInputAnimatedBorder.web.js';
|
|
5
4
|
import { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper.web.js';
|
|
6
|
-
import {
|
|
5
|
+
import { jsx } from 'react/jsx-runtime';
|
|
7
6
|
|
|
8
7
|
var _excluded = ["children", "validationState", "currentInteraction", "isLabelLeftPositioned", "isTextArea", "showAllTags", "setShowAllTagsWithAnimation", "maxTagRows"];
|
|
9
8
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
@@ -18,7 +17,7 @@ var _BaseInputWrapper = function _BaseInputWrapper(_ref, ref) {
|
|
|
18
17
|
setShowAllTagsWithAnimation = _ref.setShowAllTagsWithAnimation,
|
|
19
18
|
maxTagRows = _ref.maxTagRows,
|
|
20
19
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
-
return /*#__PURE__*/
|
|
20
|
+
return /*#__PURE__*/jsx(AnimatedBaseInputWrapper
|
|
22
21
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion
|
|
23
22
|
, _objectSpread(_objectSpread({
|
|
24
23
|
ref: ref,
|
|
@@ -29,10 +28,7 @@ var _BaseInputWrapper = function _BaseInputWrapper(_ref, ref) {
|
|
|
29
28
|
maxTagRows: maxTagRows,
|
|
30
29
|
setShowAllTagsWithAnimation: setShowAllTagsWithAnimation
|
|
31
30
|
}, props), {}, {
|
|
32
|
-
children:
|
|
33
|
-
currentInteraction: currentInteraction,
|
|
34
|
-
validationState: validationState
|
|
35
|
-
})]
|
|
31
|
+
children: children
|
|
36
32
|
}));
|
|
37
33
|
};
|
|
38
34
|
var BaseInputWrapper = /*#__PURE__*/React__default.forwardRef(_BaseInputWrapper);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport {
|
|
1
|
+
{"version":3,"file":"BaseInputWrapper.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputWrapper.tsx"],"sourcesContent":["import type { ReactElement, ReactNode } from 'react';\nimport React from 'react';\nimport type { BaseInputProps } from './BaseInput';\nimport { AnimatedBaseInputWrapper } from './AnimatedBaseInputWrapper';\nimport type { ContainerElementType } from '~utils/types';\nimport type { ActionStates } from '~utils/useInteraction';\n\ntype BaseInputWrapperProps = Pick<\n BaseInputProps,\n | 'isDisabled'\n | 'validationState'\n | 'showAllTags'\n | 'maxTagRows'\n | 'setInputWrapperRef'\n | 'isDropdownTrigger'\n> & {\n isFocused?: boolean;\n isLabelLeftPositioned?: boolean;\n currentInteraction: ActionStates;\n isTextArea?: boolean;\n setShowAllTagsWithAnimation: (showAllTagsWithAnimation: boolean) => void;\n children: React.ReactNode;\n size: NonNullable<BaseInputProps['size']>;\n};\n\nconst _BaseInputWrapper: React.ForwardRefRenderFunction<\n ContainerElementType,\n BaseInputWrapperProps & {\n children: ReactNode;\n }\n> = (\n {\n children,\n validationState,\n currentInteraction,\n isLabelLeftPositioned,\n isTextArea,\n showAllTags,\n setShowAllTagsWithAnimation,\n maxTagRows,\n ...props\n },\n ref,\n): ReactElement => {\n return (\n <AnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unnecessary-type-assertion\n ref={ref as any}\n isTextArea={isTextArea}\n validationState={validationState}\n currentInteraction={currentInteraction}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n {...props}\n >\n {children}\n </AnimatedBaseInputWrapper>\n );\n};\n\nexport const BaseInputWrapper = React.forwardRef(_BaseInputWrapper);\n"],"names":["_BaseInputWrapper","_ref","ref","children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows","props","_objectWithoutProperties","_excluded","_jsx","AnimatedBaseInputWrapper","_objectSpread","BaseInputWrapper","React","forwardRef"],"mappings":";;;;;;;;;AAyBA,IAAMA,iBAKL,GAAG,SALEA,iBAKLA,CAAAC,IAAA,EAYCC,GAAG,EACc;AAAA,EAAA,IAXfC,QAAQ,GAAAF,IAAA,CAARE,QAAQ;IACRC,eAAe,GAAAH,IAAA,CAAfG,eAAe;IACfC,kBAAkB,GAAAJ,IAAA,CAAlBI,kBAAkB;IAClBC,qBAAqB,GAAAL,IAAA,CAArBK,qBAAqB;IACrBC,UAAU,GAAAN,IAAA,CAAVM,UAAU;IACVC,WAAW,GAAAP,IAAA,CAAXO,WAAW;IACXC,2BAA2B,GAAAR,IAAA,CAA3BQ,2BAA2B;IAC3BC,UAAU,GAAAT,IAAA,CAAVS,UAAU;AACPC,IAAAA,KAAK,GAAAC,wBAAA,CAAAX,IAAA,EAAAY,SAAA,CAAA,CAAA;AAIV,EAAA,oBACEC,GAAA,CAACC,wBAAAA;AACC;IAAAC,aAAA,CAAAA,aAAA,CAAA;AACAd,IAAAA,GAAG,EAAEA,GAAW;AAChBK,IAAAA,UAAU,EAAEA,UAAW;AACvBH,IAAAA,eAAe,EAAEA,eAAgB;AACjCC,IAAAA,kBAAkB,EAAEA,kBAAmB;AACvCG,IAAAA,WAAW,EAAEA,WAAY;AACzBE,IAAAA,UAAU,EAAEA,UAAW;AACvBD,IAAAA,2BAA2B,EAAEA,2BAAAA;AAA4B,GAAA,EACrDE,KAAK,CAAA,EAAA,EAAA,EAAA;AAAAR,IAAAA,QAAA,EAERA,QAAAA;AAAQ,GAAA,CACe,CAAC,CAAA;AAE/B,CAAC,CAAA;AAEM,IAAMc,gBAAgB,gBAAGC,cAAK,CAACC,UAAU,CAACnB,iBAAiB;;;;"}
|
|
@@ -10,7 +10,7 @@ import { jsx } from 'react/jsx-runtime';
|
|
|
10
10
|
import { Text } from '../../Typography/Text/Text.js';
|
|
11
11
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
12
12
|
|
|
13
|
-
var _excluded = ["name", "isDisabled", "isRequired", "maxCharacters", "handleOnFocus", "handleOnChange", "handleOnBlur", "handleOnInput", "handleOnKeyDown", "handleOnClick", "keyboardType", "keyboardReturnKeyType", "autoCompleteSuggestionType", "accessibilityProps", "setCurrentInteraction", "numberOfLines", "type", "hasPopup", "shouldIgnoreBlurAnimation", "autoCapitalize"];
|
|
13
|
+
var _excluded = ["name", "isDisabled", "isRequired", "maxCharacters", "handleOnFocus", "handleOnChange", "handleOnBlur", "handleOnInput", "handleOnKeyDown", "handleOnClick", "keyboardType", "keyboardReturnKeyType", "autoCompleteSuggestionType", "accessibilityProps", "setCurrentInteraction", "numberOfLines", "type", "hasPopup", "shouldIgnoreBlurAnimation", "autoCapitalize", "$size", "valueComponentType"];
|
|
14
14
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
15
15
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
16
16
|
var getWebInputStyles = function getWebInputStyles(props) {
|
|
@@ -26,12 +26,14 @@ var getWebInputStyles = function getWebInputStyles(props) {
|
|
|
26
26
|
textAlign: props.textAlign,
|
|
27
27
|
isTextArea: props.isTextArea,
|
|
28
28
|
hasTags: props.hasTags,
|
|
29
|
-
isDropdownTrigger: props.isDropdownTrigger
|
|
29
|
+
isDropdownTrigger: props.isDropdownTrigger,
|
|
30
|
+
size: props.$size,
|
|
31
|
+
valueComponentType: props.valueComponentType
|
|
30
32
|
})), {}, {
|
|
31
33
|
outline: 'none',
|
|
32
34
|
border: 'none',
|
|
33
35
|
'::placeholder': _objectSpread(_objectSpread({}, getTextStyles({
|
|
34
|
-
size:
|
|
36
|
+
size: props.$size,
|
|
35
37
|
variant: 'body',
|
|
36
38
|
weight: 'regular',
|
|
37
39
|
color: 'surface.text.gray.disabled',
|
|
@@ -94,6 +96,8 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
|
|
|
94
96
|
hasPopup = _ref.hasPopup,
|
|
95
97
|
shouldIgnoreBlurAnimation = _ref.shouldIgnoreBlurAnimation,
|
|
96
98
|
autoCapitalize = _ref.autoCapitalize,
|
|
99
|
+
$size = _ref.$size,
|
|
100
|
+
valueComponentType = _ref.valueComponentType,
|
|
97
101
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
98
102
|
var commonProps = {
|
|
99
103
|
onBlur: function onBlur(event) {
|
|
@@ -142,13 +146,16 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
|
|
|
142
146
|
name: name,
|
|
143
147
|
value: event
|
|
144
148
|
});
|
|
145
|
-
}
|
|
149
|
+
},
|
|
150
|
+
$size: $size,
|
|
151
|
+
valueComponentType: valueComponentType
|
|
146
152
|
}, commonProps), props), accessibilityProps), {}, {
|
|
147
153
|
value: props.value,
|
|
148
154
|
children: /*#__PURE__*/jsx(Text, {
|
|
149
155
|
color: props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled',
|
|
150
156
|
truncateAfterLines: 1,
|
|
151
157
|
textAlign: props.textAlign,
|
|
158
|
+
size: $size,
|
|
152
159
|
children: props.value ? props.value : props.placeholder
|
|
153
160
|
})
|
|
154
161
|
})) : /*#__PURE__*/jsx(StyledBaseNativeInput
|
|
@@ -184,7 +191,9 @@ var _StyledBaseInput = function _StyledBaseInput(_ref, ref) {
|
|
|
184
191
|
value: event
|
|
185
192
|
});
|
|
186
193
|
},
|
|
187
|
-
autoCapitalize: autoCapitalize
|
|
194
|
+
autoCapitalize: autoCapitalize,
|
|
195
|
+
$size: $size,
|
|
196
|
+
valueComponentType: valueComponentType
|
|
188
197
|
}, commonProps), props), accessibilityProps));
|
|
189
198
|
};
|
|
190
199
|
var StyledBaseInput = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/React__default.forwardRef(_StyledBaseInput), {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledBaseInput.web.js","sources":["../../../../../../../src/components/Input/BaseInput/StyledBaseInput.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { CSSObject, DefaultTheme, ThemeProps } from 'styled-components';\nimport { getBaseInputStyles } from './baseInputStyles';\n\nimport type { StyledBaseInputProps } from './types';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { Text } from '~components/Typography';\n\nconst getWebInputStyles = (\n props: Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'> &\n ThemeProps<DefaultTheme> &\n (React.InputHTMLAttributes<HTMLInputElement> | React.ButtonHTMLAttributes<HTMLButtonElement>),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n isDisabled: props.disabled,\n theme: props.theme,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n interactionElement: props.interactionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n textAlign: props.textAlign,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n outline: 'none',\n border: 'none',\n '::placeholder': {\n ...getTextStyles({\n size: 'medium',\n variant: 'body',\n weight: 'regular',\n color: 'surface.text.gray.disabled',\n theme: props.theme,\n }),\n textAlign: props.textAlign,\n },\n ':focus': {\n outline: 'none',\n },\n cursor: props.disabled ? 'not-allowed' : 'auto',\n };\n};\n\nconst StyledBaseNativeInput = styled.input<\n Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'>\n>(getWebInputStyles);\n\nconst StyledBaseNativeButton = styled.button<\n Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'>\n>((props) => ({\n ...getWebInputStyles(props),\n}));\n\nconst autoCompleteSuggestionTypeMap = {\n none: 'off',\n on: 'on',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'current-password',\n newPassword: 'new-password',\n oneTimeCode: 'one-time-code',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n};\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n HTMLInputElement | HTMLButtonElement,\n StyledBaseInputProps\n> = (\n {\n name,\n isDisabled,\n isRequired,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n setCurrentInteraction,\n numberOfLines,\n type,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n ...props\n },\n ref,\n) => {\n const commonProps = {\n onBlur: (event: React.ChangeEvent<HTMLInputElement>): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n handleOnBlur?.({ name, value: event });\n },\n onFocus: (event: React.ChangeEvent<HTMLInputElement>): void => {\n setCurrentInteraction('focus');\n handleOnFocus?.({ name, value: event });\n },\n onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => {\n handleOnKeyDown?.({ name, key: event.key, code: event.code, event });\n },\n disabled: isDisabled,\n enterKeyHint: keyboardReturnKeyType === 'default' ? 'enter' : keyboardReturnKeyType,\n autoComplete: autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeMap[autoCompleteSuggestionType]\n : undefined,\n };\n\n return props.as === 'button' ? (\n <StyledBaseNativeButton\n // @ts-expect-error: TS doesnt understand that this will always be `button`\n ref={ref}\n name={name}\n type=\"button\"\n onClick={(event: React.MouseEvent<HTMLInputElement>): void => {\n if (props.isDropdownTrigger) {\n // dropdown triggers have click event on outer container as well on web to handle outer padding clicks of input\n // we don't want the clicks to be called twice in such cases so we stop propogation if this click has happened\n event.stopPropagation();\n }\n\n handleOnClick?.({ name, value: event });\n }}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n value={props.value}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n >\n {props.value ? props.value : props.placeholder}\n </Text>\n </StyledBaseNativeButton>\n ) : (\n <StyledBaseNativeInput\n // @ts-expect-error: TS doesnt understand that this will always be `input`\n ref={ref}\n name={name}\n type={type === 'telephone' ? 'tel' : type}\n required={isRequired}\n maxLength={maxCharacters}\n rows={numberOfLines}\n inputMode={keyboardType === 'telephone' ? 'tel' : keyboardType}\n onChange={(event: React.ChangeEvent<HTMLInputElement>): void =>\n handleOnChange?.({ name, value: event })\n }\n onInput={(event: React.ChangeEvent<HTMLInputElement>) => {\n handleOnInput?.({ name, value: event });\n }}\n onClick={(event) => {\n if (props.isDropdownTrigger) {\n // dropdown triggers have click event on outer container as well on web to handle outer padding clicks of input\n // we don't want the clicks to be called twice in such cases so we stop propogation if this click has happened\n event.stopPropagation();\n }\n\n handleOnClick?.({ name, value: event });\n }}\n autoCapitalize={autoCapitalize}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["getWebInputStyles","props","_objectSpread","getBaseInputStyles","isDisabled","disabled","theme","validationState","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","isTextArea","hasTags","isDropdownTrigger","outline","border","getTextStyles","size","variant","weight","color","cursor","StyledBaseNativeInput","styled","input","withConfig","displayName","componentId","StyledBaseNativeButton","button","autoCompleteSuggestionTypeMap","none","on","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","_StyledBaseInput","_ref","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","setCurrentInteraction","numberOfLines","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","_objectWithoutProperties","_excluded","commonProps","onBlur","event","value","onFocus","onKeyDown","key","code","enterKeyHint","autoComplete","undefined","as","_jsx","onClick","stopPropagation","children","Text","truncateAfterLines","placeholder","required","maxLength","rows","inputMode","onChange","onInput","StyledBaseInput","assignWithoutSideEffects","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AAUA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CACrBC,KAE+F,EACjF;AACd,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKC,kBAAkB,CAAC;IACpBC,UAAU,EAAEH,KAAK,CAACI,QAAQ;IAC1BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,eAAe,EAAEN,KAAK,CAACM,eAAe;IACtCC,WAAW,EAAEP,KAAK,CAACO,WAAW;IAC9BC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpBC,kBAAkB,EAAET,KAAK,CAACS,kBAAkB;IAC5CC,MAAM,EAAEV,KAAK,CAACU,MAAM;IACpBC,YAAY,EAAEX,KAAK,CAACW,YAAY;IAChCC,SAAS,EAAEZ,KAAK,CAACY,SAAS;IAC1BC,UAAU,EAAEb,KAAK,CAACa,UAAU;IAC5BC,OAAO,EAAEd,KAAK,CAACc,OAAO;IACtBC,iBAAiB,EAAEf,KAAK,CAACe,iBAAAA;AAC3B,GAAC,CAAC,CAAA,EAAA,EAAA,EAAA;AACFC,IAAAA,OAAO,EAAE,MAAM;AACfC,IAAAA,MAAM,EAAE,MAAM;AACd,IAAA,eAAe,EAAAhB,aAAA,CAAAA,aAAA,CAAA,EAAA,EACViB,aAAa,CAAC;AACfC,MAAAA,IAAI,EAAE,QAAQ;AACdC,MAAAA,OAAO,EAAE,MAAM;AACfC,MAAAA,MAAM,EAAE,SAAS;AACjBC,MAAAA,KAAK,EAAE,4BAA4B;MACnCjB,KAAK,EAAEL,KAAK,CAACK,KAAAA;AACf,KAAC,CAAC,CAAA,EAAA,EAAA,EAAA;MACFO,SAAS,EAAEZ,KAAK,CAACY,SAAAA;KAClB,CA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ACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"StyledBaseInput.web.js","sources":["../../../../../../../src/components/Input/BaseInput/StyledBaseInput.web.tsx"],"sourcesContent":["import React from 'react';\nimport styled from 'styled-components';\nimport type { CSSObject, DefaultTheme, ThemeProps } from 'styled-components';\nimport { getBaseInputStyles } from './baseInputStyles';\nimport type { StyledBaseInputProps } from './types';\nimport getTextStyles from '~components/Typography/Text/getTextStyles';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { Text } from '~components/Typography';\n\nconst getWebInputStyles = (\n props: Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'> &\n ThemeProps<DefaultTheme> &\n (React.InputHTMLAttributes<HTMLInputElement> | React.ButtonHTMLAttributes<HTMLButtonElement>),\n): CSSObject => {\n return {\n ...getBaseInputStyles({\n isDisabled: props.disabled,\n theme: props.theme,\n validationState: props.validationState,\n leadingIcon: props.leadingIcon,\n prefix: props.prefix,\n interactionElement: props.interactionElement,\n suffix: props.suffix,\n trailingIcon: props.trailingIcon,\n textAlign: props.textAlign,\n isTextArea: props.isTextArea,\n hasTags: props.hasTags,\n isDropdownTrigger: props.isDropdownTrigger,\n size: props.$size,\n valueComponentType: props.valueComponentType,\n }),\n outline: 'none',\n border: 'none',\n '::placeholder': {\n ...getTextStyles({\n size: props.$size,\n variant: 'body',\n weight: 'regular',\n color: 'surface.text.gray.disabled',\n theme: props.theme,\n }),\n textAlign: props.textAlign,\n },\n ':focus': {\n outline: 'none',\n },\n cursor: props.disabled ? 'not-allowed' : 'auto',\n };\n};\n\nconst StyledBaseNativeInput = styled.input<\n Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'>\n>(getWebInputStyles);\n\nconst StyledBaseNativeButton = styled.button<\n Omit<StyledBaseInputProps, 'accessibilityProps' | 'setCurrentInteraction' | 'type'>\n>((props) => ({\n ...getWebInputStyles(props),\n}));\n\nconst autoCompleteSuggestionTypeMap = {\n none: 'off',\n on: 'on',\n name: 'name',\n email: 'email',\n username: 'username',\n password: 'current-password',\n newPassword: 'new-password',\n oneTimeCode: 'one-time-code',\n telephone: 'tel',\n postalCode: 'postal-code',\n countryName: 'country',\n creditCardNumber: 'cc-number',\n creditCardCSC: 'cc-csc',\n creditCardExpiry: 'cc-exp',\n creditCardExpiryMonth: 'cc-exp-month',\n creditCardExpiryYear: 'cc-exp-year',\n};\n\nconst _StyledBaseInput: React.ForwardRefRenderFunction<\n HTMLInputElement | HTMLButtonElement,\n StyledBaseInputProps\n> = (\n {\n name,\n isDisabled,\n isRequired,\n maxCharacters,\n handleOnFocus,\n handleOnChange,\n handleOnBlur,\n handleOnInput,\n handleOnKeyDown,\n handleOnClick,\n keyboardType,\n keyboardReturnKeyType,\n autoCompleteSuggestionType,\n accessibilityProps,\n setCurrentInteraction,\n numberOfLines,\n type,\n hasPopup,\n shouldIgnoreBlurAnimation,\n autoCapitalize,\n $size,\n valueComponentType,\n ...props\n },\n ref,\n) => {\n const commonProps = {\n onBlur: (event: React.ChangeEvent<HTMLInputElement>): void => {\n // In certain cases like SelectInput, we want to ignore the blur animation when option item is clicked.\n // The selectinput should always look like it is in focus otherwise it triggers blur + focus again which can cause flicker\n if (!shouldIgnoreBlurAnimation) {\n setCurrentInteraction('default');\n }\n handleOnBlur?.({ name, value: event });\n },\n onFocus: (event: React.ChangeEvent<HTMLInputElement>): void => {\n setCurrentInteraction('focus');\n handleOnFocus?.({ name, value: event });\n },\n onKeyDown: (event: React.KeyboardEvent<HTMLInputElement>) => {\n handleOnKeyDown?.({ name, key: event.key, code: event.code, event });\n },\n disabled: isDisabled,\n enterKeyHint: keyboardReturnKeyType === 'default' ? 'enter' : keyboardReturnKeyType,\n autoComplete: autoCompleteSuggestionType\n ? autoCompleteSuggestionTypeMap[autoCompleteSuggestionType]\n : undefined,\n };\n\n return props.as === 'button' ? (\n <StyledBaseNativeButton\n // @ts-expect-error: TS doesnt understand that this will always be `button`\n ref={ref}\n name={name}\n type=\"button\"\n onClick={(event: React.MouseEvent<HTMLInputElement>): void => {\n if (props.isDropdownTrigger) {\n // dropdown triggers have click event on outer container as well on web to handle outer padding clicks of input\n // we don't want the clicks to be called twice in such cases so we stop propogation if this click has happened\n event.stopPropagation();\n }\n\n handleOnClick?.({ name, value: event });\n }}\n $size={$size}\n valueComponentType={valueComponentType}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n value={props.value}\n >\n <Text\n color={\n props.value && !isDisabled ? 'surface.text.gray.subtle' : 'surface.text.gray.disabled'\n }\n truncateAfterLines={1}\n textAlign={props.textAlign}\n size={$size}\n >\n {props.value ? props.value : props.placeholder}\n </Text>\n </StyledBaseNativeButton>\n ) : (\n <StyledBaseNativeInput\n // @ts-expect-error: TS doesnt understand that this will always be `input`\n ref={ref}\n name={name}\n type={type === 'telephone' ? 'tel' : type}\n required={isRequired}\n maxLength={maxCharacters}\n rows={numberOfLines}\n inputMode={keyboardType === 'telephone' ? 'tel' : keyboardType}\n onChange={(event: React.ChangeEvent<HTMLInputElement>): void =>\n handleOnChange?.({ name, value: event })\n }\n onInput={(event: React.ChangeEvent<HTMLInputElement>) => {\n handleOnInput?.({ name, value: event });\n }}\n onClick={(event) => {\n if (props.isDropdownTrigger) {\n // dropdown triggers have click event on outer container as well on web to handle outer padding clicks of input\n // we don't want the clicks to be called twice in such cases so we stop propogation if this click has happened\n event.stopPropagation();\n }\n\n handleOnClick?.({ name, value: event });\n }}\n autoCapitalize={autoCapitalize}\n $size={$size}\n valueComponentType={valueComponentType}\n {...commonProps}\n {...props}\n {...accessibilityProps}\n />\n );\n};\n\nconst StyledBaseInput = assignWithoutSideEffects(React.forwardRef(_StyledBaseInput), {\n displayName: 'StyledBaseInput',\n});\n\nexport { StyledBaseInput };\n"],"names":["getWebInputStyles","props","_objectSpread","getBaseInputStyles","isDisabled","disabled","theme","validationState","leadingIcon","prefix","interactionElement","suffix","trailingIcon","textAlign","isTextArea","hasTags","isDropdownTrigger","size","$size","valueComponentType","outline","border","getTextStyles","variant","weight","color","cursor","StyledBaseNativeInput","styled","input","withConfig","displayName","componentId","StyledBaseNativeButton","button","autoCompleteSuggestionTypeMap","none","on","name","email","username","password","newPassword","oneTimeCode","telephone","postalCode","countryName","creditCardNumber","creditCardCSC","creditCardExpiry","creditCardExpiryMonth","creditCardExpiryYear","_StyledBaseInput","_ref","ref","isRequired","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","setCurrentInteraction","numberOfLines","type","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","_objectWithoutProperties","_excluded","commonProps","onBlur","event","value","onFocus","onKeyDown","key","code","enterKeyHint","autoComplete","undefined","as","_jsx","onClick","stopPropagation","children","Text","truncateAfterLines","placeholder","required","maxLength","rows","inputMode","onChange","onInput","StyledBaseInput","assignWithoutSideEffects","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;AASA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAiBA,CACrBC,KAE+F,EACjF;AACd,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACKC,kBAAkB,CAAC;IACpBC,UAAU,EAAEH,KAAK,CAACI,QAAQ;IAC1BC,KAAK,EAAEL,KAAK,CAACK,KAAK;IAClBC,eAAe,EAAEN,KAAK,CAACM,eAAe;IACtCC,WAAW,EAAEP,KAAK,CAACO,WAAW;IAC9BC,MAAM,EAAER,KAAK,CAACQ,MAAM;IACpBC,kBAAkB,EAAET,KAAK,CAACS,kBAAkB;IAC5CC,MAAM,EAAEV,KAAK,CAACU,MAAM;IACpBC,YAAY,EAAEX,KAAK,CAACW,YAAY;IAChCC,SAAS,EAAEZ,KAAK,CAACY,SAAS;IAC1BC,UAAU,EAAEb,KAAK,CAACa,UAAU;IAC5BC,OAAO,EAAEd,KAAK,CAACc,OAAO;IACtBC,iBAAiB,EAAEf,KAAK,CAACe,iBAAiB;IAC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