@razorpay/blade 8.6.1 → 8.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/components/index.d.ts +63 -17
- package/build/components/index.native.d.ts +63 -17
- package/build/components/index.native.js +4 -4
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +58 -22
- 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/codemods/migrate-typography/transformers/migrate-typography.ts +0 -0
- package/package.json +2 -2
|
@@ -5864,7 +5864,7 @@ var BaseText = function BaseText(_ref2) {
|
|
|
5864
5864
|
}));
|
|
5865
5865
|
};
|
|
5866
5866
|
|
|
5867
|
-
var _excluded$4N = ["size", "type", "contrast", "children", "testID"];
|
|
5867
|
+
var _excluded$4N = ["size", "type", "contrast", "color", "children", "testID"];
|
|
5868
5868
|
|
|
5869
5869
|
function ownKeys$5m(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5870
5870
|
|
|
@@ -5874,11 +5874,12 @@ var getProps$3 = function getProps(_ref) {
|
|
|
5874
5874
|
var size = _ref.size,
|
|
5875
5875
|
type = _ref.type,
|
|
5876
5876
|
contrast = _ref.contrast,
|
|
5877
|
+
color = _ref.color,
|
|
5877
5878
|
testID = _ref.testID;
|
|
5878
5879
|
var isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';
|
|
5879
5880
|
var colorContrast = contrast ? "".concat(contrast, "Contrast") : 'lowContrast';
|
|
5880
5881
|
var props = {
|
|
5881
|
-
color: "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
5882
|
+
color: color !== null && color !== void 0 ? color : "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
5882
5883
|
fontSize: 600,
|
|
5883
5884
|
fontWeight: 'bold',
|
|
5884
5885
|
fontStyle: 'normal',
|
|
@@ -5919,6 +5920,7 @@ var Title = function Title(_ref2) {
|
|
|
5919
5920
|
type = _ref2$type === void 0 ? 'normal' : _ref2$type,
|
|
5920
5921
|
_ref2$contrast = _ref2.contrast,
|
|
5921
5922
|
contrast = _ref2$contrast === void 0 ? 'low' : _ref2$contrast,
|
|
5923
|
+
color = _ref2.color,
|
|
5922
5924
|
children = _ref2.children,
|
|
5923
5925
|
testID = _ref2.testID,
|
|
5924
5926
|
styledProps = _objectWithoutProperties$1(_ref2, _excluded$4N);
|
|
@@ -5927,6 +5929,7 @@ var Title = function Title(_ref2) {
|
|
|
5927
5929
|
size: size,
|
|
5928
5930
|
type: type,
|
|
5929
5931
|
contrast: contrast,
|
|
5932
|
+
color: color,
|
|
5930
5933
|
testID: testID
|
|
5931
5934
|
});
|
|
5932
5935
|
return /*#__PURE__*/jsx(BaseText, _objectSpread$5l(_objectSpread$5l(_objectSpread$5l({}, props), getStyledProps(styledProps)), {}, {
|
|
@@ -5934,7 +5937,7 @@ var Title = function Title(_ref2) {
|
|
|
5934
5937
|
}));
|
|
5935
5938
|
};
|
|
5936
5939
|
|
|
5937
|
-
var _excluded$4M = ["variant", "size", "type", "weight", "contrast", "children", "testID", "textAlign"];
|
|
5940
|
+
var _excluded$4M = ["variant", "size", "type", "weight", "contrast", "color", "children", "testID", "textAlign"];
|
|
5938
5941
|
|
|
5939
5942
|
function ownKeys$5l(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
5940
5943
|
|
|
@@ -5946,11 +5949,12 @@ var getProps$2 = function getProps(_ref) {
|
|
|
5946
5949
|
type = _ref.type,
|
|
5947
5950
|
weight = _ref.weight,
|
|
5948
5951
|
contrast = _ref.contrast,
|
|
5952
|
+
color = _ref.color,
|
|
5949
5953
|
testID = _ref.testID;
|
|
5950
5954
|
var isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';
|
|
5951
5955
|
var colorContrast = contrast ? "".concat(contrast, "Contrast") : 'lowContrast';
|
|
5952
5956
|
var props = {
|
|
5953
|
-
color: "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
5957
|
+
color: color !== null && color !== void 0 ? color : "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
5954
5958
|
fontSize: 200,
|
|
5955
5959
|
fontWeight: weight !== null && weight !== void 0 ? weight : 'bold',
|
|
5956
5960
|
fontStyle: 'normal',
|
|
@@ -6004,6 +6008,7 @@ var Heading = function Heading(_ref2) {
|
|
|
6004
6008
|
weight = _ref2$weight === void 0 ? 'bold' : _ref2$weight,
|
|
6005
6009
|
_ref2$contrast = _ref2.contrast,
|
|
6006
6010
|
contrast = _ref2$contrast === void 0 ? 'low' : _ref2$contrast,
|
|
6011
|
+
color = _ref2.color,
|
|
6007
6012
|
children = _ref2.children,
|
|
6008
6013
|
testID = _ref2.testID,
|
|
6009
6014
|
textAlign = _ref2.textAlign,
|
|
@@ -6014,6 +6019,7 @@ var Heading = function Heading(_ref2) {
|
|
|
6014
6019
|
size: size,
|
|
6015
6020
|
type: type,
|
|
6016
6021
|
weight: weight,
|
|
6022
|
+
color: color,
|
|
6017
6023
|
contrast: contrast,
|
|
6018
6024
|
testID: testID
|
|
6019
6025
|
});
|
|
@@ -6035,13 +6041,14 @@ var getTextProps = function getTextProps(_ref) {
|
|
|
6035
6041
|
type = _ref.type,
|
|
6036
6042
|
weight = _ref.weight,
|
|
6037
6043
|
size = _ref.size,
|
|
6044
|
+
color = _ref.color,
|
|
6038
6045
|
contrast = _ref.contrast,
|
|
6039
6046
|
testID = _ref.testID,
|
|
6040
6047
|
textAlign = _ref.textAlign;
|
|
6041
6048
|
var isPlatformWeb = getPlatformType() === 'browser' || getPlatformType() === 'node';
|
|
6042
6049
|
var colorContrast = contrast ? "".concat(contrast, "Contrast") : 'lowContrast';
|
|
6043
6050
|
var props = {
|
|
6044
|
-
color: "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
6051
|
+
color: color !== null && color !== void 0 ? color : "surface.text.".concat(type !== null && type !== void 0 ? type : 'normal', ".").concat(colorContrast),
|
|
6045
6052
|
fontSize: 100,
|
|
6046
6053
|
fontWeight: weight !== null && weight !== void 0 ? weight : 'regular',
|
|
6047
6054
|
fontStyle: 'normal',
|
|
@@ -6130,19 +6137,18 @@ var _Text = function _Text(_ref3) {
|
|
|
6130
6137
|
textAlign = _ref3.textAlign,
|
|
6131
6138
|
styledProps = _objectWithoutProperties$1(_ref3, _excluded$4L);
|
|
6132
6139
|
|
|
6133
|
-
var props = _objectSpread$5j(
|
|
6140
|
+
var props = _objectSpread$5j({
|
|
6134
6141
|
truncateAfterLines: truncateAfterLines
|
|
6135
6142
|
}, getTextProps({
|
|
6136
6143
|
variant: variant,
|
|
6137
6144
|
type: type,
|
|
6138
6145
|
weight: weight,
|
|
6146
|
+
color: color,
|
|
6139
6147
|
size: size,
|
|
6140
6148
|
contrast: contrast,
|
|
6141
6149
|
testID: testID,
|
|
6142
6150
|
textAlign: textAlign
|
|
6143
|
-
}))
|
|
6144
|
-
color: color
|
|
6145
|
-
} : {});
|
|
6151
|
+
}));
|
|
6146
6152
|
|
|
6147
6153
|
return /*#__PURE__*/jsx(StyledText, _objectSpread$5j(_objectSpread$5j(_objectSpread$5j({}, props), getStyledProps(styledProps)), {}, {
|
|
6148
6154
|
children: children
|
|
@@ -6154,7 +6160,7 @@ var Text = /*#__PURE__*/assignWithoutSideEffects(_Text, {
|
|
|
6154
6160
|
componentId: 'Text'
|
|
6155
6161
|
});
|
|
6156
6162
|
|
|
6157
|
-
var _excluded$4K = ["children", "size", "weight", "testID"];
|
|
6163
|
+
var _excluded$4K = ["children", "size", "weight", "isHighlighted", "color", "testID"];
|
|
6158
6164
|
|
|
6159
6165
|
function ownKeys$5j(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
6160
6166
|
|
|
@@ -6188,7 +6194,7 @@ var CodeContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
6188
6194
|
var padding = "".concat(makeSpace(props.theme.spacing[0]), " ").concat(makeSpace(props.theme.spacing[2]));
|
|
6189
6195
|
return {
|
|
6190
6196
|
padding: padding,
|
|
6191
|
-
backgroundColor: props.theme.colors.brand.gray.
|
|
6197
|
+
backgroundColor: props.isHighlighted ? props.theme.colors.brand.gray.a100.lowContrast : undefined,
|
|
6192
6198
|
borderRadius: props.theme.border.radius.medium,
|
|
6193
6199
|
display: isPlatformWeb ? 'inline-block' : 'flex',
|
|
6194
6200
|
alignSelf: isPlatformWeb ? undefined : 'center',
|
|
@@ -6196,6 +6202,25 @@ var CodeContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
6196
6202
|
lineHeight: makeTypographySize(props.theme.typography.lineHeights[0])
|
|
6197
6203
|
};
|
|
6198
6204
|
});
|
|
6205
|
+
|
|
6206
|
+
var getCodeColor = function getCodeColor(_ref) {
|
|
6207
|
+
var isHighlighted = _ref.isHighlighted,
|
|
6208
|
+
color = _ref.color;
|
|
6209
|
+
|
|
6210
|
+
if (isHighlighted) {
|
|
6211
|
+
if (color) {
|
|
6212
|
+
throw new Error('[Blade: Code]: `color` prop cannot be used without `isHighlighted={false}`');
|
|
6213
|
+
}
|
|
6214
|
+
|
|
6215
|
+
return 'surface.text.subtle.lowContrast';
|
|
6216
|
+
}
|
|
6217
|
+
|
|
6218
|
+
if (color) {
|
|
6219
|
+
return color;
|
|
6220
|
+
}
|
|
6221
|
+
|
|
6222
|
+
return 'surface.text.normal.lowContrast';
|
|
6223
|
+
};
|
|
6199
6224
|
/**
|
|
6200
6225
|
* Code component can be used for displaying token, variable names, or inlined code snippets.
|
|
6201
6226
|
*
|
|
@@ -6215,36 +6240,47 @@ var CodeContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
6215
6240
|
* In React Native, you would have to align it using flex to make sure the Code and the surrounding text is correctly aligned
|
|
6216
6241
|
*
|
|
6217
6242
|
* ```tsx
|
|
6218
|
-
* <
|
|
6243
|
+
* <Box flexWrap="wrap" flexDirection="row" alignItems="flex-start">
|
|
6219
6244
|
* <Text>Lorem ipsum </Text>
|
|
6220
6245
|
* <Code>SENTRY_TOKEN</Code>
|
|
6221
6246
|
* <Text> normal text</Text>
|
|
6222
|
-
* </
|
|
6247
|
+
* </Box>
|
|
6223
6248
|
* ```
|
|
6224
6249
|
*/
|
|
6225
6250
|
|
|
6226
|
-
|
|
6227
|
-
|
|
6228
|
-
|
|
6229
|
-
size =
|
|
6230
|
-
|
|
6231
|
-
weight =
|
|
6232
|
-
|
|
6233
|
-
|
|
6251
|
+
|
|
6252
|
+
var Code = function Code(_ref2) {
|
|
6253
|
+
var children = _ref2.children,
|
|
6254
|
+
_ref2$size = _ref2.size,
|
|
6255
|
+
size = _ref2$size === void 0 ? 'small' : _ref2$size,
|
|
6256
|
+
_ref2$weight = _ref2.weight,
|
|
6257
|
+
weight = _ref2$weight === void 0 ? 'regular' : _ref2$weight,
|
|
6258
|
+
_ref2$isHighlighted = _ref2.isHighlighted,
|
|
6259
|
+
isHighlighted = _ref2$isHighlighted === void 0 ? true : _ref2$isHighlighted,
|
|
6260
|
+
color = _ref2.color,
|
|
6261
|
+
testID = _ref2.testID,
|
|
6262
|
+
styledProps = _objectWithoutProperties$1(_ref2, _excluded$4K);
|
|
6234
6263
|
|
|
6235
6264
|
var _getCodeFontSizeAndLi = getCodeFontSizeAndLineHeight(size),
|
|
6236
6265
|
fontSize = _getCodeFontSizeAndLi.fontSize,
|
|
6237
6266
|
lineHeight = _getCodeFontSizeAndLi.lineHeight;
|
|
6238
6267
|
|
|
6268
|
+
var codeTextColor = React__default.useMemo(function () {
|
|
6269
|
+
return getCodeColor({
|
|
6270
|
+
isHighlighted: isHighlighted,
|
|
6271
|
+
color: color
|
|
6272
|
+
});
|
|
6273
|
+
}, [isHighlighted, color]);
|
|
6239
6274
|
return /*#__PURE__*/jsx(CodeContainer, _objectSpread$5i(_objectSpread$5i(_objectSpread$5i({
|
|
6240
6275
|
size: size,
|
|
6276
|
+
isHighlighted: isHighlighted,
|
|
6241
6277
|
as: isPlatformWeb ? 'span' : undefined
|
|
6242
6278
|
}, metaAttribute({
|
|
6243
6279
|
name: MetaConstants.Code,
|
|
6244
6280
|
testID: testID
|
|
6245
6281
|
})), getStyledProps(styledProps)), {}, {
|
|
6246
6282
|
children: /*#__PURE__*/jsx(BaseText, {
|
|
6247
|
-
color:
|
|
6283
|
+
color: codeTextColor,
|
|
6248
6284
|
fontFamily: "code",
|
|
6249
6285
|
fontSize: fontSize,
|
|
6250
6286
|
fontWeight: weight,
|