@razorpay/blade 10.17.1 → 10.17.3
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 +71 -45
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.js +8 -6
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +53 -30
- 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
|
@@ -2737,7 +2737,7 @@ var _excluded$D=["description","title","isDismissible","onDismiss","contrast","i
|
|
|
2737
2737
|
|
|
2738
2738
|
var _excluded$C=["children","surfaceLevel","elevation","onTouchEnd","onTouchStart","onPointerDown","onPointerEnter","pointerEvents"];var CardSurfaceStyled=styled(BaseBox)(function(_ref){var surfaceLevel=_ref.surfaceLevel,elevation=_ref.elevation,theme=_ref.theme;var backgroundColor=theme.colors.surface.background[`level${surfaceLevel}`].lowContrast;return {width:'100%',display:'flex',flexDirection:'column',borderWidth:elevation==='none'?`${theme.border.width.thin}`:undefined,borderStyle:elevation==='none'?'solid':undefined,borderColor:elevation==='none'?`${theme.colors.surface.border.normal.lowContrast}`:undefined,backgroundColor:backgroundColor};});var CardSurface=function CardSurface(_ref2){var children=_ref2.children,surfaceLevel=_ref2.surfaceLevel,elevation=_ref2.elevation,onTouchEnd=_ref2.onTouchEnd,onTouchStart=_ref2.onTouchStart,onPointerDown=_ref2.onPointerDown,onPointerEnter=_ref2.onPointerEnter,pointerEvents=_ref2.pointerEvents,props=_objectWithoutProperties(_ref2,_excluded$C);return jsx(CardSurfaceStyled,Object.assign({},props,{surfaceLevel:surfaceLevel,elevation:elevation,onPointerEnter:castNativeType(onPointerEnter),onPointerDown:castNativeType(onPointerDown),onTouchStart:castNativeType(onTouchStart),onTouchEnd:castNativeType(onTouchEnd),pointerEvents:castNativeType(pointerEvents),children:children}));};
|
|
2739
2739
|
|
|
2740
|
-
var CardContext=React__default.createContext(null);var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(__DEV__){if(!context){throwBladeError({message:`${componentName} cannot be used outside of Card component`,moduleName:'Card'});}}return true;};var
|
|
2740
|
+
var CardContext=React__default.createContext(null);var useVerifyInsideCard=function useVerifyInsideCard(componentName){var context=React__default.useContext(CardContext);if(__DEV__){if(!context){throwBladeError({message:`${componentName} cannot be used outside of Card component`,moduleName:'Card'});}}return true;};var CardProvider=function CardProvider(_ref){var children=_ref.children;return jsx(CardContext.Provider,{value:true,children:children});};
|
|
2741
2741
|
|
|
2742
2742
|
var LinkOverlay=function LinkOverlay(_props){return jsx(Fragment,{});};
|
|
2743
2743
|
|
|
@@ -2745,7 +2745,9 @@ var CARD_SCALE_DOWN_VALUE=0.95;var CARD_LINK_OVERLAY_ID='card-link-overlay';
|
|
|
2745
2745
|
|
|
2746
2746
|
var _excluded$B=["isSelected"],_excluded2=["children","onClick","isSelected","shouldScaleOnHover","href","as","accessibilityLabel"];var StyledCardRoot=styled(BaseBox)(function(_ref){var isSelected=_ref.isSelected,props=_objectWithoutProperties(_ref,_excluded$B);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}));};
|
|
2747
2747
|
|
|
2748
|
-
var
|
|
2748
|
+
var useVerifyAllowedChildren=function useVerifyAllowedChildren(props){var children=props.children,componentName=props.componentName,allowedComponents=props.allowedComponents;if(__DEV__){React__default.Children.forEach(children,function(child){var isValidChild=child&&allowedComponents.includes(getComponentId(child));if(!isValidChild){throwBladeError({message:`Only \`${allowedComponents.join(', ')}\` components are accepted in \`${componentName}\` children`,moduleName:componentName});}});}};
|
|
2749
|
+
|
|
2750
|
+
var _excluded$A=["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$A);var _React$useState=React__default.useState(false),_React$useState2=_slicedToArray(_React$useState,2),isFocused=_React$useState2[0],setIsFocused=_React$useState2[1];useVerifyAllowedChildren({children:children,componentName:'Card',allowedComponents:[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});
|
|
2749
2751
|
|
|
2750
2752
|
var _excluded$z=["children","icon","iconPosition","isDisabled","onClick","variant","color","href","target","rel","accessibilityLabel","size","testID","hitSlop","htmlTitle","onBlur","onFocus","onMouseLeave","onMouseMove","onPointerDown","onPointerEnter","onTouchStart","onTouchEnd"];var _Link=function _Link(_ref,ref){var children=_ref.children,icon=_ref.icon,_ref$iconPosition=_ref.iconPosition,iconPosition=_ref$iconPosition===void 0?'left':_ref$iconPosition,_ref$isDisabled=_ref.isDisabled,isDisabled=_ref$isDisabled===void 0?false:_ref$isDisabled,onClick=_ref.onClick,_ref$variant=_ref.variant,variant=_ref$variant===void 0?'anchor':_ref$variant,_ref$color=_ref.color,color=_ref$color===void 0?'default':_ref$color,href=_ref.href,target=_ref.target,rel=_ref.rel,accessibilityLabel=_ref.accessibilityLabel,_ref$size=_ref.size,size=_ref$size===void 0?'medium':_ref$size,testID=_ref.testID,hitSlop=_ref.hitSlop,htmlTitle=_ref.htmlTitle,onBlur=_ref.onBlur,onFocus=_ref.onFocus,onMouseLeave=_ref.onMouseLeave,onMouseMove=_ref.onMouseMove,onPointerDown=_ref.onPointerDown,onPointerEnter=_ref.onPointerEnter,onTouchStart=_ref.onTouchStart,onTouchEnd=_ref.onTouchEnd,rest=_objectWithoutProperties(_ref,_excluded$z);return jsx(BaseLink,Object.assign({},icon?{icon:icon,children:children}:{children:children},variant==='anchor'?{variant:variant,href:href,target:target,rel:rel}:{variant:variant,isDisabled:isDisabled},{ref:ref,iconPosition:iconPosition,onClick:onClick,accessibilityProps:{label:accessibilityLabel,describedBy:rest['aria-describedby']},size:size,color:color,testID:testID,hitSlop:hitSlop,htmlTitle:htmlTitle,onBlur:onBlur,onFocus:onFocus,onMouseLeave:onMouseLeave,onMouseMove:onMouseMove,onPointerDown:onPointerDown,onPointerEnter:onPointerEnter,onTouchStart:onTouchStart,onTouchEnd:onTouchEnd},getStyledProps(rest)));};var Link=assignWithoutSideEffects(React__default.forwardRef(_Link),{displayName:'Link',componentId:'Link'});
|
|
2751
2753
|
|
|
@@ -2759,11 +2761,11 @@ var StyledCounter=styled(BaseBox)(function(props){return Object.assign({},getSty
|
|
|
2759
2761
|
|
|
2760
2762
|
var _excluded$x=["value","max","intent","variant","color","contrast","size","testID"];var isFeedbackVariant=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps=function getColorProps(_ref){var _ref$variant=_ref.variant,variant=_ref$variant===void 0?'neutral':_ref$variant,_ref$contrast=_ref.contrast,contrast=_ref$contrast===void 0?'low':_ref$contrast;var counterVariant=variant==='default'?'blue':variant;var props={textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(counterVariant)){props.textColor=`feedback.text.${counterVariant}.${contrast}Contrast`;props.backgroundColor=`feedback.background.${counterVariant}.${contrast}Contrast`;}else {props.textColor=`badge.text.${counterVariant}.${contrast}Contrast`;props.backgroundColor=`badge.background.${counterVariant}.${contrast}Contrast`;}return props;};var _Counter=function _Counter(_ref2){var _ref3;var value=_ref2.value,max=_ref2.max,intent=_ref2.intent,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,color=_ref2.color,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$x);var content=`${value}`;if(max&&value>max){content=`${max}+`;}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({variant:(_ref3=color!=null?color:intent)!=null?_ref3:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;if(__DEV__){if(intent){logger({type:'warn',message:'The prop `intent` is deprecated and will be removed in a future release. Please use `variant` instead.',moduleName:'Counter'});}}var counterTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(BaseBox,Object.assign({display:isReactNative$4()?'flex':'inline-flex'},metaAttribute({name:MetaConstants.Counter,testID:testID}),getStyledProps(styledProps),{children:jsx(StyledCounter,{backgroundColor:backgroundColor,size:size,platform:platform,children:jsx(BaseBox,{paddingRight:horizontalPadding[size],paddingLeft:horizontalPadding[size],paddingTop:verticalPadding[size],paddingBottom:verticalPadding[size],display:"flex",flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:jsx(Text,Object.assign({},counterTextSizes[size],{textAlign:"center",type:"normal",weight:"regular",truncateAfterLines:1,color:textColor,children:content}))})})}));};var Counter=assignWithoutSideEffects(_Counter,{displayName:'Counter',componentId:'Counter'});
|
|
2761
2763
|
|
|
2762
|
-
var _CardHeaderIcon=function _CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.text.normal.lowContrast",size:"xlarge"});};var CardHeaderIcon=assignWithoutSideEffects(_CardHeaderIcon,{componentId:ComponentIds$1.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,Object.assign({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds$1.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,Object.assign({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds$1.CardHeaderBadge});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,Object.assign({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds$1.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,Object.assign({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds$1.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,Object.assign({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds$1.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardHeader');
|
|
2764
|
+
var _CardHeaderIcon=function _CardHeaderIcon(_ref){var Icon=_ref.icon;useVerifyInsideCard('CardHeaderIcon');return jsx(Icon,{color:"surface.text.normal.lowContrast",size:"xlarge"});};var CardHeaderIcon=assignWithoutSideEffects(_CardHeaderIcon,{componentId:ComponentIds$1.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,Object.assign({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds$1.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,Object.assign({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds$1.CardHeaderBadge});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,Object.assign({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds$1.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,Object.assign({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds$1.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,Object.assign({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds$1.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardHeader');useVerifyAllowedChildren({children:children,componentName:'CardHeader',allowedComponents:[ComponentIds$1.CardHeaderLeading,ComponentIds$1.CardHeaderTrailing]});return jsxs(BaseBox,Object.assign({marginBottom:"spacing.7"},metaAttribute({name:MetaConstants.CardHeader,testID:testID}),{children:[jsx(BaseBox,{marginBottom:"spacing.7",display:"flex",flexDirection:"row",justifyContent:"space-between",children:children}),jsx(Divider,{})]}));};var CardHeader=assignWithoutSideEffects(_CardHeader,{componentId:ComponentIds$1.CardHeader});var _CardHeaderLeading=function _CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix;useVerifyInsideCard('CardHeaderLeading');if(__DEV__){if(prefix&&!isValidAllowedChildren(prefix,ComponentIds$1.CardHeaderIcon)){throwBladeError({message:`Only \`${ComponentIds$1.CardHeaderIcon}\` component is accepted in prefix`,moduleName:'CardHeaderLeading'});}if(suffix&&!isValidAllowedChildren(suffix,ComponentIds$1.CardHeaderCounter)){throwBladeError({message:`Only \`${ComponentIds$1.CardHeaderCounter}\` component is accepted in prefix`,moduleName:'CardHeaderLeading'});}}return jsxs(BaseBox,{flex:1,display:"flex",flexDirection:"row",children:[jsx(BaseBox,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(BaseBox,{marginRight:"spacing.5",children:[jsxs(BaseBox,{display:"flex",flexDirection:"row",alignItems:"center",flexWrap:"wrap",children:[jsx(Heading,{size:"small",variant:"regular",type:"normal",children:title}),jsx(BaseBox,{marginLeft:"spacing.3",children:suffix})]}),subtitle&&jsx(Text,{textAlign:"left",variant:"body",size:"small",weight:"regular",children:subtitle})]})]});};var CardHeaderLeading=assignWithoutSideEffects(_CardHeaderLeading,{componentId:ComponentIds$1.CardHeaderLeading});var headerTrailingAllowedComponents=[ComponentIds$1.CardHeaderLink,ComponentIds$1.CardHeaderText,ComponentIds$1.CardHeaderIconButton,ComponentIds$1.CardHeaderBadge];var _CardHeaderTrailing=function _CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');if(__DEV__){if(visual&&!headerTrailingAllowedComponents.includes(getComponentId(visual))){throwBladeError({message:`Only one of \`${headerTrailingAllowedComponents.join(', ')}\` component is accepted in visual`,moduleName:'CardHeaderTrailing'});}}return jsx(BaseBox,{alignSelf:"center",children:visual});};var CardHeaderTrailing=assignWithoutSideEffects(_CardHeaderTrailing,{componentId:ComponentIds$1.CardHeaderTrailing});
|
|
2763
2765
|
|
|
2764
2766
|
var useIsMobile=function useIsMobile(){var _useTheme=useTheme(),theme=_useTheme.theme;var _useBreakpoint=useBreakpoint({breakpoints:theme.breakpoints}),matchedDeviceType=_useBreakpoint.matchedDeviceType;return matchedDeviceType==='mobile';};
|
|
2765
2767
|
|
|
2766
|
-
var _CardFooter=function _CardFooter(_ref){var _footerChildrensArray,_footerChildrensArray2;var children=_ref.children,testID=_ref.testID;var isMobile=useIsMobile();useVerifyInsideCard('CardFooter');
|
|
2768
|
+
var _CardFooter=function _CardFooter(_ref){var _footerChildrensArray,_footerChildrensArray2;var children=_ref.children,testID=_ref.testID;var isMobile=useIsMobile();useVerifyInsideCard('CardFooter');useVerifyAllowedChildren({children:children,componentName:'CardFooter',allowedComponents:[ComponentIds$1.CardFooterLeading,ComponentIds$1.CardFooterTrailing]});var footerChildrensArray=React__default.Children.toArray(children);if(__DEV__){if(!React__default.isValidElement(footerChildrensArray[0])){throwBladeError({message:`Invalid React Element ${footerChildrensArray}`,moduleName:'CardFooter'});}}var baseBoxJustifyContent=footerChildrensArray.length===2||!((_footerChildrensArray=footerChildrensArray[0])!=null&&(_footerChildrensArray2=_footerChildrensArray.props)!=null&&_footerChildrensArray2.actions)?'space-between':'flex-end';return jsxs(BaseBox,Object.assign({marginTop:"auto"},metaAttribute({name:MetaConstants.CardFooter,testID:testID}),{children:[jsx(BaseBox,{marginTop:"spacing.7"}),jsx(Divider,{}),jsx(BaseBox,{marginTop:"spacing.7",display:"flex",flexDirection:isMobile?'column':'row',justifyContent:baseBoxJustifyContent,alignItems:isMobile?'stretch':'center',children:children})]}));};var CardFooter=assignWithoutSideEffects(_CardFooter,{componentId:ComponentIds$1.CardFooter});var _CardFooterLeading=function _CardFooterLeading(_ref2){var title=_ref2.title,subtitle=_ref2.subtitle;useVerifyInsideCard('CardFooterLeading');return jsxs(BaseBox,{textAlign:'left',children:[title&&jsx(Text,{variant:"body",size:"medium",weight:"bold",children:title}),subtitle&&jsx(Text,{variant:"body",size:"small",weight:"regular",children:subtitle})]});};var CardFooterLeading=assignWithoutSideEffects(_CardFooterLeading,{componentId:ComponentIds$1.CardFooterLeading});var _CardFooterTrailing=function _CardFooterTrailing(_ref3){var actions=_ref3.actions;var isMobile=useIsMobile();useVerifyInsideCard('CardFooterTrailing');return jsxs(BaseBox,{display:"flex",flexDirection:"row",alignSelf:isMobile?'auto':'center',marginTop:isMobile?'spacing.5':'spacing.0',marginLeft:isMobile?'spacing.0':'spacing.5',children:[jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.secondary?jsx(Button,Object.assign({isFullWidth:true,size:"medium",variant:"secondary"},actions.secondary,{children:actions.secondary.text})):null}),jsx(BaseBox,{marginLeft:"spacing.5"}),jsx(BaseBox,{flexGrow:1,children:actions!=null&&actions.primary?jsx(Button,Object.assign({isFullWidth:true,size:"medium"},actions.primary,{children:actions.primary.text})):null})]});};var CardFooterTrailing=assignWithoutSideEffects(_CardFooterTrailing,{componentId:ComponentIds$1.CardFooterTrailing});
|
|
2767
2769
|
|
|
2768
2770
|
var CarouselContext=React__default.createContext(null);var useCarouselContext=function useCarouselContext(){var state=React__default.useContext(CarouselContext);if(!state){throwBladeError({moduleName:'Carousel',message:'useCarouselContext must be used within Carousel'});}return state;};
|
|
2769
2771
|
|
|
@@ -2833,7 +2835,7 @@ var getTextStyles=function getTextStyles(_ref){var variant=_ref.variant,type=_re
|
|
|
2833
2835
|
|
|
2834
2836
|
var getInputBackgroundAndBorderStyles=function getInputBackgroundAndBorderStyles(_ref){var theme=_ref.theme,isHovered=_ref.isHovered,isFocused=_ref.isFocused,isDisabled=_ref.isDisabled,validationState=_ref.validationState,isTextArea=_ref.isTextArea,isDropdownTrigger=_ref.isDropdownTrigger;var backgroundColor=theme.colors.brand.gray.a50.lowContrast;var borderBottomColor=theme.colors.brand.gray.a100.lowContrast;if(isHovered){backgroundColor=theme.colors.brand.gray.a100.lowContrast;}if(isFocused){backgroundColor=theme.colors.brand.primary[300];}if(isDisabled){backgroundColor=theme.colors.brand.gray.a50.lowContrast;borderBottomColor=theme.colors.brand.gray[300].lowContrast;}if(validationState==='error'){backgroundColor=theme.colors.feedback.background.negative.lowContrast;borderBottomColor=theme.colors.feedback.border.negative.highContrast;}else if(validationState==='success'){backgroundColor=theme.colors.feedback.background.positive.lowContrast;borderBottomColor=theme.colors.feedback.border.positive.highContrast;}return {backgroundColor:backgroundColor,borderBottomColor:borderBottomColor,borderTopLeftRadius:makeBorderSize(theme.border.radius.small),borderTopRightRadius:makeBorderSize(theme.border.radius.small),borderBottomWidth:makeBorderSize(theme.border.width.thin),borderBottomStyle:'solid',display:'flex',flexDirection:'row',width:'100%',alignItems:isTextArea?'flex-start':undefined,position:'relative',height:isDropdownTrigger?'auto':undefined};};var getLeftPadding=function getLeftPadding(_ref2){var theme=_ref2.theme,isDropdownTrigger=_ref2.isDropdownTrigger,hasLeadingIcon=_ref2.hasLeadingIcon,hasPrefix=_ref2.hasPrefix;if(isDropdownTrigger){return theme.spacing[0];}if(hasLeadingIcon||hasPrefix){return theme.spacing[3];}return theme.spacing[4];};var getBaseInputStyles=function getBaseInputStyles(_ref3){var theme=_ref3.theme,isDisabled=_ref3.isDisabled,leadingIcon=_ref3.leadingIcon,prefix=_ref3.prefix,interactionElement=_ref3.interactionElement,suffix=_ref3.suffix,trailingIcon=_ref3.trailingIcon,textAlign=_ref3.textAlign,isTextArea=_ref3.isTextArea,hasTags=_ref3.hasTags,isDropdownTrigger=_ref3.isDropdownTrigger;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 isDropdownWithTags=isDropdownTrigger&&hasTags;var isReactNative=getPlatformType()==='react-native';return Object.assign({},getTextStyles({size:'medium',variant:'body',type:isDisabled?'placeholder':'subtle',weight:'regular',contrast:'low',theme:theme}),{flex:1,backgroundColor:'transparent',paddingTop:makeSpace(theme.spacing[3]),paddingBottom:makeSpace(theme.spacing[3]),paddingLeft:makeSpace(getLeftPadding({theme:theme,isDropdownTrigger:isDropdownTrigger,hasLeadingIcon:hasLeadingIcon,hasPrefix:hasPrefix})),paddingRight:hasInteractionElement||hasSuffix||hasTrailingIcon?makeSpace(theme.spacing[3]):makeSpace(theme.spacing[4]),textAlign:textAlign,width:'100%',height:isTextArea||isDropdownWithTags?undefined:makeSpace(BASEINPUT_DEFAULT_HEIGHT),minHeight:isDropdownWithTags?undefined:makeSpace(BASEINPUT_DEFAULT_HEIGHT)},isReactNative?{}:{resize:'none'});};
|
|
2835
2837
|
|
|
2836
|
-
var _excluded$p=["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$p);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&&!isDisabled?'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'});
|
|
2838
|
+
var _excluded$p=["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:Platform.select({android:makeSize(props.theme.typography.lineHeights[100]),ios: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$p);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&&!isDisabled?'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'});
|
|
2837
2839
|
|
|
2838
2840
|
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});};
|
|
2839
2841
|
|
|
@@ -3208,7 +3210,7 @@ var _BottomSheetFooter=function _BottomSheetFooter(_ref){var children=_ref.child
|
|
|
3208
3210
|
|
|
3209
3211
|
var BottomSheetBackdrop=function BottomSheetBackdrop(props){var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(BottomSheetBackdrop$1,Object.assign({},props,{appearsOnIndex:0,disappearsOnIndex:-1,pressBehavior:"close",opacity:1,style:[props.style,{backgroundColor:theme.colors.surface.overlay.background[800],zIndex:props.zIndex}]}));};
|
|
3210
3212
|
|
|
3211
|
-
var BottomSheetSurface=styled(BaseBox)(function(_ref){var theme=_ref.theme;return {borderTopLeftRadius:makeSpace(theme.spacing[5]),borderTopRightRadius:makeSpace(theme.spacing[5]),backgroundColor:theme.colors.surface.background.level2.lowContrast,justifyContent:'center',alignItems:'center',position:'relative'};});var focusOnElement=function focusOnElement(element){var reactTag=findNodeHandle(element);if(reactTag){AccessibilityInfo.setAccessibilityFocus(reactTag);}};var _BottomSheet=function _BottomSheet(_ref2){var children=_ref2.children,_ref2$snapPoints=_ref2.snapPoints,snapPoints=_ref2$snapPoints===void 0?[0.35,0.5,0.85]:_ref2$snapPoints,isOpen=_ref2.isOpen,onDismiss=_ref2.onDismiss,initialFocusRef=_ref2.initialFocusRef;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var defaultInitialFocusRef=React__default.useRef(null);var sheetRef=React__default.useRef(null);var
|
|
3213
|
+
var BottomSheetSurface=styled(BaseBox)(function(_ref){var theme=_ref.theme;return {borderTopLeftRadius:makeSpace(theme.spacing[5]),borderTopRightRadius:makeSpace(theme.spacing[5]),backgroundColor:theme.colors.surface.background.level2.lowContrast,justifyContent:'center',alignItems:'center',position:'relative'};});var focusOnElement=function focusOnElement(element){var reactTag=findNodeHandle(element);if(reactTag){AccessibilityInfo.setAccessibilityFocus(reactTag);}};var _BottomSheet=function _BottomSheet(_ref2){var children=_ref2.children,_ref2$snapPoints=_ref2.snapPoints,snapPoints=_ref2$snapPoints===void 0?[0.35,0.5,0.85]:_ref2$snapPoints,isOpen=_ref2.isOpen,onDismiss=_ref2.onDismiss,initialFocusRef=_ref2.initialFocusRef;var bottomSheetAndDropdownGlue=useBottomSheetAndDropdownGlue();var defaultInitialFocusRef=React__default.useRef(null);var sheetRef=React__default.useRef(null);var _React$useState=React__default.useState(),_React$useState2=_slicedToArray(_React$useState,2),header=_React$useState2[0],setHeader=_React$useState2[1];var _React$useState3=React__default.useState(),_React$useState4=_slicedToArray(_React$useState3,2),footer=_React$useState4[0],setFooter=_React$useState4[1];var _React$useState5=React__default.useState(),_React$useState6=_slicedToArray(_React$useState5,2),body=_React$useState6[0],setBody=_React$useState6[1];var _isOpen=isOpen!=null?isOpen:bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.isOpen;var _React$useState7=React__default.useState(0),_React$useState8=_slicedToArray(_React$useState7,2),headerHeight=_React$useState8[0],setHeaderHeight=_React$useState8[1];var _React$useState9=React__default.useState(0),_React$useState10=_slicedToArray(_React$useState9,2),footerHeight=_React$useState10[0],setFooterHeight=_React$useState10[1];var _React$useState11=React__default.useState(0),_React$useState12=_slicedToArray(_React$useState11,2),contentHeight=_React$useState12[0],setContentHeight=_React$useState12[1];var _React$useState13=React__default.useState(true),_React$useState14=_slicedToArray(_React$useState13,2),hasBodyPadding=_React$useState14[0],setHasBodyPadding=_React$useState14[1];var _React$useState15=React__default.useState(false),_React$useState16=_slicedToArray(_React$useState15,2),isHeaderEmpty=_React$useState16[0],setIsHeaderEmpty=_React$useState16[1];var initialSnapPoint=React__default.useRef(0);var totalHeight=React__default.useMemo(function(){return headerHeight+footerHeight+contentHeight;},[contentHeight,footerHeight,headerHeight]);var id=useId();var _useBottomSheetStack=useBottomSheetStack(),addBottomSheetToStack=_useBottomSheetStack.addBottomSheetToStack,removeBottomSheetFromStack=_useBottomSheetStack.removeBottomSheetFromStack,getCurrentStackIndexById=_useBottomSheetStack.getCurrentStackIndexById,getTopOfTheStack=_useBottomSheetStack.getTopOfTheStack;var currentStackIndex=getCurrentStackIndexById(id);var zIndex=100-currentStackIndex;useIsomorphicLayoutEffect(function(){if(bottomSheetAndDropdownGlue!=null&&bottomSheetAndDropdownGlue.hasAutoCompleteInBottomSheetHeader){initialSnapPoint.current=2;}else {var height=Dimensions.get('window').height;var middleSnapPoint=snapPoints[1]*height;if(totalHeight>middleSnapPoint){initialSnapPoint.current=1;}}},[snapPoints,totalHeight]);var _snapPoints=React__default.useMemo(function(){return snapPoints.map(function(point){return `${point*100}%`;});},[snapPoints]);var close=React__default.useCallback(function(){onDismiss==null?void 0:onDismiss();bottomSheetAndDropdownGlue==null?void 0:bottomSheetAndDropdownGlue.onBottomSheetDismiss();},[bottomSheetAndDropdownGlue,onDismiss]);var handleOnOpen=React__default.useCallback(function(){var _sheetRef$current;(_sheetRef$current=sheetRef.current)==null?void 0:_sheetRef$current.snapToIndex(initialSnapPoint.current);},[]);var handleOnClose=React__default.useCallback(function(){var _sheetRef$current2;(_sheetRef$current2=sheetRef.current)==null?void 0:_sheetRef$current2.close();Keyboard.dismiss();},[sheetRef]);React__default.useEffect(function(){if(_isOpen){handleOnOpen();if(!initialFocusRef){focusOnElement(defaultInitialFocusRef.current);}else {focusOnElement(initialFocusRef.current);}}else {handleOnClose();}},[_isOpen,handleOnClose,handleOnOpen,initialFocusRef]);React__default.useEffect(function(){if(!bottomSheetAndDropdownGlue)return;bottomSheetAndDropdownGlue.setDropdownHasBottomSheet(true);},[bottomSheetAndDropdownGlue]);React__default.useLayoutEffect(function(){React__default.Children.forEach(children,function(child){if(getComponentId(child)===ComponentIds.BottomSheetHeader){setHeader(child);}if(getComponentId(child)===ComponentIds.BottomSheetFooter){setFooter(child);}if(getComponentId(child)===ComponentIds.BottomSheetBody){setBody(child);}});},[children]);var renderFooter=React__default.useCallback(function(props){return jsx(BottomSheetFooter$1,Object.assign({},props,{children:jsx(View,{onLayout:function onLayout(event){setFooterHeight(event.nativeEvent.layout.height);},children:footer})}));},[footer]);var renderBackdrop=React__default.useCallback(function(props){return jsx(BottomSheetBackdrop,Object.assign({},props,{zIndex:zIndex}));},[zIndex]);var renderHandle=React__default.useCallback(function(){return jsxs(BaseBox,{position:isHeaderEmpty?'absolute':'relative',top:"spacing.0",left:"spacing.0",right:"spacing.0",onLayout:function onLayout(_ref3){var nativeEvent=_ref3.nativeEvent;setHeaderHeight(nativeEvent.layout.height);},children:[jsx(BaseBox,{zIndex:zIndex,children:jsx(BottomSheetGrabHandle,{})}),header]});},[isHeaderEmpty,zIndex,header]);var isHeaderFloating=!hasBodyPadding&&isHeaderEmpty;var contextValue=React__default.useMemo(function(){return {isInBottomSheet:true,isOpen:Boolean(_isOpen),close:handleOnClose,positionY:0,headerHeight:headerHeight,contentHeight:contentHeight,footerHeight:footerHeight,setContentHeight:setContentHeight,setFooterHeight:setFooterHeight,setHeaderHeight:setHeaderHeight,scrollRef:function scrollRef(){},bind:{},defaultInitialFocusRef:defaultInitialFocusRef,isHeaderFloating:isHeaderFloating,setHasBodyPadding:setHasBodyPadding,setIsHeaderEmpty:setIsHeaderEmpty};},[_isOpen,contentHeight,footerHeight,handleOnClose,headerHeight,isHeaderFloating]);var dropdownProps=useDropdown();React__default.useEffect(function(){if(_isOpen){addBottomSheetToStack(id);}else {removeBottomSheetFromStack(id);}},[addBottomSheetToStack,_isOpen,id,removeBottomSheetFromStack]);React__default.useEffect(function(){var showSubscription=Keyboard.addListener('keyboardDidShow',function(){if(id&&id===getTopOfTheStack()){var _sheetRef$current3;(_sheetRef$current3=sheetRef.current)==null?void 0:_sheetRef$current3.expand();}});return function(){showSubscription.remove();};},[getTopOfTheStack,id]);return jsx(Portal,{hostName:"BladeBottomSheetPortal",children:jsx(DropdownContext.Provider,{value:dropdownProps,children:jsx(BottomSheetContext.Provider,{value:contextValue,children:jsx(GorhomBottomSheet,{style:isOpen?{shadowColor:'hsla(217,56%,17%,0.64)',shadowOffset:{width:0,height:-18},shadowOpacity:0.2,shadowRadius:12}:{},enablePanDownToClose:true,enableOverDrag:true,enableContentPanningGesture:true,ref:sheetRef,index:_isOpen?initialSnapPoint.current:-1,containerStyle:{zIndex:zIndex},animateOnMount:true,handleComponent:renderHandle,backgroundComponent:BottomSheetSurface,footerComponent:renderFooter,backdropComponent:renderBackdrop,onClose:close,snapPoints:_snapPoints,children:body})})})});};var BottomSheet=assignWithoutSideEffects(_BottomSheet,{componentId:ComponentIds.BottomSheet});
|
|
3212
3214
|
|
|
3213
3215
|
var AccordionContext=createContext(null);var useAccordion=function useAccordion(){var accordionContext=useContext(AccordionContext);if(__DEV__){if(!accordionContext){throwBladeError({message:'useAccordion should be only used within AccordionContext',moduleName:'AccordionContext'});}}return accordionContext;};
|
|
3214
3216
|
|