@razorpay/blade 8.15.0 → 8.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +8 -1
- package/build/components/index.native.d.ts +8 -1
- package/build/components/index.native.js +2 -2
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +29 -10
- package/build/components/index.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
|
@@ -3571,8 +3571,15 @@ declare type CounterProps = {
|
|
|
3571
3571
|
* Sets the intent of the counter.
|
|
3572
3572
|
*
|
|
3573
3573
|
* @default 'neutral'
|
|
3574
|
+
* @deprecated Use `variant` instead
|
|
3574
3575
|
*/
|
|
3575
3576
|
intent?: Feedback;
|
|
3577
|
+
/**
|
|
3578
|
+
* Sets the variant of the counter.
|
|
3579
|
+
*
|
|
3580
|
+
* @default 'neutral'
|
|
3581
|
+
*/
|
|
3582
|
+
variant?: Feedback | 'blue';
|
|
3576
3583
|
/**
|
|
3577
3584
|
* Sets the contrast of the counter.
|
|
3578
3585
|
*
|
|
@@ -3586,7 +3593,7 @@ declare type CounterProps = {
|
|
|
3586
3593
|
*/
|
|
3587
3594
|
size?: 'small' | 'medium' | 'large';
|
|
3588
3595
|
} & TestID$1 & StyledPropsBlade;
|
|
3589
|
-
declare const Counter: ({ value, max, intent, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
|
|
3596
|
+
declare const Counter: ({ value, max, intent, variant, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
|
|
3590
3597
|
|
|
3591
3598
|
type FeedbackColors$1 = `feedback.text.${DotNotationColorStringToken<
|
|
3592
3599
|
Theme$1['colors']['feedback']['text']
|
|
@@ -3383,8 +3383,15 @@ declare type CounterProps = {
|
|
|
3383
3383
|
* Sets the intent of the counter.
|
|
3384
3384
|
*
|
|
3385
3385
|
* @default 'neutral'
|
|
3386
|
+
* @deprecated Use `variant` instead
|
|
3386
3387
|
*/
|
|
3387
3388
|
intent?: Feedback;
|
|
3389
|
+
/**
|
|
3390
|
+
* Sets the variant of the counter.
|
|
3391
|
+
*
|
|
3392
|
+
* @default 'neutral'
|
|
3393
|
+
*/
|
|
3394
|
+
variant?: Feedback | 'blue';
|
|
3388
3395
|
/**
|
|
3389
3396
|
* Sets the contrast of the counter.
|
|
3390
3397
|
*
|
|
@@ -3398,7 +3405,7 @@ declare type CounterProps = {
|
|
|
3398
3405
|
*/
|
|
3399
3406
|
size?: 'small' | 'medium' | 'large';
|
|
3400
3407
|
} & TestID & StyledPropsBlade;
|
|
3401
|
-
declare const Counter: ({ value, max, intent, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
|
|
3408
|
+
declare const Counter: ({ value, max, intent, variant, contrast, size, testID, ...styledProps }: CounterProps) => React.ReactElement;
|
|
3402
3409
|
|
|
3403
3410
|
type FeedbackColors$1 = `feedback.text.${DotNotationColorStringToken<
|
|
3404
3411
|
Theme$1['colors']['feedback']['text']
|
|
@@ -2697,7 +2697,7 @@ var StyledBadge=styled(BaseBox)(function(props){return _extends({},getStyledBadg
|
|
|
2697
2697
|
|
|
2698
2698
|
var verticalPadding$1={small:'spacing.0',medium:'spacing.1',large:'spacing.2'};var horizontalPadding$1={small:'spacing.3',medium:'spacing.3',large:'spacing.4'};var iconPadding={small:'spacing.1',medium:'spacing.2',large:'spacing.2'};var iconSize={small:'xsmall',medium:'small',large:'small'};
|
|
2699
2699
|
|
|
2700
|
-
var _excluded$r=["children","contrast","fontWeight","icon","size","variant","testID"];var isFeedbackVariant=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps$1=function getColorProps(_ref){var variant=_ref.variant,contrast=_ref.contrast;var props={iconColor:'feedback.icon.neutral.lowContrast',textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(variant)){props.iconColor="feedback.icon."+variant+"."+contrast+"Contrast";props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.iconColor="badge.icon."+variant+"."+contrast+"Contrast";props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var _Badge=function _Badge(_ref2){var children=_ref2.children,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$fontWeight=_ref2.fontWeight,fontWeight=_ref2$fontWeight===void 0?'regular':_ref2$fontWeight,Icon=_ref2.icon,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$r);var childrenString=getStringFromReactText(children);if(!(childrenString!=null&&childrenString.trim())){throw new Error('[Blade: Badge]: Text as children is required for Badge.');}var _getColorProps=getColorProps$1({variant:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,iconColor=_getColorProps.iconColor,textColor=_getColorProps.textColor;var badgeTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'small'}};return jsx(StyledBadge,_extends({backgroundColor:backgroundColor,size:size,textAlign:'left'},metaAttribute({name:MetaConstants.Badge,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,{paddingRight:horizontalPadding$1[size],paddingLeft:horizontalPadding$1[size],paddingTop:verticalPadding$1[size],paddingBottom:verticalPadding$1[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:[Icon?jsx(BaseBox,{paddingRight:Boolean(Icon)?iconPadding[size]:'spacing.0',display:"flex",children:jsx(Icon,{color:iconColor,size:iconSize[size]})}):null,jsx(Text,_extends({},badgeTextSizes[size],{type:"normal",weight:fontWeight,truncateAfterLines:1,color:textColor,children:children}))]})}));};var Badge=assignWithoutSideEffects(_Badge,{displayName:'Badge',componentId:'Badge'});
|
|
2700
|
+
var _excluded$r=["children","contrast","fontWeight","icon","size","variant","testID"];var isFeedbackVariant$1=function isFeedbackVariant(variant){var feedbackVariants=['information','negative','neutral','notice','positive'];return feedbackVariants.includes(variant);};var getColorProps$1=function getColorProps(_ref){var variant=_ref.variant,contrast=_ref.contrast;var props={iconColor:'feedback.icon.neutral.lowContrast',textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant$1(variant)){props.iconColor="feedback.icon."+variant+"."+contrast+"Contrast";props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.iconColor="badge.icon."+variant+"."+contrast+"Contrast";props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var _Badge=function _Badge(_ref2){var children=_ref2.children,_ref2$contrast=_ref2.contrast,contrast=_ref2$contrast===void 0?'low':_ref2$contrast,_ref2$fontWeight=_ref2.fontWeight,fontWeight=_ref2$fontWeight===void 0?'regular':_ref2$fontWeight,Icon=_ref2.icon,_ref2$size=_ref2.size,size=_ref2$size===void 0?'medium':_ref2$size,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,testID=_ref2.testID,styledProps=_objectWithoutProperties(_ref2,_excluded$r);var childrenString=getStringFromReactText(children);if(!(childrenString!=null&&childrenString.trim())){throw new Error('[Blade: Badge]: Text as children is required for Badge.');}var _getColorProps=getColorProps$1({variant:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,iconColor=_getColorProps.iconColor,textColor=_getColorProps.textColor;var badgeTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'small'}};return jsx(StyledBadge,_extends({backgroundColor:backgroundColor,size:size,textAlign:'left'},metaAttribute({name:MetaConstants.Badge,testID:testID}),getStyledProps(styledProps),{children:jsxs(BaseBox,{paddingRight:horizontalPadding$1[size],paddingLeft:horizontalPadding$1[size],paddingTop:verticalPadding$1[size],paddingBottom:verticalPadding$1[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden",children:[Icon?jsx(BaseBox,{paddingRight:Boolean(Icon)?iconPadding[size]:'spacing.0',display:"flex",children:jsx(Icon,{color:iconColor,size:iconSize[size]})}):null,jsx(Text,_extends({},badgeTextSizes[size],{type:"normal",weight:fontWeight,truncateAfterLines:1,color:textColor,children:children}))]})}));};var Badge=assignWithoutSideEffects(_Badge,{displayName:'Badge',componentId:'Badge'});
|
|
2701
2701
|
|
|
2702
2702
|
var _excluded$q=["children","surfaceLevel","elevation"];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,props=_objectWithoutProperties(_ref2,_excluded$q);var _useTheme=useTheme(),theme=_useTheme.theme;return jsx(CardSurfaceStyled,_extends({},props,{surfaceLevel:surfaceLevel,elevation:elevation,style:castNativeType(theme.elevation[elevation]),children:children}));};
|
|
2703
2703
|
|
|
@@ -2715,7 +2715,7 @@ var getStyledCounterStyles=function getStyledCounterStyles(_ref){var theme=_ref.
|
|
|
2715
2715
|
|
|
2716
2716
|
var StyledCounter=styled(BaseBox)(function(props){return _extends({},getStyledCounterStyles(props),{alignSelf:'center'});});
|
|
2717
2717
|
|
|
2718
|
-
var _excluded$m=["value","max","intent","contrast","size","testID"];var getColorProps=function getColorProps(_ref){var _ref$
|
|
2718
|
+
var _excluded$m=["value","max","intent","variant","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 props={textColor:'feedback.text.neutral.lowContrast',backgroundColor:'feedback.background.neutral.lowContrast'};if(isFeedbackVariant(variant)){props.textColor="feedback.text."+variant+"."+contrast+"Contrast";props.backgroundColor="feedback.background."+variant+"."+contrast+"Contrast";}else {props.textColor="badge.text."+variant+"."+contrast+"Contrast";props.backgroundColor="badge.background."+variant+"."+contrast+"Contrast";}return props;};var Counter=function Counter(_ref2){var value=_ref2.value,max=_ref2.max,intent=_ref2.intent,_ref2$variant=_ref2.variant,variant=_ref2$variant===void 0?'neutral':_ref2$variant,_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$m);var content=""+value;if(max&&value>max){content=max+"+";}var _useTheme=useTheme(),platform=_useTheme.platform;var _getColorProps=getColorProps({variant:intent!=null?intent:variant,contrast:contrast}),backgroundColor=_getColorProps.backgroundColor,textColor=_getColorProps.textColor;if(intent){console.warn('[Blade: Counter] The prop `intent` is deprecated and will be removed in a future release. Please use `variant` instead.');}var counterTextSizes={small:{variant:'body',size:'xsmall'},medium:{variant:'body',size:'small'},large:{variant:'body',size:'medium'}};return jsx(StyledCounter,_extends({backgroundColor:backgroundColor,size:size,platform:platform},getStyledProps(styledProps),{children:jsx(BaseBox,_extends({paddingRight:horizontalPadding[size],paddingLeft:horizontalPadding[size],paddingTop:verticalPadding[size],paddingBottom:verticalPadding[size],display:isReactNative$4()?'flex':'inline-flex',flexDirection:"row",justifyContent:"center",alignItems:"center",overflow:"hidden"},metaAttribute({name:MetaConstants.Counter,testID:testID}),{children:jsx(Text,_extends({},counterTextSizes[size],{textAlign:"center",type:"normal",weight:"regular",truncateAfterLines:1,color:textColor,children:content}))}))}));};
|
|
2719
2719
|
|
|
2720
2720
|
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$2.CardHeaderIcon});var _CardHeaderCounter=function _CardHeaderCounter(props){useVerifyInsideCard('CardHeaderCounter');return jsx(Counter,_extends({},props));};var CardHeaderCounter=assignWithoutSideEffects(_CardHeaderCounter,{componentId:ComponentIds$2.CardHeaderCounter});var _CardHeaderBadge=function _CardHeaderBadge(props){useVerifyInsideCard('CardHeaderBadge');return jsx(Badge,_extends({},props));};var CardHeaderBadge=assignWithoutSideEffects(_CardHeaderBadge,{componentId:ComponentIds$2.CardHeaderBadge});var _CardHeaderText=function _CardHeaderText(props){useVerifyInsideCard('CardHeaderText');return jsx(Text,_extends({textAlign:"left"},props));};var CardHeaderText=assignWithoutSideEffects(_CardHeaderText,{componentId:ComponentIds$2.CardHeaderText});var _CardHeaderLink=function _CardHeaderLink(props){useVerifyInsideCard('CardHeaderLink');return jsx(Link,_extends({},props));};var CardHeaderLink=assignWithoutSideEffects(_CardHeaderLink,{componentId:ComponentIds$2.CardHeaderLink});var _CardHeaderIconButton=function _CardHeaderIconButton(props){useVerifyInsideCard('CardHeaderIconButton');return jsx(BaseBox,{width:makeSpace(minHeight.xsmall),children:jsx(Button,_extends({},props,{variant:"tertiary",size:"xsmall",iconPosition:"left",isFullWidth:true}))});};var CardHeaderIconButton=assignWithoutSideEffects(_CardHeaderIconButton,{componentId:ComponentIds$2.CardHeaderIconButton});var _CardHeader=function _CardHeader(_ref2){var children=_ref2.children,testID=_ref2.testID;useVerifyInsideCard('CardHeader');useVerifyAllowedComponents(children,'CardHeader',[ComponentIds$2.CardHeaderLeading,ComponentIds$2.CardHeaderTrailing]);return jsxs(BaseBox,_extends({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$2.CardHeader});var _CardHeaderLeading=function _CardHeaderLeading(_ref3){var title=_ref3.title,subtitle=_ref3.subtitle,prefix=_ref3.prefix,suffix=_ref3.suffix;useVerifyInsideCard('CardHeaderLeading');if(prefix&&!isValidAllowedChildren(prefix,ComponentIds$2.CardHeaderIcon)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds$2.CardHeaderIcon+"` component is accepted in prefix");}if(suffix&&!isValidAllowedChildren(suffix,ComponentIds$2.CardHeaderCounter)){throw new Error("[Blade CardHeaderLeading]: Only `"+ComponentIds$2.CardHeaderCounter+"` component is accepted in prefix");}return jsxs(BaseBox,{flex:1,display:"flex",flexDirection:"row",children:[jsx(BaseBox,{marginRight:"spacing.3",alignSelf:"center",display:"flex",children:prefix}),jsxs(BaseBox,{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$2.CardHeaderLeading});var headerTrailingAllowedComponents=[ComponentIds$2.CardHeaderLink,ComponentIds$2.CardHeaderText,ComponentIds$2.CardHeaderIconButton,ComponentIds$2.CardHeaderBadge];var _CardHeaderTrailing=function _CardHeaderTrailing(_ref4){var visual=_ref4.visual;useVerifyInsideCard('CardHeaderTrailing');if(visual&&!headerTrailingAllowedComponents.includes(getComponentId(visual))){throw new Error("[Blade CardHeaderTrailing]: Only one of `"+headerTrailingAllowedComponents.join(', ')+"` component is accepted in visual");}return jsx(BaseBox,{alignSelf:"center",children:visual});};var CardHeaderTrailing=assignWithoutSideEffects(_CardHeaderTrailing,{componentId:ComponentIds$2.CardHeaderTrailing});
|
|
2721
2721
|
|