@razorpay/blade 10.14.5 → 10.14.7
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/components/index.development.web.js +2 -4
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.js +20 -20
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +2 -4
- package/build/components/index.production.web.js.map +1 -1
- package/build/css/bankingThemeDarkDesktop.css +1 -1
- package/build/css/bankingThemeDarkMobile.css +1 -1
- package/build/css/bankingThemeLightDesktop.css +1 -1
- package/build/css/bankingThemeLightMobile.css +1 -1
- package/build/css/paymentThemeDarkDesktop.css +1 -1
- package/build/css/paymentThemeDarkMobile.css +1 -1
- package/build/css/paymentThemeLightDesktop.css +1 -1
- package/build/css/paymentThemeLightMobile.css +1 -1
- package/package.json +1 -1
|
@@ -2706,7 +2706,7 @@ var _IconButton=function _IconButton(_ref,ref){var icon=_ref.icon,onClick=_ref.o
|
|
|
2706
2706
|
|
|
2707
2707
|
var getBaseButtonStyles=function getBaseButtonStyles(_ref){var defaultBorderColor=_ref.defaultBorderColor,minHeight=_ref.minHeight,buttonPaddingTop=_ref.buttonPaddingTop,buttonPaddingBottom=_ref.buttonPaddingBottom,buttonPaddingLeft=_ref.buttonPaddingLeft,buttonPaddingRight=_ref.buttonPaddingRight,defaultBackgroundColor=_ref.defaultBackgroundColor,disabled=_ref.disabled,isFullWidth=_ref.isFullWidth,borderWidth=_ref.borderWidth,borderRadius=_ref.borderRadius;return {minHeight:minHeight,width:isFullWidth?'100%':'auto',cursor:disabled?'not-allowed':'pointer',backgroundColor:defaultBackgroundColor,borderColor:defaultBorderColor,borderWidth:borderWidth,borderRadius:borderRadius,borderStyle:'solid',paddingTop:buttonPaddingTop,paddingBottom:buttonPaddingBottom,paddingLeft:buttonPaddingLeft,paddingRight:buttonPaddingRight,justifyContent:'center',alignItems:'center',textDecoration:'none'};};
|
|
2708
2708
|
|
|
2709
|
-
var _excluded$G=["onClick","href","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","activeBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","activeBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus"];var StyledPressable$3=styled(Animated$1.createAnimatedComponent(Pressable))(function(props){var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseButtonStyles(props),{alignSelf:'center',display:'flex'},styledPropsCSSObject);});var openURL$2=function(){var _ref=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref.apply(this,arguments);};}();var
|
|
2709
|
+
var _excluded$G=["onClick","href","onBlur","onKeyDown","children","variant","minHeight","buttonPaddingTop","buttonPaddingBottom","buttonPaddingLeft","buttonPaddingRight","isFullWidth","disabled","defaultBackgroundColor","defaultBorderColor","hoverBackgroundColor","activeBackgroundColor","focusBackgroundColor","focusRingColor","hoverBorderColor","activeBorderColor","focusBorderColor","borderWidth","borderRadius","motionDuration","motionEasing","isLoading","accessibilityProps","testID","onTouchStart","onTouchEnd","onPointerEnter","onPointerDown","onFocus"];var StyledPressable$3=styled(Animated$1.createAnimatedComponent(Pressable))(function(props){var styledPropsCSSObject=useStyledProps(props);return Object.assign({},getBaseButtonStyles(props),{alignSelf:'center',display:'flex'},styledPropsCSSObject);});var openURL$2=function(){var _ref=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref.apply(this,arguments);};}();var _StyledBaseButton=function _StyledBaseButton(_ref2,ref){var onClick=_ref2.onClick,href=_ref2.href;_ref2.onBlur;_ref2.onKeyDown;var _children=_ref2.children,variant=_ref2.variant,minHeight=_ref2.minHeight,buttonPaddingTop=_ref2.buttonPaddingTop,buttonPaddingBottom=_ref2.buttonPaddingBottom,buttonPaddingLeft=_ref2.buttonPaddingLeft,buttonPaddingRight=_ref2.buttonPaddingRight,isFullWidth=_ref2.isFullWidth,disabled=_ref2.disabled,defaultBackgroundColor=_ref2.defaultBackgroundColor,defaultBorderColor=_ref2.defaultBorderColor,hoverBackgroundColor=_ref2.hoverBackgroundColor,activeBackgroundColor=_ref2.activeBackgroundColor,focusBackgroundColor=_ref2.focusBackgroundColor,focusRingColor=_ref2.focusRingColor,hoverBorderColor=_ref2.hoverBorderColor,activeBorderColor=_ref2.activeBorderColor,focusBorderColor=_ref2.focusBorderColor,borderWidth=_ref2.borderWidth,borderRadius=_ref2.borderRadius,motionDuration=_ref2.motionDuration,motionEasing=_ref2.motionEasing,isLoading=_ref2.isLoading,accessibilityProps=_ref2.accessibilityProps,testID=_ref2.testID,onTouchStart=_ref2.onTouchStart,onTouchEnd=_ref2.onTouchEnd,onPointerEnter=_ref2.onPointerEnter,onPointerDown=_ref2.onPointerDown,onFocus=_ref2.onFocus,styledProps=_objectWithoutProperties(_ref2,_excluded$G);var _useTheme=useTheme(),theme=_useTheme.theme;var isPressed=useSharedValue(false);var duration=getIn(theme.motion,motionDuration);var easing=getIn(theme.motion,motionEasing);var animatedStyles=useAnimatedStyle(function(){return Object.assign({backgroundColor:withTiming(isPressed.value?activeBackgroundColor:defaultBackgroundColor,{duration:duration,easing:easing})},variant!=='tertiary'&&{borderColor:withTiming(isPressed.value?activeBorderColor:defaultBorderColor,{duration:duration,easing:easing})});});var handleOnPress=function handleOnPress(event){if(href){void openURL$2(href);}if(onClick){onClick(event);}};return jsx(StyledPressable$3,Object.assign({},styledProps,accessibilityProps,{ref:ref,role:"button",onTouchStart:castNativeType(onTouchStart),onTouchEnd:castNativeType(onTouchEnd),onPointerEnter:castNativeType(onPointerEnter),onPointerDown:castNativeType(onPointerDown),onFocus:castNativeType(onFocus),isLoading:isLoading,onPress:handleOnPress,style:animatedStyles,minHeight:minHeight,buttonPaddingTop:buttonPaddingTop,buttonPaddingBottom:buttonPaddingBottom,buttonPaddingLeft:buttonPaddingLeft,buttonPaddingRight:buttonPaddingRight,isFullWidth:isFullWidth,disabled:disabled,defaultBackgroundColor:defaultBackgroundColor,defaultBorderColor:defaultBorderColor,hoverBackgroundColor:hoverBackgroundColor,activeBackgroundColor:activeBackgroundColor,focusBackgroundColor:focusBackgroundColor,focusRingColor:focusRingColor,hoverBorderColor:hoverBorderColor,activeBorderColor:activeBorderColor,focusBorderColor:focusBorderColor,borderWidth:borderWidth,borderRadius:borderRadius,motionDuration:motionDuration,motionEasing:motionEasing,testID:testID,children:function children(_ref3){var pressed=_ref3.pressed;isPressed.value=pressed;return _children;}}));};var StyledBaseButton=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseButton),{displayName:'StyledBaseButton'});
|
|
2710
2710
|
|
|
2711
2711
|
var typography={fonts:{size:{xsmall:75,small:75,medium:100,large:200}},lineHeights:{xsmall:50,small:50,medium:100,large:300}};var minHeight={xsmall:size[28],small:size[32],medium:size[36],large:size[48]};var buttonPadding={xsmall:{top:0,bottom:0,left:3,right:3},small:{top:0,bottom:0,left:4,right:4},medium:{top:0,bottom:0,left:6,right:6},large:{top:0,bottom:0,left:6,right:6}};var buttonIconOnlyPadding={xsmall:{top:0,bottom:0,left:4,right:4},small:{top:0,bottom:0,left:3,right:3},medium:{top:0,bottom:0,left:3,right:3},large:{top:0,bottom:0,left:2,right:2}};var buttonSizeToIconSizeMap={xsmall:'small',small:'small',medium:'medium',large:'medium'};var buttonIconOnlySizeToIconSizeMap={xsmall:'small',small:'small',medium:'medium',large:'medium'};var buttonSizeToSpinnerSizeMap={xsmall:'medium',small:'large',medium:'large',large:'xlarge'};var buttonIconPadding={xsmall:1,small:1,medium:2,large:2};
|
|
2712
2712
|
|
|
@@ -2716,7 +2716,7 @@ var dimensions={medium:16,large:20,xlarge:24};var motion={duration:'duration.2xg
|
|
|
2716
2716
|
|
|
2717
2717
|
var SpinnerIcon=function SpinnerIcon(_ref){var dimensions=_ref.dimensions,color=_ref.color;return jsxs(Svg,{width:dimensions,height:dimensions,viewBox:"0 0 24 24",fill:"none",children:[jsx(Path,{fillOpacity:0.2,d:"M24 12C24 18.6274 18.6274 24 12 24C5.37258 24 0 18.6274 0 12C0 5.37258 5.37258 0 12 0C18.6274 0 24 5.37258 24 12ZM3 12C3 16.9706 7.02944 21 12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12Z",fill:color}),jsx(Path,{d:"M24 12C24 13.8937 23.5518 15.7606 22.6921 17.4479C21.8324 19.1352 20.5855 20.5951 19.0534 21.7082C17.5214 22.8213 15.7476 23.556 13.8772 23.8523C12.0068 24.1485 10.0928 23.9979 8.29181 23.4127L9.21886 20.5595C10.5696 20.9984 12.0051 21.1114 13.4079 20.8892C14.8107 20.667 16.141 20.116 17.2901 19.2812C18.4391 18.4463 19.3743 17.3514 20.0191 16.0859C20.6639 14.8204 21 13.4203 21 12H24Z",fill:color}),jsx(Path,{d:"M-1.33514e-05 12C-1.33514e-05 10.1063 0.448176 8.23944 1.30791 6.55211C2.16764 4.86479 3.41451 3.4049 4.94656 2.2918C6.47862 1.17869 8.25236 0.443983 10.1228 0.147739C11.9932 -0.148504 13.9072 0.00212896 15.7082 0.587322L14.7811 3.44049C13.4304 3.0016 11.9949 2.88862 10.5921 3.11081C9.18927 3.33299 7.85896 3.88402 6.70992 4.71885C5.56088 5.55367 4.62573 6.64859 3.98093 7.91409C3.33613 9.17958 2.99999 10.5797 2.99999 12H-1.33514e-05Z",fill:color})]});};
|
|
2718
2718
|
|
|
2719
|
-
var
|
|
2719
|
+
var SpinningBox=function SpinningBox(_ref){var children=_ref.children;var _useTheme=useTheme(),theme=_useTheme.theme;var duration=castNativeType(makeMotionTime(getIn(theme.motion,motion.duration)));var easing=getIn(theme.motion,motion.easing);var rotation=useSharedValue(0);var animatedStyles=useAnimatedStyle(function(){return {transform:[{rotateZ:`${rotation.value}deg`}]};},[rotation.value]);React__default.useEffect(function(){rotation.value=withRepeat(withTiming(360,{duration:duration,easing:easing}),-1);return function(){cancelAnimation(rotation);};},[duration,easing,rotation]);return jsx(BaseBox,{alignSelf:"center",children:jsx(Animated$1.View,{style:animatedStyles,children:children})});};
|
|
2720
2720
|
|
|
2721
2721
|
var _excluded$F=["label","labelPosition","accessibilityLabel","contrast","color","size","testID"];var getColor=function getColor(_ref){var contrast=_ref.contrast,color=_ref.color,theme=_ref.theme;if(contrast==='high'||color&&color==='white'){return getIn(theme.colors,'static.white');}if(color&&color!=='default'){return getIn(theme.colors,`feedback.${color}.action.icon.primary.disabled.lowContrast`);}return getIn(theme.colors,'brand.gray.700.lowContrast');};var BaseSpinner=function BaseSpinner(_ref2){var label=_ref2.label,_ref2$labelPosition=_ref2.labelPosition,labelPosition=_ref2$labelPosition===void 0?'right':_ref2$labelPosition,accessibilityLabel=_ref2.accessibilityLabel,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$color=_ref2.color,color=_ref2$color===void 0?'default':_ref2$color,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$F);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.Spinner,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,Object.assign({display:"flex",alignItems:"center",flexDirection:labelPosition==='right'?'row':'column'},makeAccessible({label:accessibilityLabel,role:'progressbar'}),{children:[jsx(SpinningBox,{children:jsx(SpinnerIcon,{dimensions:makeSize(dimensions[size]),color:getColor({contrast:contrast,color:color,theme:theme})})}),label&&label.trim().length>0?jsx(BaseBox,{marginLeft:labelPosition==='right'?'spacing.3':'spacing.0',marginTop:labelPosition==='bottom'?'spacing.3':'spacing.0',children:jsx(Text,{variant:"body",weight:"regular",type:"subdued",size:"small",contrast:contrast,children:label})}):null]}))}));};
|
|
2722
2722
|
|
|
@@ -2740,7 +2740,7 @@ var LinkOverlay=function LinkOverlay(_props){return jsx(Fragment,{});};
|
|
|
2740
2740
|
|
|
2741
2741
|
var CARD_SCALE_DOWN_VALUE=0.95;var CARD_LINK_OVERLAY_ID='card-link-overlay';
|
|
2742
2742
|
|
|
2743
|
-
var _excluded$A=["isSelected"],_excluded2=["children","onClick","isSelected","shouldScaleOnHover","href","as","accessibilityLabel"];var StyledCardRoot=styled(BaseBox)(function(_ref){var isSelected=_ref.isSelected,props=_objectWithoutProperties(_ref,_excluded$A);var selectedColor=isSelected?props.theme.colors.brand.primary[500]:'transparent';return {border:`${props.theme.border.width.thicker}px solid ${selectedColor}`};});var AnimatedPressable=Animated$1.createAnimatedComponent(Pressable);var openURL=function(){var _ref2=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref2.apply(this,arguments);};}();var
|
|
2743
|
+
var _excluded$A=["isSelected"],_excluded2=["children","onClick","isSelected","shouldScaleOnHover","href","as","accessibilityLabel"];var StyledCardRoot=styled(BaseBox)(function(_ref){var isSelected=_ref.isSelected,props=_objectWithoutProperties(_ref,_excluded$A);var selectedColor=isSelected?props.theme.colors.brand.primary[500]:'transparent';return {border:`${props.theme.border.width.thicker}px solid ${selectedColor}`};});var AnimatedPressable=Animated$1.createAnimatedComponent(Pressable);var openURL=function(){var _ref2=_asyncToGenerator(function*(href){try{var canOpen=yield Linking.canOpenURL(href);if(canOpen){yield Linking.openURL(href);}}catch(_unused){if(__DEV__){logger({type:'warn',message:`Could not open the link "href=${href}"`,moduleName:'BaseButton'});}}});return function openURL(_x){return _ref2.apply(this,arguments);};}();var CardRoot=function CardRoot(_ref3){var children=_ref3.children,onClick=_ref3.onClick,isSelected=_ref3.isSelected,shouldScaleOnHover=_ref3.shouldScaleOnHover,href=_ref3.href;_ref3.as;var accessibilityLabel=_ref3.accessibilityLabel,props=_objectWithoutProperties(_ref3,_excluded2);var _useTheme=useTheme(),theme=_useTheme.theme;var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPressed=_React$useState2[0],setIsPressed=_React$useState2[1];var duration=castNativeType(makeMotionTime(theme.motion.duration.xquick));var easing=castNativeType(theme.motion.easing.standard.effective);var styles=useAnimatedStyle(function(){return {transform:[{scale:withTiming(isPressed?CARD_SCALE_DOWN_VALUE:1,{duration:duration,easing:easing})}]};},[isPressed]);if(onClick||shouldScaleOnHover||href){return jsx(AnimatedPressable,Object.assign({},makeAccessible({role:href?'link':undefined,label:accessibilityLabel,selected:isSelected}),{style:styles,onPressIn:function onPressIn(){if(onClick){onClick();}setIsPressed(true);},onPressOut:function onPressOut(){if(href){void openURL(href);}setIsPressed(false);},children:jsx(StyledCardRoot,Object.assign({as:undefined,isSelected:isSelected},props,{children:children}))}));}return jsx(StyledCardRoot,Object.assign({as:undefined,isSelected:isSelected},props,{children:children}));};
|
|
2744
2744
|
|
|
2745
2745
|
var _excluded$z=["children","surfaceLevel","elevation","testID","padding","width","height","onClick","isSelected","accessibilityLabel","shouldScaleOnHover","onHover","href","target","rel","as"];var ComponentIds$1={CardHeader:'CardHeader',CardHeaderTrailing:'CardHeaderTrailing',CardHeaderLeading:'CardHeaderLeading',CardFooter:'CardFooter',CardFooterTrailing:'CardFooterTrailing',CardFooterLeading:'CardFooterLeading',CardBody:'CardBody',CardHeaderIcon:'CardHeaderIcon',CardHeaderCounter:'CardHeaderCounter',CardHeaderBadge:'CardHeaderBadge',CardHeaderText:'CardHeaderText',CardHeaderLink:'CardHeaderLink',CardHeaderIconButton:'CardHeaderIconButton'};var Card=function Card(_ref){var children=_ref.children,_ref$surfaceLevel=_ref.surfaceLevel,surfaceLevel=_ref$surfaceLevel===void 0?2:_ref$surfaceLevel,_ref$elevation=_ref.elevation,elevation=_ref$elevation===void 0?'lowRaised':_ref$elevation,testID=_ref.testID,_ref$padding=_ref.padding,padding=_ref$padding===void 0?'spacing.7':_ref$padding,width=_ref.width,height=_ref.height,onClick=_ref.onClick,_ref$isSelected=_ref.isSelected,isSelected=_ref$isSelected===void 0?false:_ref$isSelected,accessibilityLabel=_ref.accessibilityLabel,_ref$shouldScaleOnHov=_ref.shouldScaleOnHover,shouldScaleOnHover=_ref$shouldScaleOnHov===void 0?false:_ref$shouldScaleOnHov,onHover=_ref.onHover,href=_ref.href,target=_ref.target,rel=_ref.rel,as=_ref.as,styledProps=_objectWithoutProperties(_ref,_excluded$z);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];useVerifyAllowedComponents(children,'Card',[ComponentIds$1.CardHeader,ComponentIds$1.CardBody,ComponentIds$1.CardFooter]);var linkOverlayProps=Object.assign({},metaAttribute({name:CARD_LINK_OVERLAY_ID}),makeAccessible({label:accessibilityLabel,pressed:isSelected}),{onFocus:function onFocus(){setIsFocused(true);},onBlur:function onBlur(){setIsFocused(false);}});var defaultRel=target&&target==='_blank'?'noreferrer noopener':undefined;return jsx(CardProvider,{children:jsx(CardRoot,Object.assign({as:as,display:'block',borderRadius:"medium",onMouseEnter:onHover,shouldScaleOnHover:shouldScaleOnHover,isSelected:isSelected,isFocused:isFocused,onClick:isReactNative$4()?onClick:undefined,width:width,height:height,href:href,accessibilityLabel:accessibilityLabel},metaAttribute({name:MetaConstants.Card,testID:testID}),getStyledProps(styledProps),{children:jsxs(CardSurface,{height:height,padding:padding,borderRadius:"medium",surfaceLevel:surfaceLevel,elevation:elevation,textAlign:'left',children:[href?jsx(LinkOverlay,Object.assign({onClick:onClick,href:href,target:target,rel:rel!=null?rel:defaultRel},linkOverlayProps)):null,!href&&onClick?jsx(LinkOverlay,Object.assign({as:"button",onClick:onClick},linkOverlayProps)):null,children]})}))});};var _CardBody=function _CardBody(_ref2){var height=_ref2.height,children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardBody');return jsx(BaseBox,Object.assign({},metaAttribute({name:MetaConstants.CardBody,testID:testID}),{height:height,children:children}));};var CardBody=assignWithoutSideEffects(_CardBody,{componentId:ComponentIds$1.CardBody});
|
|
2746
2746
|
|
|
@@ -2766,7 +2766,7 @@ var CarouselContext=React__default.createContext(null);var useCarouselContext=fu
|
|
|
2766
2766
|
|
|
2767
2767
|
var getIndicatorButtonStyles=function getIndicatorButtonStyles(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;var backgroundColor={gray:theme.colors.brand.gray[600].highContrast,white:theme.colors.brand.gray[700].highContrast,blue:theme.colors.brand.primary[500]};var easing=castWebType(theme.motion.easing.standard.effective);var duration=castWebType(makeMotionTime(theme.motion.duration.gentle));return Object.assign({border:'none',cursor:'pointer',padding:makeSpace(theme.spacing[0]),borderRadius:theme.border.radius.max,backgroundColor:isActive?backgroundColor[variant]:'hsla(214, 18%, 69%, 0.64)',width:isActive?makeSize(size[18]):makeSize(size[6]),height:makeSize(size[6])},isReactNative$4()&&{width:undefined},!isReactNative$4()&&{transitionProperty:'width',transitionDuration:duration,transitionTimingFunction:easing,'&:before':{content:`""`,padding:makeSize(size[10]),paddingTop:makeSize(size[20])},'&:focus-visible':{outline:'none',boxShadow:`0px 0px 0px 4px ${theme.colors.brand.primary[400]}`}});};
|
|
2768
2768
|
|
|
2769
|
-
var _excluded$v=["onClick","accessibilityLabel"];var PressableIndicatorButton=styled(BaseBox)(function(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;return getIndicatorButtonStyles({theme:theme,isActive:isActive,variant:variant});});var
|
|
2769
|
+
var _excluded$v=["onClick","accessibilityLabel"];var PressableIndicatorButton=styled(BaseBox)(function(_ref){var theme=_ref.theme,isActive=_ref.isActive,variant=_ref.variant;return getIndicatorButtonStyles({theme:theme,isActive:isActive,variant:variant});});var StyledIndicatorButton=function StyledIndicatorButton(_ref2){var onClick=_ref2.onClick,accessibilityLabel=_ref2.accessibilityLabel,props=_objectWithoutProperties(_ref2,_excluded$v);var _useTheme=useTheme(),theme=_useTheme.theme;var easing=castNativeType(theme.motion.easing.standard.effective);var duration=castNativeType(makeMotionTime(theme.motion.duration.gentle));var style=useAnimatedStyle(function(){return {width:withTiming(props.isActive?size[18]:size[6],{duration:duration,easing:easing})};},[props.isActive]);return jsx(Pressable,{onPress:onClick,accessibilityLabel:accessibilityLabel,children:jsx(PressableIndicatorButton,Object.assign({},props,{children:jsx(Animated$1.View,{style:style})}))});};
|
|
2770
2770
|
|
|
2771
2771
|
var _excluded$u=["onClick","isActive","variant"];var IndicatorButton=function IndicatorButton(_ref){var onClick=_ref.onClick,isActive=_ref.isActive,variant=_ref.variant,props=_objectWithoutProperties(_ref,_excluded$u);return jsx(StyledIndicatorButton,Object.assign({},props,metaAttribute({name:'carousel-indicator-button'}),{isActive:isActive,variant:variant,onClick:onClick}));};
|
|
2772
2772
|
|
|
@@ -2792,7 +2792,7 @@ var chipGroupGapTokens={xsmall:{right:'spacing.3',bottom:'spacing.3'},small:{rig
|
|
|
2792
2792
|
|
|
2793
2793
|
var getAnimatedChipStyles=function getAnimatedChipStyles(_ref){var theme=_ref.theme,isDesktop=_ref.isDesktop,isDisabled=_ref.isDisabled,borderColor=_ref.borderColor;return {backgroundColor:isDisabled?'transparent':getIn(theme.colors,'surface.background.level2.lowContrast'),borderRadius:makeBorderSize(theme.border.radius.max),borderColor:getIn(theme.colors,borderColor),borderWidth:getIn(theme,'border.width.thin'),display:'flex',flexWrap:'nowrap',flexDirection:'row',alignItems:'center',justifyContent:'center',textAlign:'left',textOverflow:'ellipsis',maxWidth:isDesktop?'420px':'280px'};};
|
|
2794
2794
|
|
|
2795
|
-
var StyledAnimatedChip=styled(Animated$1.View)(function(props){return Object.assign({},getAnimatedChipStyles(props),{alignSelf:'center'});});var
|
|
2795
|
+
var StyledAnimatedChip=styled(Animated$1.View)(function(props){return Object.assign({},getAnimatedChipStyles(props),{alignSelf:'center'});});var AnimatedChip=function AnimatedChip(_ref){var borderColor=_ref.borderColor,children=_ref.children,isPressed=_ref.isPressed,isDisabled=_ref.isDisabled;var _useTheme=useTheme(),theme=_useTheme.theme;var easing=getIn(theme,chipMotionTokens.easing);var duration=getIn(theme,chipMotionTokens.duration);var chipAnimation=useAnimatedStyle(function(){return {transform:[{scale:withTiming(isPressed?0.92:1,{duration:duration,easing:easing})}]};},[isPressed]);return jsx(StyledAnimatedChip,{borderColor:borderColor,isDisabled:isDisabled,style:chipAnimation,children:children});};
|
|
2796
2796
|
|
|
2797
2797
|
var StyledChipWrapper=styled(BaseBox)(function(_ref){var theme=_ref.theme,borderColor=_ref.borderColor,isChecked=_ref.isChecked;return {display:'flex',borderColor:isChecked?getIn(theme.colors,borderColor):'transparent'};});
|
|
2798
2798
|
|
|
@@ -2824,7 +2824,7 @@ var _DropdownHeader=function _DropdownHeader(_ref){var title=_ref.title,subtitle
|
|
|
2824
2824
|
|
|
2825
2825
|
var getVisualContainerStyles=function getVisualContainerStyles(){return {display:'flex',flexDirection:'row',alignItems:'center',alignSelf:'center'};};var getPrefixStyles=function getPrefixStyles(_ref){var hasLeadingIcon=_ref.hasLeadingIcon,hasPrefix=_ref.hasPrefix;if(hasPrefix&&hasLeadingIcon){return {paddingLeft:'spacing.2'};}if(hasPrefix&&!hasLeadingIcon){return {paddingLeft:'spacing.4'};}return {paddingLeft:'spacing.0'};};var getInteractionElementStyles=function getInteractionElementStyles(_ref2){var hasTrailingIcon=_ref2.hasTrailingIcon,hasInteractionElement=_ref2.hasInteractionElement,hasSuffix=_ref2.hasSuffix;if(hasInteractionElement&&(hasSuffix||hasTrailingIcon)){return {paddingRight:'spacing.2'};}if(hasInteractionElement&&!hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getSuffixStyles=function getSuffixStyles(_ref3){var hasTrailingIcon=_ref3.hasTrailingIcon,hasSuffix=_ref3.hasSuffix;if(hasSuffix&&hasTrailingIcon){return {paddingRight:'spacing.2'};}if(hasSuffix&&!hasTrailingIcon){return {paddingRight:'spacing.4'};}return {paddingRight:'spacing.0'};};var getInputVisualsToBeRendered=function getInputVisualsToBeRendered(_ref4){var leadingIcon=_ref4.leadingIcon,prefix=_ref4.prefix,interactionElement=_ref4.interactionElement,suffix=_ref4.suffix,trailingIcon=_ref4.trailingIcon;return {hasLeadingIcon:Boolean(leadingIcon),hasPrefix:Boolean(prefix),hasInteractionElement:Boolean(interactionElement),hasSuffix:Boolean(suffix),hasTrailingIcon:Boolean(trailingIcon)};};var BaseInputVisuals=function BaseInputVisuals(_ref5){var LeadingIcon=_ref5.leadingIcon,prefix=_ref5.prefix,interactionElement=_ref5.interactionElement,suffix=_ref5.suffix,TrailingIcon=_ref5.trailingIcon,isDisabled=_ref5.isDisabled;var _getInputVisualsToBeR=getInputVisualsToBeRendered({leadingIcon:LeadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:TrailingIcon}),hasLeadingIcon=_getInputVisualsToBeR.hasLeadingIcon,hasPrefix=_getInputVisualsToBeR.hasPrefix,hasInteractionElement=_getInputVisualsToBeR.hasInteractionElement,hasSuffix=_getInputVisualsToBeR.hasSuffix,hasTrailingIcon=_getInputVisualsToBeR.hasTrailingIcon;var hasLeadingVisuals=hasLeadingIcon||hasPrefix;var hasTrailingVisuals=hasInteractionElement||hasSuffix||hasTrailingIcon;if(hasLeadingVisuals){return jsxs(BaseBox,Object.assign({},getVisualContainerStyles(),{children:[LeadingIcon?jsx(BaseBox,{paddingLeft:"spacing.4",display:"flex",children:jsx(LeadingIcon,{size:"medium",color:isDisabled?'surface.text.placeholder.lowContrast':'surface.text.subtle.lowContrast'})}):null,hasPrefix?jsx(BaseBox,Object.assign({},getPrefixStyles({hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",contrast:"low",type:isDisabled?'placeholder':'subtle',children:prefix})})):null]}));}if(hasTrailingVisuals){return jsxs(BaseBox,Object.assign({alignSelf:"stretch",alignItems:"stretch"},getVisualContainerStyles(),{children:[hasInteractionElement?jsx(BaseBox,Object.assign({},getInteractionElementStyles({hasTrailingIcon:hasTrailingIcon,hasInteractionElement:hasInteractionElement,hasSuffix:hasSuffix}),{display:"flex",alignItems:"stretch",alignSelf:"stretch",children:interactionElement})):null,hasSuffix?jsx(BaseBox,Object.assign({},getSuffixStyles({hasTrailingIcon:hasTrailingIcon,hasSuffix:hasSuffix}),{children:jsx(Text,{size:"medium",variant:"body",weight:"regular",contrast:"low",type:isDisabled?'placeholder':'subtle',children:suffix})})):null,TrailingIcon?jsx(BaseBox,{paddingRight:"spacing.4",display:"flex",children:jsx(TrailingIcon,{size:"medium",color:isDisabled?'surface.text.placeholder.lowContrast':'surface.text.subtle.lowContrast'})}):null]}));}return null;};
|
|
2826
2826
|
|
|
2827
|
-
var BASEINPUT_BOTTOM_LINE_HEIGHT=size['1'];var BASEINPUT_MAX_ROWS=4;
|
|
2827
|
+
var BASEINPUT_BOTTOM_LINE_HEIGHT=size['1'];var BASEINPUT_MAX_ROWS=4;var BASEINPUT_DEFAULT_HEIGHT=size['36'];var BASEINPUT_WRAPPER_MIN_HEIGHT=BASEINPUT_DEFAULT_HEIGHT+BASEINPUT_BOTTOM_LINE_HEIGHT;var BASEINPUT_WRAPPER_MAX_HEIGHT=size['36']*BASEINPUT_MAX_ROWS+BASEINPUT_BOTTOM_LINE_HEIGHT;
|
|
2828
2828
|
|
|
2829
2829
|
var getTextStyles=function getTextStyles(_ref){var variant=_ref.variant,type=_ref.type,weight=_ref.weight,size=_ref.size,contrast=_ref.contrast,theme=_ref.theme;return getBaseTextStyles(Object.assign({},getTextProps({variant:variant,type:type,weight:weight,size:size,contrast:contrast}),{theme:theme}));};
|
|
2830
2830
|
|
|
@@ -2832,9 +2832,9 @@ var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles
|
|
|
2832
2832
|
|
|
2833
2833
|
var _excluded$o=["name","isRequired","isDisabled","maxCharacters","handleOnFocus","handleOnChange","handleOnBlur","handleOnSubmit","handleOnInput","handleOnKeyDown","handleOnClick","keyboardType","keyboardReturnKeyType","autoCompleteSuggestionType","accessibilityProps","currentInteraction","setCurrentInteraction","type","numberOfLines","isTextArea","hasPopup","shouldIgnoreBlurAnimation","autoCapitalize","as"];var autoCompleteSuggestionTypeAndroid={none:'off',name:'name',email:'email',username:'username',password:'password',newPassword:'password-new',oneTimeCode:'sms-otp',telephone:'tel',postalCode:'postal-code',countryName:'postal-address-country',creditCardNumber:'cc-number',creditCardCSC:'cc-csc',creditCardExpiry:'cc-exp',creditCardExpiryMonth:'cc-exp-month',creditCardExpiryYear:'cc-exp-year'};var autoCompleteSuggestionTypeIOS={none:'none',name:'name',email:'emailAddress',username:'username',password:'password',newPassword:'newPassword',oneTimeCode:'oneTimeCode',telephone:'telephoneNumber',postalCode:'postalCode',countryName:'countryName',creditCardNumber:'creditCardNumber',creditCardCSC:'none',creditCardExpiry:'none',creditCardExpiryMonth:'none',creditCardExpiryYear:'none'};var KeyboardTypeToNativeValuesMap={text:'default',search:'default',telephone:'phone-pad',email:'email-address',url:'url',decimal:'decimal-pad'};var getInputHeight=function getInputHeight(_ref){var isTextArea=_ref.isTextArea,hasTags=_ref.hasTags,numberOfLines=_ref.numberOfLines,lineHeight=_ref.lineHeight;if(isTextArea){return `${lineHeight*(numberOfLines!=null?numberOfLines:0)}px`;}if(hasTags){return undefined;}return makeSize(size[36]);};var getRNInputStyles=function getRNInputStyles(props){return Object.assign({},getBaseInputStyles({theme:props.theme,isFocused:props.isFocused,isDisabled:!props.editable,validationState:props.validationState,leadingIcon:props.leadingIcon,prefix:props.prefix,interactionElement:props.interactionElement,suffix:props.suffix,trailingIcon:props.trailingIcon,isTextArea:props.isTextArea,hasTags:props.hasTags,isDropdownTrigger:props.isDropdownTrigger}),{lineHeight:undefined,textAlignVertical:'top',height:getInputHeight({isTextArea:props.isTextArea,hasTags:props.hasTags,numberOfLines:props.numberOfLines,lineHeight:props.theme.typography.lineHeights[300]})});};var StyledNativeBaseInput=styled.TextInput(function(_ref2){var id=_ref2.id,isFocused=_ref2.isFocused,theme=_ref2.theme,editable=_ref2.editable,validationState=_ref2.validationState,leadingIcon=_ref2.leadingIcon,prefix=_ref2.prefix,interactionElement=_ref2.interactionElement,suffix=_ref2.suffix,trailingIcon=_ref2.trailingIcon,isTextArea=_ref2.isTextArea,numberOfLines=_ref2.numberOfLines,isDropdownTrigger=_ref2.isDropdownTrigger,hasTags=_ref2.hasTags;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,hasTags:hasTags,isDropdownTrigger:isDropdownTrigger});});var StyledNativeBaseButton=styled.TouchableOpacity(function(_ref3){var id=_ref3.id,isFocused=_ref3.isFocused,theme=_ref3.theme,editable=_ref3.editable,validationState=_ref3.validationState,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,interactionElement=_ref3.interactionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,isTextArea=_ref3.isTextArea,numberOfLines=_ref3.numberOfLines,isDropdownTrigger=_ref3.isDropdownTrigger,hasTags=_ref3.hasTags;return getRNInputStyles({id:id,isFocused:isFocused,theme:theme,editable:editable,validationState:validationState,leadingIcon:leadingIcon,prefix:prefix,interactionElement:interactionElement,suffix:suffix,trailingIcon:trailingIcon,isTextArea:isTextArea,numberOfLines:numberOfLines,isDropdownTrigger:isDropdownTrigger,hasTags:hasTags});});var _StyledBaseInput=function _StyledBaseInput(_ref4,ref){var name=_ref4.name;_ref4.isRequired;var isDisabled=_ref4.isDisabled,maxCharacters=_ref4.maxCharacters,handleOnFocus=_ref4.handleOnFocus,handleOnChange=_ref4.handleOnChange,handleOnBlur=_ref4.handleOnBlur,handleOnSubmit=_ref4.handleOnSubmit,handleOnInput=_ref4.handleOnInput,handleOnKeyDown=_ref4.handleOnKeyDown,handleOnClick=_ref4.handleOnClick,_ref4$keyboardType=_ref4.keyboardType,keyboardType=_ref4$keyboardType===void 0?'text':_ref4$keyboardType,keyboardReturnKeyType=_ref4.keyboardReturnKeyType,autoCompleteSuggestionType=_ref4.autoCompleteSuggestionType,accessibilityProps=_ref4.accessibilityProps,currentInteraction=_ref4.currentInteraction,setCurrentInteraction=_ref4.setCurrentInteraction,type=_ref4.type,numberOfLines=_ref4.numberOfLines,isTextArea=_ref4.isTextArea;_ref4.hasPopup;var shouldIgnoreBlurAnimation=_ref4.shouldIgnoreBlurAnimation,autoCapitalize=_ref4.autoCapitalize,renderAs=_ref4.as,props=_objectWithoutProperties(_ref4,_excluded$o);var buttonValue=props.value?props.value:props.placeholder;var commonProps={onBlur:function onBlur(){if(!shouldIgnoreBlurAnimation){setCurrentInteraction('default');}},isFocused:currentInteraction==='active'};return renderAs==='button'?jsx(StyledNativeBaseButton,Object.assign({ref:ref,onPress:function onPress(){handleOnClick==null?void 0:handleOnClick({name:name,value:props.value});},onFocus:function onFocus(){handleOnFocus==null?void 0:handleOnFocus({name:name,value:props.value});setCurrentInteraction('active');},as:undefined},commonProps,props,accessibilityProps,{children:jsx(Text,{type:props.value?'subtle':'placeholder',truncateAfterLines:1,textAlign:props.textAlign,children:buttonValue})})):jsx(StyledNativeBaseInput,Object.assign({ref:ref,multiline:isTextArea,numberOfLines:numberOfLines,editable:!isDisabled,maxLength:maxCharacters,onFocus:function onFocus(event){handleOnFocus==null?void 0:handleOnFocus({name:name,value:event==null?void 0:event.nativeEvent.text});setCurrentInteraction('active');},onChangeText:function onChangeText(text){handleOnChange==null?void 0:handleOnChange({name:name,value:text});handleOnInput==null?void 0:handleOnInput({name:name,value:text});},onEndEditing:function onEndEditing(event){return handleOnBlur==null?void 0:handleOnBlur({name:name,value:event==null?void 0:event.nativeEvent.text});},onSubmitEditing:function onSubmitEditing(event){return handleOnSubmit==null?void 0:handleOnSubmit({name:name,value:event==null?void 0:event.nativeEvent.text});},onKeyPress:function onKeyPress(event){handleOnKeyDown==null?void 0:handleOnKeyDown({name:name,key:event==null?void 0:event.nativeEvent.key,event:event});},keyboardType:KeyboardTypeToNativeValuesMap[keyboardType],returnKeyType:keyboardReturnKeyType,autoCompleteType:autoCompleteSuggestionType?autoCompleteSuggestionTypeAndroid[autoCompleteSuggestionType]:undefined,secureTextEntry:type==='password',isTextArea:isTextArea,textContentType:autoCompleteSuggestionType?autoCompleteSuggestionTypeIOS[autoCompleteSuggestionType]:undefined,autoCapitalize:autoCapitalize},commonProps,props,accessibilityProps));};var StyledBaseInput=assignWithoutSideEffects(React__default.forwardRef(_StyledBaseInput),{displayName:'StyledBaseInput'});
|
|
2834
2834
|
|
|
2835
|
-
var BaseInputStyledAnimatedBorder=styled(Animated$1.View)(function(_ref){var theme=_ref.theme;return {position:'absolute',bottom:0,left:0,right:0,opacity:1,backgroundColor:theme.colors.brand.primary[500],height:makeBorderSize(theme.border.width.thin)};});var
|
|
2835
|
+
var BaseInputStyledAnimatedBorder=styled(Animated$1.View)(function(_ref){var theme=_ref.theme;return {position:'absolute',bottom:0,left:0,right:0,opacity:1,backgroundColor:theme.colors.brand.primary[500],height:makeBorderSize(theme.border.width.thin)};});var BaseInputAnimatedBorder=function BaseInputAnimatedBorder(_ref2){var currentInteraction=_ref2.currentInteraction,validationState=_ref2.validationState;var _useTheme=useTheme(),theme=_useTheme.theme;var borderAnimationEasing=theme.motion.easing.standard.effective;var widthTrigger=useSharedValue(0);var opacityTrigger=useSharedValue(1);var animatedStyle=useAnimatedStyle(function(){return {width:`${interpolate(widthTrigger.value,[0,1],[0,100])}%`,opacity:interpolate(opacityTrigger.value,[0,1],[0,1])};});useEffect(function(){if(currentInteraction=='active'&&validationState!=='error'&&validationState!=='success'){widthTrigger.value=0;opacityTrigger.value=1;widthTrigger.value=withTiming(1,{duration:theme.motion.duration.moderate,easing:borderAnimationEasing});}else if(currentInteraction==='default'){opacityTrigger.value=withTiming(0,{duration:theme.motion.duration.xquick,easing:borderAnimationEasing});}},[currentInteraction,opacityTrigger,widthTrigger,theme.motion.duration,borderAnimationEasing,validationState]);return jsx(BaseInputStyledAnimatedBorder,{style:animatedStyle});};
|
|
2836
2836
|
|
|
2837
|
-
var _excluded$n=["showAllTags","setShowAllTagsWithAnimation","children","maxTagRows","isDropdownTrigger"];var StyledBaseInputWrapper=styled(Animated$1.View)(function(props){return Object.assign({},getInputBackgroundAndBorderStyles({theme:props.theme,isFocused:props.currentInteraction==='active',isDisabled:props.isDisabled,validationState:props.validationState,isTextArea:props.isTextArea,isDropdownTrigger:props.isDropdownTrigger}));});var getMaxHeight=function getMaxHeight(_ref){var maxTagRows=_ref.maxTagRows,showAllTags=_ref.showAllTags;if(maxTagRows==='single'){return BASEINPUT_WRAPPER_MIN_HEIGHT;}if(maxTagRows==='multiple'){return BASEINPUT_WRAPPER_MAX_HEIGHT;}return showAllTags?BASEINPUT_WRAPPER_MAX_HEIGHT:BASEINPUT_WRAPPER_MIN_HEIGHT;};var
|
|
2837
|
+
var _excluded$n=["showAllTags","setShowAllTagsWithAnimation","children","maxTagRows","isDropdownTrigger"];var StyledBaseInputWrapper=styled(Animated$1.View)(function(props){return Object.assign({},getInputBackgroundAndBorderStyles({theme:props.theme,isFocused:props.currentInteraction==='active',isDisabled:props.isDisabled,validationState:props.validationState,isTextArea:props.isTextArea,isDropdownTrigger:props.isDropdownTrigger}));});var getMaxHeight=function getMaxHeight(_ref){var maxTagRows=_ref.maxTagRows,showAllTags=_ref.showAllTags;if(maxTagRows==='single'){return BASEINPUT_WRAPPER_MIN_HEIGHT;}if(maxTagRows==='multiple'){return BASEINPUT_WRAPPER_MAX_HEIGHT;}return showAllTags?BASEINPUT_WRAPPER_MAX_HEIGHT:BASEINPUT_WRAPPER_MIN_HEIGHT;};var _AnimatedBaseInputWrapper=function _AnimatedBaseInputWrapper(_ref2,ref){var showAllTags=_ref2.showAllTags,setShowAllTagsWithAnimation=_ref2.setShowAllTagsWithAnimation,children=_ref2.children,maxTagRows=_ref2.maxTagRows,isDropdownTrigger=_ref2.isDropdownTrigger,rest=_objectWithoutProperties(_ref2,_excluded$n);var _useTheme=useTheme(),theme=_useTheme.theme;var sharedHeight=useSharedValue(BASEINPUT_WRAPPER_MIN_HEIGHT);React__default.useEffect(function(){if(!isDropdownTrigger){return;}sharedHeight.value=withTiming(showAllTags?BASEINPUT_WRAPPER_MAX_HEIGHT:BASEINPUT_WRAPPER_MIN_HEIGHT,{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:getMaxHeight({showAllTags:showAllTags,maxTagRows:maxTagRows})};return jsx(StyledBaseInputWrapper,Object.assign({ref:ref,style:isDropdownTrigger?Object.assign({},maxHeightStyleObject,animatedStyleObject):{},isDropdownTrigger:isDropdownTrigger},rest,{children:children}));};var AnimatedBaseInputWrapper=React__default.forwardRef(_AnimatedBaseInputWrapper);
|
|
2838
2838
|
|
|
2839
2839
|
var _excluded$m=["children","validationState","currentInteraction","isLabelLeftPositioned","isTextArea","showAllTags","setShowAllTagsWithAnimation","maxTagRows"];var _BaseInputWrapper=function _BaseInputWrapper(_ref,ref){var children=_ref.children,validationState=_ref.validationState,currentInteraction=_ref.currentInteraction;_ref.isLabelLeftPositioned;var isTextArea=_ref.isTextArea,showAllTags=_ref.showAllTags,setShowAllTagsWithAnimation=_ref.setShowAllTagsWithAnimation,maxTagRows=_ref.maxTagRows,props=_objectWithoutProperties(_ref,_excluded$m);return jsxs(AnimatedBaseInputWrapper,Object.assign({ref:ref,isTextArea:isTextArea,validationState:validationState,currentInteraction:currentInteraction,showAllTags:showAllTags,maxTagRows:maxTagRows,setShowAllTagsWithAnimation:setShowAllTagsWithAnimation},props,{children:[children,jsx(BaseInputAnimatedBorder,{currentInteraction:currentInteraction,validationState:validationState})]}));};var BaseInputWrapper=React__default.forwardRef(_BaseInputWrapper);
|
|
2840
2840
|
|
|
@@ -2860,9 +2860,9 @@ var StyledChevronIconContainer=styled(TouchableOpacity)(function(_props){return
|
|
|
2860
2860
|
|
|
2861
2861
|
var _excluded$f=["size","icon","onDismiss","children","isDisabled","testID","_isVirtuallyFocused","_isTagInsideInput"];var FocussableTag=styled(BaseBox)(function(props){if(props._isVirtuallyFocused&&!isReactNative$4()){return {outline:`${makeSize(size['1'])} solid ${props.theme.colors.surface.background.level1.lowContrast}`,boxShadow:`0px 0px 0px 4px ${props.theme.colors.brand.primary[400]}`};}return {};});var Tag=function Tag(_ref){var _ref$size=_ref.size,size$1=_ref$size===void 0?'medium':_ref$size,Icon=_ref.icon,onDismiss=_ref.onDismiss,children=_ref.children,isDisabled=_ref.isDisabled,testID=_ref.testID,_isVirtuallyFocused=_ref._isVirtuallyFocused,_isTagInsideInput=_ref._isTagInsideInput,styledProps=_objectWithoutProperties(_ref,_excluded$f);var isMobile=useIsMobile();var textColor=isDisabled?'surface.text.placeholder.lowContrast':'surface.text.subtle.lowContrast';var mediumPadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.1','spacing.2','spacing.1','spacing.3']};var largePadding={base:['spacing.2','spacing.3','spacing.2','spacing.4'],m:['spacing.2','spacing.3','spacing.2','spacing.4']};var assetSize=React__default.useMemo(function(){if(isMobile&&size$1==='large'){return 'medium';}return 'small';},[isMobile,size$1]);return jsx(BaseBox,Object.assign({display:isReactNative$4()?'flex':'inline-flex'},getStyledProps(styledProps),metaAttribute({name:MetaConstants.Tag,testID:testID}),{children:jsxs(FocussableTag,{display:isReactNative$4()?'flex':'inline-flex',alignSelf:isReactNative$4()?'center':undefined,flexDirection:"row",flexWrap:"nowrap",backgroundColor:"brand.gray.a100.lowContrast",borderRadius:"max",padding:size$1==='medium'?mediumPadding:largePadding,_isVirtuallyFocused:_isVirtuallyFocused,children:[Icon?jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",children:jsx(Icon,{color:textColor,size:assetSize,marginRight:"spacing.2"})}):null,jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",maxWidth:makeSize(size['100']),children:jsx(Text,{truncateAfterLines:1,marginRight:"spacing.2",color:textColor,size:assetSize,children:children})}),jsx(Box,{display:"flex",flexDirection:"row",alignItems:"center",justifyContent:"center",children:jsx(IconButton,{size:assetSize,icon:CloseIcon,accessibilityLabel:`Close ${children} tag`,isDisabled:isDisabled,_tabIndex:_isTagInsideInput?-1:undefined,onClick:function onClick(e){if(_isTagInsideInput){e.stopPropagation();}onDismiss();}})})]})}));};
|
|
2862
2862
|
|
|
2863
|
-
var TAG_MAX_WIDTH_START=size['140'];var TAG_MAX_WIDTH_END=size['0'];
|
|
2863
|
+
var TAG_MAX_WIDTH_START=size['140'];var TAG_MAX_WIDTH_END=size['0'];var TAG_OPACITY_START=1;var TAG_OPACITY_END=0;
|
|
2864
2864
|
|
|
2865
|
-
var
|
|
2865
|
+
var useAnimatedTag=function useAnimatedTag(onAnimationEndCallback){var maxWidth=useSharedValue(TAG_MAX_WIDTH_START);var opacity=useSharedValue(TAG_OPACITY_START);var _useTheme=useTheme(),theme=_useTheme.theme;var entering=new Keyframe({0:{opacity:TAG_OPACITY_END},100:{opacity:TAG_OPACITY_START,easing:theme.motion.easing.exit.effective}}).duration(makeMotionTime(theme.motion.duration.xquick));var animate=function animate(){maxWidth.value=withTiming(TAG_MAX_WIDTH_END,{duration:makeMotionTime(theme.motion.duration.xquick),easing:castNativeType(theme.motion.easing.exit.effective)},function(isComplete){if(isComplete){runOnJS(onAnimationEndCallback)();}});opacity.value=withTiming(TAG_OPACITY_END,{duration:makeMotionTime(theme.motion.duration.xquick),easing:Easing.out(Easing.exp)});};var animatedStyle=useAnimatedStyle(function(){return {maxWidth:maxWidth.value,opacity:opacity.value};});return {animate:animate,animatedStyle:animatedStyle,entering:entering};};var AnimatedTag=function AnimatedTag(_ref){var children=_ref.children,currentTagIndex=_ref.currentTagIndex,activeTagIndex=_ref.activeTagIndex,onDismiss=_ref.onDismiss,tagsLength=_ref.tagsLength;var onAnimationEnd=function onAnimationEnd(){onDismiss({tagIndex:currentTagIndex,tagName:children});};var prevSelectionsLength=React__default.useRef();var _useAnimatedTag=useAnimatedTag(onAnimationEnd),animate=_useAnimatedTag.animate,animatedStyle=_useAnimatedTag.animatedStyle,entering=_useAnimatedTag.entering;var isTagRemoved=prevSelectionsLength.current?prevSelectionsLength.current>tagsLength:false;return jsx(Animated$1.View,{style:animatedStyle,entering:isTagRemoved?undefined:entering,children:jsx(Tag,{_isVirtuallyFocused:currentTagIndex===activeTagIndex,_isTagInsideInput:true,onDismiss:function onDismiss(){animate();},marginRight:"spacing.3",marginY:"spacing.2",children:children})});};
|
|
2866
2866
|
|
|
2867
2867
|
var getTagsGroup=function getTagsGroup(_ref){var tags=_ref.tags,activeTagIndex=_ref.activeTagIndex,onDismiss=_ref.onDismiss;return tags.map(function(tagName,tagIndex){return jsx(AnimatedTag,{activeTagIndex:activeTagIndex,onDismiss:onDismiss,currentTagIndex:tagIndex,tagsLength:tags.length,children:tagName},tagName);});};
|
|
2868
2868
|
|
|
@@ -3082,7 +3082,7 @@ var clamp$1 = /*@__PURE__*/getDefaultExportFromCjs(clamp_1);
|
|
|
3082
3082
|
|
|
3083
3083
|
var indeterminateAnimation={scaleXInitial:1,scaleXMid:5,scaleXFinal:1,leftInitial:'-8%',leftMid:'50%',leftFinal:'103%',fillWidth:'5%'};var pulseAnimation={opacityInitial:0,opacityMid:0.25,opacityFinal:0,backgroundColor:'white'};
|
|
3084
3084
|
|
|
3085
|
-
var ProgressBarIndeterminateFilledContainer=styled(Animated$1.View)(function(_ref){var backgroundColor=_ref.backgroundColor;return {backgroundColor:backgroundColor,height:'100%',width:indeterminateAnimation.fillWidth,position:'absolute'};});var ProgressBarDeterminateFilledContainer=styled(Animated$1.View)(function(_ref2){var backgroundColor=_ref2.backgroundColor,progress=_ref2.progress;return {backgroundColor:backgroundColor,height:'100%',width:`${progress}%`};});var ProgressBarPulseAnimation=styled(Animated$1.View)({backgroundColor:pulseAnimation.backgroundColor,opacity:pulseAnimation.opacityInitial,width:'100%',height:'100%'});var
|
|
3085
|
+
var ProgressBarIndeterminateFilledContainer=styled(Animated$1.View)(function(_ref){var backgroundColor=_ref.backgroundColor;return {backgroundColor:backgroundColor,height:'100%',width:indeterminateAnimation.fillWidth,position:'absolute'};});var ProgressBarDeterminateFilledContainer=styled(Animated$1.View)(function(_ref2){var backgroundColor=_ref2.backgroundColor,progress=_ref2.progress;return {backgroundColor:backgroundColor,height:'100%',width:`${progress}%`};});var ProgressBarPulseAnimation=styled(Animated$1.View)({backgroundColor:pulseAnimation.backgroundColor,opacity:pulseAnimation.opacityInitial,width:'100%',height:'100%'});var ProgressBarFilled=function ProgressBarFilled(_ref3){var backgroundColor=_ref3.backgroundColor,progress=_ref3.progress,fillMotionDuration=_ref3.fillMotionDuration,motionEasing=_ref3.motionEasing,pulseMotionDuration=_ref3.pulseMotionDuration,pulseMotionDelay=_ref3.pulseMotionDelay,variant=_ref3.variant,isIndeterminate=_ref3.isIndeterminate,indeterminateMotionDuration=_ref3.indeterminateMotionDuration;var animatedWidth=useSharedValue(progress);var animatedOpacity=useSharedValue(pulseAnimation.opacityInitial);var animatedScaleX=useSharedValue(indeterminateAnimation.scaleXInitial);var animatedLeft=useSharedValue(indeterminateAnimation.leftInitial);var _useTheme=useTheme(),theme=_useTheme.theme;var fillAndPulseEasing=getIn(theme.motion,motionEasing);var pulseDuration=castNativeType(makeMotionTime(getIn(theme.motion,pulseMotionDuration)))/2;useEffect(function(){var fillDuration=castNativeType(makeMotionTime(getIn(theme.motion,fillMotionDuration)));animatedWidth.value=withTiming(progress,{duration:fillDuration,easing:fillAndPulseEasing});return function(){cancelAnimation(animatedWidth);};},[progress,animatedWidth,fillMotionDuration,theme,fillAndPulseEasing]);var progressFillAnimatedStyle=useAnimatedStyle(function(){return {width:`${animatedWidth.value}%`};});useEffect(function(){if(variant==='progress'&&isIndeterminate){var indeterminateDuration=castNativeType(makeMotionTime(getIn(theme.motion,indeterminateMotionDuration)));var indeterminateEasing=Easing.linear;animatedLeft.value=withRepeat(withTiming(indeterminateAnimation.leftFinal,{duration:indeterminateDuration,easing:indeterminateEasing}),-1);animatedScaleX.value=withRepeat(withSequence(withTiming(indeterminateAnimation.scaleXMid,{duration:indeterminateDuration/2,easing:indeterminateEasing}),withTiming(indeterminateAnimation.scaleXFinal,{duration:indeterminateDuration/2,easing:indeterminateEasing})),-1);}return function(){cancelAnimation(animatedLeft);cancelAnimation(animatedScaleX);};},[animatedLeft,animatedScaleX,indeterminateMotionDuration,isIndeterminate,theme,variant]);var indeterminateAnimatedStyle=useAnimatedStyle(function(){return {left:animatedLeft.value,transform:[{scaleX:animatedScaleX.value}]};});useEffect(function(){var pulsatingAnimationTimingConfig={duration:pulseDuration,easing:fillAndPulseEasing};if(variant==='progress'){animatedOpacity.value=withDelay(castNativeType(makeMotionTime(getIn(theme.motion,pulseMotionDelay))),withRepeat(withSequence(withTiming(pulseAnimation.opacityMid,pulsatingAnimationTimingConfig),withTiming(pulseAnimation.opacityFinal,pulsatingAnimationTimingConfig)),-1));}return function(){cancelAnimation(animatedOpacity);};},[animatedOpacity,fillAndPulseEasing,pulseDuration,pulseMotionDelay,theme,variant]);var pulseAnimatedStyle=useAnimatedStyle(function(){return {opacity:animatedOpacity.value};});var ProgressBarFilledContainer=isIndeterminate?ProgressBarIndeterminateFilledContainer:ProgressBarDeterminateFilledContainer;return jsx(ProgressBarFilledContainer,{style:isIndeterminate?indeterminateAnimatedStyle:progressFillAnimatedStyle,backgroundColor:backgroundColor,progress:progress,children:jsx(ProgressBarPulseAnimation,{style:pulseAnimatedStyle})});};
|
|
3086
3086
|
|
|
3087
3087
|
var _excluded$b=["accessibilityLabel","contrast","intent","isIndeterminate","label","showPercentage","size","value","variant","min","max","testID"];var progressBarHeight={small:size[2],medium:size[4]};var ProgressBar=function ProgressBar(_ref){var _label$trim;var accessibilityLabel=_ref.accessibilityLabel,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,intent=_ref.intent,_ref$isIndeterminate=_ref.isIndeterminate,isIndeterminate=_ref$isIndeterminate===void 0?false:_ref$isIndeterminate,label=_ref.label,_ref$showPercentage=_ref.showPercentage,showPercentage=_ref$showPercentage===void 0?true:_ref$showPercentage,_ref$size=_ref.size,size=_ref$size===void 0?'small':_ref$size,_ref$value=_ref.value,value=_ref$value===void 0?0:_ref$value,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'progress':_ref$variant,_ref$min=_ref.min,min=_ref$min===void 0?0:_ref$min,_ref$max=_ref.max,max=_ref$max===void 0?100:_ref$max,testID=_ref.testID,styledProps=_objectWithoutProperties(_ref,_excluded$b);var _useTheme=useTheme(),theme=_useTheme.theme;var id=useId(variant);if(__DEV__){if(variant==='meter'&&isIndeterminate){throwBladeError({moduleName:'ProgressBar',message:`Cannot set 'isIndeterminate' when 'variant' is 'meter'.`});}}var unfilledBackgroundColor=theme.colors.brand.gray.a100[`${contrast}Contrast`];var filledBackgroundColor=intent?theme.colors.feedback.background[intent].highContrast:theme.colors.brand.primary[500];var hasLabel=label&&((_label$trim=label.trim())==null?void 0:_label$trim.length)>0;var isMeter=variant==='meter';var progressValue=clamp$1(value,min,max);var percentageProgressValue=Math.floor((progressValue-min)*100/(max-min));var shouldShowPercentage=showPercentage&&!isMeter&&!isIndeterminate;var accessibilityProps={role:'progressbar',label:accessibilityLabel!=null?accessibilityLabel:label,valueNow:percentageProgressValue,valueText:`${percentageProgressValue}%`,valueMin:min,valueMax:max};if(isMeter){accessibilityProps.role='meter';accessibilityProps.valueNow=progressValue;accessibilityProps.valueText=`${progressValue}`;}if(isIndeterminate){accessibilityProps.valueNow=undefined;accessibilityProps.valueMin=undefined;accessibilityProps.valueMax=undefined;accessibilityProps.valueText=undefined;}return jsx(BaseBox,Object.assign({},getStyledProps(styledProps),metaAttribute({name:MetaConstants.ProgressBar,testID:testID}),{children:jsxs(BaseBox,{display:"flex",flexDirection:"column",width:"100%",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",justifyContent:hasLabel?'space-between':'flex-end',children:[hasLabel?jsx(FormLabel,{as:"label",htmlFor:id,contrast:contrast,children:label}):null,shouldShowPercentage?jsx(BaseBox,{marginBottom:"spacing.2",children:jsx(Text,{type:"subdued",variant:"body",contrast:contrast,size:"small",children:`${percentageProgressValue}%`})}):null]}),jsx(BaseBox,Object.assign({id:id},makeAccessible({role:accessibilityProps.role,label:accessibilityProps.label,valueNow:accessibilityProps.valueNow,valueText:accessibilityProps.valueText,valueMin:accessibilityProps.valueMin,valueMax:accessibilityProps.valueMax}),{children:jsx(BaseBox,{backgroundColor:unfilledBackgroundColor,height:makeSize(progressBarHeight[size]),overflow:"hidden",position:"relative",children:jsx(ProgressBarFilled,{backgroundColor:filledBackgroundColor,progress:percentageProgressValue,fillMotionDuration:"duration.2xgentle",pulseMotionDuration:"duration.2xgentle",indeterminateMotionDuration:"duration.2xgentle",pulseMotionDelay:"delay.long",motionEasing:"easing.standard.revealing",variant:variant,isIndeterminate:isIndeterminate})})}))]})}));};
|
|
3088
3088
|
|
|
@@ -3149,21 +3149,21 @@ var isNumber$1 = /*@__PURE__*/getDefaultExportFromCjs(isNumber_1);
|
|
|
3149
3149
|
|
|
3150
3150
|
var switchSizes={track:{desktop:{small:{width:size[28],height:'spacing.5'},medium:{width:size[36],height:'spacing.6'}},mobile:{small:{width:size[36],height:'spacing.6'},medium:{width:size[44],height:'spacing.7'}}},thumb:{desktop:{small:{width:'spacing.4',height:'spacing.4'},medium:{width:'spacing.5',height:'spacing.5'}},mobile:{small:{width:'spacing.5',height:'spacing.5'},medium:{width:'spacing.6',height:'spacing.6'}}}};var switchColors={track:{default:{background:{checked:'colors.brand.primary.500',unchecked:'colors.brand.gray.500.lowContrast'}},disabled:{background:{checked:'colors.brand.primary.400',unchecked:'colors.brand.gray.a100.lowContrast'}}},thumb:{default:{background:'colors.brand.gray.700.highContrast'},disabled:{background:'colors.brand.gray.200.lowContrast'}},thumbIcon:{default:{fill:'colors.brand.gray.200.highContrast'},disabled:{fill:'colors.surface.text.placeholder.lowContrast'}}};var switchMotion={easing:{thumb:'motion.easing.standard.effective',thumbIcon:'motion.easing.standard.effective',track:'motion.easing.standard.effective'},duration:{thumb:'motion.duration.xquick',thumbIcon:'motion.duration.xquick',track:'motion.duration.xquick'}};var switchHoverTokens={default:{background:{checked:'colors.brand.primary.600',unchecked:'colors.brand.gray.600.lowContrast'}}};
|
|
3151
3151
|
|
|
3152
|
-
var
|
|
3152
|
+
var AnimatedThumbIcon=function AnimatedThumbIcon(_ref){var children=_ref.children,isChecked=_ref.isChecked,width=_ref.width,height=_ref.height,viewBox=_ref.viewBox,fill=_ref.fill;var _useTheme=useTheme(),theme=_useTheme.theme;var opacity=useSharedValue(isChecked?1:0);var easing=getIn(theme,switchMotion.easing.thumbIcon);var duration=getIn(theme,switchMotion.duration.thumbIcon);React__default.useEffect(function(){opacity.value=withTiming(isChecked?1:0,{duration:duration,easing:easing});},[isChecked]);var opacityStyle=useAnimatedStyle(function(){return {opacity:interpolate(opacity.value,[0,0.2,1],[0,0,1])};},[]);return jsx(Animated$1.View,{style:opacityStyle,children:jsx(Svg,{width:width,height:height,viewBox:viewBox,fill:fill,children:children})});};
|
|
3153
3153
|
|
|
3154
3154
|
var switchIconSize={desktop:{small:size[6],medium:'spacing.3'},mobile:{small:'spacing.3',medium:size[10]}};var ThumbIcon=function ThumbIcon(_ref){var isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var width=switchIconSize[matchedDeviceType][size];var height=switchIconSize[matchedDeviceType][size];var finalWidth=isNumber$1(width)?makeSize(width):makeSpace(getIn(theme,width));var finalHeight=isNumber$1(height)?makeSize(height):makeSpace(getIn(theme,height));var variant=isDisabled?'disabled':'default';var fillColor=getIn(theme,switchColors.thumbIcon[variant].fill);return jsx(AnimatedThumbIcon,{isChecked:Boolean(isChecked),width:finalWidth,height:finalHeight,viewBox:"0 0 11 8",fill:"none",children:jsx(Path,{fillRule:"evenodd",clipRule:"evenodd",d:"M8.81891 0.546661C9.12722 0.238352 9.62709 0.238353 9.9354 0.546661C10.2437 0.85497 10.2437 1.35484 9.9354 1.66315L4.14592 7.45262C3.83761 7.76093 3.33775 7.76093 3.02944 7.45262L0.397858 4.82104C0.0895488 4.51273 0.0895488 4.01286 0.397857 3.70456C0.706166 3.39625 1.20603 3.39625 1.51434 3.70456L3.58768 5.77789L8.81891 0.546661Z",fill:fillColor})});};
|
|
3155
3155
|
|
|
3156
3156
|
var Thumb=styled(BaseBox)(function(_ref){var theme=_ref.theme,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,deviceType=_ref.deviceType;var width=switchSizes.thumb[deviceType][size].width;var height=switchSizes.thumb[deviceType][size].height;var finalWidth=isNumber$1(width)?makeSize(width):makeSpace(getIn(theme,width));var finalHeight=isNumber$1(height)?makeSize(height):makeSpace(getIn(theme,height));var reactNativeStyles={left:0,margin:makeSpace(theme.spacing[1])};return Object.assign({display:'flex',alignItems:'center',justifyContent:'center',width:finalWidth,height:finalHeight,position:isReactNative$4()?'absolute':'relative'},isReactNative$4()&&reactNativeStyles);});
|
|
3157
3157
|
|
|
3158
|
-
var StyledAnimatedThumb=styled(Animated$1.View)(function(_ref){var theme=_ref.theme,isDisabled=_ref.isDisabled;var variant=isDisabled?'disabled':'default';var backgroundColor=getIn(theme,switchColors.thumb[variant].background);return {display:'flex',alignItems:'center',justifyContent:'center',flexShrink:0,width:'100%',height:'100%',borderRadius:makeBorderSize(theme.border.radius.max),backgroundColor:backgroundColor,position:'absolute'};});var
|
|
3158
|
+
var StyledAnimatedThumb=styled(Animated$1.View)(function(_ref){var theme=_ref.theme,isDisabled=_ref.isDisabled;var variant=isDisabled?'disabled':'default';var backgroundColor=getIn(theme,switchColors.thumb[variant].background);return {display:'flex',alignItems:'center',justifyContent:'center',flexShrink:0,width:'100%',height:'100%',borderRadius:makeBorderSize(theme.border.radius.max),backgroundColor:backgroundColor,position:'absolute'};});var AnimatedThumb=function AnimatedThumb(_ref2){var isChecked=_ref2.isChecked,isDisabled=_ref2.isDisabled,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,children=_ref2.children,isPressed=_ref2.isPressed;var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var sharedLeft=useSharedValue(isChecked?1:0);var sharedWidth=useSharedValue(isPressed?1:0);var sharedShouldShiftOffset=useSharedValue(Boolean(isChecked&&isPressed));var easing=getIn(theme,switchMotion.easing.thumb);var duration=getIn(theme,switchMotion.duration.thumb);var thumbWidth=switchSizes.thumb[matchedDeviceType][size].width;var finalWidth=isNumber$1(thumbWidth)?thumbWidth:getIn(theme,thumbWidth);React__default.useEffect(function(){sharedLeft.value=withTiming(isChecked?1:0,{duration:duration,easing:easing});},[isChecked]);React__default.useEffect(function(){sharedWidth.value=withTiming(isPressed?1:0,{duration:duration,easing:easing});},[isPressed]);React__default.useEffect(function(){sharedShouldShiftOffset.value=Boolean(isChecked&&isPressed);},[isChecked,isPressed]);var thumbAnimation=useAnimatedStyle(function(){return {width:interpolate(sharedWidth.value,[0,1],[finalWidth,finalWidth*1.25]),left:withTiming(sharedShouldShiftOffset.value?finalWidth*-0.25:0,{easing:easing,duration:duration}),transform:[{translateX:interpolate(sharedLeft.value,[0,1],[0,finalWidth])}]};},[]);return jsx(StyledAnimatedThumb,{style:thumbAnimation,isDisabled:isDisabled,children:children});};
|
|
3159
3159
|
|
|
3160
3160
|
var getTrackStyles=function getTrackStyles(_ref){var isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,deviceType=_ref.deviceType,size=_ref.size,theme=_ref.theme;var variant='default';if(isDisabled)variant='disabled';var checked=isChecked?'checked':'unchecked';var background=switchColors.track[variant].background[checked];var backgroundColor=getIn(theme,background);var widthToken=switchSizes.track[deviceType][size].width;var heightToken=switchSizes.track[deviceType][size].height;var width=isNumber$1(widthToken)?makeSize(widthToken):makeSpace(getIn(theme,widthToken));var height=isNumber$1(heightToken)?makeSize(heightToken):makeSpace(getIn(theme,heightToken));return {pointerEvents:'none',position:'relative',display:'flex',alignItems:'center',margin:makeSpace(theme.spacing[1]),padding:makeSpace(theme.spacing[1]),width:width,height:height,borderRadius:makeSize(theme.border.radius.max),backgroundColor:backgroundColor,transitionTimingFunction:`${theme.motion.easing.standard.effective}`,transitionDuration:isReactNative$4()?undefined:`${makeMotionTime(theme.motion.duration['2xquick'])}`};};
|
|
3161
3161
|
|
|
3162
|
-
var _excluded$8=["children","isChecked"];var StyledSwitchTrack=styled(Animated$1.View)(function(_ref){var theme=_ref.theme,size=_ref.size,deviceType=_ref.deviceType,isDisabled=_ref.isDisabled,isChecked=_ref.isChecked;return Object.assign({},getTrackStyles({theme:theme,size:size,deviceType:deviceType,isDisabled:isDisabled,isChecked:isChecked}));});var
|
|
3162
|
+
var _excluded$8=["children","isChecked"];var StyledSwitchTrack=styled(Animated$1.View)(function(_ref){var theme=_ref.theme,size=_ref.size,deviceType=_ref.deviceType,isDisabled=_ref.isDisabled,isChecked=_ref.isChecked;return Object.assign({},getTrackStyles({theme:theme,size:size,deviceType:deviceType,isDisabled:isDisabled,isChecked:isChecked}));});var SwitchTrack=function SwitchTrack(_ref2){var children=_ref2.children,isChecked=_ref2.isChecked,props=_objectWithoutProperties(_ref2,_excluded$8);var _useTheme=useTheme(),theme=_useTheme.theme;var sharedColor=useSharedValue(isChecked?1:0);var easing=getIn(theme,switchMotion.easing.track);var duration=getIn(theme,switchMotion.duration.track);var checkedColor=getIn(theme,switchColors.track.default.background.checked);var uncheckedColor=getIn(theme,switchColors.track.default.background.unchecked);React__default.useEffect(function(){sharedColor.value=withTiming(isChecked?1:0,{duration:duration,easing:easing});},[isChecked]);var colorStyle=useAnimatedStyle(function(){return {backgroundColor:interpolateColor(sharedColor.value,[0,1],[uncheckedColor,checkedColor])};},[]);return jsx(StyledSwitchTrack,Object.assign({isChecked:isChecked},props,{style:colorStyle,children:children}));};
|
|
3163
3163
|
|
|
3164
3164
|
var _excluded$7=["defaultChecked","isChecked","isDisabled","name","onChange","size","value","accessibilityLabel","testID"];var _Switch=function _Switch(_ref,ref){var defaultChecked=_ref.defaultChecked,isChecked=_ref.isChecked,isDisabled=_ref.isDisabled,name=_ref.name,onChange=_ref.onChange,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,value=_ref.value,accessibilityLabel=_ref.accessibilityLabel,testID=_ref.testID,styledProps=_objectWithoutProperties(_ref,_excluded$7);var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isPressed=_React$useState2[0],setIsPressed=_React$useState2[1];var _useCheckbox=useCheckbox({role:'switch',defaultChecked:defaultChecked,isChecked:isChecked,isIndeterminate:false,hasError:false,hasHelperText:false,isDisabled:isDisabled,isRequired:false,name:name,value:value,onChange:onChange}),state=_useCheckbox.state,inputProps=_useCheckbox.inputProps;var handlePointerPressedIn=React__default.useCallback(function(){if(isDisabled)return;setIsPressed(true);},[isDisabled]);var handlePointerPressedOut=React__default.useCallback(function(){if(isDisabled)return;setIsPressed(false);},[isDisabled]);var handleKeyboardPressedIn=React__default.useCallback(function(e){if(isDisabled)return;if(e.key===' '){setIsPressed(true);}},[isDisabled]);var handleKeyboardPressedOut=React__default.useCallback(function(e){if(isDisabled)return;if(e.key===' '){setIsPressed(false);}},[isDisabled]);return jsx(BaseBox,Object.assign({},metaAttribute({testID:testID,name:MetaConstants.Switch}),{display:state.isReactNative?'flex':'inline-block'},getStyledProps(styledProps),{children:jsxs(SelectorLabel,{componentName:MetaConstants.SwitchLabel,onTouchStart:handlePointerPressedIn,onTouchEnd:handlePointerPressedOut,onMouseDown:handlePointerPressedIn,onMouseUp:handlePointerPressedOut,onMouseOut:handlePointerPressedOut,onKeyDown:handleKeyboardPressedIn,onKeyUp:handleKeyboardPressedOut,style:{cursor:isDisabled?'not-allowed':'pointer'},inputProps:state.isReactNative?Object.assign({},inputProps,makeAccessible({label:accessibilityLabel})):{},children:[jsx(SelectorInput,{hoverTokens:switchHoverTokens,ref:ref,isChecked:state.isChecked,isDisabled:isDisabled,hasError:false,inputProps:inputProps,accessibilityLabel:accessibilityLabel}),jsx(SwitchTrack,Object.assign({size:size,deviceType:matchedDeviceType,isDisabled:Boolean(isDisabled),isChecked:state.isChecked},makeAccessible({hidden:true}),{children:jsx(Thumb,{size:size,deviceType:matchedDeviceType,isChecked:state.isChecked,children:jsx(AnimatedThumb,{isPressed:isPressed,isChecked:state.isChecked,isDisabled:isDisabled,size:size,children:jsx(ThumbIcon,{isChecked:state.isChecked,isDisabled:isDisabled,size:size})})})}))]})}));};var Switch=assignWithoutSideEffects(React__default.forwardRef(_Switch),{displayName:'Switch'});
|
|
3165
3165
|
|
|
3166
|
-
var _excluded$6=["contrast"];var AnimatedBox=Animated$1.createAnimatedComponent(BaseBox);var
|
|
3166
|
+
var _excluded$6=["contrast"];var AnimatedBox=Animated$1.createAnimatedComponent(BaseBox);var PulseAnimation=function PulseAnimation(_ref){var contrast=_ref.contrast,props=_objectWithoutProperties(_ref,_excluded$6);var _useTheme=useTheme(),theme=_useTheme.theme;var durationPluseOff=theme.motion.duration.xmoderate;var durationPluseOn=theme.motion.duration['2xgentle'];var totalDuration=castNativeType(makeMotionTime(durationPluseOn+durationPluseOff));var easing=castNativeType(theme.motion.easing.standard.revealing);var progress=useSharedValue(0);var fadeIn=function fadeIn(){'worklet';var animations={opacity:withTiming(1,{duration:totalDuration,easing:easing})};var initialValues={opacity:0};return {initialValues:initialValues,animations:animations};};React__default.useEffect(function(){var pulsatingAnimationTimingConfig={duration:totalDuration,easing:easing};progress.value=withRepeat(withSequence(withTiming(0,pulsatingAnimationTimingConfig),withTiming(1,pulsatingAnimationTimingConfig)),-1,true);return function(){cancelAnimation(progress);};},[easing,progress,totalDuration]);var pulseAnimatedStyle=useAnimatedStyle(function(){return {backgroundColor:interpolateColor(progress.value,[1,0],[theme.colors.brand.gray.a50[`${contrast}Contrast`],theme.colors.brand.gray.a100[`${contrast}Contrast`]])};});return jsx(AnimatedBox,Object.assign({entering:fadeIn,style:pulseAnimatedStyle},props));};
|
|
3167
3167
|
|
|
3168
3168
|
var _excluded$5=["contrast","width","maxWidth","minWidth","height","maxHeight","minHeight","borderRadius","flexWrap","flexDirection","flexGrow","flexShrink","flexBasis","alignItems","alignContent","alignSelf","justifyItems","justifyContent","justifySelf","placeSelf","placeItems","order","testID"];var Skeleton=function Skeleton(_ref){var _ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast,width=_ref.width,maxWidth=_ref.maxWidth;_ref.minWidth;var height=_ref.height,maxHeight=_ref.maxHeight;_ref.minHeight;var borderRadius=_ref.borderRadius,flexWrap=_ref.flexWrap,flexDirection=_ref.flexDirection,flexGrow=_ref.flexGrow,flexShrink=_ref.flexShrink,flexBasis=_ref.flexBasis,alignItems=_ref.alignItems,alignContent=_ref.alignContent,alignSelf=_ref.alignSelf,justifyItems=_ref.justifyItems,justifyContent=_ref.justifyContent,justifySelf=_ref.justifySelf,placeSelf=_ref.placeSelf,placeItems=_ref.placeItems,order=_ref.order,testID=_ref.testID,props=_objectWithoutProperties(_ref,_excluded$5);return jsx(PulseAnimation,Object.assign({width:width,maxWidth:maxWidth,height:height,maxHeight:maxHeight,borderRadius:borderRadius,flexWrap:flexWrap,flexDirection:flexDirection,flexGrow:flexGrow,flexShrink:flexShrink,flexBasis:flexBasis,alignItems:alignItems,alignContent:alignContent,alignSelf:alignSelf,justifyItems:justifyItems,justifyContent:justifyContent,justifySelf:justifySelf,placeSelf:placeSelf,placeItems:placeItems,order:order,contrast:contrast},getStyledProps(props),makeAccessible({hidden:true}),metaAttribute({name:MetaConstants.Skeleton,testID:testID})));};
|
|
3169
3169
|
|
|
@@ -3201,9 +3201,9 @@ var CollapsibleContext=createContext(null);var useCollapsible=function useCollap
|
|
|
3201
3201
|
|
|
3202
3202
|
var getCollapsibleBodyContentBoxProps=function getCollapsibleBodyContentBoxProps(_ref){var direction=_ref.direction;return {marginTop:direction==='bottom'?'spacing.5':'spacing.0',marginBottom:direction==='top'?'spacing.5':'spacing.0'};};var getOpacity=function getOpacity(_ref2){var isExpanded=_ref2.isExpanded;return isExpanded?1:0.8;};var getTransitionDuration=function getTransitionDuration(theme){return makeMotionTime(theme.motion.duration.xmoderate);};var getTransitionEasing=function getTransitionEasing(theme){return theme.motion.easing.standard.effective;};var getCollapsibleChevronIconTransforms=function getCollapsibleChevronIconTransforms(){return {transformExpanded:-180,transformCollapsed:0};};
|
|
3203
3203
|
|
|
3204
|
-
var
|
|
3204
|
+
var CollapsibleChevronIcon=function CollapsibleChevronIcon(props){var _useCollapsible=useCollapsible(),isExpanded=_useCollapsible.isExpanded;var _useTheme=useTheme(),theme=_useTheme.theme;var _getCollapsibleChevro=getCollapsibleChevronIconTransforms(),transformExpanded=_getCollapsibleChevro.transformExpanded,transformCollapsed=_getCollapsibleChevro.transformCollapsed;var duration=castNativeType(getTransitionDuration(theme));var easing=castNativeType(getTransitionEasing(theme));var rotateZ=useDerivedValue(function(){return withTiming(isExpanded?transformExpanded:transformCollapsed,{duration:duration,easing:easing});});var animatedStyles=useAnimatedStyle(function(){return {transform:[{rotateZ:`${rotateZ.value}deg`}]};});return jsx(Animated$1.View,Object.assign({style:animatedStyles},makeAccessible({hidden:true}),{children:jsx(ChevronDownIcon,Object.assign({},props))}));};
|
|
3205
3205
|
|
|
3206
|
-
var
|
|
3206
|
+
var _AccordionButton=function _AccordionButton(_ref){var index=_ref.index,Icon=_ref.icon,children=_ref.children;var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var _useAccordion=useAccordion(),showNumberPrefix=_useAccordion.showNumberPrefix,expandedIndex=_useAccordion.expandedIndex;var _useTheme=useTheme(),theme=_useTheme.theme;var toggleCollapse=function toggleCollapse(){return onExpandChange(!isExpanded);};var isItemExpanded=expandedIndex===index;var isPressed=useSharedValue(false);var duration=castNativeType(getTransitionDuration$1(theme));var easing=castNativeType(getTransitionEasing$1(theme));var activeBackgroundColor=useSharedValue(getBackgroundColor({theme:theme,isExpanded:isExpanded,isActive:true}));var inActiveBackgroundColor=useSharedValue(getBackgroundColor({theme:theme,isExpanded:isExpanded,isActive:false}));useEffect(function(){activeBackgroundColor.value=getBackgroundColor({theme:theme,isExpanded:isExpanded,isActive:true});inActiveBackgroundColor.value=getBackgroundColor({theme:theme,isExpanded:isExpanded,isActive:false});},[isExpanded,activeBackgroundColor,inActiveBackgroundColor,theme]);var animatedStyles=useAnimatedStyle(function(){return {backgroundColor:withTiming(isPressed.value?activeBackgroundColor.value:inActiveBackgroundColor.value,{duration:duration,easing:easing})};});var _showNumberPrefix=typeof index==='number'&&showNumberPrefix;var _index=_showNumberPrefix?jsxs(Heading,{size:"small",marginRight:"spacing.2",children:[index+1,"."]}):null;var a11yLabel=_showNumberPrefix?`${index+1}. ${children}`:children;var renderChildren=function renderChildren(_ref2){var pressed=_ref2.pressed;isPressed.value=pressed;var iconColor=pressed?'surface.action.icon.focus.lowContrast':'surface.action.icon.default.lowContrast';var _icon=Icon&&jsx(Icon,{size:"medium",color:iconColor,marginRight:"spacing.3",marginY:"spacing.2"});if(__DEV__){if(_index&&_icon){throwBladeError({message:"showNumberPrefix and icon shouldn't be used together",moduleName:'Accordion'});}}return jsxs(BaseBox,{display:"flex",flexDirection:"row",flex:1,justifyContent:"space-between",alignItems:"center",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"flex-start",marginRight:"spacing.5",flexShrink:1,children:[_index,_icon,jsx(Heading,{size:"small",children:children})]}),jsx(BaseBox,{children:jsx(CollapsibleChevronIcon,{color:iconColor,size:"large"})})]});};return jsx(StyledAccordionButton,Object.assign({isExpanded:isExpanded,onPress:toggleCollapse,style:animatedStyles},makeAccessible({role:'button',expanded:isItemExpanded,controls:collapsibleBodyId,label:a11yLabel}),metaAttribute({name:MetaConstants.AccordionButton}),{children:renderChildren}));};var AccordionButton=assignWithoutSideEffects(_AccordionButton,{componentId:MetaConstants.AccordionButton});
|
|
3207
3207
|
|
|
3208
3208
|
var MAX_WIDTH={s:makeSize(Dimensions.get('window').width-size[40]),m:makeSize(size[640]),l:makeSize(size[1136])};var nativeStyles=StyleSheet.create({collapsibleBodyExpanded:{position:'relative'},collapsibleBodyCollapsed:{position:'absolute'}});var MAX_WIDTH_NO_RESTRICTIONS=undefined;
|
|
3209
3209
|
|
|
@@ -3213,7 +3213,7 @@ var _CollapsibleLink=function _CollapsibleLink(_ref){var children=_ref.children,
|
|
|
3213
3213
|
|
|
3214
3214
|
var _CollapsibleButton=function _CollapsibleButton(_ref,ref){var children=_ref.children,variant=_ref.variant,size=_ref.size,icon=_ref.icon,iconPosition=_ref.iconPosition,isDisabled=_ref.isDisabled,testID=_ref.testID,accessibilityLabel=_ref.accessibilityLabel;var _useCollapsible=useCollapsible(),onExpandChange=_useCollapsible.onExpandChange,isExpanded=_useCollapsible.isExpanded,collapsibleBodyId=_useCollapsible.collapsibleBodyId;var toggleIsExpanded=useCallback(function(){return onExpandChange(!isExpanded);},[onExpandChange,isExpanded]);return jsx(BaseButton,{variant:variant,size:size,icon:icon,iconPosition:iconPosition,isDisabled:isDisabled,testID:testID,ref:ref,onClick:toggleIsExpanded,alignSelf:isReactNative$4()?'flex-start':undefined,accessibilityProps:{label:accessibilityLabel,controls:collapsibleBodyId,expanded:isExpanded},children:children});};var CollapsibleButton=assignWithoutSideEffects(forwardRef(_CollapsibleButton),{displayName:'CollapsibleButton',componentId:MetaConstants.CollapsibleButton});
|
|
3215
3215
|
|
|
3216
|
-
var AnimatedStyledCollapsibleBodyContent=styled(Animated$1.View)(function(){return {overflow:'hidden'};});var
|
|
3216
|
+
var AnimatedStyledCollapsibleBodyContent=styled(Animated$1.View)(function(){return {overflow:'hidden'};});var CollapsibleBodyContent=function CollapsibleBodyContent(_ref){var children=_ref.children;var _useCollapsible=useCollapsible(),isExpanded=_useCollapsible.isExpanded,direction=_useCollapsible.direction;var _useTheme=useTheme(),theme=_useTheme.theme;var opacity=useSharedValue(getOpacity({isExpanded:isExpanded}));var height=useSharedValue(isExpanded?undefined:0);var _useState=useState(0),_useState2=_slicedToArray(_useState,2),layoutHeight=_useState2[0],setLayoutHeight=_useState2[1];var _useState3=useState(false),_useState4=_slicedToArray(_useState3,2),isAnimating=_useState4[0],setIsAnimating=_useState4[1];var onAnimationComplete=useCallback(function(){requestAnimationFrame(function(){return setIsAnimating(false);});},[]);var duration=castNativeType(getTransitionDuration(theme));var easing=castNativeType(getTransitionEasing(theme));useEffect(function(){setIsAnimating(true);opacity.value=withTiming(getOpacity({isExpanded:isExpanded}),{duration:duration,easing:easing});height.value=withTiming(isExpanded&&layoutHeight?layoutHeight:0,{duration:duration,easing:easing},function(isComplete){if(isComplete){runOnJS(onAnimationComplete)();}});},[isExpanded,opacity,duration,easing,height,layoutHeight,onAnimationComplete]);var animatedStyles=useAnimatedStyle(function(){return {opacity:opacity.value,height:height.value};});var onLayout=useCallback(function(event){if(isAnimating){if(event.nativeEvent.layout.height>layoutHeight){setLayoutHeight(event.nativeEvent.layout.height);}}else if(event.nativeEvent.layout.height!==layoutHeight){setLayoutHeight(event.nativeEvent.layout.height);}},[layoutHeight,isAnimating]);return jsx(AnimatedStyledCollapsibleBodyContent,{isExpanded:isExpanded,style:animatedStyles,children:jsx(View,{onLayout:onLayout,style:isExpanded||isAnimating?nativeStyles.collapsibleBodyExpanded:nativeStyles.collapsibleBodyCollapsed,children:jsx(Box,Object.assign({},getCollapsibleBodyContentBoxProps({direction:direction}),{children:children}))})});};
|
|
3217
3217
|
|
|
3218
3218
|
var _CollapsibleBody=function _CollapsibleBody(_ref){var children=_ref.children,testID=_ref.testID,_width=_ref._width;var _useCollapsible=useCollapsible(),collapsibleBodyId=_useCollapsible.collapsibleBodyId,isExpanded=_useCollapsible.isExpanded;return jsx(BaseBox,Object.assign({id:collapsibleBodyId,width:_width},makeAccessible({role:'region',hidden:!isExpanded}),metaAttribute({name:MetaConstants.CollapsibleBody,testID:testID}),{children:jsx(CollapsibleBodyContent,{children:children})}));};var CollapsibleBody=assignWithoutSideEffects(_CollapsibleBody,{componentId:MetaConstants.CollapsibleBody});
|
|
3219
3219
|
|
|
@@ -3221,7 +3221,7 @@ var BLANK_SPACE=' ';var reactNativeMultilineTextOverflowFix=jsx(BaseBox,Object.a
|
|
|
3221
3221
|
|
|
3222
3222
|
var getTooltipContentWrapperStyles=function getTooltipContentWrapperStyles(_ref){var theme=_ref.theme,styles=_ref.styles;return Object.assign({backgroundColor:theme.colors.brand.gray[200].highContrast,borderWidth:makeBorderSize(theme.border.width.thin),borderRadius:makeBorderSize(theme.border.radius.medium),borderColor:theme.colors.brand.gray[300].highContrast,borderStyle:'solid',boxShadow:isReactNative$4()?undefined:castWebType(theme.elevation.lowRaised)},styles);};
|
|
3223
3223
|
|
|
3224
|
-
var _excluded$1=["children","styles","side","isVisible"];var StyledTooltipContentWrapper=styled(BaseBox)(function(_ref){var theme=_ref.theme,styles=_ref.styles;return getTooltipContentWrapperStyles({theme:theme,styles:styles});});var
|
|
3224
|
+
var _excluded$1=["children","styles","side","isVisible"];var StyledTooltipContentWrapper=styled(BaseBox)(function(_ref){var theme=_ref.theme,styles=_ref.styles;return getTooltipContentWrapperStyles({theme:theme,styles:styles});});var TooltipContentWrapper=React__default.forwardRef(function(_ref2,ref){var children=_ref2.children,styles=_ref2.styles,side=_ref2.side,isVisible=_ref2.isVisible,props=_objectWithoutProperties(_ref2,_excluded$1);var _useTheme=useTheme(),theme=_useTheme.theme;var isOppositeAxis=side==='right'||side==='bottom';var isHorizontal=side==='left'||side==='right';var offset=isOppositeAxis?-size[4]:size[4];var translate=useSharedValue(offset);var opacity=useSharedValue(0);var easing=theme.motion.easing.entrance.effective;var duration=theme.motion.duration.quick;React__default.useEffect(function(){var timings={easing:easing,duration:duration};opacity.value=withDelay(duration,withTiming(isVisible?1:0,timings));translate.value=withDelay(duration,withTiming(isVisible?0:offset,timings));},[isVisible]);var animatedStyles=useAnimatedStyle(function(){var transform=isHorizontal?'translateX':'translateY';return {opacity:opacity.value,transform:[_defineProperty({},transform,translate.value)]};},[isVisible]);return jsx(Animated$1.View,{style:animatedStyles,children:jsx(StyledTooltipContentWrapper,Object.assign({styles:styles,style:castNativeType(theme.elevation.lowRaised),elevation:20,ref:ref,collapse:false},props,{children:children}))});});
|
|
3225
3225
|
|
|
3226
3226
|
var TooltipContent=React__default.forwardRef(function(_ref,ref){var children=_ref.children,title=_ref.title,arrow=_ref.arrow,side=_ref.side,style=_ref.style,isVisible=_ref.isVisible;return jsxs(TooltipContentWrapper,{position:isReactNative$4()?'absolute':'relative',paddingTop:"spacing.3",paddingBottom:"spacing.3",paddingLeft:"spacing.4",paddingRight:"spacing.4",maxWidth:makeSize(size[200]),ref:ref,styles:style,side:side,isVisible:isVisible,children:[title?jsx(Text,{contrast:"high",weight:"bold",size:"medium",children:title}):null,jsx(Text,{variant:"body",size:"small",weight:"regular",contrast:"high",color:"feedback.text.neutral.highContrast",children:children}),arrow]});});
|
|
3227
3227
|
|
|
@@ -3243,7 +3243,7 @@ var ARROW_WIDTH=14;var ARROW_HEIGHT=7;var popoverZIndex=1100;var POPOVER_BG_DARK
|
|
|
3243
3243
|
|
|
3244
3244
|
var getPopoverContentWrapperStyles=function getPopoverContentWrapperStyles(_ref){var theme=_ref.theme,styles=_ref.styles,isMobile=_ref.isMobile,colorScheme=_ref.colorScheme;return Object.assign({width:'100%',maxWidth:makeSpace(isMobile?288:328),position:isReactNative$4()?'absolute':'relative',backgroundColor:colorScheme==='dark'?POPOVER_BG_DARK:POPOVER_BG_LIGHT,borderWidth:makeBorderSize(theme.border.width.thin),borderRadius:makeBorderSize(theme.border.radius.large),borderColor:theme.colors.brand.gray[400].lowContrast,borderStyle:'solid',boxShadow:isReactNative$4()?undefined:castWebType(theme.elevation.midRaised)},styles);};
|
|
3245
3245
|
|
|
3246
|
-
var _excluded=["children","styles","side","isVisible"];var StyledPopoverContentWrapper=styled(BaseBox)(function(_ref){var theme=_ref.theme,isMobile=_ref.isMobile,styles=_ref.styles,colorScheme=_ref.colorScheme;return getPopoverContentWrapperStyles({theme:theme,styles:styles,isMobile:isMobile,colorScheme:colorScheme});});var
|
|
3246
|
+
var _excluded=["children","styles","side","isVisible"];var StyledPopoverContentWrapper=styled(BaseBox)(function(_ref){var theme=_ref.theme,isMobile=_ref.isMobile,styles=_ref.styles,colorScheme=_ref.colorScheme;return getPopoverContentWrapperStyles({theme:theme,styles:styles,isMobile:isMobile,colorScheme:colorScheme});});var PopoverContentWrapper=React__default.forwardRef(function(_ref2,ref){var children=_ref2.children,styles=_ref2.styles,side=_ref2.side,isVisible=_ref2.isVisible,props=_objectWithoutProperties(_ref2,_excluded);var _useTheme=useTheme(),theme=_useTheme.theme,platform=_useTheme.platform,colorScheme=_useTheme.colorScheme;var isMobile=platform==='onMobile';var isOppositeAxis=side==='right'||side==='bottom';var isHorizontal=side==='left'||side==='right';var offset=isOppositeAxis?-size[4]:size[4];var translate=useSharedValue(offset);var opacity=useSharedValue(0);var easing=theme.motion.easing.entrance.effective;var duration=theme.motion.duration.quick;React__default.useEffect(function(){var timings={easing:easing,duration:duration};opacity.value=withDelay(duration,withTiming(isVisible?1:0,timings));translate.value=withDelay(duration,withTiming(isVisible?0:offset,timings));},[isVisible]);var animatedStyles=useAnimatedStyle(function(){var transform=isHorizontal?'translateX':'translateY';return {opacity:opacity.value,transform:[_defineProperty({},transform,translate.value)]};},[isVisible]);return jsx(Animated$1.View,{style:animatedStyles,children:jsx(StyledPopoverContentWrapper,Object.assign({colorScheme:colorScheme,styles:styles,style:castNativeType(theme.elevation.lowRaised),elevation:20,ref:ref,collapse:false,isMobile:isMobile},props,{children:children}))});});
|
|
3247
3247
|
|
|
3248
3248
|
var PopoverContext=React__default.createContext(null);var usePopoverContext=function usePopoverContext(){var context=React__default.useContext(PopoverContext);if(__DEV__){if(!context){throwBladeError({message:`usePopoverContext must be used within Popover`,moduleName:'Popover'});}}return context;};
|
|
3249
3249
|
|