@razorpay/blade 6.4.0 → 6.5.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.
@@ -2795,6 +2795,7 @@ var MetaConstants = {
2795
2795
  ActionListSection: 'action-list-section',
2796
2796
  Alert: 'alert',
2797
2797
  Badge: 'badge',
2798
+ Box: 'box',
2798
2799
  Button: 'button',
2799
2800
  Checkbox: 'checkbox',
2800
2801
  CheckboxGroup: 'checkbox-group',
@@ -3235,6 +3236,12 @@ function get(object, path, defaultValue) {
3235
3236
 
3236
3237
  var get_1 = get;
3237
3238
 
3239
+ var getMediaQuery = function getMediaQuery(_ref) {
3240
+ var min = _ref.min,
3241
+ max = _ref.max;
3242
+ return "screen and (min-width: ".concat(min, "px)").concat(max ? " and (max-width: ".concat(max, "px)") : '');
3243
+ };
3244
+
3238
3245
  var getPlatformType = function getPlatformType() {
3239
3246
  if (typeof navigator !== 'undefined' && navigator.product === 'ReactNative') {
3240
3247
  return 'react-native';
@@ -4809,20 +4816,18 @@ var useBreakpoint = function useBreakpoint(_ref) {
4809
4816
  var supportsMatchMedia = typeof document !== 'undefined' && typeof window !== 'undefined' && typeof ((_window = window) === null || _window === void 0 ? void 0 : _window.matchMedia) === 'function';
4810
4817
  var breakpointsTokenAndQueryCollection = useMemo(function () {
4811
4818
  return supportsMatchMedia ? Object.entries(breakpoints).map(function (_ref2, index, breakpointsArray) {
4819
+ var _breakpointsArray;
4820
+
4812
4821
  var _ref3 = _slicedToArray(_ref2, 2),
4813
4822
  token = _ref3[0],
4814
4823
  screenSize = _ref3[1];
4815
4824
 
4816
- var mediaQuery = '';
4817
-
4818
- if (token === 'max') {
4819
- mediaQuery = "screen and (min-width: ".concat(screenSize, "px)");
4820
- } else if (breakpointsArray[index - 1]) {
4821
- mediaQuery = "screen and (min-width: ".concat(breakpointsArray[index - 1][1] + 1, "px) and (max-width: ").concat(screenSize, "px)");
4822
- } else {
4823
- mediaQuery = "screen and (max-width: ".concat(screenSize, "px)");
4824
- }
4825
-
4825
+ var min = screenSize;
4826
+ var maxValue = (_breakpointsArray = breakpointsArray[index + 1]) === null || _breakpointsArray === void 0 ? void 0 : _breakpointsArray[1];
4827
+ var mediaQuery = getMediaQuery({
4828
+ min: min,
4829
+ max: maxValue ? maxValue - 1 : undefined
4830
+ });
4826
4831
  return {
4827
4832
  token: token,
4828
4833
  screenSize: screenSize,
@@ -4837,7 +4842,7 @@ var useBreakpoint = function useBreakpoint(_ref) {
4837
4842
  if (platform === 'react-native') {
4838
4843
  matchedDeviceType = deviceType.mobile;
4839
4844
  } else if (platform === 'browser') {
4840
- if (matchedBreakpoint && ['xs', 's', 'm'].includes(matchedBreakpoint)) {
4845
+ if (matchedBreakpoint && ['base', 'xs', 's'].includes(matchedBreakpoint)) {
4841
4846
  // tablet is also categorised as mobile
4842
4847
  matchedDeviceType = deviceType.mobile;
4843
4848
  } else {
@@ -5111,5 +5116,5 @@ var castNativeType = function castNativeType(value) {
5111
5116
  return value;
5112
5117
  };
5113
5118
 
5114
- export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, getComponentId, get_1 as getIn, getOS, getPlatformType, isAndroid, isEmpty_1 as isEmpty, isEqual_1 as isEqual, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, merge_1 as merge, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
5119
+ export { MetaConstants, Platform, castNativeType, castWebType, cloneDeep_1 as cloneDeep, getColorScheme, getComponentId, get_1 as getIn, getMediaQuery, getOS, getPlatformType, isAndroid, isEmpty_1 as isEmpty, isEqual_1 as isEqual, isPartialMatchObjectKeys, isReactNative, isValidAllowedChildren, makeAccessible, makeBezier, makeBorderSize, makeMotionTime, makeSize, makeSpace, makeTypographySize, merge_1 as merge, metaAttribute, setupMatchMediaMock, testID, toTitleCase, useBreakpoint, useColorScheme, usePrevious };
5115
5120
  //# sourceMappingURL=index.web.js.map