@razorpay/blade 5.4.1 → 5.4.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/CHANGELOG.md +12 -0
- package/build/components/index.d.ts +25 -10
- package/build/components/index.native.d.ts +25 -10
- package/build/components/index.native.js +9 -9
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.web.js +68 -41
- 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
|
@@ -6877,39 +6877,12 @@ var Alert = function Alert(_ref) {
|
|
|
6877
6877
|
}));
|
|
6878
6878
|
};
|
|
6879
6879
|
|
|
6880
|
-
var verticalPadding$1 = {
|
|
6881
|
-
small: 'spacing.0',
|
|
6882
|
-
medium: 'spacing.1',
|
|
6883
|
-
large: 'spacing.2'
|
|
6884
|
-
};
|
|
6885
|
-
var horizontalPadding$1 = {
|
|
6886
|
-
small: 'spacing.3',
|
|
6887
|
-
medium: 'spacing.3',
|
|
6888
|
-
large: 'spacing.4'
|
|
6889
|
-
};
|
|
6890
|
-
var iconPadding = {
|
|
6891
|
-
small: 'spacing.1',
|
|
6892
|
-
medium: 'spacing.2',
|
|
6893
|
-
large: 'spacing.2'
|
|
6894
|
-
};
|
|
6895
|
-
var iconSize = {
|
|
6896
|
-
small: 'xsmall',
|
|
6897
|
-
medium: 'small',
|
|
6898
|
-
large: 'small'
|
|
6899
|
-
};
|
|
6900
|
-
var maxWidth$1 = {
|
|
6901
|
-
onMobile: 100,
|
|
6902
|
-
onDesktop: 120
|
|
6903
|
-
};
|
|
6904
|
-
|
|
6905
6880
|
var getStyledBadgeStyles = function getStyledBadgeStyles(_ref) {
|
|
6906
6881
|
var theme = _ref.theme,
|
|
6907
|
-
platform = _ref.platform,
|
|
6908
6882
|
backgroundColor = _ref.backgroundColor;
|
|
6909
6883
|
return {
|
|
6910
6884
|
backgroundColor: get_1(theme.colors, backgroundColor),
|
|
6911
6885
|
borderRadius: makeBorderSize(theme.border.radius.max),
|
|
6912
|
-
maxWidth: makeSize(maxWidth$1[platform]),
|
|
6913
6886
|
display: 'flex',
|
|
6914
6887
|
flexWrap: 'nowrap'
|
|
6915
6888
|
};
|
|
@@ -6927,6 +6900,27 @@ var StyledBadge = /*#__PURE__*/styled.div.withConfig({
|
|
|
6927
6900
|
});
|
|
6928
6901
|
});
|
|
6929
6902
|
|
|
6903
|
+
var verticalPadding$1 = {
|
|
6904
|
+
small: 'spacing.0',
|
|
6905
|
+
medium: 'spacing.1',
|
|
6906
|
+
large: 'spacing.2'
|
|
6907
|
+
};
|
|
6908
|
+
var horizontalPadding$1 = {
|
|
6909
|
+
small: 'spacing.3',
|
|
6910
|
+
medium: 'spacing.3',
|
|
6911
|
+
large: 'spacing.4'
|
|
6912
|
+
};
|
|
6913
|
+
var iconPadding = {
|
|
6914
|
+
small: 'spacing.1',
|
|
6915
|
+
medium: 'spacing.2',
|
|
6916
|
+
large: 'spacing.2'
|
|
6917
|
+
};
|
|
6918
|
+
var iconSize = {
|
|
6919
|
+
small: 'xsmall',
|
|
6920
|
+
medium: 'small',
|
|
6921
|
+
large: 'small'
|
|
6922
|
+
};
|
|
6923
|
+
|
|
6930
6924
|
function ownKeys$p(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; }
|
|
6931
6925
|
|
|
6932
6926
|
function _objectSpread$p(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$p(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$p(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -6974,9 +6968,6 @@ var Badge = function Badge(_ref2) {
|
|
|
6974
6968
|
throw new Error('[Blade: Badge]: Text as children is required for Badge.');
|
|
6975
6969
|
}
|
|
6976
6970
|
|
|
6977
|
-
var _useTheme = useTheme(),
|
|
6978
|
-
platform = _useTheme.platform;
|
|
6979
|
-
|
|
6980
6971
|
var _getColorProps = getColorProps$1({
|
|
6981
6972
|
variant: variant,
|
|
6982
6973
|
contrast: contrast
|
|
@@ -6987,8 +6978,7 @@ var Badge = function Badge(_ref2) {
|
|
|
6987
6978
|
|
|
6988
6979
|
return /*#__PURE__*/jsx(StyledBadge, _objectSpread$p(_objectSpread$p({
|
|
6989
6980
|
backgroundColor: backgroundColor,
|
|
6990
|
-
size: size
|
|
6991
|
-
platform: platform
|
|
6981
|
+
size: size
|
|
6992
6982
|
}, metaAttribute(MetaConstants.Component, MetaConstants.Badge)), {}, {
|
|
6993
6983
|
children: /*#__PURE__*/jsxs(Box, {
|
|
6994
6984
|
paddingRight: horizontalPadding$1[size],
|
|
@@ -7056,6 +7046,20 @@ var useVerifyInsideCard = function useVerifyInsideCard(componentName) {
|
|
|
7056
7046
|
|
|
7057
7047
|
return true;
|
|
7058
7048
|
};
|
|
7049
|
+
/**
|
|
7050
|
+
* Verify if the passed childrens are only of allowedComponents list
|
|
7051
|
+
*/
|
|
7052
|
+
|
|
7053
|
+
|
|
7054
|
+
var useVerifyAllowedComponents = function useVerifyAllowedComponents(children, componentName, allowedComponents) {
|
|
7055
|
+
React__default.Children.forEach(children, function (child) {
|
|
7056
|
+
var isValidChild = child && allowedComponents.includes(getComponentId(child));
|
|
7057
|
+
|
|
7058
|
+
if (!isValidChild) {
|
|
7059
|
+
throw new Error("[Blade Card]: Only one of `".concat(allowedComponents.join(', '), "` component is accepted as ").concat(componentName, " children"));
|
|
7060
|
+
}
|
|
7061
|
+
});
|
|
7062
|
+
};
|
|
7059
7063
|
|
|
7060
7064
|
var CardProvider = function CardProvider(_ref) {
|
|
7061
7065
|
var children = _ref.children;
|
|
@@ -7068,11 +7072,27 @@ var CardProvider = function CardProvider(_ref) {
|
|
|
7068
7072
|
function ownKeys$o(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; }
|
|
7069
7073
|
|
|
7070
7074
|
function _objectSpread$o(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$o(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$o(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7075
|
+
var ComponentIds = {
|
|
7076
|
+
CardHeader: 'CardHeader',
|
|
7077
|
+
CardHeaderTrailing: 'CardHeaderTrailing',
|
|
7078
|
+
CardHeaderLeading: 'CardHeaderLeading',
|
|
7079
|
+
CardFooter: 'CardFooter',
|
|
7080
|
+
CardFooterTrailing: 'CardFooterTrailing',
|
|
7081
|
+
CardFooterLeading: 'CardFooterLeading',
|
|
7082
|
+
CardBody: 'CardBody',
|
|
7083
|
+
CardHeaderIcon: 'CardHeaderIcon',
|
|
7084
|
+
CardHeaderCounter: 'CardHeaderCounter',
|
|
7085
|
+
CardHeaderBadge: 'CardHeaderBadge',
|
|
7086
|
+
CardHeaderText: 'CardHeaderText',
|
|
7087
|
+
CardHeaderLink: 'CardHeaderLink',
|
|
7088
|
+
CardHeaderIconButton: 'CardHeaderIconButton'
|
|
7089
|
+
};
|
|
7071
7090
|
|
|
7072
7091
|
var Card = function Card(_ref) {
|
|
7073
7092
|
var children = _ref.children,
|
|
7074
7093
|
_ref$surfaceLevel = _ref.surfaceLevel,
|
|
7075
7094
|
surfaceLevel = _ref$surfaceLevel === void 0 ? 3 : _ref$surfaceLevel;
|
|
7095
|
+
useVerifyAllowedComponents(children, 'Card', [ComponentIds.CardHeader, ComponentIds.CardBody, ComponentIds.CardFooter]);
|
|
7076
7096
|
return /*#__PURE__*/jsx(CardProvider, {
|
|
7077
7097
|
children: /*#__PURE__*/jsx(CardSurface, _objectSpread$o(_objectSpread$o({}, metaAttribute(MetaConstants.Component, MetaConstants.Card)), {}, {
|
|
7078
7098
|
paddingLeft: "spacing.7",
|
|
@@ -7094,6 +7114,8 @@ var CardBody = function CardBody(_ref2) {
|
|
|
7094
7114
|
}));
|
|
7095
7115
|
};
|
|
7096
7116
|
|
|
7117
|
+
CardBody.componentId = ComponentIds.CardBody;
|
|
7118
|
+
|
|
7097
7119
|
function ownKeys$n(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; }
|
|
7098
7120
|
|
|
7099
7121
|
function _objectSpread$n(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$n(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$n(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -7311,14 +7333,6 @@ var Counter = function Counter(_ref2) {
|
|
|
7311
7333
|
function ownKeys$j(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; }
|
|
7312
7334
|
|
|
7313
7335
|
function _objectSpread$j(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$j(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$j(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
7314
|
-
var ComponentIds = {
|
|
7315
|
-
CardHeaderIcon: 'CardHeaderIcon',
|
|
7316
|
-
CardHeaderCounter: 'CardHeaderCounter',
|
|
7317
|
-
CardHeaderBadge: 'CardHeaderBadge',
|
|
7318
|
-
CardHeaderText: 'CardHeaderText',
|
|
7319
|
-
CardHeaderLink: 'CardHeaderLink',
|
|
7320
|
-
CardHeaderIconButton: 'CardHeaderIconButton'
|
|
7321
|
-
};
|
|
7322
7336
|
|
|
7323
7337
|
var CardHeaderIcon = function CardHeaderIcon(_ref) {
|
|
7324
7338
|
var Icon = _ref.icon;
|
|
@@ -7377,6 +7391,7 @@ CardHeaderIconButton.componentId = ComponentIds.CardHeaderIconButton;
|
|
|
7377
7391
|
var CardHeader = function CardHeader(_ref2) {
|
|
7378
7392
|
var children = _ref2.children;
|
|
7379
7393
|
useVerifyInsideCard('CardHeader');
|
|
7394
|
+
useVerifyAllowedComponents(children, 'CardHeader', [ComponentIds.CardHeaderLeading, ComponentIds.CardHeaderTrailing]);
|
|
7380
7395
|
return /*#__PURE__*/jsxs(Box, _objectSpread$j(_objectSpread$j({
|
|
7381
7396
|
marginBottom: "spacing.7"
|
|
7382
7397
|
}, metaAttribute(MetaConstants.Component, MetaConstants.CardHeader)), {}, {
|
|
@@ -7390,6 +7405,8 @@ var CardHeader = function CardHeader(_ref2) {
|
|
|
7390
7405
|
}));
|
|
7391
7406
|
};
|
|
7392
7407
|
|
|
7408
|
+
CardHeader.componentId = ComponentIds.CardHeader;
|
|
7409
|
+
|
|
7393
7410
|
var CardHeaderLeading = function CardHeaderLeading(_ref3) {
|
|
7394
7411
|
var title = _ref3.title,
|
|
7395
7412
|
subtitle = _ref3.subtitle,
|
|
@@ -7439,6 +7456,7 @@ var CardHeaderLeading = function CardHeaderLeading(_ref3) {
|
|
|
7439
7456
|
});
|
|
7440
7457
|
};
|
|
7441
7458
|
|
|
7459
|
+
CardHeaderLeading.componentId = ComponentIds.CardHeaderLeading;
|
|
7442
7460
|
var headerTrailingAllowedComponents = [ComponentIds.CardHeaderLink, ComponentIds.CardHeaderText, ComponentIds.CardHeaderIconButton, ComponentIds.CardHeaderBadge];
|
|
7443
7461
|
|
|
7444
7462
|
var CardHeaderTrailing = function CardHeaderTrailing(_ref4) {
|
|
@@ -7455,6 +7473,8 @@ var CardHeaderTrailing = function CardHeaderTrailing(_ref4) {
|
|
|
7455
7473
|
});
|
|
7456
7474
|
};
|
|
7457
7475
|
|
|
7476
|
+
CardHeaderTrailing.componentId = ComponentIds.CardHeaderTrailing;
|
|
7477
|
+
|
|
7458
7478
|
function ownKeys$i(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; }
|
|
7459
7479
|
|
|
7460
7480
|
function _objectSpread$i(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$i(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$i(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -7475,6 +7495,7 @@ var CardFooter = function CardFooter(_ref) {
|
|
|
7475
7495
|
var children = _ref.children;
|
|
7476
7496
|
var isMobile = useIsMobile();
|
|
7477
7497
|
useVerifyInsideCard('CardFooter');
|
|
7498
|
+
useVerifyAllowedComponents(children, 'CardFooter', [ComponentIds.CardFooterLeading, ComponentIds.CardFooterTrailing]);
|
|
7478
7499
|
return /*#__PURE__*/jsxs(Box, _objectSpread$i(_objectSpread$i({
|
|
7479
7500
|
marginTop: "auto"
|
|
7480
7501
|
}, metaAttribute(MetaConstants.Component, MetaConstants.CardFooter)), {}, {
|
|
@@ -7491,6 +7512,8 @@ var CardFooter = function CardFooter(_ref) {
|
|
|
7491
7512
|
}));
|
|
7492
7513
|
};
|
|
7493
7514
|
|
|
7515
|
+
CardFooter.componentId = ComponentIds.CardFooter;
|
|
7516
|
+
|
|
7494
7517
|
var CardFooterLeading = function CardFooterLeading(_ref2) {
|
|
7495
7518
|
var title = _ref2.title,
|
|
7496
7519
|
subtitle = _ref2.subtitle;
|
|
@@ -7510,6 +7533,8 @@ var CardFooterLeading = function CardFooterLeading(_ref2) {
|
|
|
7510
7533
|
});
|
|
7511
7534
|
};
|
|
7512
7535
|
|
|
7536
|
+
CardFooterLeading.componentId = ComponentIds.CardFooterLeading;
|
|
7537
|
+
|
|
7513
7538
|
var CardFooterTrailing = function CardFooterTrailing(_ref3) {
|
|
7514
7539
|
var actions = _ref3.actions;
|
|
7515
7540
|
var isMobile = useIsMobile();
|
|
@@ -7543,6 +7568,8 @@ var CardFooterTrailing = function CardFooterTrailing(_ref3) {
|
|
|
7543
7568
|
});
|
|
7544
7569
|
};
|
|
7545
7570
|
|
|
7571
|
+
CardFooterTrailing.componentId = ComponentIds.CardFooterTrailing;
|
|
7572
|
+
|
|
7546
7573
|
/**
|
|
7547
7574
|
* Checks if `value` is `undefined`.
|
|
7548
7575
|
*
|
|
@@ -11609,5 +11636,5 @@ var SkipNavContent = function SkipNavContent(_ref3) {
|
|
|
11609
11636
|
}, testID('skipnav-content')), metaAttribute(MetaConstants.Component, MetaConstants.SkipNav)));
|
|
11610
11637
|
};
|
|
11611
11638
|
|
|
11612
|
-
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, ProgressBar, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
11639
|
+
export { Alert, AlertTriangleIcon as AlertOctagonIcon, AlertTriangleIcon$1 as AlertTriangleIcon, ArrowDownIcon, ArrowLeftIcon, ArrowRightIcon, ArrowUpIcon, ArrowUpRightIcon, Badge, BladeProvider, Button, Card, CardBody, CardFooter, CardFooterLeading, CardFooterTrailing, CardHeader, CardHeaderBadge, CardHeaderCounter, CardHeaderIcon, CardHeaderIconButton, CardHeaderLeading, CardHeaderLink, CardHeaderText, CardHeaderTrailing, CheckCircleIcon, CheckIcon, Checkbox, CheckboxGroup, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, CloseIcon, Code, ComponentIds, Counter, CreditCardIcon, DollarIcon, DownloadIcon, EditIcon, ExternalLinkIcon, EyeIcon, EyeOffIcon, FileTextIcon, Heading, HelpCircleIcon, HistoryIcon, HomeIcon, IconButton, Indicator, InfoIcon, Link, LinkIcon, LockIcon, MailIcon, MinusIcon, OTPInput, PasswordInput, PauseIcon, PlusIcon, ProgressBar, Radio, RadioGroup, RefreshLeftIcon, RotateCounterClockWiseIcon, RupeeIcon, SearchIcon, SettingsIcon, SkipNavContent, SkipNavLink, SlashIcon, Spinner, Text, TextArea, TextInput, Title, TrashIcon, TrendingDownIcon, TrendingUpIcon, UsersIcon, VisuallyHidden, announce, clearAnnouncer, destroyAnnouncer, getTextProps, screenReaderStyles, useTheme };
|
|
11613
11640
|
//# sourceMappingURL=index.web.js.map
|