@razorpay/blade 4.0.0 → 5.0.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.
@@ -3617,7 +3617,7 @@ var getCommonStyles = function getCommonStyles(props) {
3617
3617
  var feedbackColors = theme.colors.feedback;
3618
3618
  return {
3619
3619
  background: feedbackColors.background[intent][contrastType],
3620
- padding: "".concat(makeSpace(theme.spacing[4]), " ").concat(makeSpace(theme.spacing[5])),
3620
+ padding: isBorderless ? "".concat(makeSpace(theme.spacing[4]), " ").concat(makeSpace(theme.spacing[5])) : "".concat(makeSpace(theme.spacing[3]), " ").concat(makeSpace(theme.spacing[3]), " ").concat(makeSpace(theme.spacing[4]), " ").concat(makeSpace(theme.spacing[3])),
3621
3621
  borderRadius: makeBorderSize(isBorderless ? theme.border.radius.none : theme.border.radius.medium),
3622
3622
  borderColor: feedbackColors.border[intent][contrastType],
3623
3623
  borderWidth: makeBorderSize(isBorderless ? theme.border.width.none : theme.border.width.thin),
@@ -6454,7 +6454,8 @@ var CloseButtonWrapper = isReactNative$3 ? Box : Fragment;
6454
6454
  var intentIconMap = {
6455
6455
  positive: CheckCircleIcon,
6456
6456
  negative: AlertTriangleIcon,
6457
- information: AlertTriangleIcon,
6457
+ information: InfoIcon,
6458
+ neutral: InfoIcon,
6458
6459
  notice: AlertTriangleIcon$1
6459
6460
  };
6460
6461
 
@@ -6469,7 +6470,7 @@ var Alert = function Alert(_ref) {
6469
6470
  _ref$isFullWidth = _ref.isFullWidth,
6470
6471
  isFullWidth = _ref$isFullWidth === void 0 ? false : _ref$isFullWidth,
6471
6472
  _ref$intent = _ref.intent,
6472
- intent = _ref$intent === void 0 ? 'information' : _ref$intent,
6473
+ intent = _ref$intent === void 0 ? 'neutral' : _ref$intent,
6473
6474
  _ref$isBorderless = _ref.isBorderless,
6474
6475
  isBorderless = _ref$isBorderless === void 0 ? false : _ref$isBorderless,
6475
6476
  actions = _ref.actions;
@@ -6484,31 +6485,46 @@ var Alert = function Alert(_ref) {
6484
6485
  setIsVisible = _useState2[1];
6485
6486
 
6486
6487
  var contrastType = "".concat(contrast, "Contrast");
6488
+ var iconSize = isBorderless ? 'large' : 'medium';
6489
+ var textSize = isBorderless ? 'medium' : 'small';
6487
6490
  var Icon = intentIconMap[intent];
6488
6491
 
6489
- var icon = /*#__PURE__*/jsx(Icon, {
6490
- color: "feedback.icon.".concat(intent, ".").concat(contrastType),
6491
- size: "large"
6492
+ var icon = /*#__PURE__*/jsx(Box, {
6493
+ marginTop: "spacing.1",
6494
+ display: "flex",
6495
+ children: /*#__PURE__*/jsx(Icon, {
6496
+ color: "feedback.icon.".concat(intent, ".").concat(contrastType),
6497
+ size: iconSize
6498
+ })
6492
6499
  });
6493
6500
 
6494
6501
  var _title = title ? /*#__PURE__*/jsx(Box, {
6495
6502
  marginBottom: "spacing.2",
6496
- children: /*#__PURE__*/jsx(Heading, {
6503
+ children: isBorderless ? /*#__PURE__*/jsx(Heading, {
6497
6504
  size: "small",
6498
6505
  contrast: contrast,
6499
6506
  children: title
6507
+ }) : /*#__PURE__*/jsx(Text, {
6508
+ weight: "bold",
6509
+ contrast: contrast,
6510
+ children: title
6500
6511
  })
6501
6512
  }) : null;
6502
6513
 
6503
- var _description = /*#__PURE__*/jsx(Text, {
6504
- contrast: contrast,
6505
- children: description
6514
+ var _description = /*#__PURE__*/jsx(Box, {
6515
+ marginTop: title || isReactNative$3 ? 'spacing.0' : 'spacing.1',
6516
+ children: /*#__PURE__*/jsx(Text, {
6517
+ size: textSize,
6518
+ contrast: contrast,
6519
+ children: description
6520
+ })
6506
6521
  });
6507
6522
 
6508
6523
  var primaryAction = actions !== null && actions !== void 0 && actions.primary ? /*#__PURE__*/jsx(Box, {
6509
6524
  marginRight: "spacing.5",
6510
6525
  display: isReactNative$3 ? 'flex' : 'inline-flex',
6511
6526
  children: /*#__PURE__*/jsx(BaseButton, {
6527
+ size: textSize,
6512
6528
  onClick: actions.primary.onClick,
6513
6529
  intent: intent,
6514
6530
  contrast: contrast,
@@ -6533,6 +6549,7 @@ var Alert = function Alert(_ref) {
6533
6549
 
6534
6550
  var secondaryAction = actions !== null && actions !== void 0 && actions.secondary ? /*#__PURE__*/jsx(SecondaryActionWrapper, {
6535
6551
  children: /*#__PURE__*/jsx(BaseLink, _objectSpread$l(_objectSpread$l({
6552
+ size: textSize,
6536
6553
  contrast: contrast,
6537
6554
  intent: intent
6538
6555
  }, secondaryActionParams), {}, {
@@ -6560,7 +6577,7 @@ var Alert = function Alert(_ref) {
6560
6577
  accessibilityLabel: "Dismiss alert",
6561
6578
  onClick: onClickDismiss,
6562
6579
  contrast: contrast,
6563
- size: "large",
6580
+ size: iconSize,
6564
6581
  icon: CloseIcon
6565
6582
  })
6566
6583
  }) : null;
@@ -6583,7 +6600,7 @@ var Alert = function Alert(_ref) {
6583
6600
  }, a11yProps), {}, {
6584
6601
  children: [icon, /*#__PURE__*/jsxs(Box, {
6585
6602
  flex: 1,
6586
- paddingLeft: "spacing.4",
6603
+ paddingLeft: isBorderless ? 'spacing.4' : 'spacing.3',
6587
6604
  paddingRight: "spacing.2",
6588
6605
  children: [_title, _description, _actions]
6589
6606
  }), closeButton]
@@ -9000,6 +9017,13 @@ var getKeyboardAndAutocompleteProps = function getKeyboardAndAutocompleteProps(_
9000
9017
  keyboardAndAutocompleteProps.type = 'text';
9001
9018
  }
9002
9019
 
9020
+ if (type === 'search') {
9021
+ /* when input type:search is provided at that time browser adds a weird close button which collides with our clear button and then we have 2 clear buttons
9022
+ * source: https://github.com/razorpay/blade/issues/857#issue-1457367160
9023
+ */
9024
+ keyboardAndAutocompleteProps.type = 'text';
9025
+ }
9026
+
9003
9027
  return keyboardAndAutocompleteProps;
9004
9028
  }; // need to do this to tell TS to infer type as TextInput of React Native and make it believe that `ref.current.clear()` exists
9005
9029
  // eslint-disable-next-line @typescript-eslint/no-explicit-any