@razorpay/blade 11.11.1 → 11.12.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/Box/BaseBox/baseBoxStyles.js +1 -1
- package/build/lib/native/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/native/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/native/components/Button/BaseButton/StyledBaseButton.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/AnimatedBaseInputWrapper.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js +2 -1
- package/build/lib/native/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputTagSlot.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js +1 -1
- package/build/lib/native/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js +1 -1
- package/build/lib/native/components/Input/BaseInput/StyledBaseInput.native.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js +1 -1
- package/build/lib/native/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/native/components/Input/BaseInput/useTaggedInput.js +13 -0
- package/build/lib/native/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- 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/Tag/AnimatedTag.native.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/Tag/tagAnimationConfig.js +1 -2
- package/build/lib/native/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js +1 -1
- package/build/lib/native/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js +2 -1
- package/build/lib/web/development/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/development/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +8 -2
- package/build/lib/web/development/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js +13 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js +14 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js +4 -2
- package/build/lib/web/development/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js +5 -2
- package/build/lib/web/development/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js +2 -2
- package/build/lib/web/development/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js +172 -0
- package/build/lib/web/development/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- package/build/lib/web/development/components/Input/TextArea/TextArea.js +54 -8
- package/build/lib/web/development/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/development/components/Input/TextInput/TextInput.js +51 -5
- package/build/lib/web/development/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js +2 -3
- package/build/lib/web/development/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/development/components/Tag/Tag.js +5 -6
- package/build/lib/web/development/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/web/development/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/development/components/Tag/tagAnimationConfig.js +4 -2
- package/build/lib/web/development/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js +2 -1
- package/build/lib/web/development/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js +2 -1
- package/build/lib/web/production/components/Box/BaseBox/baseBoxStyles.js.map +1 -1
- package/build/lib/web/production/components/Box/BaseBox/types/propsTypes.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js +8 -2
- package/build/lib/web/production/components/Input/BaseInput/AnimatedBaseInputWrapper.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js +13 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInput.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js +14 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputTagSlot.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js +4 -2
- package/build/lib/web/production/components/Input/BaseInput/BaseInputWrapper.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js +5 -2
- package/build/lib/web/production/components/Input/BaseInput/StyledBaseInput.web.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js +2 -2
- package/build/lib/web/production/components/Input/BaseInput/baseInputStyles.js.map +1 -1
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js +172 -0
- package/build/lib/web/production/components/Input/BaseInput/useTaggedInput.js.map +1 -0
- package/build/lib/web/production/components/Input/TextArea/TextArea.js +54 -8
- package/build/lib/web/production/components/Input/TextArea/TextArea.js.map +1 -1
- package/build/lib/web/production/components/Input/TextInput/TextInput.js +51 -5
- package/build/lib/web/production/components/Input/TextInput/TextInput.js.map +1 -1
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js +2 -3
- package/build/lib/web/production/components/Tag/AnimatedTag.web.js.map +1 -1
- package/build/lib/web/production/components/Tag/Tag.js +5 -6
- package/build/lib/web/production/components/Tag/Tag.js.map +1 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js +1 -1
- package/build/lib/web/production/components/Tag/getTagsGroup.js.map +1 -1
- package/build/lib/web/production/components/Tag/tagAnimationConfig.js +4 -2
- package/build/lib/web/production/components/Tag/tagAnimationConfig.js.map +1 -1
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js +2 -1
- package/build/lib/web/production/components/Typography/BaseText/getBaseTextStyles.js.map +1 -1
- package/build/types/components/index.d.ts +19 -3
- package/build/types/components/index.native.d.ts +11 -3
- package/package.json +1 -1
|
@@ -14,7 +14,7 @@ import { makeBorderSize } from '../../../utils/makeBorderSize/makeBorderSize.js'
|
|
|
14
14
|
import { makeSpace } from '../../../utils/makeSpace/makeSpace.js';
|
|
15
15
|
import '../../BladeProvider/useTheme.js';
|
|
16
16
|
|
|
17
|
-
var _excluded=["base"];var isSpacingToken=function isSpacingToken(value){return typeof value==='string'&&value.startsWith('spacing.');};var getSpacingValue=function getSpacingValue(spacingValue,theme,breakpoint){if(isEmpty(spacingValue)){return undefined;}var responsiveSpacingValue=getResponsiveValue(spacingValue,breakpoint);if(isEmpty(responsiveSpacingValue)){return undefined;}if(responsiveSpacingValue==='auto'){return responsiveSpacingValue;}if(Array.isArray(responsiveSpacingValue)){return responsiveSpacingValue.map(function(value){return getSpacingValue(value,theme);}).join(' ');}if(isSpacingToken(responsiveSpacingValue)){var spacingReturnValue=getIn(theme,responsiveSpacingValue);return isEmpty(spacingReturnValue)?makeSpace(spacingReturnValue):undefined;}return responsiveSpacingValue;};var getColorValue=function getColorValue(color,theme,breakpoint){var responsiveBackgroundValue=getResponsiveValue(color,breakpoint);var tokenValue=getIn(theme,`colors.${responsiveBackgroundValue}`);return tokenValue!=null?tokenValue:responsiveBackgroundValue;};var getBorderRadiusValue=function getBorderRadiusValue(borderRadius,theme,breakpoint){var responsiveBorderRadiusValue=getResponsiveValue(borderRadius,breakpoint);return isEmpty(responsiveBorderRadiusValue)?undefined:makeBorderSize(getIn(theme,`border.radius.${responsiveBorderRadiusValue}`));};var getBorderWidthValue=function getBorderWidthValue(borderWidth,theme,breakpoint){var responsiveBorderWidthValue=getResponsiveValue(borderWidth,breakpoint);return isEmpty(responsiveBorderWidthValue)?undefined:makeBorderSize(getIn(theme,`border.width.${responsiveBorderWidthValue}`));};var getElevationValue=function getElevationValue(elevation,theme,breakpoint){var responsiveElevationValue=getResponsiveValue(elevation,breakpoint);return isEmpty(responsiveElevationValue)?undefined:getIn(theme,`elevation.${responsiveElevationValue}`);};var getAllProps=function getAllProps(props,breakpoint){var _props$paddingTop,_props$paddingBottom,_props$paddingRight,_props$paddingLeft,_props$marginBottom,_props$marginTop,_props$marginRight,_props$marginLeft;var hasBorder=props.borderWidth||props.borderColor;var hasBorderRight=props.borderRight||props.borderRightColor||props.borderRightWidth;var hasBorderLeft=props.borderLeft||props.borderLeftColor||props.borderLeftWidth;var hasBorderTop=props.borderTop||props.borderTopColor||props.borderTopWidth;var hasBorderBottom=props.borderBottom||props.borderBottomColor||props.borderBottomWidth;return Object.assign({display:getResponsiveValue(props.display,breakpoint),overflow:getResponsiveValue(props.overflow,breakpoint),overflowX:getResponsiveValue(props.overflowX,breakpoint),overflowY:getResponsiveValue(props.overflowY,breakpoint),textAlign:getResponsiveValue(props.textAlign,breakpoint),whiteSpace:getResponsiveValue(props.whiteSpace,breakpoint),flex:getResponsiveValue(props.flex,breakpoint),flexWrap:getResponsiveValue(props.flexWrap,breakpoint),flexDirection:getResponsiveValue(props.flexDirection,breakpoint),flexGrow:getResponsiveValue(props.flexGrow,breakpoint),flexShrink:getResponsiveValue(props.flexShrink,breakpoint),flexBasis:getResponsiveValue(props.flexBasis,breakpoint),alignItems:getResponsiveValue(props.alignItems,breakpoint),alignContent:getResponsiveValue(props.alignContent,breakpoint),alignSelf:getResponsiveValue(props.alignSelf,breakpoint),justifyItems:getResponsiveValue(props.justifyItems,breakpoint),justifyContent:getResponsiveValue(props.justifyContent,breakpoint),justifySelf:getResponsiveValue(props.justifySelf,breakpoint),placeSelf:getResponsiveValue(props.placeSelf,breakpoint),placeItems:getResponsiveValue(props.placeItems,breakpoint),order:getResponsiveValue(props.order,breakpoint),position:getResponsiveValue(props.position,breakpoint),zIndex:getResponsiveValue(props.zIndex,breakpoint),grid:getResponsiveValue(props.grid,breakpoint),gridColumn:getResponsiveValue(props.gridColumn,breakpoint),gridRow:getResponsiveValue(props.gridRow,breakpoint),gridRowStart:getResponsiveValue(props.gridRowStart,breakpoint),gridRowEnd:getResponsiveValue(props.gridRowEnd,breakpoint),gridArea:getResponsiveValue(props.gridArea,breakpoint),gridAutoFlow:getResponsiveValue(props.gridAutoFlow,breakpoint),gridAutoRows:getResponsiveValue(props.gridAutoRows,breakpoint),gridAutoColumns:getResponsiveValue(props.gridAutoColumns,breakpoint),gridTemplate:getResponsiveValue(props.gridTemplate,breakpoint),gridTemplateAreas:getResponsiveValue(props.gridTemplateAreas,breakpoint),gridTemplateColumns:getResponsiveValue(props.gridTemplateColumns,breakpoint),gridTemplateRows:getResponsiveValue(props.gridTemplateRows,breakpoint),padding:getSpacingValue(props.padding,props.theme,breakpoint),paddingTop:getSpacingValue((_props$paddingTop=props.paddingTop)!=null?_props$paddingTop:props.paddingY,props.theme,breakpoint),paddingBottom:getSpacingValue((_props$paddingBottom=props.paddingBottom)!=null?_props$paddingBottom:props.paddingY,props.theme,breakpoint),paddingRight:getSpacingValue((_props$paddingRight=props.paddingRight)!=null?_props$paddingRight:props.paddingX,props.theme,breakpoint),paddingLeft:getSpacingValue((_props$paddingLeft=props.paddingLeft)!=null?_props$paddingLeft:props.paddingX,props.theme,breakpoint),margin:getSpacingValue(props.margin,props.theme,breakpoint),marginBottom:getSpacingValue((_props$marginBottom=props.marginBottom)!=null?_props$marginBottom:props.marginY,props.theme,breakpoint),marginTop:getSpacingValue((_props$marginTop=props.marginTop)!=null?_props$marginTop:props.marginY,props.theme,breakpoint),marginRight:getSpacingValue((_props$marginRight=props.marginRight)!=null?_props$marginRight:props.marginX,props.theme,breakpoint),marginLeft:getSpacingValue((_props$marginLeft=props.marginLeft)!=null?_props$marginLeft:props.marginX,props.theme,breakpoint),height:getSpacingValue(props.height,props.theme,breakpoint),minHeight:getSpacingValue(props.minHeight,props.theme,breakpoint),maxHeight:getSpacingValue(props.maxHeight,props.theme,breakpoint),width:getSpacingValue(props.width,props.theme,breakpoint),minWidth:getSpacingValue(props.minWidth,props.theme,breakpoint),maxWidth:getSpacingValue(props.maxWidth,props.theme,breakpoint),gap:getSpacingValue(props.gap,props.theme,breakpoint),rowGap:getSpacingValue(props.rowGap,props.theme,breakpoint),columnGap:getSpacingValue(props.columnGap,props.theme,breakpoint),top:getSpacingValue(props.top,props.theme,breakpoint),right:getSpacingValue(props.right,props.theme,breakpoint),bottom:getSpacingValue(props.bottom,props.theme,breakpoint),left:getSpacingValue(props.left,props.theme,breakpoint),backgroundColor:getColorValue(props.backgroundColor,props.theme,breakpoint),backgroundImage:getResponsiveValue(props.backgroundImage,breakpoint),backgroundSize:getResponsiveValue(props.backgroundSize,breakpoint),backgroundPosition:getResponsiveValue(props.backgroundPosition,breakpoint),backgroundOrigin:getResponsiveValue(props.backgroundOrigin,breakpoint),backgroundRepeat:getResponsiveValue(props.backgroundRepeat,breakpoint),borderRadius:getBorderRadiusValue(props.borderRadius,props.theme,breakpoint),lineHeight:getSpacingValue(props.lineHeight,props.theme,breakpoint),border:getResponsiveValue(props.border,breakpoint),borderTop:getResponsiveValue(props.borderTop,breakpoint),borderRight:getResponsiveValue(props.borderRight,breakpoint),borderBottom:getResponsiveValue(props.borderBottom,breakpoint),borderLeft:getResponsiveValue(props.borderLeft,breakpoint),borderWidth:getBorderWidthValue(props.borderWidth,props.theme,breakpoint),borderColor:getColorValue(props.borderColor,props.theme,breakpoint),borderTopWidth:getBorderWidthValue(props.borderTopWidth,props.theme,breakpoint),borderTopColor:getColorValue(props.borderTopColor,props.theme,breakpoint),borderRightWidth:getBorderWidthValue(props.borderRightWidth,props.theme,breakpoint),borderRightColor:getColorValue(props.borderRightColor,props.theme,breakpoint),borderBottomWidth:getBorderWidthValue(props.borderBottomWidth,props.theme,breakpoint),borderBottomColor:getColorValue(props.borderBottomColor,props.theme,breakpoint),borderLeftWidth:getBorderWidthValue(props.borderLeftWidth,props.theme,breakpoint),borderLeftColor:getColorValue(props.borderLeftColor,props.theme,breakpoint),borderTopLeftRadius:getBorderRadiusValue(props.borderTopLeftRadius,props.theme,breakpoint),borderTopRightRadius:getBorderRadiusValue(props.borderTopRightRadius,props.theme,breakpoint),borderBottomRightRadius:getBorderRadiusValue(props.borderBottomRightRadius,props.theme,breakpoint),borderBottomLeftRadius:getBorderRadiusValue(props.borderBottomLeftRadius,props.theme,breakpoint),borderStyle:hasBorder?'solid':undefined},!hasBorder&&{borderTopStyle:hasBorderTop?'solid':undefined,borderBottomStyle:hasBorderBottom?'solid':undefined,borderLeftStyle:hasBorderLeft?'solid':undefined,borderRightStyle:hasBorderRight?'solid':undefined},{touchAction:getResponsiveValue(props.touchAction,breakpoint),userSelect:getResponsiveValue(props.userSelect,breakpoint),pointerEvents:getResponsiveValue(props.pointerEvents),opacity:getResponsiveValue(props.opacity,breakpoint),visibility:getResponsiveValue(props.visibility,breakpoint)},!isReactNative()&&{boxShadow:getElevationValue(props.elevation,props.theme,breakpoint)},{transform:getResponsiveValue(props.transform,breakpoint),transformOrigin:getResponsiveValue(props.transformOrigin,breakpoint),clipPath:getResponsiveValue(props.clipPath,breakpoint)});};var shouldAddBreakpoint=function shouldAddBreakpoint(cssProps){var firstDefinedValue=Object.values(cssProps).find(function(cssValue){return cssValue!==undefined&&cssValue!==null;});return firstDefinedValue!==undefined;};var getAllMediaQueries=function getAllMediaQueries(props){if(isReactNative()){return {};}breakpoints.base;var breakpointsWithoutBase=_objectWithoutProperties(breakpoints,_excluded);return Object.fromEntries(Object.entries(breakpointsWithoutBase).map(function(_ref){var _ref2=_slicedToArray(_ref,2),breakpointKey=_ref2[0],breakpointValue=_ref2[1];var cssPropsForCurrentBreakpoint=getAllProps(props,breakpointKey);if(!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)){return [];}var mediaQuery=`@media ${getMediaQuery({min:breakpointValue})}`;return [mediaQuery,cssPropsForCurrentBreakpoint];}));};var getBaseBoxStyles=function getBaseBoxStyles(props){return Object.assign({},getAllProps(props),getAllMediaQueries(props));};
|
|
17
|
+
var _excluded=["base"];var isSpacingToken=function isSpacingToken(value){return typeof value==='string'&&value.startsWith('spacing.');};var getSpacingValue=function getSpacingValue(spacingValue,theme,breakpoint){if(isEmpty(spacingValue)){return undefined;}var responsiveSpacingValue=getResponsiveValue(spacingValue,breakpoint);if(isEmpty(responsiveSpacingValue)){return undefined;}if(responsiveSpacingValue==='auto'){return responsiveSpacingValue;}if(Array.isArray(responsiveSpacingValue)){return responsiveSpacingValue.map(function(value){return getSpacingValue(value,theme);}).join(' ');}if(isSpacingToken(responsiveSpacingValue)){var spacingReturnValue=getIn(theme,responsiveSpacingValue);return isEmpty(spacingReturnValue)?makeSpace(spacingReturnValue):undefined;}return responsiveSpacingValue;};var getColorValue=function getColorValue(color,theme,breakpoint){var responsiveBackgroundValue=getResponsiveValue(color,breakpoint);var tokenValue=getIn(theme,`colors.${responsiveBackgroundValue}`);return tokenValue!=null?tokenValue:responsiveBackgroundValue;};var getBorderRadiusValue=function getBorderRadiusValue(borderRadius,theme,breakpoint){var responsiveBorderRadiusValue=getResponsiveValue(borderRadius,breakpoint);return isEmpty(responsiveBorderRadiusValue)?undefined:makeBorderSize(getIn(theme,`border.radius.${responsiveBorderRadiusValue}`));};var getBorderWidthValue=function getBorderWidthValue(borderWidth,theme,breakpoint){var responsiveBorderWidthValue=getResponsiveValue(borderWidth,breakpoint);return isEmpty(responsiveBorderWidthValue)?undefined:makeBorderSize(getIn(theme,`border.width.${responsiveBorderWidthValue}`));};var getElevationValue=function getElevationValue(elevation,theme,breakpoint){var responsiveElevationValue=getResponsiveValue(elevation,breakpoint);return isEmpty(responsiveElevationValue)?undefined:getIn(theme,`elevation.${responsiveElevationValue}`);};var getAllProps=function getAllProps(props,breakpoint){var _props$paddingTop,_props$paddingBottom,_props$paddingRight,_props$paddingLeft,_props$marginBottom,_props$marginTop,_props$marginRight,_props$marginLeft;var hasBorder=props.borderWidth||props.borderColor;var hasBorderRight=props.borderRight||props.borderRightColor||props.borderRightWidth;var hasBorderLeft=props.borderLeft||props.borderLeftColor||props.borderLeftWidth;var hasBorderTop=props.borderTop||props.borderTopColor||props.borderTopWidth;var hasBorderBottom=props.borderBottom||props.borderBottomColor||props.borderBottomWidth;return Object.assign({display:getResponsiveValue(props.display,breakpoint),overflow:getResponsiveValue(props.overflow,breakpoint),overflowX:getResponsiveValue(props.overflowX,breakpoint),overflowY:getResponsiveValue(props.overflowY,breakpoint),textAlign:getResponsiveValue(props.textAlign,breakpoint),whiteSpace:getResponsiveValue(props.whiteSpace,breakpoint),flex:getResponsiveValue(props.flex,breakpoint),flexWrap:getResponsiveValue(props.flexWrap,breakpoint),flexDirection:getResponsiveValue(props.flexDirection,breakpoint),flexGrow:getResponsiveValue(props.flexGrow,breakpoint),flexShrink:getResponsiveValue(props.flexShrink,breakpoint),flexBasis:getResponsiveValue(props.flexBasis,breakpoint),alignItems:getResponsiveValue(props.alignItems,breakpoint),alignContent:getResponsiveValue(props.alignContent,breakpoint),alignSelf:getResponsiveValue(props.alignSelf,breakpoint),justifyItems:getResponsiveValue(props.justifyItems,breakpoint),justifyContent:getResponsiveValue(props.justifyContent,breakpoint),justifySelf:getResponsiveValue(props.justifySelf,breakpoint),placeSelf:getResponsiveValue(props.placeSelf,breakpoint),placeItems:getResponsiveValue(props.placeItems,breakpoint),order:getResponsiveValue(props.order,breakpoint),position:getResponsiveValue(props.position,breakpoint),zIndex:getResponsiveValue(props.zIndex,breakpoint),grid:getResponsiveValue(props.grid,breakpoint),gridColumn:getResponsiveValue(props.gridColumn,breakpoint),gridRow:getResponsiveValue(props.gridRow,breakpoint),gridRowStart:getResponsiveValue(props.gridRowStart,breakpoint),gridRowEnd:getResponsiveValue(props.gridRowEnd,breakpoint),gridArea:getResponsiveValue(props.gridArea,breakpoint),gridAutoFlow:getResponsiveValue(props.gridAutoFlow,breakpoint),gridAutoRows:getResponsiveValue(props.gridAutoRows,breakpoint),gridAutoColumns:getResponsiveValue(props.gridAutoColumns,breakpoint),gridTemplate:getResponsiveValue(props.gridTemplate,breakpoint),gridTemplateAreas:getResponsiveValue(props.gridTemplateAreas,breakpoint),gridTemplateColumns:getResponsiveValue(props.gridTemplateColumns,breakpoint),gridTemplateRows:getResponsiveValue(props.gridTemplateRows,breakpoint),padding:getSpacingValue(props.padding,props.theme,breakpoint),paddingTop:getSpacingValue((_props$paddingTop=props.paddingTop)!=null?_props$paddingTop:props.paddingY,props.theme,breakpoint),paddingBottom:getSpacingValue((_props$paddingBottom=props.paddingBottom)!=null?_props$paddingBottom:props.paddingY,props.theme,breakpoint),paddingRight:getSpacingValue((_props$paddingRight=props.paddingRight)!=null?_props$paddingRight:props.paddingX,props.theme,breakpoint),paddingLeft:getSpacingValue((_props$paddingLeft=props.paddingLeft)!=null?_props$paddingLeft:props.paddingX,props.theme,breakpoint),margin:getSpacingValue(props.margin,props.theme,breakpoint),marginBottom:getSpacingValue((_props$marginBottom=props.marginBottom)!=null?_props$marginBottom:props.marginY,props.theme,breakpoint),marginTop:getSpacingValue((_props$marginTop=props.marginTop)!=null?_props$marginTop:props.marginY,props.theme,breakpoint),marginRight:getSpacingValue((_props$marginRight=props.marginRight)!=null?_props$marginRight:props.marginX,props.theme,breakpoint),marginLeft:getSpacingValue((_props$marginLeft=props.marginLeft)!=null?_props$marginLeft:props.marginX,props.theme,breakpoint),height:getSpacingValue(props.height,props.theme,breakpoint),minHeight:getSpacingValue(props.minHeight,props.theme,breakpoint),maxHeight:getSpacingValue(props.maxHeight,props.theme,breakpoint),width:getSpacingValue(props.width,props.theme,breakpoint),minWidth:getSpacingValue(props.minWidth,props.theme,breakpoint),maxWidth:getSpacingValue(props.maxWidth,props.theme,breakpoint),gap:getSpacingValue(props.gap,props.theme,breakpoint),rowGap:getSpacingValue(props.rowGap,props.theme,breakpoint),columnGap:getSpacingValue(props.columnGap,props.theme,breakpoint),top:getSpacingValue(props.top,props.theme,breakpoint),right:getSpacingValue(props.right,props.theme,breakpoint),bottom:getSpacingValue(props.bottom,props.theme,breakpoint),left:getSpacingValue(props.left,props.theme,breakpoint),backgroundColor:getColorValue(props.backgroundColor,props.theme,breakpoint),backgroundImage:getResponsiveValue(props.backgroundImage,breakpoint),backgroundSize:getResponsiveValue(props.backgroundSize,breakpoint),backgroundPosition:getResponsiveValue(props.backgroundPosition,breakpoint),backgroundOrigin:getResponsiveValue(props.backgroundOrigin,breakpoint),backgroundRepeat:getResponsiveValue(props.backgroundRepeat,breakpoint),borderRadius:getBorderRadiusValue(props.borderRadius,props.theme,breakpoint),lineHeight:getSpacingValue(props.lineHeight,props.theme,breakpoint),border:getResponsiveValue(props.border,breakpoint),borderTop:getResponsiveValue(props.borderTop,breakpoint),borderRight:getResponsiveValue(props.borderRight,breakpoint),borderBottom:getResponsiveValue(props.borderBottom,breakpoint),borderLeft:getResponsiveValue(props.borderLeft,breakpoint),borderWidth:getBorderWidthValue(props.borderWidth,props.theme,breakpoint),borderColor:getColorValue(props.borderColor,props.theme,breakpoint),borderTopWidth:getBorderWidthValue(props.borderTopWidth,props.theme,breakpoint),borderTopColor:getColorValue(props.borderTopColor,props.theme,breakpoint),borderRightWidth:getBorderWidthValue(props.borderRightWidth,props.theme,breakpoint),borderRightColor:getColorValue(props.borderRightColor,props.theme,breakpoint),borderBottomWidth:getBorderWidthValue(props.borderBottomWidth,props.theme,breakpoint),borderBottomColor:getColorValue(props.borderBottomColor,props.theme,breakpoint),borderLeftWidth:getBorderWidthValue(props.borderLeftWidth,props.theme,breakpoint),borderLeftColor:getColorValue(props.borderLeftColor,props.theme,breakpoint),borderTopLeftRadius:getBorderRadiusValue(props.borderTopLeftRadius,props.theme,breakpoint),borderTopRightRadius:getBorderRadiusValue(props.borderTopRightRadius,props.theme,breakpoint),borderBottomRightRadius:getBorderRadiusValue(props.borderBottomRightRadius,props.theme,breakpoint),borderBottomLeftRadius:getBorderRadiusValue(props.borderBottomLeftRadius,props.theme,breakpoint),borderStyle:hasBorder?'solid':undefined,cursor:getResponsiveValue(props.cursor,breakpoint)},!hasBorder&&{borderTopStyle:hasBorderTop?'solid':undefined,borderBottomStyle:hasBorderBottom?'solid':undefined,borderLeftStyle:hasBorderLeft?'solid':undefined,borderRightStyle:hasBorderRight?'solid':undefined},{touchAction:getResponsiveValue(props.touchAction,breakpoint),userSelect:getResponsiveValue(props.userSelect,breakpoint),pointerEvents:getResponsiveValue(props.pointerEvents),opacity:getResponsiveValue(props.opacity,breakpoint),visibility:getResponsiveValue(props.visibility,breakpoint)},!isReactNative()&&{boxShadow:getElevationValue(props.elevation,props.theme,breakpoint)},{transform:getResponsiveValue(props.transform,breakpoint),transformOrigin:getResponsiveValue(props.transformOrigin,breakpoint),clipPath:getResponsiveValue(props.clipPath,breakpoint)});};var shouldAddBreakpoint=function shouldAddBreakpoint(cssProps){var firstDefinedValue=Object.values(cssProps).find(function(cssValue){return cssValue!==undefined&&cssValue!==null;});return firstDefinedValue!==undefined;};var getAllMediaQueries=function getAllMediaQueries(props){if(isReactNative()){return {};}breakpoints.base;var breakpointsWithoutBase=_objectWithoutProperties(breakpoints,_excluded);return Object.fromEntries(Object.entries(breakpointsWithoutBase).map(function(_ref){var _ref2=_slicedToArray(_ref,2),breakpointKey=_ref2[0],breakpointValue=_ref2[1];var cssPropsForCurrentBreakpoint=getAllProps(props,breakpointKey);if(!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)){return [];}var mediaQuery=`@media ${getMediaQuery({min:breakpointValue})}`;return [mediaQuery,cssPropsForCurrentBreakpoint];}));};var getBaseBoxStyles=function getBaseBoxStyles(props){return Object.assign({},getAllProps(props),getAllMediaQueries(props));};
|
|
18
18
|
|
|
19
19
|
export { getAllMediaQueries, getAllProps, getBaseBoxStyles, getBorderRadiusValue, getColorValue, getElevationValue, getSpacingValue, shouldAddBreakpoint };
|
|
20
20
|
//# sourceMappingURL=baseBoxStyles.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseBoxStyles.js","sources":["../../../../../../src/components/Box/BaseBox/baseBoxStyles.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CSSObject } from 'styled-components';\nimport type {\n BaseBoxProps,\n MakeValueResponsive,\n SpacingValueType,\n ArrayOfMaxLength4,\n} from './types';\nimport { getResponsiveValue } from './getResponsiveValue';\nimport getIn from '~utils/lodashButBetter/get';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { Breakpoints } from '~tokens/global';\nimport { breakpoints } from '~tokens/global';\nimport { isReactNative, getMediaQuery } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\nconst isSpacingToken = (value: string): value is DotNotationSpacingStringToken => {\n return typeof value === 'string' && value.startsWith('spacing.');\n};\n\nconst getSpacingValue = (\n spacingValue:\n | MakeValueResponsive<SpacingValueType | ArrayOfMaxLength4<SpacingValueType>>\n | undefined,\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n if (isEmpty(spacingValue)) {\n return undefined;\n }\n\n const responsiveSpacingValue = getResponsiveValue(\n spacingValue as MakeValueResponsive<SpacingValueType | SpacingValueType[]>,\n breakpoint,\n );\n\n if (isEmpty(responsiveSpacingValue)) {\n return undefined;\n }\n\n if (responsiveSpacingValue === 'auto') {\n return responsiveSpacingValue;\n }\n\n if (Array.isArray(responsiveSpacingValue)) {\n return responsiveSpacingValue.map((value) => getSpacingValue(value, theme)).join(' ');\n }\n\n if (isSpacingToken(responsiveSpacingValue)) {\n const spacingReturnValue = getIn(theme, responsiveSpacingValue);\n return isEmpty(spacingReturnValue) ? makeSpace(spacingReturnValue!) : undefined;\n }\n\n // pixel or with unit values\n return responsiveSpacingValue;\n};\n\nconst getColorValue = (\n color: BaseBoxProps['backgroundColor'] | BaseBoxProps['borderColor'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string => {\n const responsiveBackgroundValue = getResponsiveValue(color, breakpoint);\n // @ts-expect-error: We always return any from getResponsiveValue so value can't be inferred here\n const tokenValue = getIn(theme, `colors.${responsiveBackgroundValue}`);\n return tokenValue ?? responsiveBackgroundValue;\n};\n\nconst getBorderRadiusValue = (\n borderRadius: BaseBoxProps['borderRadius'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderRadiusValue = getResponsiveValue(borderRadius, breakpoint);\n return isEmpty(responsiveBorderRadiusValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.radius.${responsiveBorderRadiusValue}`));\n};\n\nconst getBorderWidthValue = (\n borderWidth: BaseBoxProps['borderWidth'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderWidthValue = getResponsiveValue(borderWidth, breakpoint);\n return isEmpty(responsiveBorderWidthValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.width.${responsiveBorderWidthValue}`));\n};\n\nexport const getElevationValue = (\n elevation: BaseBoxProps['elevation'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveElevationValue = getResponsiveValue(elevation, breakpoint);\n return isEmpty(responsiveElevationValue)\n ? undefined\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n getIn(theme, `elevation.${responsiveElevationValue!}`);\n};\n\nconst getAllProps = (\n props: BaseBoxProps & { theme: Theme },\n breakpoint?: keyof Breakpoints,\n): CSSObject => {\n const hasBorder = props.borderWidth || props.borderColor;\n const hasBorderRight = props.borderRight || props.borderRightColor || props.borderRightWidth;\n const hasBorderLeft = props.borderLeft || props.borderLeftColor || props.borderLeftWidth;\n const hasBorderTop = props.borderTop || props.borderTopColor || props.borderTopWidth;\n const hasBorderBottom = props.borderBottom || props.borderBottomColor || props.borderBottomWidth;\n\n return {\n display: getResponsiveValue(props.display, breakpoint),\n overflow: getResponsiveValue(props.overflow, breakpoint),\n overflowX: getResponsiveValue(props.overflowX, breakpoint),\n overflowY: getResponsiveValue(props.overflowY, breakpoint),\n textAlign: getResponsiveValue(props.textAlign, breakpoint),\n whiteSpace: getResponsiveValue(props.whiteSpace, breakpoint),\n\n // Flex\n flex: getResponsiveValue(props.flex, breakpoint),\n flexWrap: getResponsiveValue(props.flexWrap, breakpoint),\n flexDirection: getResponsiveValue(props.flexDirection, breakpoint),\n flexGrow: getResponsiveValue(props.flexGrow, breakpoint),\n flexShrink: getResponsiveValue(props.flexShrink, breakpoint),\n flexBasis: getResponsiveValue(props.flexBasis, breakpoint),\n alignItems: getResponsiveValue(props.alignItems, breakpoint),\n alignContent: getResponsiveValue(props.alignContent, breakpoint),\n alignSelf: getResponsiveValue(props.alignSelf, breakpoint),\n justifyItems: getResponsiveValue(props.justifyItems, breakpoint),\n justifyContent: getResponsiveValue(props.justifyContent, breakpoint),\n justifySelf: getResponsiveValue(props.justifySelf, breakpoint),\n placeSelf: getResponsiveValue(props.placeSelf, breakpoint),\n placeItems: getResponsiveValue(props.placeItems, breakpoint),\n order: getResponsiveValue(props.order, breakpoint),\n position: getResponsiveValue(props.position, breakpoint),\n zIndex: getResponsiveValue(props.zIndex, breakpoint),\n\n // Grid\n grid: getResponsiveValue(props.grid, breakpoint),\n gridColumn: getResponsiveValue(props.gridColumn, breakpoint),\n gridRow: getResponsiveValue(props.gridRow, breakpoint),\n gridRowStart: getResponsiveValue(props.gridRowStart, breakpoint),\n gridRowEnd: getResponsiveValue(props.gridRowEnd, breakpoint),\n gridArea: getResponsiveValue(props.gridArea, breakpoint),\n gridAutoFlow: getResponsiveValue(props.gridAutoFlow, breakpoint),\n gridAutoRows: getResponsiveValue(props.gridAutoRows, breakpoint),\n gridAutoColumns: getResponsiveValue(props.gridAutoColumns, breakpoint),\n gridTemplate: getResponsiveValue(props.gridTemplate, breakpoint),\n gridTemplateAreas: getResponsiveValue(props.gridTemplateAreas, breakpoint),\n gridTemplateColumns: getResponsiveValue(props.gridTemplateColumns, breakpoint),\n gridTemplateRows: getResponsiveValue(props.gridTemplateRows, breakpoint),\n\n // Spacing Props\n padding: getSpacingValue(props.padding, props.theme, breakpoint),\n paddingTop: getSpacingValue(props.paddingTop ?? props.paddingY, props.theme, breakpoint),\n paddingBottom: getSpacingValue(props.paddingBottom ?? props.paddingY, props.theme, breakpoint),\n paddingRight: getSpacingValue(props.paddingRight ?? props.paddingX, props.theme, breakpoint),\n paddingLeft: getSpacingValue(props.paddingLeft ?? props.paddingX, props.theme, breakpoint),\n margin: getSpacingValue(props.margin, props.theme, breakpoint),\n marginBottom: getSpacingValue(props.marginBottom ?? props.marginY, props.theme, breakpoint),\n marginTop: getSpacingValue(props.marginTop ?? props.marginY, props.theme, breakpoint),\n marginRight: getSpacingValue(props.marginRight ?? props.marginX, props.theme, breakpoint),\n marginLeft: getSpacingValue(props.marginLeft ?? props.marginX, props.theme, breakpoint),\n height: getSpacingValue(props.height, props.theme, breakpoint),\n minHeight: getSpacingValue(props.minHeight, props.theme, breakpoint),\n maxHeight: getSpacingValue(props.maxHeight, props.theme, breakpoint),\n width: getSpacingValue(props.width, props.theme, breakpoint),\n minWidth: getSpacingValue(props.minWidth, props.theme, breakpoint),\n maxWidth: getSpacingValue(props.maxWidth, props.theme, breakpoint),\n gap: getSpacingValue(props.gap, props.theme, breakpoint),\n rowGap: getSpacingValue(props.rowGap, props.theme, breakpoint),\n columnGap: getSpacingValue(props.columnGap, props.theme, breakpoint),\n top: getSpacingValue(props.top, props.theme, breakpoint),\n right: getSpacingValue(props.right, props.theme, breakpoint),\n bottom: getSpacingValue(props.bottom, props.theme, breakpoint),\n left: getSpacingValue(props.left, props.theme, breakpoint),\n\n // Visual props\n backgroundColor: getColorValue(props.backgroundColor, props.theme, breakpoint),\n backgroundImage: getResponsiveValue(props.backgroundImage, breakpoint),\n backgroundSize: getResponsiveValue(props.backgroundSize, breakpoint),\n backgroundPosition: getResponsiveValue(props.backgroundPosition, breakpoint),\n backgroundOrigin: getResponsiveValue(props.backgroundOrigin, breakpoint),\n backgroundRepeat: getResponsiveValue(props.backgroundRepeat, breakpoint),\n borderRadius: getBorderRadiusValue(props.borderRadius, props.theme, breakpoint),\n lineHeight: getSpacingValue(props.lineHeight, props.theme, breakpoint),\n border: getResponsiveValue(props.border, breakpoint),\n borderTop: getResponsiveValue(props.borderTop, breakpoint),\n borderRight: getResponsiveValue(props.borderRight, breakpoint),\n borderBottom: getResponsiveValue(props.borderBottom, breakpoint),\n borderLeft: getResponsiveValue(props.borderLeft, breakpoint),\n borderWidth: getBorderWidthValue(props.borderWidth, props.theme, breakpoint),\n borderColor: getColorValue(props.borderColor, props.theme, breakpoint),\n borderTopWidth: getBorderWidthValue(props.borderTopWidth, props.theme, breakpoint),\n borderTopColor: getColorValue(props.borderTopColor, props.theme, breakpoint),\n borderRightWidth: getBorderWidthValue(props.borderRightWidth, props.theme, breakpoint),\n borderRightColor: getColorValue(props.borderRightColor, props.theme, breakpoint),\n borderBottomWidth: getBorderWidthValue(props.borderBottomWidth, props.theme, breakpoint),\n borderBottomColor: getColorValue(props.borderBottomColor, props.theme, breakpoint),\n borderLeftWidth: getBorderWidthValue(props.borderLeftWidth, props.theme, breakpoint),\n borderLeftColor: getColorValue(props.borderLeftColor, props.theme, breakpoint),\n borderTopLeftRadius: getBorderRadiusValue(props.borderTopLeftRadius, props.theme, breakpoint),\n borderTopRightRadius: getBorderRadiusValue(props.borderTopRightRadius, props.theme, breakpoint),\n borderBottomRightRadius: getBorderRadiusValue(\n props.borderBottomRightRadius,\n props.theme,\n breakpoint,\n ),\n borderBottomLeftRadius: getBorderRadiusValue(\n props.borderBottomLeftRadius,\n props.theme,\n breakpoint,\n ),\n borderStyle: hasBorder ? 'solid' : undefined,\n // Since we only allow 'solid', we can use the same value for all borders if hasBorder is true\n // If hasBorder is false, we need to check each border individually\n ...(!hasBorder && {\n borderTopStyle: hasBorderTop ? 'solid' : undefined,\n borderBottomStyle: hasBorderBottom ? 'solid' : undefined,\n borderLeftStyle: hasBorderLeft ? 'solid' : undefined,\n borderRightStyle: hasBorderRight ? 'solid' : undefined,\n }),\n\n touchAction: getResponsiveValue(props.touchAction, breakpoint),\n userSelect: getResponsiveValue(props.userSelect, breakpoint),\n pointerEvents: getResponsiveValue(props.pointerEvents),\n opacity: getResponsiveValue(props.opacity, breakpoint),\n visibility: getResponsiveValue(props.visibility, breakpoint),\n ...(!isReactNative() && {\n boxShadow: getElevationValue(props.elevation, props.theme, breakpoint),\n }),\n\n // Polygon support\n transform: getResponsiveValue(props.transform as string, breakpoint),\n transformOrigin: getResponsiveValue(props.transformOrigin, breakpoint),\n clipPath: getResponsiveValue(props.clipPath, breakpoint),\n };\n};\n\n/** We only add breakpoint if at least one of the value is defined */\nconst shouldAddBreakpoint = (cssProps: CSSObject): boolean => {\n const firstDefinedValue = Object.values(cssProps).find(\n (cssValue) => cssValue !== undefined && cssValue !== null,\n );\n\n return firstDefinedValue !== undefined;\n};\n\nconst getAllMediaQueries = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n if (isReactNative()) {\n return {};\n }\n\n const { base, ...breakpointsWithoutBase } = breakpoints;\n\n return Object.fromEntries(\n Object.entries(breakpointsWithoutBase).map(([breakpointKey, breakpointValue]) => {\n const cssPropsForCurrentBreakpoint = getAllProps(props, breakpointKey as keyof Breakpoints);\n if (!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)) {\n return [];\n }\n\n const mediaQuery = `@media ${getMediaQuery({ min: breakpointValue })}`;\n return [mediaQuery, cssPropsForCurrentBreakpoint];\n }),\n );\n};\n\nconst getBaseBoxStyles = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n return {\n ...getAllProps(props),\n ...getAllMediaQueries(props),\n };\n};\n\nexport {\n getBaseBoxStyles,\n getSpacingValue,\n getColorValue,\n getBorderRadiusValue,\n shouldAddBreakpoint,\n getAllMediaQueries,\n getAllProps,\n};\n"],"names":["isSpacingToken","value","startsWith","getSpacingValue","spacingValue","theme","breakpoint","isEmpty","undefined","responsiveSpacingValue","getResponsiveValue","Array","isArray","map","join","spacingReturnValue","getIn","makeSpace","getColorValue","color","responsiveBackgroundValue","tokenValue","getBorderRadiusValue","borderRadius","responsiveBorderRadiusValue","makeBorderSize","getBorderWidthValue","borderWidth","responsiveBorderWidthValue","getElevationValue","elevation","responsiveElevationValue","getAllProps","props","_props$paddingTop","_props$paddingBottom","_props$paddingRight","_props$paddingLeft","_props$marginBottom","_props$marginTop","_props$marginRight","_props$marginLeft","hasBorder","borderColor","hasBorderRight","borderRight","borderRightColor","borderRightWidth","hasBorderLeft","borderLeft","borderLeftColor","borderLeftWidth","hasBorderTop","borderTop","borderTopColor","borderTopWidth","hasBorderBottom","borderBottom","borderBottomColor","borderBottomWidth","Object","assign","display","overflow","overflowX","overflowY","textAlign","whiteSpace","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","position","zIndex","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingY","paddingBottom","paddingRight","paddingX","paddingLeft","margin","marginBottom","marginY","marginTop","marginRight","marginX","marginLeft","height","minHeight","maxHeight","width","minWidth","maxWidth","gap","rowGap","columnGap","top","right","bottom","left","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","lineHeight","border","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderStyle","borderTopStyle","borderBottomStyle","borderLeftStyle","borderRightStyle","touchAction","userSelect","pointerEvents","opacity","visibility","isReactNative","boxShadow","transform","transformOrigin","clipPath","shouldAddBreakpoint","cssProps","firstDefinedValue","values","find","cssValue","getAllMediaQueries","breakpoints","base","breakpointsWithoutBase","_objectWithoutProperties","_excluded","fromEntries","entries","_ref","_ref2","_slicedToArray","breakpointKey","breakpointValue","cssPropsForCurrentBreakpoint","mediaQuery","getMediaQuery","min","getBaseBoxStyles"],"mappings":";;;;;;;;;;;;;;;;uBAoBA,IAAMA,cAAc,CAAG,SAAjBA,cAAcA,CAAIC,KAAa,CAA6C,CAChF,OAAO,OAAOA,KAAK,GAAK,QAAQ,EAAIA,KAAK,CAACC,UAAU,CAAC,UAAU,CAAC,CAClE,CAAC,CAEK,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CACnBC,YAEa,CACbC,KAAY,CACZC,UAA8B,CACP,CACvB,GAAIC,OAAO,CAACH,YAAY,CAAC,CAAE,CACzB,OAAOI,SAAS,CAClB,CAEA,IAAMC,sBAAsB,CAAGC,kBAAkB,CAC/CN,YAAY,CACZE,UACF,CAAC,CAED,GAAIC,OAAO,CAACE,sBAAsB,CAAC,CAAE,CACnC,OAAOD,SAAS,CAClB,CAEA,GAAIC,sBAAsB,GAAK,MAA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,QAAQ,GAAK,IAAI,CAAA,CAC3D,CAAC,CAED,OAAOH,iBAAiB,GAAKlJ,SAAS,CACxC,EAEM,IAAAsJ,kBAAkB,CAAG,SAArBA,kBAAkBA,CAAI7H,KAAsC,CAAgB,CAChF,GAAIkH,aAAa,EAAE,CAAE,CACnB,OAAO,EAAE,CACX,CAE4CY,WAAW,CAA/CC,IAAI,KAAKC,sBAAsB,CAAAC,wBAAA,CAAKH,WAAW,CAAAI,SAAA,EAEvD,OAAOvG,MAAM,CAACwG,WAAW,CACvBxG,MAAM,CAACyG,OAAO,CAACJ,sBAAsB,CAAC,CAACpJ,GAAG,CAAC,SAAAyJ,IAAA,CAAsC,CAAA,IAAAC,KAAA,CAAAC,cAAA,CAAAF,IAAA,CAAA,CAAA,CAAA,CAApCG,aAAa,CAAAF,KAAA,CAAA,CAAA,CAAA,CAAEG,eAAe,CAAAH,KAAA,CAAA,CAAA,CAAA,CACzE,IAAMI,4BAA4B,CAAG3I,WAAW,CAACC,KAAK,CAAEwI,aAAkC,CAAC,CAC3F,GAAI,CAACjB,mBAAmB,CAACmB,4BAA4B,CAAC,CAAE,CACtD,OAAO,EAAE,CACX,CAEA,IAAMC,UAAU,CAAI,CAAA,OAAA,EAASC,aAAa,CAAC,CAAEC,GAAG,CAAEJ,eAAgB,CAAC,CAAE,CAAC,CAAA,CACtE,OAAO,CAACE,UAAU,CAAED,4BAA4B,CAAC,CACnD,CAAC,CACH,CAAC,CACH,EAEM,IAAAI,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAI9I,KAAsC,CAAgB,CAC9E,OAAA2B,MAAA,CAAAC,MAAA,CACK7B,EAAAA,CAAAA,WAAW,CAACC,KAAK,CAAC,CAClB6H,kBAAkB,CAAC7H,KAAK,CAAC,CAEhC,CAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"baseBoxStyles.js","sources":["../../../../../../src/components/Box/BaseBox/baseBoxStyles.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/prefer-ts-expect-error */\n/* eslint-disable @typescript-eslint/no-unnecessary-type-assertion */\nimport type { CSSObject } from 'styled-components';\nimport type {\n BaseBoxProps,\n MakeValueResponsive,\n SpacingValueType,\n ArrayOfMaxLength4,\n} from './types';\nimport { getResponsiveValue } from './getResponsiveValue';\nimport getIn from '~utils/lodashButBetter/get';\nimport isEmpty from '~utils/lodashButBetter/isEmpty';\nimport type { Breakpoints } from '~tokens/global';\nimport { breakpoints } from '~tokens/global';\nimport { isReactNative, getMediaQuery } from '~utils';\nimport type { Theme } from '~components/BladeProvider';\nimport { makeSpace } from '~utils/makeSpace';\nimport { makeBorderSize } from '~utils/makeBorderSize';\nimport type { DotNotationSpacingStringToken } from '~utils/types';\n\nconst isSpacingToken = (value: string): value is DotNotationSpacingStringToken => {\n return typeof value === 'string' && value.startsWith('spacing.');\n};\n\nconst getSpacingValue = (\n spacingValue:\n | MakeValueResponsive<SpacingValueType | ArrayOfMaxLength4<SpacingValueType>>\n | undefined,\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n if (isEmpty(spacingValue)) {\n return undefined;\n }\n\n const responsiveSpacingValue = getResponsiveValue(\n spacingValue as MakeValueResponsive<SpacingValueType | SpacingValueType[]>,\n breakpoint,\n );\n\n if (isEmpty(responsiveSpacingValue)) {\n return undefined;\n }\n\n if (responsiveSpacingValue === 'auto') {\n return responsiveSpacingValue;\n }\n\n if (Array.isArray(responsiveSpacingValue)) {\n return responsiveSpacingValue.map((value) => getSpacingValue(value, theme)).join(' ');\n }\n\n if (isSpacingToken(responsiveSpacingValue)) {\n const spacingReturnValue = getIn(theme, responsiveSpacingValue);\n return isEmpty(spacingReturnValue) ? makeSpace(spacingReturnValue!) : undefined;\n }\n\n // pixel or with unit values\n return responsiveSpacingValue;\n};\n\nconst getColorValue = (\n color: BaseBoxProps['backgroundColor'] | BaseBoxProps['borderColor'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string => {\n const responsiveBackgroundValue = getResponsiveValue(color, breakpoint);\n // @ts-expect-error: We always return any from getResponsiveValue so value can't be inferred here\n const tokenValue = getIn(theme, `colors.${responsiveBackgroundValue}`);\n return tokenValue ?? responsiveBackgroundValue;\n};\n\nconst getBorderRadiusValue = (\n borderRadius: BaseBoxProps['borderRadius'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderRadiusValue = getResponsiveValue(borderRadius, breakpoint);\n return isEmpty(responsiveBorderRadiusValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.radius.${responsiveBorderRadiusValue}`));\n};\n\nconst getBorderWidthValue = (\n borderWidth: BaseBoxProps['borderWidth'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveBorderWidthValue = getResponsiveValue(borderWidth, breakpoint);\n return isEmpty(responsiveBorderWidthValue)\n ? undefined\n : // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n makeBorderSize(getIn(theme, `border.width.${responsiveBorderWidthValue}`));\n};\n\nexport const getElevationValue = (\n elevation: BaseBoxProps['elevation'],\n theme: Theme,\n breakpoint?: keyof Breakpoints,\n): string | undefined => {\n const responsiveElevationValue = getResponsiveValue(elevation, breakpoint);\n return isEmpty(responsiveElevationValue)\n ? undefined\n : // eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion\n // @ts-ignore: intentionally set to any since figuring out types of responsive props is complex\n getIn(theme, `elevation.${responsiveElevationValue!}`);\n};\n\nconst getAllProps = (\n props: BaseBoxProps & { theme: Theme },\n breakpoint?: keyof Breakpoints,\n): CSSObject => {\n const hasBorder = props.borderWidth || props.borderColor;\n const hasBorderRight = props.borderRight || props.borderRightColor || props.borderRightWidth;\n const hasBorderLeft = props.borderLeft || props.borderLeftColor || props.borderLeftWidth;\n const hasBorderTop = props.borderTop || props.borderTopColor || props.borderTopWidth;\n const hasBorderBottom = props.borderBottom || props.borderBottomColor || props.borderBottomWidth;\n\n return {\n display: getResponsiveValue(props.display, breakpoint),\n overflow: getResponsiveValue(props.overflow, breakpoint),\n overflowX: getResponsiveValue(props.overflowX, breakpoint),\n overflowY: getResponsiveValue(props.overflowY, breakpoint),\n textAlign: getResponsiveValue(props.textAlign, breakpoint),\n whiteSpace: getResponsiveValue(props.whiteSpace, breakpoint),\n\n // Flex\n flex: getResponsiveValue(props.flex, breakpoint),\n flexWrap: getResponsiveValue(props.flexWrap, breakpoint),\n flexDirection: getResponsiveValue(props.flexDirection, breakpoint),\n flexGrow: getResponsiveValue(props.flexGrow, breakpoint),\n flexShrink: getResponsiveValue(props.flexShrink, breakpoint),\n flexBasis: getResponsiveValue(props.flexBasis, breakpoint),\n alignItems: getResponsiveValue(props.alignItems, breakpoint),\n alignContent: getResponsiveValue(props.alignContent, breakpoint),\n alignSelf: getResponsiveValue(props.alignSelf, breakpoint),\n justifyItems: getResponsiveValue(props.justifyItems, breakpoint),\n justifyContent: getResponsiveValue(props.justifyContent, breakpoint),\n justifySelf: getResponsiveValue(props.justifySelf, breakpoint),\n placeSelf: getResponsiveValue(props.placeSelf, breakpoint),\n placeItems: getResponsiveValue(props.placeItems, breakpoint),\n order: getResponsiveValue(props.order, breakpoint),\n position: getResponsiveValue(props.position, breakpoint),\n zIndex: getResponsiveValue(props.zIndex, breakpoint),\n\n // Grid\n grid: getResponsiveValue(props.grid, breakpoint),\n gridColumn: getResponsiveValue(props.gridColumn, breakpoint),\n gridRow: getResponsiveValue(props.gridRow, breakpoint),\n gridRowStart: getResponsiveValue(props.gridRowStart, breakpoint),\n gridRowEnd: getResponsiveValue(props.gridRowEnd, breakpoint),\n gridArea: getResponsiveValue(props.gridArea, breakpoint),\n gridAutoFlow: getResponsiveValue(props.gridAutoFlow, breakpoint),\n gridAutoRows: getResponsiveValue(props.gridAutoRows, breakpoint),\n gridAutoColumns: getResponsiveValue(props.gridAutoColumns, breakpoint),\n gridTemplate: getResponsiveValue(props.gridTemplate, breakpoint),\n gridTemplateAreas: getResponsiveValue(props.gridTemplateAreas, breakpoint),\n gridTemplateColumns: getResponsiveValue(props.gridTemplateColumns, breakpoint),\n gridTemplateRows: getResponsiveValue(props.gridTemplateRows, breakpoint),\n\n // Spacing Props\n padding: getSpacingValue(props.padding, props.theme, breakpoint),\n paddingTop: getSpacingValue(props.paddingTop ?? props.paddingY, props.theme, breakpoint),\n paddingBottom: getSpacingValue(props.paddingBottom ?? props.paddingY, props.theme, breakpoint),\n paddingRight: getSpacingValue(props.paddingRight ?? props.paddingX, props.theme, breakpoint),\n paddingLeft: getSpacingValue(props.paddingLeft ?? props.paddingX, props.theme, breakpoint),\n margin: getSpacingValue(props.margin, props.theme, breakpoint),\n marginBottom: getSpacingValue(props.marginBottom ?? props.marginY, props.theme, breakpoint),\n marginTop: getSpacingValue(props.marginTop ?? props.marginY, props.theme, breakpoint),\n marginRight: getSpacingValue(props.marginRight ?? props.marginX, props.theme, breakpoint),\n marginLeft: getSpacingValue(props.marginLeft ?? props.marginX, props.theme, breakpoint),\n height: getSpacingValue(props.height, props.theme, breakpoint),\n minHeight: getSpacingValue(props.minHeight, props.theme, breakpoint),\n maxHeight: getSpacingValue(props.maxHeight, props.theme, breakpoint),\n width: getSpacingValue(props.width, props.theme, breakpoint),\n minWidth: getSpacingValue(props.minWidth, props.theme, breakpoint),\n maxWidth: getSpacingValue(props.maxWidth, props.theme, breakpoint),\n gap: getSpacingValue(props.gap, props.theme, breakpoint),\n rowGap: getSpacingValue(props.rowGap, props.theme, breakpoint),\n columnGap: getSpacingValue(props.columnGap, props.theme, breakpoint),\n top: getSpacingValue(props.top, props.theme, breakpoint),\n right: getSpacingValue(props.right, props.theme, breakpoint),\n bottom: getSpacingValue(props.bottom, props.theme, breakpoint),\n left: getSpacingValue(props.left, props.theme, breakpoint),\n\n // Visual props\n backgroundColor: getColorValue(props.backgroundColor, props.theme, breakpoint),\n backgroundImage: getResponsiveValue(props.backgroundImage, breakpoint),\n backgroundSize: getResponsiveValue(props.backgroundSize, breakpoint),\n backgroundPosition: getResponsiveValue(props.backgroundPosition, breakpoint),\n backgroundOrigin: getResponsiveValue(props.backgroundOrigin, breakpoint),\n backgroundRepeat: getResponsiveValue(props.backgroundRepeat, breakpoint),\n borderRadius: getBorderRadiusValue(props.borderRadius, props.theme, breakpoint),\n lineHeight: getSpacingValue(props.lineHeight, props.theme, breakpoint),\n border: getResponsiveValue(props.border, breakpoint),\n borderTop: getResponsiveValue(props.borderTop, breakpoint),\n borderRight: getResponsiveValue(props.borderRight, breakpoint),\n borderBottom: getResponsiveValue(props.borderBottom, breakpoint),\n borderLeft: getResponsiveValue(props.borderLeft, breakpoint),\n borderWidth: getBorderWidthValue(props.borderWidth, props.theme, breakpoint),\n borderColor: getColorValue(props.borderColor, props.theme, breakpoint),\n borderTopWidth: getBorderWidthValue(props.borderTopWidth, props.theme, breakpoint),\n borderTopColor: getColorValue(props.borderTopColor, props.theme, breakpoint),\n borderRightWidth: getBorderWidthValue(props.borderRightWidth, props.theme, breakpoint),\n borderRightColor: getColorValue(props.borderRightColor, props.theme, breakpoint),\n borderBottomWidth: getBorderWidthValue(props.borderBottomWidth, props.theme, breakpoint),\n borderBottomColor: getColorValue(props.borderBottomColor, props.theme, breakpoint),\n borderLeftWidth: getBorderWidthValue(props.borderLeftWidth, props.theme, breakpoint),\n borderLeftColor: getColorValue(props.borderLeftColor, props.theme, breakpoint),\n borderTopLeftRadius: getBorderRadiusValue(props.borderTopLeftRadius, props.theme, breakpoint),\n borderTopRightRadius: getBorderRadiusValue(props.borderTopRightRadius, props.theme, breakpoint),\n borderBottomRightRadius: getBorderRadiusValue(\n props.borderBottomRightRadius,\n props.theme,\n breakpoint,\n ),\n borderBottomLeftRadius: getBorderRadiusValue(\n props.borderBottomLeftRadius,\n props.theme,\n breakpoint,\n ),\n borderStyle: hasBorder ? 'solid' : undefined,\n cursor: getResponsiveValue(props.cursor, breakpoint),\n // Since we only allow 'solid', we can use the same value for all borders if hasBorder is true\n // If hasBorder is false, we need to check each border individually\n ...(!hasBorder && {\n borderTopStyle: hasBorderTop ? 'solid' : undefined,\n borderBottomStyle: hasBorderBottom ? 'solid' : undefined,\n borderLeftStyle: hasBorderLeft ? 'solid' : undefined,\n borderRightStyle: hasBorderRight ? 'solid' : undefined,\n }),\n\n touchAction: getResponsiveValue(props.touchAction, breakpoint),\n userSelect: getResponsiveValue(props.userSelect, breakpoint),\n pointerEvents: getResponsiveValue(props.pointerEvents),\n opacity: getResponsiveValue(props.opacity, breakpoint),\n visibility: getResponsiveValue(props.visibility, breakpoint),\n ...(!isReactNative() && {\n boxShadow: getElevationValue(props.elevation, props.theme, breakpoint),\n }),\n\n // Polygon support\n transform: getResponsiveValue(props.transform as string, breakpoint),\n transformOrigin: getResponsiveValue(props.transformOrigin, breakpoint),\n clipPath: getResponsiveValue(props.clipPath, breakpoint),\n };\n};\n\n/** We only add breakpoint if at least one of the value is defined */\nconst shouldAddBreakpoint = (cssProps: CSSObject): boolean => {\n const firstDefinedValue = Object.values(cssProps).find(\n (cssValue) => cssValue !== undefined && cssValue !== null,\n );\n\n return firstDefinedValue !== undefined;\n};\n\nconst getAllMediaQueries = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n if (isReactNative()) {\n return {};\n }\n\n const { base, ...breakpointsWithoutBase } = breakpoints;\n\n return Object.fromEntries(\n Object.entries(breakpointsWithoutBase).map(([breakpointKey, breakpointValue]) => {\n const cssPropsForCurrentBreakpoint = getAllProps(props, breakpointKey as keyof Breakpoints);\n if (!shouldAddBreakpoint(cssPropsForCurrentBreakpoint)) {\n return [];\n }\n\n const mediaQuery = `@media ${getMediaQuery({ min: breakpointValue })}`;\n return [mediaQuery, cssPropsForCurrentBreakpoint];\n }),\n );\n};\n\nconst getBaseBoxStyles = (props: BaseBoxProps & { theme: Theme }): CSSObject => {\n return {\n ...getAllProps(props),\n ...getAllMediaQueries(props),\n };\n};\n\nexport {\n getBaseBoxStyles,\n getSpacingValue,\n getColorValue,\n getBorderRadiusValue,\n shouldAddBreakpoint,\n getAllMediaQueries,\n getAllProps,\n};\n"],"names":["isSpacingToken","value","startsWith","getSpacingValue","spacingValue","theme","breakpoint","isEmpty","undefined","responsiveSpacingValue","getResponsiveValue","Array","isArray","map","join","spacingReturnValue","getIn","makeSpace","getColorValue","color","responsiveBackgroundValue","tokenValue","getBorderRadiusValue","borderRadius","responsiveBorderRadiusValue","makeBorderSize","getBorderWidthValue","borderWidth","responsiveBorderWidthValue","getElevationValue","elevation","responsiveElevationValue","getAllProps","props","_props$paddingTop","_props$paddingBottom","_props$paddingRight","_props$paddingLeft","_props$marginBottom","_props$marginTop","_props$marginRight","_props$marginLeft","hasBorder","borderColor","hasBorderRight","borderRight","borderRightColor","borderRightWidth","hasBorderLeft","borderLeft","borderLeftColor","borderLeftWidth","hasBorderTop","borderTop","borderTopColor","borderTopWidth","hasBorderBottom","borderBottom","borderBottomColor","borderBottomWidth","Object","assign","display","overflow","overflowX","overflowY","textAlign","whiteSpace","flex","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","position","zIndex","grid","gridColumn","gridRow","gridRowStart","gridRowEnd","gridArea","gridAutoFlow","gridAutoRows","gridAutoColumns","gridTemplate","gridTemplateAreas","gridTemplateColumns","gridTemplateRows","padding","paddingTop","paddingY","paddingBottom","paddingRight","paddingX","paddingLeft","margin","marginBottom","marginY","marginTop","marginRight","marginX","marginLeft","height","minHeight","maxHeight","width","minWidth","maxWidth","gap","rowGap","columnGap","top","right","bottom","left","backgroundColor","backgroundImage","backgroundSize","backgroundPosition","backgroundOrigin","backgroundRepeat","lineHeight","border","borderTopLeftRadius","borderTopRightRadius","borderBottomRightRadius","borderBottomLeftRadius","borderStyle","cursor","borderTopStyle","borderBottomStyle","borderLeftStyle","borderRightStyle","touchAction","userSelect","pointerEvents","opacity","visibility","isReactNative","boxShadow","transform","transformOrigin","clipPath","shouldAddBreakpoint","cssProps","firstDefinedValue","values","find","cssValue","getAllMediaQueries","breakpoints","base","breakpointsWithoutBase","_objectWithoutProperties","_excluded","fromEntries","entries","_ref","_ref2","_slicedToArray","breakpointKey","breakpointValue","cssPropsForCurrentBreakpoint","mediaQuery","getMediaQuery","min","getBaseBoxStyles"],"mappings":";;;;;;;;;;;;;;;;uBAoBA,IAAMA,cAAc,CAAG,SAAjBA,cAAcA,CAAIC,KAAa,CAA6C,CAChF,OAAO,OAAOA,KAAK,GAAK,QAAQ,EAAIA,KAAK,CAACC,UAAU,CAAC,UAAU,CAAC,CAClE,CAAC,CAEK,IAAAC,eAAe,CAAG,SAAlBA,eAAeA,CACnBC,YAEa,CACbC,KAAY,CACZC,UAA8B,CACP,CACvB,GAAIC,OAAO,CAACH,YAAY,CAAC,CAAE,CACzB,OAAOI,SAAS,CAClB,CAEA,IAAMC,sBAAsB,CAAGC,kBAAkB,CAC/CN,YAAY,CACZE,UACF,CAAC,CAED,GAAIC,OAAO,CAACE,sBAAsB,CAAC,CAAE,CACnC,OAAOD,SAAS,CAClB,CAEA,GAAIC,sBAAsB,GAAK,MAAM,CAAE,CACrC,OAAOA,sBAAsB,CAC/B,CAEA,GAAIE,KAAK,CAACC,OAAO,CAACH,sBAAsB,CAAC,CAAE,CACzC,OAAOA,sBAAsB,CAACI,GAAG,CAAC,SAACZ,KAAK,CAAA,CAAA,OAAKE,eAAe,CAACF,KAAK,CAAEI,KAAK,CAAC,CAAA,CAAA,CAAC,CAACS,IAAI,CAAC,GAAG,CAAC,CACvF,CAEA,GAAId,cAAc,CAACS,sBAAsB,CAAC,CAAE,CAC1C,IAAMM,kBAAkB,CAAGC,KAAK,CAACX,KAAK,CAAEI,sBAAsB,CAAC,CAC/D,OAAOF,OAAO,CAACQ,kBAAkB,CAAC,CAAGE,SAAS,CAACF,kBAAmB,CAAC,CAAGP,SAAS,CACjF,CAGA,OAAOC,sBAAsB,CAC/B,EAEM,IAAAS,aAAa,CAAG,SAAhBA,aAAaA,CACjBC,KAAoE,CACpEd,KAAY,CACZC,UAA8B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,KAAA,CAAA,CAAA,CAAA,CAAEG,eAAe,CAAAH,KAAA,CAAA,CAAA,CAAA,CACzE,IAAMI,4BAA4B,CAAG5I,WAAW,CAACC,KAAK,CAAEyI,aAAkC,CAAC,CAC3F,GAAI,CAACjB,mBAAmB,CAACmB,4BAA4B,CAAC,CAAE,CACtD,OAAO,EAAE,CACX,CAEA,IAAMC,UAAU,CAAI,CAAA,OAAA,EAASC,aAAa,CAAC,CAAEC,GAAG,CAAEJ,eAAgB,CAAC,CAAE,CAAC,CAAA,CACtE,OAAO,CAACE,UAAU,CAAED,4BAA4B,CAAC,CACnD,CAAC,CACH,CAAC,CACH,EAEM,IAAAI,gBAAgB,CAAG,SAAnBA,gBAAgBA,CAAI/I,KAAsC,CAAgB,CAC9E,OAAA2B,MAAA,CAAAC,MAAA,CACK7B,EAAAA,CAAAA,WAAW,CAACC,KAAK,CAAC,CAClB8H,kBAAkB,CAAC9H,KAAK,CAAC,CAEhC,CAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"propsTypes.js","sources":["../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--page\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor: BackgroundColorString<'surface'> | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA8GM,IAAAA,gBAAgB,CAAG,CACvB,KAAK,CACL,SAAS,CACT,QAAQ,CACR,QAAQ,CACR,MAAM,CACN,OAAO,CACP,KAAK,CACL,MAAM,CACN,OAAO;;;;"}
|
|
1
|
+
{"version":3,"file":"propsTypes.js","sources":["../../../../../../../src/components/Box/BaseBox/types/propsTypes.ts"],"sourcesContent":["import type { View } from 'react-native';\nimport type { CSSObject } from 'styled-components';\nimport type { MarginProps, PaddingProps, SpacingValueType } from './spacingTypes';\nimport type { MakeObjectResponsive } from './responsiveTypes';\nimport type { Theme } from '~components/BladeProvider';\nimport type { Border, Elevation } from '~tokens/global';\nimport type { PickCSSByPlatform, TestID } from '~utils/types';\nimport type { Platform } from '~utils';\nimport type { BladeCommonEvents } from '~components/types';\nimport type { DotNotationToken } from '~utils/lodashButBetter/get';\n\ntype LayoutProps = MakeObjectResponsive<\n {\n height: SpacingValueType;\n minHeight: SpacingValueType;\n maxHeight: SpacingValueType;\n width: SpacingValueType;\n minWidth: SpacingValueType;\n maxWidth: SpacingValueType;\n } & PickCSSByPlatform<\n 'display' | 'overflow' | 'overflowX' | 'overflowY' | 'textAlign' | 'whiteSpace'\n >\n>;\n\ntype FlexboxProps = MakeObjectResponsive<\n {\n /**\n * This uses the native gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=gap\n */\n gap: SpacingValueType;\n /**\n * This uses the native row-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=row-gap\n */\n rowGap: SpacingValueType;\n /**\n * This uses the native column-gap property which might not work on older browsers.\n * If you want to support older browsers, you might want to use `margin` instead.\n *\n * @see https://caniuse.com/?search=column-gap\n */\n columnGap: SpacingValueType;\n /**\n * The **`flex`** CSS shorthand property sets how a flex _item_ will grow or shrink to fit the space available in its flex container.\n *\n * @see https://developer.mozilla.org/docs/Web/CSS/flex\n */\n flex: string | number;\n } & PickCSSByPlatform<\n | 'flexWrap'\n | 'flexDirection'\n | 'flexGrow'\n | 'flexShrink'\n | 'flexBasis'\n | 'alignItems'\n | 'alignContent'\n | 'alignSelf'\n | 'justifyItems'\n | 'justifyContent'\n | 'justifySelf'\n | 'placeSelf'\n | 'placeItems'\n | 'order'\n >\n>;\n\ntype PositionProps = MakeObjectResponsive<\n {\n top: SpacingValueType;\n right: SpacingValueType;\n bottom: SpacingValueType;\n left: SpacingValueType;\n } & PickCSSByPlatform<'position' | 'zIndex'>\n>;\n\ntype GridProps = MakeObjectResponsive<\n PickCSSByPlatform<\n | 'grid'\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n | 'gridAutoFlow'\n | 'gridAutoRows'\n | 'gridAutoColumns'\n | 'gridTemplate'\n | 'gridTemplateAreas'\n | 'gridTemplateColumns'\n | 'gridTemplateRows'\n >\n>;\n\ntype ColorObjects = 'feedback' | 'surface' | 'interactive';\ntype BackgroundOnlyColorObjects = 'popup' | 'overlay';\ntype BackgroundColorString<\n T extends ColorObjects | BackgroundOnlyColorObjects\n> = `${T}.background.${DotNotationToken<Theme['colors'][T]['background']>}`;\ntype BorderColorString<T extends ColorObjects> = `${T}.border.${DotNotationToken<\n Theme['colors'][T]['border']\n>}`;\n\n// Created this as an array so I can reuse it for runtime validation\nconst validBoxAsValues = [\n 'div',\n 'section',\n 'footer',\n 'header',\n 'main',\n 'aside',\n 'nav',\n 'span',\n 'label',\n] as const;\n\ntype BoxAsType = typeof validBoxAsValues[number];\n\n// Visual props that are common for both Box and BaseBox\ntype CommonBoxVisualProps = MakeObjectResponsive<\n {\n borderRadius: keyof Border['radius'];\n borderWidth: keyof Border['width'];\n borderColor: BorderColorString<'surface'>;\n borderTopWidth: keyof Border['width'];\n borderTopColor: BorderColorString<'surface'>;\n borderRightWidth: keyof Border['width'];\n borderRightColor: BorderColorString<'surface'>;\n borderBottomWidth: keyof Border['width'];\n borderBottomColor: BorderColorString<'surface'>;\n borderLeftWidth: keyof Border['width'];\n borderLeftColor: BorderColorString<'surface'>;\n borderTopLeftRadius: keyof Border['radius'];\n borderTopRightRadius: keyof Border['radius'];\n borderBottomRightRadius: keyof Border['radius'];\n borderBottomLeftRadius: keyof Border['radius'];\n } & PickCSSByPlatform<\n | 'backgroundImage'\n | 'backgroundSize'\n | 'backgroundPosition'\n | 'backgroundOrigin'\n | 'backgroundRepeat'\n | 'pointerEvents'\n | 'opacity'\n | 'visibility'\n | 'transform'\n | 'transformOrigin'\n | 'clipPath'\n > & {\n /**\n * Sets the elevation for Box\n *\n * eg: `theme.elevation.midRaised`\n *\n * @default `theme.elevation.lowRaised`\n *\n * **Links:**\n * - Docs: https://blade.razorpay.com/?path=/docs/tokens-elevation--page\n */\n elevation?: keyof Elevation;\n }\n>;\n\n// Visual props that are specific BaseBox\n// This is used to ensure some of the more flexible BaseBox props are not passed to Box\ntype BaseBoxVisualProps = MakeObjectResponsive<\n {\n backgroundColor:\n | BackgroundColorString<'feedback'>\n | BackgroundColorString<'surface'>\n | BackgroundColorString<'interactive'>\n | BackgroundColorString<'overlay'>\n | BackgroundColorString<'popup'>\n | 'transparent'\n | (string & Record<never, never>);\n lineHeight: SpacingValueType;\n touchAction: CSSObject['touchAction'];\n userSelect: CSSObject['userSelect'];\n } & PickCSSByPlatform<\n | 'border'\n | 'borderLeft'\n | 'borderRight'\n | 'borderTop'\n | 'borderBottom'\n | 'opacity'\n | 'pointerEvents'\n | 'cursor'\n >\n>;\n\n// Visual props that are specific to Box\ntype BoxVisualProps = MakeObjectResponsive<{\n backgroundColor: BackgroundColorString<'surface'> | 'transparent';\n}> & {\n // Intentionally keeping this outside of MakeObjectResponsive since we only want as to be string and not responsive object\n // styled-components do not support passing `as` prop as an object\n as: BoxAsType;\n};\n\ntype StyledPropsBlade = Partial<\n Omit<\n MarginProps &\n Pick<FlexboxProps, 'alignSelf' | 'justifySelf' | 'placeSelf' | 'order'> &\n PositionProps &\n Pick<\n GridProps,\n | 'gridColumn'\n | 'gridRow'\n | 'gridRowStart'\n | 'gridRowEnd'\n | 'gridColumnStart'\n | 'gridColumnEnd'\n | 'gridArea'\n > &\n Pick<LayoutProps, 'display'>,\n '__brand__'\n >\n>;\n\ntype BoxCallbackProps = Omit<\n Platform.Select<{\n web: {\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseOver: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseEnter: React.MouseEventHandler<HTMLElement>;\n /**\n * **Warning**\n *\n * Make sure to not use Box when you want to create a trigger that performs action on hover.\n * You would probably want to render it as `button` using `styled.button` instead.\n *\n * Use this for hoverable containers in cases like custom menus.\n */\n onMouseLeave: React.MouseEventHandler<HTMLElement>;\n onScroll: React.UIEventHandler<HTMLElement>;\n };\n native: Record<'onMouseOver' | 'onMouseEnter' | 'onMouseLeave' | 'onScroll', undefined>;\n }>,\n '__brand__'\n>;\n\ntype BoxDragAndDropProps = Omit<\n Platform.Select<{\n web: {\n draggable: boolean;\n onDragStart: React.DragEventHandler<HTMLElement>;\n onDragEnter: React.DragEventHandler<HTMLElement>;\n onDragLeave: React.DragEventHandler<HTMLElement>;\n onDragOver: React.DragEventHandler<HTMLElement>;\n onDragEnd: React.DragEventHandler<HTMLElement>;\n onDrop: React.DragEventHandler<HTMLElement>;\n };\n native: Record<\n | 'draggable'\n | 'onDragStart'\n | 'onDragEnter'\n | 'onDragLeave'\n | 'onDragOver'\n | 'onDragEnd'\n | 'onDrop',\n undefined\n >;\n }>,\n '__brand__'\n>;\n\ntype BoxProps = Partial<\n PaddingProps &\n MarginProps &\n LayoutProps &\n FlexboxProps &\n PositionProps &\n GridProps &\n BoxCallbackProps &\n BoxDragAndDropProps &\n CommonBoxVisualProps &\n BoxVisualProps & {\n children?: React.ReactNode | React.ReactNode[];\n tabIndex?: number;\n id?: string;\n } & TestID\n>;\n\n// Visual props have different types for BaseBox and Box. BaseBox has more flexible types and more props exposed.\n// So first we Omit Visual props of Box\n// Then we append BaseBoxVisualProps and some other props for styled-components like class and id\ntype BaseBoxProps = Omit<BoxProps, keyof BoxVisualProps> &\n Partial<\n BaseBoxVisualProps & {\n className?: string;\n id?: string;\n tabIndex?: number;\n }\n > &\n BladeCommonEvents;\n\n// ref prop type\ntype BoxRefType = Platform.Select<{\n web: Omit<HTMLElement, 'style'>;\n native: View;\n}>;\n\nexport type { BaseBoxProps, BoxProps, BoxRefType, StyledPropsBlade, FlexboxProps };\nexport { validBoxAsValues };\n"],"names":["validBoxAsValues"],"mappings":"AA8GM,IAAAA,gBAAgB,CAAG,CACvB,KAAK,CACL,SAAS,CACT,QAAQ,CACR,QAAQ,CACR,MAAM,CACN,OAAO,CACP,KAAK,CACL,MAAM,CACN,OAAO;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StyledBaseButton.native.js","sources":["../../../../../../src/components/Button/BaseButton/StyledBaseButton.native.tsx"],"sourcesContent":["import { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components/native';\nimport React from 'react';\nimport type { TextInput, GestureResponderEvent } from 'react-native';\nimport getStyledBaseButtonStyles from './getStyledBaseButtonStyles';\nimport type { StyledBaseButtonProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useStyledProps } from '~components/Box/styledProps';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { logger } from '~utils/logger';\nimport { castNativeType } from '~utils';\n\nconst StyledPressable = styled(Animated.createAnimatedComponent(Pressable))<\n Omit<StyledBaseButtonProps, 'accessibilityProps'>\n>((props) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getStyledBaseButtonStyles(props),\n alignSelf: 'center',\n display: 'flex',\n flexDirection: 'row',\n ...styledPropsCSSObject,\n };\n});\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst _StyledBaseButton: React.ForwardRefRenderFunction<TextInput, StyledBaseButtonProps> = (\n {\n onClick,\n href,\n onBlur,\n onKeyDown,\n children,\n variant,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n isFullWidth,\n disabled,\n defaultBackgroundColor,\n defaultBorderColor,\n hoverBackgroundColor,\n focusBackgroundColor,\n focusRingColor,\n hoverBorderColor,\n focusBorderColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n isLoading,\n accessibilityProps,\n testID,\n onTouchStart,\n onTouchEnd,\n onPointerEnter,\n onPointerDown,\n onFocus,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const isPressed = useSharedValue(false);\n const duration = getIn(theme.motion, motionDuration);\n const easing = getIn(theme.motion, motionEasing);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n backgroundColor: withTiming(isPressed.value ? focusBackgroundColor : defaultBackgroundColor, {\n duration,\n easing,\n }),\n ...(variant !== 'tertiary' && {\n borderColor: withTiming(isPressed.value ? focusBorderColor : defaultBorderColor, {\n duration,\n easing,\n }),\n }),\n };\n });\n\n const handleOnPress = (event: GestureResponderEvent): void => {\n if (href) {\n void openURL(href);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <StyledPressable\n {...styledProps}\n {...accessibilityProps}\n ref={ref}\n role=\"button\"\n onTouchStart={castNativeType(onTouchStart)}\n onTouchEnd={castNativeType(onTouchEnd)}\n onPointerEnter={castNativeType(onPointerEnter)}\n onPointerDown={castNativeType(onPointerDown)}\n onFocus={castNativeType(onFocus)}\n isLoading={isLoading}\n onPress={handleOnPress}\n style={animatedStyles}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n isFullWidth={isFullWidth}\n disabled={disabled}\n defaultBackgroundColor={defaultBackgroundColor}\n defaultBorderColor={defaultBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n focusBorderColor={focusBorderColor}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n testID={testID}\n >\n {/* @ts-expect-error */}\n {({ pressed }): React.ReactNode => {\n isPressed.value = pressed;\n return children;\n }}\n </StyledPressable>\n );\n};\n\nconst StyledBaseButton = assignWithoutSideEffects(React.forwardRef(_StyledBaseButton), {\n displayName: 'StyledBaseButton',\n});\n\nexport default StyledBaseButton;\n"],"names":["StyledPressable","styled","Animated","createAnimatedComponent","Pressable","props","styledPropsCSSObject","useStyledProps","Object","assign","getStyledBaseButtonStyles","alignSelf","display","flexDirection","openURL","_ref","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","_StyledBaseButton","_ref2","ref","onClick","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","isPressed","useSharedValue","duration","getIn","motion","easing","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","value","borderColor","handleOnPress","event","_jsx","role","castNativeType","onPress","style","_ref3","pressed","StyledBaseButton","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;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,OAAO,CAAAD,KAAA,CAAPC,OAAO,CACTpB,SAAS,CAACU,KAAK,CAAGU,OAAO,CACzB,OAAOtD,SAAQ,CACjB,CAAC,CACc,CAAA,CAAC,CAEtB,CAAC,CAEK,IAAAuD,gBAAgB,CAAGC,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAChE,iBAAiB,CAAC,CAAE,CACrFiE,WAAW,CAAE,kBACf,CAAC;;;;"}
|
|
1
|
+
{"version":3,"file":"StyledBaseButton.native.js","sources":["../../../../../../src/components/Button/BaseButton/StyledBaseButton.native.tsx"],"sourcesContent":["import { Linking, Pressable } from 'react-native';\nimport Animated, { useAnimatedStyle, useSharedValue, withTiming } from 'react-native-reanimated';\nimport styled from 'styled-components/native';\nimport React from 'react';\nimport type { TextInput, GestureResponderEvent } from 'react-native';\nimport getStyledBaseButtonStyles from './getStyledBaseButtonStyles';\nimport type { StyledBaseButtonProps } from './types';\nimport getIn from '~utils/lodashButBetter/get';\nimport { useStyledProps } from '~components/Box/styledProps';\nimport { useTheme } from '~components/BladeProvider';\nimport { assignWithoutSideEffects } from '~utils/assignWithoutSideEffects';\nimport { logger } from '~utils/logger';\nimport { castNativeType } from '~utils';\n\nconst StyledPressable = styled(Animated.createAnimatedComponent(Pressable))<\n Omit<StyledBaseButtonProps, 'accessibilityProps'>\n>((props) => {\n const styledPropsCSSObject = useStyledProps(props);\n\n return {\n ...getStyledBaseButtonStyles(props),\n alignSelf: 'center',\n display: 'flex',\n flexDirection: 'row',\n ...styledPropsCSSObject,\n };\n});\n\nconst openURL = async (href: string): Promise<void> => {\n try {\n const canOpen = await Linking.canOpenURL(href);\n if (canOpen) {\n await Linking.openURL(href);\n }\n } catch {\n if (__DEV__) {\n logger({\n type: 'warn',\n message: `Could not open the link \"href=${href}\"`,\n moduleName: 'BaseButton',\n });\n }\n }\n};\n\nconst _StyledBaseButton: React.ForwardRefRenderFunction<TextInput, StyledBaseButtonProps> = (\n {\n onClick,\n href,\n onBlur,\n onKeyDown,\n children,\n variant,\n minHeight,\n buttonPaddingTop,\n buttonPaddingBottom,\n buttonPaddingLeft,\n buttonPaddingRight,\n isFullWidth,\n disabled,\n defaultBackgroundColor,\n defaultBorderColor,\n hoverBackgroundColor,\n focusBackgroundColor,\n focusRingColor,\n hoverBorderColor,\n focusBorderColor,\n borderWidth,\n borderRadius,\n motionDuration,\n motionEasing,\n isLoading,\n accessibilityProps,\n testID,\n onTouchStart,\n onTouchEnd,\n onPointerEnter,\n onPointerDown,\n onFocus,\n ...styledProps\n },\n ref,\n) => {\n const { theme } = useTheme();\n const isPressed = useSharedValue(false);\n const duration = getIn(theme.motion, motionDuration);\n const easing = getIn(theme.motion, motionEasing);\n\n const animatedStyles = useAnimatedStyle(() => {\n return {\n backgroundColor: withTiming(isPressed.value ? focusBackgroundColor : defaultBackgroundColor, {\n duration,\n easing,\n }),\n ...(variant !== 'tertiary' && {\n borderColor: withTiming(isPressed.value ? focusBorderColor : defaultBorderColor, {\n duration,\n easing,\n }),\n }),\n };\n });\n\n const handleOnPress = (event: GestureResponderEvent): void => {\n if (href) {\n void openURL(href);\n }\n\n if (onClick) {\n onClick(event);\n }\n };\n\n return (\n <StyledPressable\n {...styledProps}\n {...accessibilityProps}\n ref={ref}\n role=\"button\"\n onTouchStart={castNativeType(onTouchStart)}\n onTouchEnd={castNativeType(onTouchEnd)}\n onPointerEnter={castNativeType(onPointerEnter)}\n onPointerDown={castNativeType(onPointerDown)}\n onFocus={castNativeType(onFocus)}\n isLoading={isLoading}\n onPress={handleOnPress}\n style={animatedStyles}\n minHeight={minHeight}\n buttonPaddingTop={buttonPaddingTop}\n buttonPaddingBottom={buttonPaddingBottom}\n buttonPaddingLeft={buttonPaddingLeft}\n buttonPaddingRight={buttonPaddingRight}\n isFullWidth={isFullWidth}\n disabled={disabled}\n defaultBackgroundColor={defaultBackgroundColor}\n defaultBorderColor={defaultBorderColor}\n hoverBackgroundColor={hoverBackgroundColor}\n focusBackgroundColor={focusBackgroundColor}\n focusRingColor={focusRingColor}\n hoverBorderColor={hoverBorderColor}\n focusBorderColor={focusBorderColor}\n borderWidth={borderWidth}\n borderRadius={borderRadius}\n motionDuration={motionDuration}\n motionEasing={motionEasing}\n testID={testID}\n >\n {/* eslint-disable-next-line @typescript-eslint/prefer-ts-expect-error */}\n {/* @ts-ignore */}\n {({ pressed }): React.ReactNode => {\n isPressed.value = pressed;\n return children;\n }}\n </StyledPressable>\n );\n};\n\nconst StyledBaseButton = assignWithoutSideEffects(React.forwardRef(_StyledBaseButton), {\n displayName: 'StyledBaseButton',\n});\n\nexport default StyledBaseButton;\n"],"names":["StyledPressable","styled","Animated","createAnimatedComponent","Pressable","props","styledPropsCSSObject","useStyledProps","Object","assign","getStyledBaseButtonStyles","alignSelf","display","flexDirection","openURL","_ref","_asyncToGenerator","href","canOpen","Linking","canOpenURL","_unused","__DEV__","logger","type","message","moduleName","_x","apply","arguments","_StyledBaseButton","_ref2","ref","onClick","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus","styledProps","_objectWithoutProperties","_excluded","_useTheme","useTheme","theme","isPressed","useSharedValue","duration","getIn","motion","easing","animatedStyles","useAnimatedStyle","backgroundColor","withTiming","value","borderColor","handleOnPress","event","_jsx","role","castNativeType","onPress","style","_ref3","pressed","StyledBaseButton","assignWithoutSideEffects","React","forwardRef","displayName"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,SAAA,CAAA,MAAA,CAAA,QAAA,CAAA,WAAA,CAAA,UAAA,CAAA,SAAA,CAAA,WAAA,CAAA,kBAAA,CAAA,qBAAA,CAAA,mBAAA,CAAA,oBAAA,C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,wBAAwB,CAACC,cAAK,CAACC,UAAU,CAAChE,iBAAiB,CAAC,CAAE,CACrFiE,WAAW,CAAE,kBACf,CAAC;;;;"}
|
|
@@ -15,7 +15,7 @@ import '../../BottomSheet/BottomSheetStack.js';
|
|
|
15
15
|
import { jsx } from 'react/jsx-runtime';
|
|
16
16
|
import getIn from '../../../utils/lodashButBetter/get.js';
|
|
17
17
|
|
|
18
|
-
var _excluded=["showAllTags","setShowAllTagsWithAnimation","children","maxTagRows","isDropdownTrigger"];var StyledBaseInputWrapper=styled(Animated.View)(function(props){return Object.assign({},getInputBackgroundAndBorderStyles({theme:props.theme,isFocused:props.currentInteraction==='focus',isDisabled:props.isDisabled,validationState:props.validationState,isTextArea:props.isTextArea,isDropdownTrigger:props.isDropdownTrigger}),{backgroundColor:'yellow'});});var _AnimatedBaseInputWrapper=function _AnimatedBaseInputWrapper(_ref,ref){var showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,children=_ref.children,maxTagRows=_ref.maxTagRows,isDropdownTrigger=_ref.isDropdownTrigger,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var sharedHeight=useSharedValue(baseInputHeight[rest.size]);React__default.useEffect(function(){if(!isDropdownTrigger){return;}sharedHeight.value=withTiming(showAllTags?baseInputWrapperMaxHeight[rest.size]:baseInputHeight[rest.size],{duration:theme.motion.duration.xquick,easing:castNativeType(theme.motion.easing.exit.effective)},function(isComplete){if(isComplete&&!showAllTags){runOnJS(setShowAllTagsWithAnimation)(false);}});},[showAllTags]);var animatedStyle=useAnimatedStyle(function(){return {maxHeight:sharedHeight.value};});var animatedStyleObject=maxTagRows==='expandable'?animatedStyle:{};var maxHeightStyleObject={maxHeight:getAnimatedBaseInputWrapperMaxHeight({maxTagRows:maxTagRows,showAllTags:showAllTags,size:rest.size})};var baseInputState=getBaseInputState({isFocused:rest.currentInteraction==='focus',isHovered:rest.currentInteraction==='hover',isDisabled:Boolean(rest.isDisabled)});var borderColor=getIn(theme.colors,baseInputBorderColor[baseInputState]);var backgroundColor=getIn(theme.colors,baseInputBackgroundColor[baseInputState]);if(rest.validationState==='error'){borderColor=getIn(theme.colors,baseInputBorderColor.error);}else if(rest.validationState==='success'){borderColor=getIn(theme.colors,baseInputBorderColor.success);}var motionConfig={duration:castNativeType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[rest.currentInteraction==='focus'?'enter':'exit'].duration))),easing:castNativeType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[rest.currentInteraction==='focus'?'enter':'exit'].easing))};var animatedBorderAndBackgroundStyle=useAnimatedStyle(function(){return {borderWidth:theme.border.width.thin,borderRadius:theme.border.radius.medium,borderStyle:'solid',backgroundColor:withTiming(backgroundColor,motionConfig),borderColor:withTiming(borderColor,motionConfig)};},[borderColor,backgroundColor,motionConfig]);return jsx(StyledBaseInputWrapper,Object.assign({ref:ref,style:[isDropdownTrigger?Object.assign({},maxHeightStyleObject,animatedStyleObject):{},animatedBorderAndBackgroundStyle],isDropdownTrigger:isDropdownTrigger},rest,{children:children}));};var AnimatedBaseInputWrapper=React__default.forwardRef(_AnimatedBaseInputWrapper);
|
|
18
|
+
var _excluded=["showAllTags","isTextArea","numberOfLines","setShowAllTagsWithAnimation","children","maxTagRows","isDropdownTrigger"];var StyledBaseInputWrapper=styled(Animated.View)(function(props){return Object.assign({},getInputBackgroundAndBorderStyles({theme:props.theme,isFocused:props.currentInteraction==='focus',isDisabled:props.isDisabled,validationState:props.validationState,isTextArea:props.isTextArea,isDropdownTrigger:props.isDropdownTrigger}),{backgroundColor:'yellow'});});var _AnimatedBaseInputWrapper=function _AnimatedBaseInputWrapper(_ref,ref){var showAllTags=_ref.showAllTags,isTextArea=_ref.isTextArea,numberOfLines=_ref.numberOfLines,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,children=_ref.children,maxTagRows=_ref.maxTagRows,isDropdownTrigger=_ref.isDropdownTrigger,rest=_objectWithoutProperties(_ref,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var sharedHeight=useSharedValue(baseInputHeight[rest.size]);React__default.useEffect(function(){if(!isDropdownTrigger){return;}sharedHeight.value=withTiming(showAllTags?baseInputWrapperMaxHeight[rest.size]:baseInputHeight[rest.size],{duration:theme.motion.duration.xquick,easing:castNativeType(theme.motion.easing.exit.effective)},function(isComplete){if(isComplete&&!showAllTags){runOnJS(setShowAllTagsWithAnimation)(false);}});},[showAllTags]);var animatedStyle=useAnimatedStyle(function(){return {maxHeight:sharedHeight.value};});var animatedStyleObject=maxTagRows==='expandable'?animatedStyle:{};var maxHeightStyleObject={maxHeight:getAnimatedBaseInputWrapperMaxHeight({maxTagRows:maxTagRows,showAllTags:showAllTags,size:rest.size})};var baseInputState=getBaseInputState({isFocused:rest.currentInteraction==='focus',isHovered:rest.currentInteraction==='hover',isDisabled:Boolean(rest.isDisabled)});var borderColor=getIn(theme.colors,baseInputBorderColor[baseInputState]);var backgroundColor=getIn(theme.colors,baseInputBackgroundColor[baseInputState]);if(rest.validationState==='error'){borderColor=getIn(theme.colors,baseInputBorderColor.error);}else if(rest.validationState==='success'){borderColor=getIn(theme.colors,baseInputBorderColor.success);}var motionConfig={duration:castNativeType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[rest.currentInteraction==='focus'?'enter':'exit'].duration))),easing:castNativeType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[rest.currentInteraction==='focus'?'enter':'exit'].easing))};var animatedBorderAndBackgroundStyle=useAnimatedStyle(function(){return {borderWidth:theme.border.width.thin,borderRadius:theme.border.radius.medium,borderStyle:'solid',backgroundColor:withTiming(backgroundColor,motionConfig),borderColor:withTiming(borderColor,motionConfig)};},[borderColor,backgroundColor,motionConfig]);return jsx(StyledBaseInputWrapper,Object.assign({ref:ref,style:[isDropdownTrigger&&!isTextArea?Object.assign({},maxHeightStyleObject,animatedStyleObject):{},animatedBorderAndBackgroundStyle],isDropdownTrigger:isDropdownTrigger,numberOfLines:numberOfLines,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation},rest,{children:children}));};var AnimatedBaseInputWrapper=React__default.forwardRef(_AnimatedBaseInputWrapper);
|
|
19
19
|
|
|
20
20
|
export { AnimatedBaseInputWrapper };
|
|
21
21
|
//# sourceMappingURL=AnimatedBaseInputWrapper.native.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AnimatedBaseInputWrapper.native.js","sources":["../../../../../../src/components/Input/BaseInput/AnimatedBaseInputWrapper.native.tsx"],"sourcesContent":["import React from 'react';\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport styled from 'styled-components';\nimport type { BaseInputWrapperProps } from './types';\nimport {\n getAnimatedBaseInputWrapperMaxHeight,\n getBaseInputState,\n getInputBackgroundAndBorderStyles,\n} from './baseInputStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderBackgroundMotion,\n baseInputBorderColor,\n baseInputHeight,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { EasingFactoryFn } from '~tokens/global';\n\nconst StyledBaseInputWrapper = styled(Animated.View)<BaseInputWrapperProps>((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 backgroundColor: 'yellow',\n}));\n\nconst _AnimatedBaseInputWrapper: React.ForwardRefRenderFunction<\n HTMLDivElement,\n BaseInputWrapperProps & {\n showAllTags?: boolean;\n setShowAllTagsWithAnimation: (showAllTagsWithAnimation: boolean) => void;\n }\n> = (\n { showAllTags, setShowAllTagsWithAnimation, children, maxTagRows, isDropdownTrigger, ...rest },\n ref,\n): React.ReactElement => {\n const { theme } = useTheme();\n const sharedHeight = useSharedValue<number>(baseInputHeight[rest.size]); // Initial max-width value\n\n React.useEffect(() => {\n if (!isDropdownTrigger) {\n return;\n }\n\n sharedHeight.value = withTiming(\n showAllTags ? baseInputWrapperMaxHeight[rest.size] : baseInputHeight[rest.size],\n {\n duration: theme.motion.duration.xquick,\n easing: castNativeType(theme.motion.easing.exit.effective),\n },\n (isComplete) => {\n if (isComplete && !showAllTags) {\n runOnJS(setShowAllTagsWithAnimation)(false);\n }\n },\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showAllTags]);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n maxHeight: sharedHeight.value,\n };\n });\n\n const animatedStyleObject = maxTagRows === 'expandable' ? animatedStyle : {};\n const maxHeightStyleObject = {\n maxHeight: getAnimatedBaseInputWrapperMaxHeight({\n maxTagRows,\n showAllTags,\n size: rest.size,\n }),\n };\n\n const baseInputState = getBaseInputState({\n isFocused: rest.currentInteraction === 'focus',\n isHovered: rest.currentInteraction === 'hover',\n isDisabled: Boolean(rest.isDisabled),\n });\n\n let borderColor = getIn(theme.colors, baseInputBorderColor[baseInputState]);\n const backgroundColor = getIn(theme.colors, baseInputBackgroundColor[baseInputState]);\n\n if (rest.validationState === 'error') {\n borderColor = getIn(theme.colors, baseInputBorderColor.error);\n } else if (rest.validationState === 'success') {\n borderColor = getIn(theme.colors, baseInputBorderColor.success);\n }\n\n const motionConfig: {\n duration: number;\n easing: EasingFactoryFn;\n } = {\n duration: castNativeType(\n makeMotionTime(\n getIn(\n theme.motion.duration,\n baseInputBorderBackgroundMotion[rest.currentInteraction === 'focus' ? 'enter' : 'exit']\n .duration,\n ),\n ),\n ),\n easing: castNativeType(\n getIn(\n theme.motion.easing,\n baseInputBorderBackgroundMotion[rest.currentInteraction === 'focus' ? 'enter' : 'exit']\n .easing,\n ),\n ),\n };\n\n const animatedBorderAndBackgroundStyle = useAnimatedStyle(\n () => ({\n borderWidth: theme.border.width.thin,\n borderRadius: theme.border.radius.medium,\n borderStyle: 'solid',\n backgroundColor: withTiming(backgroundColor, motionConfig),\n borderColor: withTiming(borderColor, motionConfig),\n }),\n [borderColor, backgroundColor, motionConfig],\n );\n\n return (\n <StyledBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={[\n isDropdownTrigger\n ? {\n ...maxHeightStyleObject,\n ...animatedStyleObject,\n }\n : {},\n animatedBorderAndBackgroundStyle,\n ]}\n isDropdownTrigger={isDropdownTrigger}\n {...rest}\n >\n {children}\n </StyledBaseInputWrapper>\n );\n};\n\nconst AnimatedBaseInputWrapper = React.forwardRef(_AnimatedBaseInputWrapper);\n\nexport { AnimatedBaseInputWrapper };\n"],"names":["StyledBaseInputWrapper","styled","Animated","View","props","Object","assign","getInputBackgroundAndBorderStyles","theme","isFocused","currentInteraction","isDisabled","validationState","isTextArea","isDropdownTrigger","backgroundColor","_AnimatedBaseInputWrapper","_ref","ref","showAllTags","setShowAllTagsWithAnimation","children","maxTagRows","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","sharedHeight","useSharedValue","baseInputHeight","size","React","useEffect","value","withTiming","baseInputWrapperMaxHeight","duration","motion","xquick","easing","castNativeType","exit","effective","isComplete","runOnJS","animatedStyle","useAnimatedStyle","maxHeight","animatedStyleObject","maxHeightStyleObject","getAnimatedBaseInputWrapperMaxHeight","baseInputState","getBaseInputState","isHovered","Boolean","borderColor","getIn","colors","baseInputBorderColor","baseInputBackgroundColor","error","success","motionConfig","makeMotionTime","baseInputBorderBackgroundMotion","animatedBorderAndBackgroundStyle","borderWidth","border","width","thin","borderRadius","radius","medium","borderStyle","_jsx","style","AnimatedBaseInputWrapper","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAA,SAAA,CAAA,CAAA,aAAA,CAAA,6BAAA,CAAA,UAAA,CAAA,YAAA,CAAA,mBAAA,CAAA,CA0BA,IAAMA,sBAAsB,CAAGC,MAAM,CAAC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ExB,EAAE,CACNiB,gCAAgC,CAChC,CACFpD,iBAAiB,CAAEA,iBAAkB,CAAA,CACjCS,IAAI,CAAAF,CAAAA,QAAA,CAEPA,QAAQ,EACa,CAAC,CAE7B,CAAC,CAEK,IAAAwD,wBAAwB,CAAG7C,cAAK,CAAC8C,UAAU,CAAC9D,yBAAyB;;;;"}
|
|
1
|
+
{"version":3,"file":"AnimatedBaseInputWrapper.native.js","sources":["../../../../../../src/components/Input/BaseInput/AnimatedBaseInputWrapper.native.tsx"],"sourcesContent":["import React from 'react';\nimport Animated, {\n runOnJS,\n useAnimatedStyle,\n useSharedValue,\n withTiming,\n} from 'react-native-reanimated';\nimport styled from 'styled-components';\nimport type { BaseInputWrapperProps } from './types';\nimport {\n getAnimatedBaseInputWrapperMaxHeight,\n getBaseInputState,\n getInputBackgroundAndBorderStyles,\n} from './baseInputStyles';\nimport {\n baseInputBackgroundColor,\n baseInputBorderBackgroundMotion,\n baseInputBorderColor,\n baseInputHeight,\n baseInputWrapperMaxHeight,\n} from './baseInputTokens';\nimport { castNativeType, makeMotionTime } from '~utils';\nimport { useTheme } from '~components/BladeProvider';\nimport getIn from '~utils/lodashButBetter/get';\nimport type { EasingFactoryFn } from '~tokens/global';\n\nconst StyledBaseInputWrapper = styled(Animated.View)<BaseInputWrapperProps>((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 backgroundColor: 'yellow',\n}));\n\nconst _AnimatedBaseInputWrapper: React.ForwardRefRenderFunction<\n HTMLDivElement,\n BaseInputWrapperProps & {\n showAllTags?: boolean;\n setShowAllTagsWithAnimation: (showAllTagsWithAnimation: boolean) => void;\n }\n> = (\n {\n showAllTags,\n isTextArea,\n numberOfLines,\n setShowAllTagsWithAnimation,\n children,\n maxTagRows,\n isDropdownTrigger,\n ...rest\n },\n ref,\n): React.ReactElement => {\n const { theme } = useTheme();\n const sharedHeight = useSharedValue<number>(baseInputHeight[rest.size]); // Initial max-width value\n\n React.useEffect(() => {\n if (!isDropdownTrigger) {\n return;\n }\n\n sharedHeight.value = withTiming(\n showAllTags ? baseInputWrapperMaxHeight[rest.size] : baseInputHeight[rest.size],\n {\n duration: theme.motion.duration.xquick,\n easing: castNativeType(theme.motion.easing.exit.effective),\n },\n (isComplete) => {\n if (isComplete && !showAllTags) {\n runOnJS(setShowAllTagsWithAnimation)(false);\n }\n },\n );\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [showAllTags]);\n\n const animatedStyle = useAnimatedStyle(() => {\n return {\n maxHeight: sharedHeight.value,\n };\n });\n\n const animatedStyleObject = maxTagRows === 'expandable' ? animatedStyle : {};\n const maxHeightStyleObject = {\n maxHeight: getAnimatedBaseInputWrapperMaxHeight({\n maxTagRows,\n showAllTags,\n size: rest.size,\n }),\n };\n\n const baseInputState = getBaseInputState({\n isFocused: rest.currentInteraction === 'focus',\n isHovered: rest.currentInteraction === 'hover',\n isDisabled: Boolean(rest.isDisabled),\n });\n\n let borderColor = getIn(theme.colors, baseInputBorderColor[baseInputState]);\n const backgroundColor = getIn(theme.colors, baseInputBackgroundColor[baseInputState]);\n\n if (rest.validationState === 'error') {\n borderColor = getIn(theme.colors, baseInputBorderColor.error);\n } else if (rest.validationState === 'success') {\n borderColor = getIn(theme.colors, baseInputBorderColor.success);\n }\n\n const motionConfig: {\n duration: number;\n easing: EasingFactoryFn;\n } = {\n duration: castNativeType(\n makeMotionTime(\n getIn(\n theme.motion.duration,\n baseInputBorderBackgroundMotion[rest.currentInteraction === 'focus' ? 'enter' : 'exit']\n .duration,\n ),\n ),\n ),\n easing: castNativeType(\n getIn(\n theme.motion.easing,\n baseInputBorderBackgroundMotion[rest.currentInteraction === 'focus' ? 'enter' : 'exit']\n .easing,\n ),\n ),\n };\n\n const animatedBorderAndBackgroundStyle = useAnimatedStyle(\n () => ({\n borderWidth: theme.border.width.thin,\n borderRadius: theme.border.radius.medium,\n borderStyle: 'solid',\n backgroundColor: withTiming(backgroundColor, motionConfig),\n borderColor: withTiming(borderColor, motionConfig),\n }),\n [borderColor, backgroundColor, motionConfig],\n );\n\n return (\n <StyledBaseInputWrapper\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ref={ref as any}\n style={[\n // We only want to define height in tagged inputs except height for TextArea is set on TextArea based on numberOfLines prop\n isDropdownTrigger && !isTextArea\n ? {\n ...maxHeightStyleObject,\n ...animatedStyleObject,\n }\n : {},\n animatedBorderAndBackgroundStyle,\n ]}\n isDropdownTrigger={isDropdownTrigger}\n numberOfLines={numberOfLines}\n setShowAllTagsWithAnimation={setShowAllTagsWithAnimation}\n {...rest}\n >\n {children}\n </StyledBaseInputWrapper>\n );\n};\n\nconst AnimatedBaseInputWrapper = React.forwardRef(_AnimatedBaseInputWrapper);\n\nexport { AnimatedBaseInputWrapper };\n"],"names":["StyledBaseInputWrapper","styled","Animated","View","props","Object","assign","getInputBackgroundAndBorderStyles","theme","isFocused","currentInteraction","isDisabled","validationState","isTextArea","isDropdownTrigger","backgroundColor","_AnimatedBaseInputWrapper","_ref","ref","showAllTags","numberOfLines","setShowAllTagsWithAnimation","children","maxTagRows","rest","_objectWithoutProperties","_excluded","_useTheme","useTheme","sharedHeight","useSharedValue","baseInputHeight","size","React","useEffect","value","withTiming","baseInputWrapperMaxHeight","duration","motion","xquick","easing","castNativeType","exit","effective","isComplete","runOnJS","animatedStyle","useAnimatedStyle","maxHeight","animatedStyleObject","maxHeightStyleObject","getAnimatedBaseInputWrapperMaxHeight","baseInputState","getBaseInputState","isHovered","Boolean","borderColor","getIn","colors","baseInputBorderColor","baseInputBackgroundColor","error","success","motionConfig","makeMotionTime","baseInputBorderBackgroundMotion","animatedBorderAndBackgroundStyle","borderWidth","border","width","thin","borderRadius","radius","medium","borderStyle","_jsx","style","AnimatedBaseInputWrapper","forwardRef"],"mappings":";;;;;;;;;;;;;;;;;AA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AC7C,CAAC,CAED,OACEY,GAAA,CAAC5E,sBAAsB,CAAAK,MAAA,CAAAC,MAAA,EAErBY,GAAG,CAAEA,GAAW,CAChB2D,KAAK,CAAE,CAEL/D,iBAAiB,EAAI,CAACD,UAAU,CAAAR,MAAA,CAAAC,MAAA,CAAA,EAAA,CAEvB6C,oBAAoB,CACpBD,mBAAmB,CAExB,CAAA,EAAE,CACNiB,gCAAgC,CAChC,CACFrD,iBAAiB,CAAEA,iBAAkB,CACrCM,aAAa,CAAEA,aAAc,CAC7BC,2BAA2B,CAAEA,2BAA4B,EACrDG,IAAI,CAAA,CAAAF,QAAA,CAEPA,QAAQ,CACa,CAAA,CAAC,CAE7B,CAAC,CAEK,IAAAwD,wBAAwB,CAAG7C,cAAK,CAAC8C,UAAU,CAAC/D,yBAAyB;;;;"}
|
|
@@ -36,8 +36,9 @@ import { makeAccessible } from '../../../utils/makeAccessible/makeAccessible.nat
|
|
|
36
36
|
import { announce } from '../../LiveAnnouncer/LiveAnnouncer.native.js';
|
|
37
37
|
import { assignWithoutSideEffects } from '../../../utils/assignWithoutSideEffects/assignWithoutSideEffects.js';
|
|
38
38
|
import { getFocusRingStyles } from '../../../utils/getFocusRingStyles/getFocusRingStyles.native.js';
|
|
39
|
+
import { useMergeRefs } from '../../../utils/useMergeRefs.js';
|
|
39
40
|
|
|
40
|
-
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","trailingInteractionElement","leadingInteractionElement","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"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction;return {borderRadius:makeBorderSize(theme.border.radius.medium),width:'100%','&:focus-within':Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing))})};});var _BaseInput=function _BaseInput(_ref12,ref){var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,styledProps=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:hasPopup?'combobox':undefined,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||Boolean(successText)||Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({},metaAttribute({name:componentName,testID:testID}),getStyledProps(styledProps),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:size,children:[jsx(BaseInputVisuals,{size:size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:isDisabled,leadingInteractionElement:leadingInteractionElement}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){if(ref&&!isReactNative&&'current'in ref){var _ref$current;(_ref$current=ref.current)==null?void 0:_ref$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:size,children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:ref,name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:size,valueComponentType:valueComponentType},metaAttribute({name:MetaConstants.StyledBaseInput})))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isDisabled:isDisabled,validationState:validationState,trailingButton:trailingButton,size:size})]})})]}),!hideFormHint&&jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
|
|
41
|
+
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","trailingInteractionElement","leadingInteractionElement","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"];var autoCompleteSuggestionTypeValues=['none','on','name','email','username','password','newPassword','oneTimeCode','telephone','postalCode','countryName','creditCardNumber','creditCardCSC','creditCardExpiry','creditCardExpiryMonth','creditCardExpiryYear'];var useTags=function useTags(tags,activeTagIndex,setActiveTagIndex){var visibleTagsCountRef=React__default.useRef(0);React__default.useEffect(function(){if(tags&&activeTagIndex>=0&&activeTagIndex<tags.length){var _tags$activeTagIndex,_tags$activeTagIndex$;var tagTitle=(_tags$activeTagIndex=tags[activeTagIndex])==null?void 0:(_tags$activeTagIndex$=_tags$activeTagIndex.props)==null?void 0:_tags$activeTagIndex$.children;if(tagTitle){announce(`Close ${tagTitle} Tag`);}}},[activeTagIndex,tags==null?void 0:tags.length]);var onTagLeft=function onTagLeft(){if(activeTagIndex<0){setActiveTagIndex==null?void 0:setActiveTagIndex(visibleTagsCountRef.current-1);}if(activeTagIndex>0){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex-1);}};var onTagRight=function onTagRight(){if(activeTagIndex<visibleTagsCountRef.current-1){setActiveTagIndex==null?void 0:setActiveTagIndex(activeTagIndex+1);}};var onTagRemove=function onTagRemove(){if(activeTagIndex>=0&&activeTagIndex<visibleTagsCountRef.current&&tags){tags[activeTagIndex].props.onDismiss({tagIndex:activeTagIndex});}};var onInputKeydownTagHandler=function onInputKeydownTagHandler(key){if(tags&&tags.length>0){if(key==='ArrowRight'){onTagRight();}if(key==='ArrowLeft'){onTagLeft();}if(key==='Backspace'){onTagRemove();}}};return {onInputKeydownTagHandler:onInputKeydownTagHandler,visibleTagsCountRef:visibleTagsCountRef};};var useInput=function useInput(_ref){var value=_ref.value,defaultValue=_ref.defaultValue,onClick=_ref.onClick,onFocus=_ref.onFocus,onChange=_ref.onChange,onBlur=_ref.onBlur,onSubmit=_ref.onSubmit,onInput=_ref.onInput,onKeyDown=_ref.onKeyDown,onInputKeydownTagHandler=_ref.onInputKeydownTagHandler;if(__DEV__){if(value&&defaultValue){throwBladeError({message:`Either 'value' or 'defaultValue' shall be passed. This decides if the input field is controlled or uncontrolled`,moduleName:'Input'});}}var _React$useState=React__default.useState(defaultValue!=null?defaultValue:value),_React$useState2=_slicedToArray(_React$useState,2),inputValue=_React$useState2[0],setInputValue=_React$useState2[1];var handleOnFocus=React__default.useCallback(function(_ref2){var name=_ref2.name,value=_ref2.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value;_value=(_value$target$value=value==null?void 0:value.target.value)!=null?_value$target$value:'';}onFocus==null?void 0:onFocus({name:name,value:_value});},[onFocus]);var handleOnClick=React__default.useCallback(function(_ref3){var name=_ref3.name,value=_ref3.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$currentTarget$;_value=(_value$currentTarget$=value==null?void 0:value.currentTarget.value)!=null?_value$currentTarget$:'';}onClick==null?void 0:onClick({name:name,value:_value});},[onClick]);var handleOnSubmit=React__default.useCallback(function(_ref4){var name=_ref4.name,value=_ref4.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value2;_value=(_value$target$value2=value==null?void 0:value.target.value)!=null?_value$target$value2:'';}if(isReactNative()){onSubmit==null?void 0:onSubmit({name:name,value:_value});}},[onSubmit]);var handleOnBlur=React__default.useCallback(function(_ref5){var name=_ref5.name,value=_ref5.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value3;_value=(_value$target$value3=value==null?void 0:value.target.value)!=null?_value$target$value3:'';}onBlur==null?void 0:onBlur({name:name,value:_value});},[onBlur]);var handleOnChange=React__default.useCallback(function(_ref6){var name=_ref6.name,value=_ref6.value;var _value='';if(getPlatformType()==='react-native'&&typeof value==='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value4;_value=(_value$target$value4=value==null?void 0:value.target.value)!=null?_value$target$value4:'';}onChange==null?void 0:onChange({name:name,value:_value});setInputValue(_value);},[onChange]);var handleOnInput=React__default.useCallback(function(_ref7){var name=_ref7.name,value=_ref7.value;var _value='';if(getPlatformType()==='react-native'&&typeof value=='string'){_value=value;}else if(typeof value!=='string'){var _value$target$value5;_value=(_value$target$value5=value==null?void 0:value.target.value)!=null?_value$target$value5:'';}onInput==null?void 0:onInput({name:name,value:_value});},[onInput]);var handleOnKeyDown=React__default.useCallback(function(_ref8){var name=_ref8.name,key=_ref8.key,code=_ref8.code,event=_ref8.event;onInputKeydownTagHandler(key);onKeyDown==null?void 0:onKeyDown({name:name,key:key,code:code,event:event});},[onKeyDown]);return {handleOnFocus:handleOnFocus,handleOnClick:handleOnClick,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,inputValue:inputValue};};var getHintType=function getHintType(_ref9){var validationState=_ref9.validationState,hasHelpText=_ref9.hasHelpText;if(validationState==='error'){return 'error';}if(validationState==='success'){return 'success';}if(hasHelpText){return 'help';}return 'help';};var getDescribedByElementId=function getDescribedByElementId(_ref10){var validationState=_ref10.validationState,hasErrorText=_ref10.hasErrorText,hasSuccessText=_ref10.hasSuccessText,hasHelpText=_ref10.hasHelpText,errorTextId=_ref10.errorTextId,successTextId=_ref10.successTextId,helpTextId=_ref10.helpTextId;if(validationState==='error'&&hasErrorText){return errorTextId;}if(validationState==='success'&&hasSuccessText){return successTextId;}if(hasHelpText){return helpTextId;}return '';};var FocusRingWrapper=styled(BaseBox)(function(_ref11){var theme=_ref11.theme,currentInteraction=_ref11.currentInteraction;return {borderRadius:makeBorderSize(theme.border.radius.medium),width:'100%','&:focus-within':Object.assign({},getFocusRingStyles(),{transitionDuration:castWebType(makeMotionTime(getIn(theme.motion.duration,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].duration))),transitionTimingFunction:castWebType(getIn(theme.motion.easing,baseInputBorderBackgroundMotion[currentInteraction==='focus'?'enter':'exit'].easing))})};});var _BaseInput=function _BaseInput(_ref12,ref){var _ref12$as=_ref12.as,as=_ref12$as===void 0?'input':_ref12$as,label=_ref12.label,_ref12$labelPosition=_ref12.labelPosition,labelPosition=_ref12$labelPosition===void 0?'top':_ref12$labelPosition,placeholder=_ref12.placeholder,_ref12$type=_ref12.type,type=_ref12$type===void 0?'text':_ref12$type,defaultValue=_ref12.defaultValue,tags=_ref12.tags,_ref12$showAllTags=_ref12.showAllTags,showAllTags=_ref12$showAllTags===void 0?false:_ref12$showAllTags,_ref12$activeTagIndex=_ref12.activeTagIndex,activeTagIndex=_ref12$activeTagIndex===void 0?-1:_ref12$activeTagIndex,setActiveTagIndex=_ref12.setActiveTagIndex,name=_ref12.name,value=_ref12.value,onFocus=_ref12.onFocus,onChange=_ref12.onChange,onInput=_ref12.onInput,onBlur=_ref12.onBlur,onSubmit=_ref12.onSubmit,onClick=_ref12.onClick,onKeyDown=_ref12.onKeyDown,isDisabled=_ref12.isDisabled,necessityIndicator=_ref12.necessityIndicator,validationState=_ref12.validationState,errorText=_ref12.errorText,helpText=_ref12.helpText,successText=_ref12.successText,isRequired=_ref12.isRequired,leadingIcon=_ref12.leadingIcon,prefix=_ref12.prefix,trailingInteractionElement=_ref12.trailingInteractionElement,leadingInteractionElement=_ref12.leadingInteractionElement,suffix=_ref12.suffix,trailingIcon=_ref12.trailingIcon,maxCharacters=_ref12.maxCharacters,textAlign=_ref12.textAlign,autoFocus=_ref12.autoFocus,keyboardReturnKeyType=_ref12.keyboardReturnKeyType,keyboardType=_ref12.keyboardType,autoCompleteSuggestionType=_ref12.autoCompleteSuggestionType,trailingHeaderSlot=_ref12.trailingHeaderSlot,trailingFooterSlot=_ref12.trailingFooterSlot,numberOfLines=_ref12.numberOfLines,id=_ref12.id,componentName=_ref12.componentName,accessibilityLabel=_ref12.accessibilityLabel,labelId=_ref12.labelId,activeDescendant=_ref12.activeDescendant,hideLabelText=_ref12.hideLabelText,hideFormHint=_ref12.hideFormHint,hasPopup=_ref12.hasPopup,popupId=_ref12.popupId,isPopupExpanded=_ref12.isPopupExpanded,maxTagRows=_ref12.maxTagRows,shouldIgnoreBlurAnimation=_ref12.shouldIgnoreBlurAnimation,setShouldIgnoreBlurAnimation=_ref12.setShouldIgnoreBlurAnimation,autoCapitalize=_ref12.autoCapitalize,setInputWrapperRef=_ref12.setInputWrapperRef,testID=_ref12.testID,isDropdownTrigger=_ref12.isDropdownTrigger,isLabelInsideInput=_ref12.isLabelInsideInput,_ref12$size=_ref12.size,size=_ref12$size===void 0?'medium':_ref12$size,trailingButton=_ref12.trailingButton,_ref12$valueComponent=_ref12.valueComponentType,valueComponentType=_ref12$valueComponent===void 0?'text':_ref12$valueComponent,styledProps=_objectWithoutProperties(_ref12,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme;var inputRef=React__default.useRef(null);var mergedInputRef=useMergeRefs(ref,inputRef);var inputWrapperRef=React__default.useRef(null);var _useTags=useTags(tags,activeTagIndex,setActiveTagIndex),onInputKeydownTagHandler=_useTags.onInputKeydownTagHandler,visibleTagsCountRef=_useTags.visibleTagsCountRef;var _React$useState3=React__default.useState(false),_React$useState4=_slicedToArray(_React$useState3,2),showAllTagsWithAnimation=_React$useState4[0],setShowAllTagsWithAnimation=_React$useState4[1];var isReactNative=getPlatformType()==='react-native';React__default.useEffect(function(){if(showAllTags){setShowAllTagsWithAnimation(true);}else if(maxTagRows!=='expandable'){setShowAllTagsWithAnimation(false);}},[showAllTags,maxTagRows]);var _useInput=useInput({defaultValue:defaultValue,value:value,onFocus:onFocus,onClick:onClick,onChange:onChange,onBlur:onBlur,onSubmit:onSubmit,onInput:onInput,onKeyDown:onKeyDown,onInputKeydownTagHandler:onInputKeydownTagHandler}),handleOnFocus=_useInput.handleOnFocus,handleOnChange=_useInput.handleOnChange,handleOnClick=_useInput.handleOnClick,handleOnBlur=_useInput.handleOnBlur,handleOnSubmit=_useInput.handleOnSubmit,handleOnInput=_useInput.handleOnInput,handleOnKeyDown=_useInput.handleOnKeyDown,inputValue=_useInput.inputValue;var _useFormId=useFormId(id),inputId=_useFormId.inputId,helpTextId=_useFormId.helpTextId,errorTextId=_useFormId.errorTextId,successTextId=_useFormId.successTextId;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var isLabelLeftPositioned=labelPosition==='left'&&matchedDeviceType==='desktop';var _useInteraction=useInteraction(),currentInteraction=_useInteraction.currentInteraction,setCurrentInteraction=_useInteraction.setCurrentInteraction;var _isRequired=isRequired||necessityIndicator==='required';var accessibilityProps=makeAccessible({required:Boolean(_isRequired),disabled:Boolean(isDisabled),invalid:Boolean(validationState==='error'),describedBy:getDescribedByElementId({validationState:validationState,hasErrorText:Boolean(errorText),hasSuccessText:Boolean(successText),hasHelpText:Boolean(helpText),errorTextId:errorTextId,successTextId:successTextId,helpTextId:helpTextId}),label:accessibilityLabel,hasPopup:hasPopup,expanded:hasPopup?isPopupExpanded:undefined,controls:hasPopup?popupId:undefined,role:hasPopup?'combobox':undefined,activeDescendant:activeDescendant});var willRenderHintText=Boolean(helpText)||Boolean(successText)||Boolean(errorText);if(__DEV__){if(autoCompleteSuggestionType&&!autoCompleteSuggestionTypeValues.includes(autoCompleteSuggestionType)){throwBladeError({message:`Expected autoCompleteSuggestionType to be one of ${autoCompleteSuggestionTypeValues.join(', ')} but received ${autoCompleteSuggestionType}`,moduleName:'Input'});}}var isTextArea=as==='textarea';return jsxs(BaseBox,Object.assign({},metaAttribute({name:componentName,testID:testID}),getStyledProps(styledProps),{children:[jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'row':'column',justifyContent:isLabelLeftPositioned?'center':undefined,alignItems:isLabelLeftPositioned?'center':undefined,position:"relative",width:"100%",children:[!hideLabelText&&!isLabelInsideInput&&jsxs(BaseBox,{display:"flex",flexDirection:isLabelLeftPositioned?'column':'row',justifyContent:"space-between",alignSelf:isTextArea?'flex-start':undefined,marginY:isTextArea&&isLabelLeftPositioned?'spacing.3':'spacing.0',children:[jsx(FormLabel,{as:"label",necessityIndicator:necessityIndicator,position:labelPosition,id:labelId,htmlFor:inputId,size:size,children:label}),trailingHeaderSlot==null?void 0:trailingHeaderSlot(value!=null?value:inputValue)]}),jsx(FocusRingWrapper,{currentInteraction:currentInteraction,children:jsxs(BaseInputWrapper,{isDropdownTrigger:isDropdownTrigger,isTextArea:isTextArea,isDisabled:isDisabled,validationState:validationState,currentInteraction:currentInteraction,isLabelLeftPositioned:isLabelLeftPositioned,showAllTags:showAllTags,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation,ref:function ref(refNode){if(refNode){setInputWrapperRef==null?void 0:setInputWrapperRef(refNode);inputWrapperRef.current=refNode;}},maxTagRows:maxTagRows,size:size,numberOfLines:numberOfLines,onClick:function onClick(){if(!isReactNative){var _inputRef$current;(_inputRef$current=inputRef.current)==null?void 0:_inputRef$current.focus();}},children:[jsx(BaseInputVisuals,{size:size,leadingIcon:leadingIcon,prefix:prefix,isDisabled:isDisabled,leadingInteractionElement:leadingInteractionElement}),jsx(BaseInputTagSlot,{renderAs:as,tags:tags,isDisabled:isDisabled,showAllTags:showAllTagsWithAnimation,setFocusOnInput:function setFocusOnInput(){if(ref&&!isReactNative&&'current'in ref){var _ref$current;(_ref$current=ref.current)==null?void 0:_ref$current.focus();}},labelPrefix:isLabelInsideInput?label:undefined,isDropdownTrigger:isDropdownTrigger,visibleTagsCountRef:visibleTagsCountRef,handleOnInputClick:function handleOnInputClick(e){handleOnClick({name:name,value:isReactNative?value:e});},setShouldIgnoreBlurAnimation:setShouldIgnoreBlurAnimation,maxTagRows:maxTagRows,inputWrapperRef:inputWrapperRef,size:size,numberOfLines:numberOfLines,isTextArea:isTextArea,children:jsx(StyledBaseInput,Object.assign({as:as,id:inputId,ref:mergedInputRef,name:name,type:type,defaultValue:defaultValue,value:value,placeholder:placeholder,isDisabled:isDisabled,validationState:validationState,isRequired:_isRequired,handleOnFocus:handleOnFocus,handleOnChange:handleOnChange,handleOnBlur:handleOnBlur,handleOnSubmit:handleOnSubmit,handleOnInput:handleOnInput,handleOnKeyDown:handleOnKeyDown,handleOnClick:handleOnClick,leadingIcon:leadingIcon,prefix:prefix,trailingInteractionElement:trailingInteractionElement,leadingInteractionElement:leadingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,maxCharacters:maxCharacters,textAlign:textAlign,autoFocus:autoFocus,keyboardReturnKeyType:keyboardReturnKeyType,keyboardType:keyboardType,autoCompleteSuggestionType:autoCompleteSuggestionType,accessibilityProps:accessibilityProps,currentInteraction:currentInteraction,setCurrentInteraction:setCurrentInteraction,numberOfLines:numberOfLines,isTextArea:isTextArea||maxTagRows==='multiple'||maxTagRows==='expandable',hasPopup:hasPopup,hasTags:!!(tags&&tags.length>0),shouldIgnoreBlurAnimation:shouldIgnoreBlurAnimation,autoCapitalize:autoCapitalize,isDropdownTrigger:isDropdownTrigger,$size:size,valueComponentType:valueComponentType},metaAttribute({name:MetaConstants.StyledBaseInput})))}),jsx(BaseInputVisuals,{trailingInteractionElement:trailingInteractionElement,suffix:suffix,trailingIcon:trailingIcon,isDisabled:isDisabled,validationState:validationState,trailingButton:trailingButton,size:size})]})})]}),!hideFormHint&&jsx(BaseBox,{marginLeft:makeSize(isLabelLeftPositioned&&!hideLabelText?formHintLeftLabelMarginLeft[size]:0),children:jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:willRenderHintText?'space-between':'flex-end',children:[jsx(FormHint,{type:getHintType({validationState:validationState,hasHelpText:Boolean(helpText)}),helpText:helpText,errorText:errorText,successText:successText,helpTextId:helpTextId,errorTextId:errorTextId,successTextId:successTextId,size:size}),trailingFooterSlot==null?void 0:trailingFooterSlot(value!=null?value:inputValue)]})})]}));};var BaseInputWithRef=React__default.forwardRef(_BaseInput);var BaseInput=assignWithoutSideEffects(BaseInputWithRef,{displayName:'BaseInput'});
|
|
41
42
|
|
|
42
43
|
export { BaseInput, getHintType };
|
|
43
44
|
//# sourceMappingURL=BaseInput.js.map
|