@razorpay/blade 11.8.2 → 11.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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/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/Table/TableBody.web.js +3 -0
- package/build/lib/web/development/components/Table/TableBody.web.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/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/Table/TableBody.web.js +3 -0
- package/build/lib/web/production/components/Table/TableBody.web.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,28 +1,22 @@
|
|
|
1
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
2
|
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import React__default from 'react';
|
|
4
|
-
import styled, {
|
|
5
|
-
import { getInputBackgroundAndBorderStyles } from './baseInputStyles.js';
|
|
6
|
-
import {
|
|
4
|
+
import styled, { css, keyframes } from 'styled-components';
|
|
5
|
+
import { getInputBackgroundAndBorderStyles, getAnimatedBaseInputWrapperMaxHeight } from './baseInputStyles.js';
|
|
6
|
+
import { baseInputHeight, baseInputWrapperMaxHeight } from './baseInputTokens.js';
|
|
7
7
|
import '../../Box/BaseBox/index.js';
|
|
8
8
|
import '../../../tokens/global/index.js';
|
|
9
9
|
import '../../../utils/index.js';
|
|
10
10
|
import { jsx } from 'react/jsx-runtime';
|
|
11
|
-
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
12
|
-
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
13
|
-
import { motion } from '../../../tokens/global/motion.js';
|
|
14
11
|
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
15
12
|
import { castWebType } from '../../../utils/platform/castUtils.js';
|
|
13
|
+
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
14
|
+
import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
15
|
+
import { motion } from '../../../tokens/global/motion.js';
|
|
16
16
|
|
|
17
17
|
var _excluded = ["showAllTags", "setShowAllTagsWithAnimation", "maxTagRows", "isDropdownTrigger"];
|
|
18
18
|
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; }
|
|
19
19
|
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; }
|
|
20
|
-
// Define the animation keyframes
|
|
21
|
-
var expandAnimation = /*#__PURE__*/keyframes(["from{max-height:", ";}to{max-height:", ";}"], makeSize(BASEINPUT_WRAPPER_MIN_HEIGHT), makeSize(BASEINPUT_WRAPPER_MAX_HEIGHT));
|
|
22
|
-
var collapseAnimation = /*#__PURE__*/keyframes(["from{max-height:", ";}to{max-height:", ";}"], makeSize(BASEINPUT_WRAPPER_MAX_HEIGHT), makeSize(BASEINPUT_WRAPPER_MIN_HEIGHT));
|
|
23
|
-
var expandTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], expandAnimation, makeMotionTime(motion.duration.quick), String(motion.easing.entrance.effective));
|
|
24
|
-
var collapseTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], collapseAnimation, makeMotionTime(motion.duration.quick), String(motion.easing.exit.effective));
|
|
25
|
-
var noTransition = /*#__PURE__*/css(["animation:none;"]);
|
|
26
20
|
var StyledBaseInputWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
27
21
|
displayName: "AnimatedBaseInputWrapperweb__StyledBaseInputWrapper",
|
|
28
22
|
componentId: "e1vobd-0"
|
|
@@ -56,36 +50,30 @@ var StyledBaseInputWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
56
50
|
}))
|
|
57
51
|
});
|
|
58
52
|
});
|
|
59
|
-
var getMaxHeight = function getMaxHeight(_ref) {
|
|
60
|
-
var maxTagRows = _ref.maxTagRows,
|
|
61
|
-
showAllTags = _ref.showAllTags;
|
|
62
|
-
if (maxTagRows === 'single') {
|
|
63
|
-
return BASEINPUT_WRAPPER_MIN_HEIGHT;
|
|
64
|
-
}
|
|
65
|
-
if (maxTagRows === 'multiple') {
|
|
66
|
-
return BASEINPUT_WRAPPER_MAX_HEIGHT;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
// In expandable, max-height depends on the state
|
|
70
|
-
return showAllTags ? BASEINPUT_WRAPPER_MAX_HEIGHT : BASEINPUT_WRAPPER_MIN_HEIGHT;
|
|
71
|
-
};
|
|
72
53
|
|
|
73
54
|
// Styled component with animation
|
|
74
55
|
var StyledAnimatedBaseInputWrapper = /*#__PURE__*/styled(StyledBaseInputWrapper).withConfig({
|
|
75
56
|
displayName: "AnimatedBaseInputWrapperweb__StyledAnimatedBaseInputWrapper",
|
|
76
57
|
componentId: "e1vobd-1"
|
|
77
58
|
})(function (props) {
|
|
78
|
-
return props.isDropdownTrigger ? css(["", ";max-height:", ";"], props.transition, makeSize(
|
|
59
|
+
return props.isDropdownTrigger ? css(["", ";max-height:", ";"], props.transition, makeSize(getAnimatedBaseInputWrapperMaxHeight({
|
|
79
60
|
maxTagRows: props.maxTagRows,
|
|
80
|
-
showAllTags: props.showAllTags
|
|
61
|
+
showAllTags: props.showAllTags,
|
|
62
|
+
size: props.size
|
|
81
63
|
}))) : undefined;
|
|
82
64
|
});
|
|
83
|
-
var _AnimatedBaseInputWrapper = function _AnimatedBaseInputWrapper(
|
|
84
|
-
var showAllTags =
|
|
85
|
-
setShowAllTagsWithAnimation =
|
|
86
|
-
maxTagRows =
|
|
87
|
-
isDropdownTrigger =
|
|
88
|
-
rest = _objectWithoutProperties(
|
|
65
|
+
var _AnimatedBaseInputWrapper = function _AnimatedBaseInputWrapper(_ref, ref) {
|
|
66
|
+
var showAllTags = _ref.showAllTags,
|
|
67
|
+
setShowAllTagsWithAnimation = _ref.setShowAllTagsWithAnimation,
|
|
68
|
+
maxTagRows = _ref.maxTagRows,
|
|
69
|
+
isDropdownTrigger = _ref.isDropdownTrigger,
|
|
70
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
71
|
+
// Define the animation keyframes
|
|
72
|
+
var expandAnimation = /*#__PURE__*/keyframes(["from{max-height:", ";}to{max-height:", ";}"], makeSize(baseInputHeight[rest.size]), makeSize(baseInputWrapperMaxHeight[rest.size]));
|
|
73
|
+
var collapseAnimation = /*#__PURE__*/keyframes(["from{max-height:", ";}to{max-height:", ";}"], makeSize(baseInputWrapperMaxHeight[rest.size]), makeSize(baseInputHeight[rest.size]));
|
|
74
|
+
var expandTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], expandAnimation, makeMotionTime(motion.duration.quick), String(motion.easing.entrance.effective));
|
|
75
|
+
var collapseTransition = /*#__PURE__*/css(["animation:", " ", " ", ";"], collapseAnimation, makeMotionTime(motion.duration.quick), String(motion.easing.exit.effective));
|
|
76
|
+
var noTransition = /*#__PURE__*/css(["animation:none;"]);
|
|
89
77
|
return /*#__PURE__*/jsx(StyledAnimatedBaseInputWrapper
|
|
90
78
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
91
79
|
, _objectSpread(_objectSpread({
|
|
@@ -97,9 +85,7 @@ var _AnimatedBaseInputWrapper = function _AnimatedBaseInputWrapper(_ref2, ref) {
|
|
|
97
85
|
maxTagRows: maxTagRows,
|
|
98
86
|
onAnimationEnd: function onAnimationEnd(e) {
|
|
99
87
|
if (!showAllTags && e.animationName === collapseAnimation.getName()) {
|
|
100
|
-
|
|
101
|
-
}
|
|
102
|
-
if (maxTagRows !== 'expandable' && !showAllTags) {
|
|
88
|
+
// Triggered for the collapse animation
|
|
103
89
|
setShowAllTagsWithAnimation === null || setShowAllTagsWithAnimation === void 0 ? void 0 : setShowAllTagsWithAnimation(false);
|
|
104
90
|
}
|
|
105
91
|
}
|
|
@@ -107,5 +93,5 @@ var _AnimatedBaseInputWrapper = function _AnimatedBaseInputWrapper(_ref2, ref) {
|
|
|
107
93
|
};
|
|
108
94
|
var AnimatedBaseInputWrapper = /*#__PURE__*/React__default.forwardRef(_AnimatedBaseInputWrapper);
|
|
109
95
|
|
|
110
|
-
export { AnimatedBaseInputWrapper
|
|
96
|
+
export { AnimatedBaseInputWrapper };
|
|
111
97
|
//# sourceMappingURL=AnimatedBaseInputWrapper.web.js.map
|
package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedBaseInputWrapper.web.js","sources":["../../../../../../../src/components/Input/BaseInput/AnimatedBaseInputWrapper.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { BaseInputWrapperProps } from './types';\nimport { getInputBackgroundAndBorderStyles } from './baseInputStyles';\nimport { BASEINPUT_WRAPPER_MIN_HEIGHT, BASEINPUT_WRAPPER_MAX_HEIGHT } from './baseInputConfig';\nimport BaseBox from '~components/Box/BaseBox';\nimport { motion } from '~tokens/global';\nimport { castWebType, makeMotionTime, makeSize } from '~utils';\nimport type { BladeElementRef } from '~utils/types';\n\n// Define the animation keyframes\nconst expandAnimation = keyframes`\n from {\n max-height: ${makeSize(BASEINPUT_WRAPPER_MIN_HEIGHT)};\n }\n to {\n max-height: ${makeSize(BASEINPUT_WRAPPER_MAX_HEIGHT)};\n }\n`;\n\nconst collapseAnimation = keyframes`\n from {\n max-height: ${makeSize(BASEINPUT_WRAPPER_MAX_HEIGHT)};\n }\n to {\n max-height: ${makeSize(BASEINPUT_WRAPPER_MIN_HEIGHT)};\n }\n`;\n\nconst expandTransition = css`\n animation: ${expandAnimation} ${makeMotionTime(motion.duration.quick)}\n ${String(motion.easing.entrance.effective)};\n`;\n\nconst collapseTransition = css`\n animation: ${collapseAnimation} ${makeMotionTime(motion.duration.quick)}\n ${String(motion.easing.exit.effective)};\n`;\n\nconst noTransition = css`\n animation: none;\n`;\n\nconst StyledBaseInputWrapper = styled(BaseBox)<\n Pick<\n BaseInputWrapperProps,\n 'currentInteraction' | 'isDisabled' | 'validationState' | 'isTextArea' | 'isDropdownTrigger'\n >\n>((props) => ({\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isTextArea: props.isTextArea,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n '&:hover': {\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isHovered: true,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n transitionProperty: 'background-color',\n transitionDuration: castWebType(makeMotionTime(props.theme.motion.duration.xquick)),\n transitionTimingFunction: castWebType(props.theme.motion.easing.standard.effective),\n },\n ':focus-within': {\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n },\n}));\n\nconst getMaxHeight = ({\n maxTagRows,\n showAllTags,\n}: Pick<BaseInputWrapperProps, 'maxTagRows' | 'showAllTags'>): number => {\n if (maxTagRows === 'single') {\n return BASEINPUT_WRAPPER_MIN_HEIGHT;\n }\n\n if (maxTagRows === 'multiple') {\n return BASEINPUT_WRAPPER_MAX_HEIGHT;\n }\n\n // In expandable, max-height depends on the state\n return showAllTags ? BASEINPUT_WRAPPER_MAX_HEIGHT : BASEINPUT_WRAPPER_MIN_HEIGHT;\n};\n\n// Styled component with animation\nconst StyledAnimatedBaseInputWrapper = styled(StyledBaseInputWrapper)<{\n transition?: FlattenSimpleInterpolation;\n maxTagRows: BaseInputWrapperProps['maxTagRows'];\n showAllTags: BaseInputWrapperProps['showAllTags'];\n isDropdownTrigger: BaseInputWrapperProps['isDropdownTrigger'];\n}>((props) =>\n props.isDropdownTrigger\n ? css`\n ${props.transition};\n max-height: ${makeSize(\n getMaxHeight({ maxTagRows: props.maxTagRows, showAllTags: props.showAllTags }),\n )};\n `\n : undefined,\n);\n\nconst _AnimatedBaseInputWrapper: React.ForwardRefRenderFunction<\n BladeElementRef,\n BaseInputWrapperProps & {\n showAllTags?: boolean;\n }\n> = (\n { showAllTags, setShowAllTagsWithAnimation, maxTagRows, isDropdownTrigger, ...rest },\n ref,\n): React.ReactElement => {\n return (\n <StyledAnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n {...rest}\n transition={\n maxTagRows !== 'expandable'\n ? noTransition\n : showAllTags\n ? expandTransition\n : collapseTransition\n }\n isDropdownTrigger={isDropdownTrigger}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n onAnimationEnd={(e) => {\n if (!showAllTags && e.animationName === collapseAnimation.getName()) {\n setShowAllTagsWithAnimation?.(false);\n }\n\n if (maxTagRows !== 'expandable' && !showAllTags) {\n setShowAllTagsWithAnimation?.(false);\n }\n }}\n />\n );\n};\n\nconst AnimatedBaseInputWrapper = React.forwardRef(_AnimatedBaseInputWrapper);\n\nexport { AnimatedBaseInputWrapper, expandAnimation, collapseAnimation };\n"],"names":["expandAnimation","keyframes","makeSize","BASEINPUT_WRAPPER_MIN_HEIGHT","BASEINPUT_WRAPPER_MAX_HEIGHT","collapseAnimation","expandTransition","css","makeMotionTime","motion","duration","quick","String","easing","entrance","effective","collapseTransition","exit","noTransition","StyledBaseInputWrapper","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getInputBackgroundAndBorderStyles","theme","isFocused","currentInteraction","isDisabled","validationState","isTextArea","isDropdownTrigger","isHovered","transitionProperty","transitionDuration","castWebType","xquick","transitionTimingFunction","standard","getMaxHeight","_ref","maxTagRows","showAllTags","StyledAnimatedBaseInputWrapper","transition","undefined","_AnimatedBaseInputWrapper","_ref2","ref","setShowAllTagsWithAnimation","rest","_objectWithoutProperties","_excluded","_jsx","onAnimationEnd","e","animationName","getName","AnimatedBaseInputWrapper","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAWA;AACA,IAAMA,eAAe,gBAAGC,SAAS,CAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,EAEfC,QAAQ,CAACC,4BAA4B,CAAC,EAGtCD,QAAQ,CAACE,4BAA4B,CAAC,EAEvD;AAED,IAAMC,iBAAiB,gBAAGJ,SAAS,CAAA,CAAA,kBAAA,EAAA,kBAAA,EAAA,IAAA,CAAA,EAEjBC,QAAQ,CAACE,4BAA4B,CAAC,EAGtCF,QAAQ,CAACC,4BAA4B,CAAC,EAEvD;AAED,IAAMG,gBAAgB,gBAAGC,GAAG,CACbP,CAAAA,YAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,CAAAA,EAAAA,eAAe,EAAIQ,cAAc,CAACC,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EACjEC,MAAM,CAACH,MAAM,CAACI,MAAM,CAACC,QAAQ,CAACC,SAAS,CAAC,CAC7C,CAAA;AAED,IAAMC,kBAAkB,gBAAGT,GAAG,CACfF,CAAAA,YAAAA,EAAAA,GAAAA,EAAAA,GAAAA,EAAAA,GAAAA,CAAAA,EAAAA,iBAAiB,EAAIG,cAAc,CAACC,MAAM,CAACC,QAAQ,CAACC,KAAK,CAAC,EACnEC,MAAM,CAACH,MAAM,CAACI,MAAM,CAACI,IAAI,CAACF,SAAS,CAAC,CACz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AG,KAAK,CAAC,CAAA;AACtC,OAAA;AACF,KAAA;AAAE,GAAA,CACH,CAAC,CAAA;AAEN,CAAC,CAAA;AAED,IAAMS,wBAAwB,gBAAGC,cAAK,CAACC,UAAU,CAACd,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"AnimatedBaseInputWrapper.web.js","sources":["../../../../../../../src/components/Input/BaseInput/AnimatedBaseInputWrapper.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { BaseInputWrapperProps } from './types';\nimport {\n getAnimatedBaseInputWrapperMaxHeight,\n getInputBackgroundAndBorderStyles,\n} from './baseInputStyles';\nimport { baseInputHeight, baseInputWrapperMaxHeight } from './baseInputTokens';\nimport BaseBox from '~components/Box/BaseBox';\nimport { motion } from '~tokens/global';\nimport { castWebType, makeMotionTime, makeSize } from '~utils';\nimport type { BladeElementRef } from '~utils/types';\n\nconst StyledBaseInputWrapper = styled(BaseBox)<\n Pick<\n BaseInputWrapperProps,\n | 'currentInteraction'\n | 'isDisabled'\n | 'validationState'\n | 'isTextArea'\n | 'isDropdownTrigger'\n | 'maxTagRows'\n >\n>((props) => ({\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isTextArea: props.isTextArea,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n '&:hover': {\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isHovered: true,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n transitionProperty: 'background-color',\n transitionDuration: castWebType(makeMotionTime(props.theme.motion.duration.xquick)),\n transitionTimingFunction: castWebType(props.theme.motion.easing.standard.effective),\n },\n ':focus-within': {\n ...getInputBackgroundAndBorderStyles({\n theme: props.theme,\n isFocused: props.currentInteraction === 'focus',\n isDisabled: props.isDisabled,\n validationState: props.validationState,\n isDropdownTrigger: props.isDropdownTrigger,\n }),\n },\n}));\n\n// Styled component with animation\nconst StyledAnimatedBaseInputWrapper = styled(StyledBaseInputWrapper)<{\n transition?: FlattenSimpleInterpolation;\n maxTagRows: BaseInputWrapperProps['maxTagRows'];\n showAllTags: BaseInputWrapperProps['showAllTags'];\n isDropdownTrigger: BaseInputWrapperProps['isDropdownTrigger'];\n size: NonNullable<BaseInputWrapperProps['size']>;\n}>((props) =>\n props.isDropdownTrigger\n ? css`\n ${props.transition};\n max-height: ${makeSize(\n getAnimatedBaseInputWrapperMaxHeight({\n maxTagRows: props.maxTagRows,\n showAllTags: props.showAllTags,\n size: props.size,\n }),\n )};\n `\n : undefined,\n);\n\nconst _AnimatedBaseInputWrapper: React.ForwardRefRenderFunction<\n BladeElementRef,\n BaseInputWrapperProps & {\n showAllTags?: boolean;\n }\n> = (\n { showAllTags, setShowAllTagsWithAnimation, maxTagRows, isDropdownTrigger, ...rest },\n ref,\n): React.ReactElement => {\n // Define the animation keyframes\n const expandAnimation = keyframes`\nfrom {\n max-height: ${makeSize(baseInputHeight[rest.size])};\n}\nto {\n max-height: ${makeSize(baseInputWrapperMaxHeight[rest.size])};\n}\n`;\n\n const collapseAnimation = keyframes`\nfrom {\n max-height: ${makeSize(baseInputWrapperMaxHeight[rest.size])};\n}\nto {\n max-height: ${makeSize(baseInputHeight[rest.size])};\n}\n`;\n\n const expandTransition = css`\n animation: ${expandAnimation} ${makeMotionTime(motion.duration.quick)}\n ${String(motion.easing.entrance.effective)};\n `;\n\n const collapseTransition = css`\n animation: ${collapseAnimation} ${makeMotionTime(motion.duration.quick)}\n ${String(motion.easing.exit.effective)};\n `;\n\n const noTransition = css`\n animation: none;\n `;\n return (\n <StyledAnimatedBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n {...rest}\n transition={\n maxTagRows !== 'expandable'\n ? noTransition\n : showAllTags\n ? expandTransition\n : collapseTransition\n }\n isDropdownTrigger={isDropdownTrigger}\n showAllTags={showAllTags}\n maxTagRows={maxTagRows}\n onAnimationEnd={(e) => {\n if (!showAllTags && e.animationName === collapseAnimation.getName()) {\n // Triggered for the collapse animation\n setShowAllTagsWithAnimation?.(false);\n }\n }}\n />\n );\n};\n\nconst AnimatedBaseInputWrapper = React.forwardRef(_AnimatedBaseInputWrapper);\n\nexport { AnimatedBaseInputWrapper };\n"],"names":["StyledBaseInputWrapper","styled","BaseBox","withConfig","displayName","componentId","props","_objectSpread","getInputBackgroundAndBorderStyles","theme","isFocused","currentInteraction","isDisabled","validationState","isTextArea","isDropdownTrigger","isHovered","transitionProperty","transitionDuration","castWebType","makeMotionTime","motion","duration","xquick","transitionTimingFunction","easing","standard","effective","StyledAnimatedBaseInputWrapper","css","transition","makeSize","getAnimatedBaseInputWrapperMaxHeight","maxTagRows","showAllTags","size","undefined","_AnimatedBaseInputWrapper","_ref","ref","setShowAllTagsWithAnimation","rest","_objectWithoutProperties","_excluded","expandAnimation","keyframes","baseInputHeight","baseInputWrapperMaxHeight","collapseAnimation","expandTransition","quick","String","entrance","collapseTransition","exit","noTransition","_jsx","onAnimationEnd","e","animationName","getName","AnimatedBaseInputWrapper","React","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;;;AAcA,IAAMA,sBAAsB,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,qDAAA;EAAAC,WAAA,EAAA,UAAA;AAAA,CAAA,CAAA,CAU5C,UAACC,KAAK,EAAA;AAAA,EAAA,OAAAC,aAAA,CAAAA,aAAA,CAAA,EAAA,EACHC,iCAAiC,CAAC;IACnCC,KAAK,EAAEH,KAAK,CAACG,KAAK;AAClBC,IAAAA,SAAS,EAAEJ,KAAK,CAACK,kBAAkB,KAAK,OAAO;IAC/CC,UAAU,EAAEN,KAAK,CAACM,UAAU;IAC5BC,eAAe,EAAEP,KAAK,CAACO,eAAe;I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BAA2B,CAAG,KAAK,CAAC,CAAA;AACtC,OAAA;AACF,KAAA;AAAE,GAAA,CACH,CAAC,CAAA;AAEN,CAAC,CAAA;AAED,IAAMqB,wBAAwB,gBAAGC,cAAK,CAACC,UAAU,CAAC1B,yBAAyB;;;;"}
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
1
|
import _objectWithoutProperties from '@babel/runtime/helpers/objectWithoutProperties';
|
|
2
|
+
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
3
3
|
import _slicedToArray from '@babel/runtime/helpers/slicedToArray';
|
|
4
4
|
import React__default from 'react';
|
|
5
|
+
import styled from 'styled-components';
|
|
5
6
|
import { StyledBaseInput } from './StyledBaseInput.web.js';
|
|
6
7
|
import { BaseInputVisuals } from './BaseInputVisuals.js';
|
|
7
8
|
import { BaseInputWrapper } from './BaseInputWrapper.js';
|
|
8
9
|
import { BaseInputTagSlot } from './BaseInputTagSlot.web.js';
|
|
10
|
+
import { baseInputBorderBackgroundMotion, formHintLeftLabelMarginLeft } from './baseInputTokens.js';
|
|
9
11
|
import '../../Form/index.js';
|
|
10
12
|
import '../../Box/BaseBox/index.js';
|
|
11
13
|
import '../../Box/styledProps/index.js';
|
|
@@ -19,14 +21,20 @@ import '../../../utils/makeAccessible/index.js';
|
|
|
19
21
|
import '../../../utils/logger/index.js';
|
|
20
22
|
import { announce } from '../../LiveAnnouncer/LiveAnnouncer.web.js';
|
|
21
23
|
import '../../../utils/assignWithoutSideEffects/index.js';
|
|
24
|
+
import '../../../utils/getFocusRingStyles/index.js';
|
|
25
|
+
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
22
26
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
23
27
|
import { throwBladeError } from '../../../utils/logger/logger.js';
|
|
24
28
|
import { getPlatformType } from '../../../utils/getPlatformType/getPlatformType.js';
|
|
25
29
|
import { isReactNative } from '../../../utils/platform/isReactNative.js';
|
|
30
|
+
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
31
|
+
import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
|
|
32
|
+
import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.web.js';
|
|
33
|
+
import { castWebType } from '../../../utils/platform/castUtils.js';
|
|
34
|
+
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
26
35
|
import useTheme from '../../BladeProvider/useTheme.js';
|
|
27
36
|
import { useBreakpoint } from '../../../utils/useBreakpoint/useBreakpoint.js';
|
|
28
37
|
import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.web.js';
|
|
29
|
-
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
30
38
|
import { metaAttribute } from '../../../utils/metaAttribute/metaAttribute.web.js';
|
|
31
39
|
import { getStyledProps } from '../../Box/styledProps/getStyledProps.js';
|
|
32
40
|
import { FormLabel } from '../../Form/FormLabel.js';
|
|
@@ -35,7 +43,7 @@ import { makeSize } from '../../../utils/makeSize/makeSize.js';
|
|
|
35
43
|
import { FormHint } from '../../Form/FormHint.js';
|
|
36
44
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
37
45
|
|
|
38
|
-
var _excluded = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "tags", "showAllTags", "activeTagIndex", "setActiveTagIndex", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "maxTagRows", "shouldIgnoreBlurAnimation", "setShouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID", "isDropdownTrigger", "isLabelInsideInput"];
|
|
46
|
+
var _excluded = ["as", "label", "labelPosition", "placeholder", "type", "defaultValue", "tags", "showAllTags", "activeTagIndex", "setActiveTagIndex", "name", "value", "onFocus", "onChange", "onInput", "onBlur", "onSubmit", "onClick", "onKeyDown", "isDisabled", "necessityIndicator", "validationState", "errorText", "helpText", "successText", "isRequired", "leadingIcon", "prefix", "interactionElement", "suffix", "trailingIcon", "maxCharacters", "textAlign", "autoFocus", "keyboardReturnKeyType", "keyboardType", "autoCompleteSuggestionType", "trailingHeaderSlot", "trailingFooterSlot", "numberOfLines", "id", "componentName", "accessibilityLabel", "labelId", "activeDescendant", "hideLabelText", "hideFormHint", "hasPopup", "popupId", "isPopupExpanded", "maxTagRows", "shouldIgnoreBlurAnimation", "setShouldIgnoreBlurAnimation", "autoCapitalize", "setInputWrapperRef", "testID", "isDropdownTrigger", "isLabelInsideInput", "size", "trailingButton", "valueComponentType"];
|
|
39
47
|
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; }
|
|
40
48
|
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; }
|
|
41
49
|
var autoCompleteSuggestionTypeValues = ['none', 'on', 'name', 'email', 'username', 'password', 'newPassword', 'oneTimeCode', 'telephone', 'postalCode', 'countryName', 'creditCardNumber', 'creditCardCSC', 'creditCardExpiry', 'creditCardExpiryMonth', 'creditCardExpiryYear'];
|
|
@@ -272,71 +280,93 @@ var getDescribedByElementId = function getDescribedByElementId(_ref10) {
|
|
|
272
280
|
}
|
|
273
281
|
return '';
|
|
274
282
|
};
|
|
275
|
-
var
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
283
|
+
var FocusRingWrapper = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
284
|
+
displayName: "BaseInput__FocusRingWrapper",
|
|
285
|
+
componentId: "sc-177qd3e-0"
|
|
286
|
+
})(function (_ref11) {
|
|
287
|
+
var theme = _ref11.theme,
|
|
288
|
+
currentInteraction = _ref11.currentInteraction;
|
|
289
|
+
return {
|
|
290
|
+
borderRadius: makeBorderSize(theme.border.radius.medium),
|
|
291
|
+
width: '100%',
|
|
292
|
+
'&:focus-within': _objectSpread(_objectSpread({}, getFocusRingStyles({
|
|
293
|
+
theme: theme
|
|
294
|
+
})), {}, {
|
|
295
|
+
transitionDuration: castWebType(makeMotionTime(getIn(theme.motion.duration, baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit'].duration))),
|
|
296
|
+
transitionTimingFunction: castWebType(getIn(theme.motion.easing, baseInputBorderBackgroundMotion[currentInteraction === 'focus' ? 'enter' : 'exit'].easing))
|
|
297
|
+
})
|
|
298
|
+
};
|
|
299
|
+
});
|
|
300
|
+
var _BaseInput = function _BaseInput(_ref12, ref) {
|
|
301
|
+
var _ref12$as = _ref12.as,
|
|
302
|
+
as = _ref12$as === void 0 ? 'input' : _ref12$as,
|
|
303
|
+
label = _ref12.label,
|
|
304
|
+
_ref12$labelPosition = _ref12.labelPosition,
|
|
305
|
+
labelPosition = _ref12$labelPosition === void 0 ? 'top' : _ref12$labelPosition,
|
|
306
|
+
placeholder = _ref12.placeholder,
|
|
307
|
+
_ref12$type = _ref12.type,
|
|
308
|
+
type = _ref12$type === void 0 ? 'text' : _ref12$type,
|
|
309
|
+
defaultValue = _ref12.defaultValue,
|
|
310
|
+
tags = _ref12.tags,
|
|
311
|
+
_ref12$showAllTags = _ref12.showAllTags,
|
|
312
|
+
showAllTags = _ref12$showAllTags === void 0 ? false : _ref12$showAllTags,
|
|
313
|
+
_ref12$activeTagIndex = _ref12.activeTagIndex,
|
|
314
|
+
activeTagIndex = _ref12$activeTagIndex === void 0 ? -1 : _ref12$activeTagIndex,
|
|
315
|
+
setActiveTagIndex = _ref12.setActiveTagIndex,
|
|
316
|
+
name = _ref12.name,
|
|
317
|
+
value = _ref12.value,
|
|
318
|
+
onFocus = _ref12.onFocus,
|
|
319
|
+
onChange = _ref12.onChange,
|
|
320
|
+
onInput = _ref12.onInput,
|
|
321
|
+
onBlur = _ref12.onBlur,
|
|
322
|
+
onSubmit = _ref12.onSubmit,
|
|
323
|
+
onClick = _ref12.onClick,
|
|
324
|
+
onKeyDown = _ref12.onKeyDown,
|
|
325
|
+
isDisabled = _ref12.isDisabled,
|
|
326
|
+
necessityIndicator = _ref12.necessityIndicator,
|
|
327
|
+
validationState = _ref12.validationState,
|
|
328
|
+
errorText = _ref12.errorText,
|
|
329
|
+
helpText = _ref12.helpText,
|
|
330
|
+
successText = _ref12.successText,
|
|
331
|
+
isRequired = _ref12.isRequired,
|
|
332
|
+
leadingIcon = _ref12.leadingIcon,
|
|
333
|
+
prefix = _ref12.prefix,
|
|
334
|
+
interactionElement = _ref12.interactionElement,
|
|
335
|
+
suffix = _ref12.suffix,
|
|
336
|
+
trailingIcon = _ref12.trailingIcon,
|
|
337
|
+
maxCharacters = _ref12.maxCharacters,
|
|
338
|
+
textAlign = _ref12.textAlign,
|
|
339
|
+
autoFocus = _ref12.autoFocus,
|
|
340
|
+
keyboardReturnKeyType = _ref12.keyboardReturnKeyType,
|
|
341
|
+
keyboardType = _ref12.keyboardType,
|
|
342
|
+
autoCompleteSuggestionType = _ref12.autoCompleteSuggestionType,
|
|
343
|
+
trailingHeaderSlot = _ref12.trailingHeaderSlot,
|
|
344
|
+
trailingFooterSlot = _ref12.trailingFooterSlot,
|
|
345
|
+
numberOfLines = _ref12.numberOfLines,
|
|
346
|
+
id = _ref12.id,
|
|
347
|
+
componentName = _ref12.componentName,
|
|
348
|
+
accessibilityLabel = _ref12.accessibilityLabel,
|
|
349
|
+
labelId = _ref12.labelId,
|
|
350
|
+
activeDescendant = _ref12.activeDescendant,
|
|
351
|
+
hideLabelText = _ref12.hideLabelText,
|
|
352
|
+
hideFormHint = _ref12.hideFormHint,
|
|
353
|
+
hasPopup = _ref12.hasPopup,
|
|
354
|
+
popupId = _ref12.popupId,
|
|
355
|
+
isPopupExpanded = _ref12.isPopupExpanded,
|
|
356
|
+
maxTagRows = _ref12.maxTagRows,
|
|
357
|
+
shouldIgnoreBlurAnimation = _ref12.shouldIgnoreBlurAnimation,
|
|
358
|
+
setShouldIgnoreBlurAnimation = _ref12.setShouldIgnoreBlurAnimation,
|
|
359
|
+
autoCapitalize = _ref12.autoCapitalize,
|
|
360
|
+
setInputWrapperRef = _ref12.setInputWrapperRef,
|
|
361
|
+
testID = _ref12.testID,
|
|
362
|
+
isDropdownTrigger = _ref12.isDropdownTrigger,
|
|
363
|
+
isLabelInsideInput = _ref12.isLabelInsideInput,
|
|
364
|
+
_ref12$size = _ref12.size,
|
|
365
|
+
size = _ref12$size === void 0 ? 'medium' : _ref12$size,
|
|
366
|
+
trailingButton = _ref12.trailingButton,
|
|
367
|
+
_ref12$valueComponent = _ref12.valueComponentType,
|
|
368
|
+
valueComponentType = _ref12$valueComponent === void 0 ? 'text' : _ref12$valueComponent,
|
|
369
|
+
styledProps = _objectWithoutProperties(_ref12, _excluded);
|
|
340
370
|
var _useTheme = useTheme(),
|
|
341
371
|
theme = _useTheme.theme;
|
|
342
372
|
var inputWrapperRef = React__default.useRef(null);
|
|
@@ -351,8 +381,10 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
|
|
|
351
381
|
React__default.useEffect(function () {
|
|
352
382
|
if (showAllTags) {
|
|
353
383
|
setShowAllTagsWithAnimation(true);
|
|
384
|
+
} else if (maxTagRows !== 'expandable') {
|
|
385
|
+
setShowAllTagsWithAnimation(false);
|
|
354
386
|
}
|
|
355
|
-
}, [showAllTags]);
|
|
387
|
+
}, [showAllTags, maxTagRows]);
|
|
356
388
|
var _useInput = useInput({
|
|
357
389
|
defaultValue: defaultValue,
|
|
358
390
|
value: value,
|
|
@@ -440,105 +472,117 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
|
|
|
440
472
|
position: labelPosition,
|
|
441
473
|
id: labelId,
|
|
442
474
|
htmlFor: inputId,
|
|
475
|
+
size: size,
|
|
443
476
|
children: label
|
|
444
477
|
}), trailingHeaderSlot === null || trailingHeaderSlot === void 0 ? void 0 : trailingHeaderSlot(value !== null && value !== void 0 ? value : inputValue)]
|
|
445
|
-
}), /*#__PURE__*/
|
|
446
|
-
isDropdownTrigger: isDropdownTrigger,
|
|
447
|
-
isTextArea: isTextArea,
|
|
448
|
-
isDisabled: isDisabled,
|
|
449
|
-
validationState: validationState,
|
|
478
|
+
}), /*#__PURE__*/jsx(FocusRingWrapper, {
|
|
450
479
|
currentInteraction: currentInteraction,
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
ref: function ref(refNode) {
|
|
455
|
-
if (refNode) {
|
|
456
|
-
setInputWrapperRef === null || setInputWrapperRef === void 0 ? void 0 : setInputWrapperRef(refNode);
|
|
457
|
-
inputWrapperRef.current = refNode;
|
|
458
|
-
}
|
|
459
|
-
},
|
|
460
|
-
maxTagRows: maxTagRows,
|
|
461
|
-
children: [/*#__PURE__*/jsx(BaseInputVisuals, {
|
|
462
|
-
leadingIcon: leadingIcon,
|
|
463
|
-
prefix: prefix,
|
|
464
|
-
isDisabled: isDisabled
|
|
465
|
-
}), /*#__PURE__*/jsx(BaseInputTagSlot, {
|
|
466
|
-
renderAs: as,
|
|
467
|
-
tags: tags,
|
|
480
|
+
children: /*#__PURE__*/jsxs(BaseInputWrapper, {
|
|
481
|
+
isDropdownTrigger: isDropdownTrigger,
|
|
482
|
+
isTextArea: isTextArea,
|
|
468
483
|
isDisabled: isDisabled,
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
484
|
+
validationState: validationState,
|
|
485
|
+
currentInteraction: currentInteraction,
|
|
486
|
+
isLabelLeftPositioned: isLabelLeftPositioned,
|
|
487
|
+
showAllTags: showAllTags,
|
|
488
|
+
setShowAllTagsWithAnimation: setShowAllTagsWithAnimation,
|
|
489
|
+
ref: function ref(refNode) {
|
|
490
|
+
if (refNode) {
|
|
491
|
+
setInputWrapperRef === null || setInputWrapperRef === void 0 ? void 0 : setInputWrapperRef(refNode);
|
|
492
|
+
inputWrapperRef.current = refNode;
|
|
474
493
|
}
|
|
475
494
|
},
|
|
476
|
-
labelPrefix: isLabelInsideInput ? label : undefined,
|
|
477
|
-
isDropdownTrigger: isDropdownTrigger,
|
|
478
|
-
visibleTagsCountRef: visibleTagsCountRef,
|
|
479
|
-
handleOnInputClick: function handleOnInputClick(e) {
|
|
480
|
-
handleOnClick({
|
|
481
|
-
name: name,
|
|
482
|
-
value: isReactNative ? value : e
|
|
483
|
-
});
|
|
484
|
-
},
|
|
485
|
-
setShouldIgnoreBlurAnimation: setShouldIgnoreBlurAnimation,
|
|
486
495
|
maxTagRows: maxTagRows,
|
|
487
|
-
|
|
488
|
-
children: /*#__PURE__*/jsx(
|
|
489
|
-
|
|
490
|
-
id: inputId,
|
|
491
|
-
ref: ref,
|
|
492
|
-
name: name,
|
|
493
|
-
type: type,
|
|
494
|
-
defaultValue: defaultValue,
|
|
495
|
-
value: value,
|
|
496
|
-
placeholder: placeholder,
|
|
497
|
-
isDisabled: isDisabled,
|
|
498
|
-
validationState: validationState,
|
|
499
|
-
isRequired: _isRequired,
|
|
500
|
-
handleOnFocus: handleOnFocus,
|
|
501
|
-
handleOnChange: handleOnChange,
|
|
502
|
-
handleOnBlur: handleOnBlur,
|
|
503
|
-
handleOnSubmit: handleOnSubmit,
|
|
504
|
-
handleOnInput: handleOnInput,
|
|
505
|
-
handleOnKeyDown: handleOnKeyDown,
|
|
506
|
-
handleOnClick: handleOnClick,
|
|
496
|
+
size: size,
|
|
497
|
+
children: [/*#__PURE__*/jsx(BaseInputVisuals, {
|
|
498
|
+
size: size,
|
|
507
499
|
leadingIcon: leadingIcon,
|
|
508
500
|
prefix: prefix,
|
|
501
|
+
isDisabled: isDisabled
|
|
502
|
+
}), /*#__PURE__*/jsx(BaseInputTagSlot, {
|
|
503
|
+
renderAs: as,
|
|
504
|
+
tags: tags,
|
|
505
|
+
isDisabled: isDisabled,
|
|
506
|
+
showAllTags: showAllTagsWithAnimation,
|
|
507
|
+
setFocusOnInput: function setFocusOnInput() {
|
|
508
|
+
if (ref && !isReactNative && 'current' in ref) {
|
|
509
|
+
var _ref$current;
|
|
510
|
+
(_ref$current = ref.current) === null || _ref$current === void 0 ? void 0 : _ref$current.focus();
|
|
511
|
+
}
|
|
512
|
+
},
|
|
513
|
+
labelPrefix: isLabelInsideInput ? label : undefined,
|
|
514
|
+
isDropdownTrigger: isDropdownTrigger,
|
|
515
|
+
visibleTagsCountRef: visibleTagsCountRef,
|
|
516
|
+
handleOnInputClick: function handleOnInputClick(e) {
|
|
517
|
+
handleOnClick({
|
|
518
|
+
name: name,
|
|
519
|
+
value: isReactNative ? value : e
|
|
520
|
+
});
|
|
521
|
+
},
|
|
522
|
+
setShouldIgnoreBlurAnimation: setShouldIgnoreBlurAnimation,
|
|
523
|
+
maxTagRows: maxTagRows,
|
|
524
|
+
inputWrapperRef: inputWrapperRef,
|
|
525
|
+
size: size,
|
|
526
|
+
children: /*#__PURE__*/jsx(StyledBaseInput, _objectSpread({
|
|
527
|
+
as: as,
|
|
528
|
+
id: inputId,
|
|
529
|
+
ref: ref,
|
|
530
|
+
name: name,
|
|
531
|
+
type: type,
|
|
532
|
+
defaultValue: defaultValue,
|
|
533
|
+
value: value,
|
|
534
|
+
placeholder: placeholder,
|
|
535
|
+
isDisabled: isDisabled,
|
|
536
|
+
validationState: validationState,
|
|
537
|
+
isRequired: _isRequired,
|
|
538
|
+
handleOnFocus: handleOnFocus,
|
|
539
|
+
handleOnChange: handleOnChange,
|
|
540
|
+
handleOnBlur: handleOnBlur,
|
|
541
|
+
handleOnSubmit: handleOnSubmit,
|
|
542
|
+
handleOnInput: handleOnInput,
|
|
543
|
+
handleOnKeyDown: handleOnKeyDown,
|
|
544
|
+
handleOnClick: handleOnClick,
|
|
545
|
+
leadingIcon: leadingIcon,
|
|
546
|
+
prefix: prefix,
|
|
547
|
+
interactionElement: interactionElement,
|
|
548
|
+
suffix: suffix,
|
|
549
|
+
trailingIcon: trailingIcon,
|
|
550
|
+
maxCharacters: maxCharacters,
|
|
551
|
+
textAlign: textAlign
|
|
552
|
+
// eslint-disable-next-line jsx-a11y/no-autofocus
|
|
553
|
+
,
|
|
554
|
+
autoFocus: autoFocus,
|
|
555
|
+
keyboardReturnKeyType: keyboardReturnKeyType,
|
|
556
|
+
keyboardType: keyboardType,
|
|
557
|
+
autoCompleteSuggestionType: autoCompleteSuggestionType,
|
|
558
|
+
accessibilityProps: accessibilityProps,
|
|
559
|
+
currentInteraction: currentInteraction,
|
|
560
|
+
setCurrentInteraction: setCurrentInteraction,
|
|
561
|
+
numberOfLines: numberOfLines,
|
|
562
|
+
isTextArea: isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable',
|
|
563
|
+
hasPopup: hasPopup,
|
|
564
|
+
hasTags: !!(tags && tags.length > 0),
|
|
565
|
+
shouldIgnoreBlurAnimation: shouldIgnoreBlurAnimation,
|
|
566
|
+
autoCapitalize: autoCapitalize,
|
|
567
|
+
isDropdownTrigger: isDropdownTrigger,
|
|
568
|
+
$size: size,
|
|
569
|
+
valueComponentType: valueComponentType
|
|
570
|
+
}, metaAttribute({
|
|
571
|
+
name: MetaConstants.StyledBaseInput
|
|
572
|
+
})))
|
|
573
|
+
}), /*#__PURE__*/jsx(BaseInputVisuals, {
|
|
509
574
|
interactionElement: interactionElement,
|
|
510
575
|
suffix: suffix,
|
|
511
576
|
trailingIcon: trailingIcon,
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
keyboardType: keyboardType,
|
|
519
|
-
autoCompleteSuggestionType: autoCompleteSuggestionType,
|
|
520
|
-
accessibilityProps: accessibilityProps,
|
|
521
|
-
currentInteraction: currentInteraction,
|
|
522
|
-
setCurrentInteraction: setCurrentInteraction,
|
|
523
|
-
numberOfLines: numberOfLines,
|
|
524
|
-
isTextArea: isTextArea || maxTagRows === 'multiple' || maxTagRows === 'expandable',
|
|
525
|
-
hasPopup: hasPopup,
|
|
526
|
-
hasTags: !!(tags && tags.length > 0),
|
|
527
|
-
shouldIgnoreBlurAnimation: shouldIgnoreBlurAnimation,
|
|
528
|
-
autoCapitalize: autoCapitalize,
|
|
529
|
-
isDropdownTrigger: isDropdownTrigger
|
|
530
|
-
}, metaAttribute({
|
|
531
|
-
name: MetaConstants.StyledBaseInput
|
|
532
|
-
})))
|
|
533
|
-
}), /*#__PURE__*/jsx(BaseInputVisuals, {
|
|
534
|
-
interactionElement: interactionElement,
|
|
535
|
-
suffix: suffix,
|
|
536
|
-
trailingIcon: trailingIcon,
|
|
537
|
-
isDisabled: isDisabled
|
|
538
|
-
})]
|
|
577
|
+
isDisabled: isDisabled,
|
|
578
|
+
validationState: validationState,
|
|
579
|
+
trailingButton: trailingButton,
|
|
580
|
+
size: size
|
|
581
|
+
})]
|
|
582
|
+
})
|
|
539
583
|
})]
|
|
540
584
|
}), !hideFormHint && /*#__PURE__*/jsx(BaseBox, {
|
|
541
|
-
marginLeft: makeSize(isLabelLeftPositioned && !hideLabelText ?
|
|
585
|
+
marginLeft: makeSize(isLabelLeftPositioned && !hideLabelText ? formHintLeftLabelMarginLeft[size] : 0),
|
|
542
586
|
children: /*#__PURE__*/jsxs(BaseBox, {
|
|
543
587
|
display: "flex",
|
|
544
588
|
flexDirection: "row",
|
|
@@ -553,7 +597,8 @@ var _BaseInput = function _BaseInput(_ref11, ref) {
|
|
|
553
597
|
successText: successText,
|
|
554
598
|
helpTextId: helpTextId,
|
|
555
599
|
errorTextId: errorTextId,
|
|
556
|
-
successTextId: successTextId
|
|
600
|
+
successTextId: successTextId,
|
|
601
|
+
size: size
|
|
557
602
|
}), trailingFooterSlot === null || trailingFooterSlot === void 0 ? void 0 : trailingFooterSlot(value !== null && value !== void 0 ? value : inputValue)]
|
|
558
603
|
})
|
|
559
604
|
})]
|