@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
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import styled from 'styled-components/native';
|
|
2
|
-
import Animated, { useSharedValue, useAnimatedStyle, interpolate, withTiming } from 'react-native-reanimated';
|
|
3
|
-
import { useEffect } from 'react';
|
|
4
|
-
import '@gorhom/portal';
|
|
5
|
-
import 'react-native-gesture-handler';
|
|
6
|
-
import useTheme from '../../BladeProvider/useTheme.js';
|
|
7
|
-
import 'react-native';
|
|
8
|
-
import '@babel/runtime/helpers/slicedToArray';
|
|
9
|
-
import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
|
|
10
|
-
import '../../BottomSheet/BottomSheetStack.js';
|
|
11
|
-
import { jsx } from 'react/jsx-runtime';
|
|
12
|
-
|
|
13
|
-
var BaseInputStyledAnimatedBorder=styled(Animated.View)(function(_ref){var theme=_ref.theme;return {position:'absolute',bottom:0,left:0,right:0,opacity:1,backgroundColor:theme.colors.interactive.background.primary.default,height:makeBorderSize(theme.border.width.thin)};});var BaseInputAnimatedBorder=function BaseInputAnimatedBorder(_ref2){var currentInteraction=_ref2.currentInteraction,validationState=_ref2.validationState;var _useTheme=useTheme(),theme=_useTheme.theme;var borderAnimationEasing=theme.motion.easing.standard.effective;var widthTrigger=useSharedValue(0);var opacityTrigger=useSharedValue(1);var animatedStyle=useAnimatedStyle(function(){return {width:`${interpolate(widthTrigger.value,[0,1],[0,100])}%`,opacity:interpolate(opacityTrigger.value,[0,1],[0,1])};});useEffect(function(){if(currentInteraction=='focus'&&validationState!=='error'&&validationState!=='success'){widthTrigger.value=0;opacityTrigger.value=1;widthTrigger.value=withTiming(1,{duration:theme.motion.duration.moderate,easing:borderAnimationEasing});}else if(currentInteraction==='default'){opacityTrigger.value=withTiming(0,{duration:theme.motion.duration.xquick,easing:borderAnimationEasing});}},[currentInteraction,opacityTrigger,widthTrigger,theme.motion.duration,borderAnimationEasing,validationState]);return jsx(BaseInputStyledAnimatedBorder,{style:animatedStyle});};
|
|
14
|
-
|
|
15
|
-
export { BaseInputAnimatedBorder };
|
|
16
|
-
//# sourceMappingURL=BaseInputAnimatedBorder.native.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputAnimatedBorder.native.js","sources":["../../../../../../src/components/Input/BaseInput/BaseInputAnimatedBorder.native.tsx"],"sourcesContent":["import styled from 'styled-components/native';\nimport type { EasingFn } from 'react-native-reanimated';\nimport Animated, {\n useAnimatedStyle,\n useSharedValue,\n interpolate,\n withTiming,\n} from 'react-native-reanimated';\nimport type { ReactElement } from 'react';\nimport { useEffect } from 'react';\nimport type { ActionStates } from '../../../utils/useInteraction';\nimport type { BaseInputProps } from './BaseInput';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeBorderSize } from '~utils/makeBorderSize';\n\nconst BaseInputStyledAnimatedBorder = styled(Animated.View)(({ theme }) => ({\n position: 'absolute',\n bottom: 0,\n left: 0,\n right: 0,\n opacity: 1,\n backgroundColor: theme.colors.interactive.background.primary.default,\n height: makeBorderSize(theme.border.width.thin),\n}));\n\nexport const BaseInputAnimatedBorder = ({\n currentInteraction,\n validationState,\n}: {\n currentInteraction: ActionStates;\n validationState: BaseInputProps['validationState'];\n}): ReactElement => {\n const { theme } = useTheme();\n const borderAnimationEasing = (theme.motion.easing.standard.effective as unknown) as EasingFn;\n\n const widthTrigger = useSharedValue(0);\n const opacityTrigger = useSharedValue(1);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n width: `${interpolate(widthTrigger.value, [0, 1], [0, 100])}%`,\n opacity: interpolate(opacityTrigger.value, [0, 1], [0, 1]),\n };\n });\n\n useEffect(() => {\n if (\n currentInteraction == 'focus' &&\n validationState !== 'error' &&\n validationState !== 'success'\n ) {\n widthTrigger.value = 0;\n opacityTrigger.value = 1;\n widthTrigger.value = withTiming(1, {\n duration: theme.motion.duration.moderate,\n easing: borderAnimationEasing,\n });\n } else if (currentInteraction === 'default') {\n opacityTrigger.value = withTiming(0, {\n duration: theme.motion.duration.xquick,\n easing: borderAnimationEasing,\n });\n }\n }, [\n currentInteraction,\n opacityTrigger,\n widthTrigger,\n theme.motion.duration,\n borderAnimationEasing,\n validationState,\n ]);\n\n return <BaseInputStyledAnimatedBorder style={animatedStyle} />;\n};\n"],"names":["BaseInputStyledAnimatedBorder","styled","Animated","View","_ref","theme","position","bottom","left","right","opacity","backgroundColor","colors","interactive","background","primary","default","height","makeBorderSize","border","width","thin","BaseInputAnimatedBorder","_ref2","currentInteraction","validationState","_useTheme","useTheme","borderAnimationEasing","motion","easing","standard","effective","widthTrigger","useSharedValue","opacityTrigger","animatedStyle","useAnimatedStyle","interpolate","value","useEffect","withTiming","duration","moderate","xquick","_jsx","style"],"mappings":";;;;;;;;;;;;AAeA,IAAMA,6BAA6B,CAAGC,MAAM,CAACC,QAAQ,CAACC,IAAI,CAAC,CAAC,SAAAC,IAAA,MAAGC,KAAK,CAAAD,IAAA,CAALC,KAAK,CAAA,OAAQ,CAC1EC,QAAQ,CAAE,UAAU,CACpBC,MAAM,CAAE,CAAC,CACTC,IAAI,CAAE,CAAC,CACPC,KAAK,CAAE,CAAC,CACRC,OAAO,CAAE,CAAC,CACVC,eAAe,CAAEN,KAAK,CAACO,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC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MAAM,CAAEF,qBACV,CAAC,CAAC,CACJ,CAAC,QAAUJ,kBAAkB,GAAK,SAAS,CAAE,CAC3CW,cAAc,CAACI,KAAK,CAAGE,UAAU,CAAC,CAAC,CAAE,CACnCC,QAAQ,CAAErC,KAAK,CAACwB,MAAM,CAACa,QAAQ,CAACE,MAAM,CACtCd,MAAM,CAAEF,qBACV,CAAC,CAAC,CACJ,CACF,CAAC,CAAE,CACDJ,kBAAkB,CAClBW,cAAc,CACdF,YAAY,CACZ5B,KAAK,CAACwB,MAAM,CAACa,QAAQ,CACrBd,qBAAqB,CACrBH,eAAe,CAChB,CAAC,CAEF,OAAOoB,GAAA,CAAC7C,6BAA6B,EAAC8C,KAAK,CAAEV,aAAc,CAAE,CAAC,CAChE;;;;"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import '../../../tokens/global/typography.js';
|
|
2
|
-
import '../../../tokens/global/motion.js';
|
|
3
|
-
import { size } from '../../../tokens/global/size.js';
|
|
4
|
-
|
|
5
|
-
var BASEINPUT_BOTTOM_LINE_HEIGHT=size['1'];var BASEINPUT_MAX_ROWS=4;var BASEINPUT_DEFAULT_HEIGHT=size['36'];var BASEINPUT_WRAPPER_MIN_HEIGHT=BASEINPUT_DEFAULT_HEIGHT+BASEINPUT_BOTTOM_LINE_HEIGHT;var BASEINPUT_WRAPPER_MAX_HEIGHT=size['36']*BASEINPUT_MAX_ROWS+BASEINPUT_BOTTOM_LINE_HEIGHT;
|
|
6
|
-
|
|
7
|
-
export { BASEINPUT_DEFAULT_HEIGHT, BASEINPUT_MAX_ROWS, BASEINPUT_WRAPPER_MAX_HEIGHT, BASEINPUT_WRAPPER_MIN_HEIGHT };
|
|
8
|
-
//# sourceMappingURL=baseInputConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseInputConfig.js","sources":["../../../../../../src/components/Input/BaseInput/baseInputConfig.ts"],"sourcesContent":["import { size, spacing } from '~tokens/global';\n\nconst BASEINPUT_BOTTOM_LINE_HEIGHT: number = size['1'];\nexport const BASEINPUT_MAX_ROWS = 4;\n\nexport const TAG_HEIGHT = size['20'];\nexport const TAG_GAP = spacing['3'];\n\n/**\n * 36px\n */\nexport const BASEINPUT_DEFAULT_HEIGHT: number = size['36'];\n\n/**\n * 37px (36px height + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MIN_HEIGHT = BASEINPUT_DEFAULT_HEIGHT + BASEINPUT_BOTTOM_LINE_HEIGHT;\n\n/**\n * 145px (36px height * 4 rows + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MAX_HEIGHT =\n size['36'] * BASEINPUT_MAX_ROWS + BASEINPUT_BOTTOM_LINE_HEIGHT; // we don't want exact number but rough number to be able to animate correctly in height.\n"],"names":["BASEINPUT_BOTTOM_LINE_HEIGHT","size","BASEINPUT_MAX_ROWS","BASEINPUT_DEFAULT_HEIGHT","BASEINPUT_WRAPPER_MIN_HEIGHT","BASEINPUT_WRAPPER_MAX_HEIGHT"],"mappings":";;;;AAEA,IAAMA,4BAAoC,CAAGC,IAAI,CAAC,GAAG,CAAC,CACzC,IAAAC,kBAAkB,CAAG,EAQrB,IAAAC,wBAAgC,CAAGF,IAAI,CAAC,IAAI,EAK5C,IAAAG,4BAA4B,CAAGD,wBAAwB,CAAGH,6BAK1D,IAAAK,4BAA4B,CACvCJ,IAAI,CAAC,IAAI,CAAC,CAAGC,kBAAkB,CAAGF;;;;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import styled, { keyframes, css } from 'styled-components';
|
|
3
|
-
import '../../Box/BaseBox/index.js';
|
|
4
|
-
import '../../../utils/makeMotionTime/index.web.js';
|
|
5
|
-
import '../../BladeProvider/index.js';
|
|
6
|
-
import '../../../utils/makeBorderSize/index.js';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
9
|
-
import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
|
|
10
|
-
import useTheme from '../../BladeProvider/useTheme.js';
|
|
11
|
-
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
12
|
-
|
|
13
|
-
var scaleBorder = /*#__PURE__*/keyframes(["from{transform:scaleX(0);transform-origin:left;opacity:0;}to{transform:scaleX(1);transform-origin:left;opacity:1;}"]);
|
|
14
|
-
var fadeOutBorder = /*#__PURE__*/keyframes(["from{opacity:1}to{opacity:0}"]);
|
|
15
|
-
var BaseInputStyledAnimatedBorder = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
16
|
-
displayName: "BaseInputAnimatedBorderweb__BaseInputStyledAnimatedBorder",
|
|
17
|
-
componentId: "sc-2cepod-0"
|
|
18
|
-
})(function (_ref) {
|
|
19
|
-
var theme = _ref.theme,
|
|
20
|
-
animation = _ref.animation;
|
|
21
|
-
return css(["position:absolute;bottom:0;left:0;right:0;opacity:0;background-color:", ";border-width:", ";height:", ";", ""], theme.colors.interactive.background.primary["default"], makeBorderSize(theme.border.width.thin), makeBorderSize(theme.border.width.thin), animation);
|
|
22
|
-
});
|
|
23
|
-
var BaseInputAnimatedBorder = function BaseInputAnimatedBorder(_ref2) {
|
|
24
|
-
var currentInteraction = _ref2.currentInteraction,
|
|
25
|
-
validationState = _ref2.validationState;
|
|
26
|
-
var _useTheme = useTheme(),
|
|
27
|
-
theme = _useTheme.theme;
|
|
28
|
-
var borderAnimationOnFocus = /*#__PURE__*/css(["animation:", " ", " ", " forwards;"], scaleBorder, makeMotionTime(theme.motion.duration.moderate), theme.motion.easing.standard.effective);
|
|
29
|
-
var borderAnimationOnBlur = /*#__PURE__*/css(["animation:", " ", " ", " forwards;"], fadeOutBorder, makeMotionTime(theme.motion.duration.xquick), theme.motion.easing.standard.effective);
|
|
30
|
-
// need ref because we don't have `blur` as an interaction which means the exit animation would run on default as well as blur event
|
|
31
|
-
var borderAnimation = React__default.useRef();
|
|
32
|
-
if (currentInteraction === 'focus' && validationState !== 'error' && validationState !== 'success') {
|
|
33
|
-
borderAnimation.current = borderAnimationOnFocus;
|
|
34
|
-
} else if (borderAnimation.current && currentInteraction === 'default') {
|
|
35
|
-
borderAnimation.current = borderAnimationOnBlur;
|
|
36
|
-
}
|
|
37
|
-
return /*#__PURE__*/jsx(BaseInputStyledAnimatedBorder, {
|
|
38
|
-
animation: borderAnimation.current
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { BaseInputAnimatedBorder };
|
|
43
|
-
//# sourceMappingURL=BaseInputAnimatedBorder.web.js.map
|
package/build/lib/web/development/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputAnimatedBorder.web.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputAnimatedBorder.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport type { ReactElement } from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { ActionStates } from '~utils/useInteraction';\n\nconst scaleBorder = keyframes`\nfrom {\n transform: scaleX(0);\n transform-origin: left;\n opacity: 0;\n}\nto {\n transform: scaleX(1);\n transform-origin: left;\n opacity: 1;\n}\n`;\n\nconst fadeOutBorder = keyframes`\nfrom {\n opacity: 1\n}\nto {\n opacity: 0\n}\n`;\n\nconst BaseInputStyledAnimatedBorder = styled(BaseBox)(\n ({ theme, animation }: { theme: Theme; animation?: FlattenSimpleInterpolation }) => css`\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0;\n background-color: ${theme.colors.interactive.background.primary.default};\n border-width: ${makeBorderSize(theme.border.width.thin)};\n height: ${makeBorderSize(theme.border.width.thin)};\n ${animation}\n `,\n);\n\nexport const BaseInputAnimatedBorder = ({\n currentInteraction,\n validationState,\n}: {\n currentInteraction: ActionStates;\n validationState: BaseInputProps['validationState'];\n}): ReactElement => {\n const { theme } = useTheme();\n\n const borderAnimationOnFocus = css`\n animation: ${scaleBorder} ${makeMotionTime(theme.motion.duration.moderate)}\n ${theme.motion.easing.standard.effective as string} forwards;\n `;\n\n const borderAnimationOnBlur = css`\n animation: ${fadeOutBorder} ${makeMotionTime(theme.motion.duration.xquick)}\n ${theme.motion.easing.standard.effective as string} forwards;\n `;\n // need ref because we don't have `blur` as an interaction which means the exit animation would run on default as well as blur event\n const borderAnimation = React.useRef<FlattenSimpleInterpolation>();\n if (\n currentInteraction === 'focus' &&\n validationState !== 'error' &&\n validationState !== 'success'\n ) {\n borderAnimation.current = borderAnimationOnFocus;\n } else if (borderAnimation.current && currentInteraction === 'default') {\n borderAnimation.current = borderAnimationOnBlur;\n }\n\n return <BaseInputStyledAnimatedBorder animation={borderAnimation.current} />;\n};\n"],"names":["scaleBorder","keyframes","fadeOutBorder","BaseInputStyledAnimatedBorder","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","animation","css","colors","interactive","background","primary","makeBorderSize","border","width","thin","BaseInputAnimatedBorder","_ref2","currentInteraction","validationState","_useTheme","useTheme","borderAnimationOnFocus","makeMotionTime","motion","duration","moderate","easing","standard","effective","borderAnimationOnBlur","xquick","borderAnimation","React","useRef","current","_jsx"],"mappings":";;;;;;;;;;;;AAYA,IAAMA,WAAW,gBAAGC,SAAS,CAW5B,CAAA,oHAAA,CAAA,CAAA,CAAA;AAED,IAAMC,aAAa,gBAAGD,SAAS,CAO9B,CAAA,8BAAA,CAAA,CAAA,CAAA;AAED,IAAME,6BAA6B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,2DAAA;EAAAC,WAAA,EAAA,aAAA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C,EACtE1B,KAAK,CAACmB,MAAM,CAACG,MAAM,CAACC,QAAQ,CAACC,SAAS,CAC3C,CAAA;AACD;AACA,EAAA,IAAMG,eAAe,GAAGC,cAAK,CAACC,MAAM,EAA8B,CAAA;EAClE,IACEhB,kBAAkB,KAAK,OAAO,IAC9BC,eAAe,KAAK,OAAO,IAC3BA,eAAe,KAAK,SAAS,EAC7B;IACAa,eAAe,CAACG,OAAO,GAAGb,sBAAsB,CAAA;GACjD,MAAM,IAAIU,eAAe,CAACG,OAAO,IAAIjB,kBAAkB,KAAK,SAAS,EAAE;IACtEc,eAAe,CAACG,OAAO,GAAGL,qBAAqB,CAAA;AACjD,GAAA;EAEA,oBAAOM,GAAA,CAACtC,6BAA6B,EAAA;IAACQ,SAAS,EAAE0B,eAAe,CAACG,OAAAA;AAAQ,GAAE,CAAC,CAAA;AAC9E;;;;"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import '../../../tokens/global/index.js';
|
|
2
|
-
import { size } from '../../../tokens/global/size.js';
|
|
3
|
-
import { spacing } from '../../../tokens/global/spacing.js';
|
|
4
|
-
|
|
5
|
-
var BASEINPUT_BOTTOM_LINE_HEIGHT = size['1'];
|
|
6
|
-
var BASEINPUT_MAX_ROWS = 4;
|
|
7
|
-
var TAG_HEIGHT = size['20'];
|
|
8
|
-
var TAG_GAP = spacing['3'];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 36px
|
|
12
|
-
*/
|
|
13
|
-
var BASEINPUT_DEFAULT_HEIGHT = size['36'];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 37px (36px height + 1px bottom line height)
|
|
17
|
-
*/
|
|
18
|
-
var BASEINPUT_WRAPPER_MIN_HEIGHT = BASEINPUT_DEFAULT_HEIGHT + BASEINPUT_BOTTOM_LINE_HEIGHT;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 145px (36px height * 4 rows + 1px bottom line height)
|
|
22
|
-
*/
|
|
23
|
-
var BASEINPUT_WRAPPER_MAX_HEIGHT = size['36'] * BASEINPUT_MAX_ROWS + BASEINPUT_BOTTOM_LINE_HEIGHT; // we don't want exact number but rough number to be able to animate correctly in height.
|
|
24
|
-
|
|
25
|
-
export { BASEINPUT_DEFAULT_HEIGHT, BASEINPUT_MAX_ROWS, BASEINPUT_WRAPPER_MAX_HEIGHT, BASEINPUT_WRAPPER_MIN_HEIGHT, TAG_GAP, TAG_HEIGHT };
|
|
26
|
-
//# sourceMappingURL=baseInputConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseInputConfig.js","sources":["../../../../../../../src/components/Input/BaseInput/baseInputConfig.ts"],"sourcesContent":["import { size, spacing } from '~tokens/global';\n\nconst BASEINPUT_BOTTOM_LINE_HEIGHT: number = size['1'];\nexport const BASEINPUT_MAX_ROWS = 4;\n\nexport const TAG_HEIGHT = size['20'];\nexport const TAG_GAP = spacing['3'];\n\n/**\n * 36px\n */\nexport const BASEINPUT_DEFAULT_HEIGHT: number = size['36'];\n\n/**\n * 37px (36px height + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MIN_HEIGHT = BASEINPUT_DEFAULT_HEIGHT + BASEINPUT_BOTTOM_LINE_HEIGHT;\n\n/**\n * 145px (36px height * 4 rows + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MAX_HEIGHT =\n size['36'] * BASEINPUT_MAX_ROWS + BASEINPUT_BOTTOM_LINE_HEIGHT; // we don't want exact number but rough number to be able to animate correctly in height.\n"],"names":["BASEINPUT_BOTTOM_LINE_HEIGHT","size","BASEINPUT_MAX_ROWS","TAG_HEIGHT","TAG_GAP","spacing","BASEINPUT_DEFAULT_HEIGHT","BASEINPUT_WRAPPER_MIN_HEIGHT","BASEINPUT_WRAPPER_MAX_HEIGHT"],"mappings":";;;;AAEA,IAAMA,4BAAoC,GAAGC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,IAAMC,kBAAkB,GAAG,EAAC;IAEtBC,UAAU,GAAGF,IAAI,CAAC,IAAI,EAAC;IACvBG,OAAO,GAAGC,OAAO,CAAC,GAAG,EAAC;;AAEnC;AACA;AACA;IACaC,wBAAgC,GAAGL,IAAI,CAAC,IAAI,EAAC;;AAE1D;AACA;AACA;AACaM,IAAAA,4BAA4B,GAAGD,wBAAwB,GAAGN,6BAA4B;;AAEnG;AACA;AACA;AACaQ,IAAAA,4BAA4B,GACvCP,IAAI,CAAC,IAAI,CAAC,GAAGC,kBAAkB,GAAGF,6BAA6B;;;;"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import React__default from 'react';
|
|
2
|
-
import styled, { keyframes, css } from 'styled-components';
|
|
3
|
-
import '../../Box/BaseBox/index.js';
|
|
4
|
-
import '../../../utils/makeMotionTime/index.web.js';
|
|
5
|
-
import '../../BladeProvider/index.js';
|
|
6
|
-
import '../../../utils/makeBorderSize/index.js';
|
|
7
|
-
import { jsx } from 'react/jsx-runtime';
|
|
8
|
-
import { BaseBox } from '../../Box/BaseBox/BaseBox.web.js';
|
|
9
|
-
import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js';
|
|
10
|
-
import useTheme from '../../BladeProvider/useTheme.js';
|
|
11
|
-
import { makeMotionTime } from '../../../utils/makeMotionTime/makeMotionTime.web.js';
|
|
12
|
-
|
|
13
|
-
var scaleBorder = /*#__PURE__*/keyframes(["from{transform:scaleX(0);transform-origin:left;opacity:0;}to{transform:scaleX(1);transform-origin:left;opacity:1;}"]);
|
|
14
|
-
var fadeOutBorder = /*#__PURE__*/keyframes(["from{opacity:1}to{opacity:0}"]);
|
|
15
|
-
var BaseInputStyledAnimatedBorder = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
16
|
-
displayName: "BaseInputAnimatedBorderweb__BaseInputStyledAnimatedBorder",
|
|
17
|
-
componentId: "sc-2cepod-0"
|
|
18
|
-
})(function (_ref) {
|
|
19
|
-
var theme = _ref.theme,
|
|
20
|
-
animation = _ref.animation;
|
|
21
|
-
return css(["position:absolute;bottom:0;left:0;right:0;opacity:0;background-color:", ";border-width:", ";height:", ";", ""], theme.colors.interactive.background.primary["default"], makeBorderSize(theme.border.width.thin), makeBorderSize(theme.border.width.thin), animation);
|
|
22
|
-
});
|
|
23
|
-
var BaseInputAnimatedBorder = function BaseInputAnimatedBorder(_ref2) {
|
|
24
|
-
var currentInteraction = _ref2.currentInteraction,
|
|
25
|
-
validationState = _ref2.validationState;
|
|
26
|
-
var _useTheme = useTheme(),
|
|
27
|
-
theme = _useTheme.theme;
|
|
28
|
-
var borderAnimationOnFocus = /*#__PURE__*/css(["animation:", " ", " ", " forwards;"], scaleBorder, makeMotionTime(theme.motion.duration.moderate), theme.motion.easing.standard.effective);
|
|
29
|
-
var borderAnimationOnBlur = /*#__PURE__*/css(["animation:", " ", " ", " forwards;"], fadeOutBorder, makeMotionTime(theme.motion.duration.xquick), theme.motion.easing.standard.effective);
|
|
30
|
-
// need ref because we don't have `blur` as an interaction which means the exit animation would run on default as well as blur event
|
|
31
|
-
var borderAnimation = React__default.useRef();
|
|
32
|
-
if (currentInteraction === 'focus' && validationState !== 'error' && validationState !== 'success') {
|
|
33
|
-
borderAnimation.current = borderAnimationOnFocus;
|
|
34
|
-
} else if (borderAnimation.current && currentInteraction === 'default') {
|
|
35
|
-
borderAnimation.current = borderAnimationOnBlur;
|
|
36
|
-
}
|
|
37
|
-
return /*#__PURE__*/jsx(BaseInputStyledAnimatedBorder, {
|
|
38
|
-
animation: borderAnimation.current
|
|
39
|
-
});
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export { BaseInputAnimatedBorder };
|
|
43
|
-
//# sourceMappingURL=BaseInputAnimatedBorder.web.js.map
|
package/build/lib/web/production/components/Input/BaseInput/BaseInputAnimatedBorder.web.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BaseInputAnimatedBorder.web.js","sources":["../../../../../../../src/components/Input/BaseInput/BaseInputAnimatedBorder.web.tsx"],"sourcesContent":["import React from 'react';\nimport type { FlattenSimpleInterpolation } from 'styled-components';\nimport type { ReactElement } from 'react';\nimport styled, { css, keyframes } from 'styled-components';\nimport type { BaseInputProps } from './BaseInput';\nimport BaseBox from '~components/Box/BaseBox';\nimport { makeMotionTime } from '~utils/makeMotionTime';\nimport type { Theme } from '~components/BladeProvider';\nimport { useTheme } from '~components/BladeProvider';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { ActionStates } from '~utils/useInteraction';\n\nconst scaleBorder = keyframes`\nfrom {\n transform: scaleX(0);\n transform-origin: left;\n opacity: 0;\n}\nto {\n transform: scaleX(1);\n transform-origin: left;\n opacity: 1;\n}\n`;\n\nconst fadeOutBorder = keyframes`\nfrom {\n opacity: 1\n}\nto {\n opacity: 0\n}\n`;\n\nconst BaseInputStyledAnimatedBorder = styled(BaseBox)(\n ({ theme, animation }: { theme: Theme; animation?: FlattenSimpleInterpolation }) => css`\n position: absolute;\n bottom: 0;\n left: 0;\n right: 0;\n opacity: 0;\n background-color: ${theme.colors.interactive.background.primary.default};\n border-width: ${makeBorderSize(theme.border.width.thin)};\n height: ${makeBorderSize(theme.border.width.thin)};\n ${animation}\n `,\n);\n\nexport const BaseInputAnimatedBorder = ({\n currentInteraction,\n validationState,\n}: {\n currentInteraction: ActionStates;\n validationState: BaseInputProps['validationState'];\n}): ReactElement => {\n const { theme } = useTheme();\n\n const borderAnimationOnFocus = css`\n animation: ${scaleBorder} ${makeMotionTime(theme.motion.duration.moderate)}\n ${theme.motion.easing.standard.effective as string} forwards;\n `;\n\n const borderAnimationOnBlur = css`\n animation: ${fadeOutBorder} ${makeMotionTime(theme.motion.duration.xquick)}\n ${theme.motion.easing.standard.effective as string} forwards;\n `;\n // need ref because we don't have `blur` as an interaction which means the exit animation would run on default as well as blur event\n const borderAnimation = React.useRef<FlattenSimpleInterpolation>();\n if (\n currentInteraction === 'focus' &&\n validationState !== 'error' &&\n validationState !== 'success'\n ) {\n borderAnimation.current = borderAnimationOnFocus;\n } else if (borderAnimation.current && currentInteraction === 'default') {\n borderAnimation.current = borderAnimationOnBlur;\n }\n\n return <BaseInputStyledAnimatedBorder animation={borderAnimation.current} />;\n};\n"],"names":["scaleBorder","keyframes","fadeOutBorder","BaseInputStyledAnimatedBorder","styled","BaseBox","withConfig","displayName","componentId","_ref","theme","animation","css","colors","interactive","background","primary","makeBorderSize","border","width","thin","BaseInputAnimatedBorder","_ref2","currentInteraction","validationState","_useTheme","useTheme","borderAnimationOnFocus","makeMotionTime","motion","duration","moderate","easing","standard","effective","borderAnimationOnBlur","xquick","borderAnimation","React","useRef","current","_jsx"],"mappings":";;;;;;;;;;;;AAYA,IAAMA,WAAW,gBAAGC,SAAS,CAW5B,CAAA,oHAAA,CAAA,CAAA,CAAA;AAED,IAAMC,aAAa,gBAAGD,SAAS,CAO9B,CAAA,8BAAA,CAAA,CAAA,CAAA;AAED,IAAME,6BAA6B,gBAAGC,MAAM,CAACC,OAAO,CAAC,CAAAC,UAAA,CAAA;EAAAC,WAAA,EAAA,2DAAA;EAAAC,WAAA,EAAA,aAAA;AAAA,CAAA,CAAA,CACnD,UAAAC,IAAA,EAAA;AAAA,EAAA,IAAGC,KAAK,GAAAD,IAAA,CAALC,KAAK;IAAEC,SAAS,GAAAF,IAAA,CAATE,SAAS,CAAA;AAAA,EAAA,OAAiEC,GAAG,CAAA,CAAA,uEAAA,EAAA,gBAAA,EAAA,UAAA,EAAA,GAAA,EAAA,EAAA,CAAA,EAMjEF,KAAK,CAACG,MAAM,CAACC,WAAW,CAACC,UAAU,CAACC,OAAO,CAAA,SAAA,CAAQ,EACvDC,cAAc,CAACP,KAAK,CAACQ,MAAM,CAACC,KAAK,CAACC,IAAI,CAAC,EAC7CH,cAAc,CAACP,KAAK,CAACQ,MAAM,CAACC,KAAK,CAACC,IAAI,CAAC,EAC/CT,SAAS,CAAA,CAAA;AAAA,CACZ,CACF,CAAA;IAEYU,uBAAuB,GAAG,SAA1BA,uBAAuBA,CAAAC,KAAA,E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
|
|
|
1
|
-
import '../../../tokens/global/index.js';
|
|
2
|
-
import { size } from '../../../tokens/global/size.js';
|
|
3
|
-
import { spacing } from '../../../tokens/global/spacing.js';
|
|
4
|
-
|
|
5
|
-
var BASEINPUT_BOTTOM_LINE_HEIGHT = size['1'];
|
|
6
|
-
var BASEINPUT_MAX_ROWS = 4;
|
|
7
|
-
var TAG_HEIGHT = size['20'];
|
|
8
|
-
var TAG_GAP = spacing['3'];
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* 36px
|
|
12
|
-
*/
|
|
13
|
-
var BASEINPUT_DEFAULT_HEIGHT = size['36'];
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* 37px (36px height + 1px bottom line height)
|
|
17
|
-
*/
|
|
18
|
-
var BASEINPUT_WRAPPER_MIN_HEIGHT = BASEINPUT_DEFAULT_HEIGHT + BASEINPUT_BOTTOM_LINE_HEIGHT;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* 145px (36px height * 4 rows + 1px bottom line height)
|
|
22
|
-
*/
|
|
23
|
-
var BASEINPUT_WRAPPER_MAX_HEIGHT = size['36'] * BASEINPUT_MAX_ROWS + BASEINPUT_BOTTOM_LINE_HEIGHT; // we don't want exact number but rough number to be able to animate correctly in height.
|
|
24
|
-
|
|
25
|
-
export { BASEINPUT_DEFAULT_HEIGHT, BASEINPUT_MAX_ROWS, BASEINPUT_WRAPPER_MAX_HEIGHT, BASEINPUT_WRAPPER_MIN_HEIGHT, TAG_GAP, TAG_HEIGHT };
|
|
26
|
-
//# sourceMappingURL=baseInputConfig.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseInputConfig.js","sources":["../../../../../../../src/components/Input/BaseInput/baseInputConfig.ts"],"sourcesContent":["import { size, spacing } from '~tokens/global';\n\nconst BASEINPUT_BOTTOM_LINE_HEIGHT: number = size['1'];\nexport const BASEINPUT_MAX_ROWS = 4;\n\nexport const TAG_HEIGHT = size['20'];\nexport const TAG_GAP = spacing['3'];\n\n/**\n * 36px\n */\nexport const BASEINPUT_DEFAULT_HEIGHT: number = size['36'];\n\n/**\n * 37px (36px height + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MIN_HEIGHT = BASEINPUT_DEFAULT_HEIGHT + BASEINPUT_BOTTOM_LINE_HEIGHT;\n\n/**\n * 145px (36px height * 4 rows + 1px bottom line height)\n */\nexport const BASEINPUT_WRAPPER_MAX_HEIGHT =\n size['36'] * BASEINPUT_MAX_ROWS + BASEINPUT_BOTTOM_LINE_HEIGHT; // we don't want exact number but rough number to be able to animate correctly in height.\n"],"names":["BASEINPUT_BOTTOM_LINE_HEIGHT","size","BASEINPUT_MAX_ROWS","TAG_HEIGHT","TAG_GAP","spacing","BASEINPUT_DEFAULT_HEIGHT","BASEINPUT_WRAPPER_MIN_HEIGHT","BASEINPUT_WRAPPER_MAX_HEIGHT"],"mappings":";;;;AAEA,IAAMA,4BAAoC,GAAGC,IAAI,CAAC,GAAG,CAAC,CAAA;AAC/C,IAAMC,kBAAkB,GAAG,EAAC;IAEtBC,UAAU,GAAGF,IAAI,CAAC,IAAI,EAAC;IACvBG,OAAO,GAAGC,OAAO,CAAC,GAAG,EAAC;;AAEnC;AACA;AACA;IACaC,wBAAgC,GAAGL,IAAI,CAAC,IAAI,EAAC;;AAE1D;AACA;AACA;AACaM,IAAAA,4BAA4B,GAAGD,wBAAwB,GAAGN,6BAA4B;;AAEnG;AACA;AACA;AACaQ,IAAAA,4BAA4B,GACvCP,IAAI,CAAC,IAAI,CAAC,GAAGC,kBAAkB,GAAGF,6BAA6B;;;;"}
|