@razorpay/blade 10.5.0 → 10.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 +4 -4
- package/build/components/index.development.web.js +37 -31
- package/build/components/index.development.web.js.map +1 -1
- package/build/components/index.native.d.ts +4 -4
- package/build/components/index.native.js +5 -3
- package/build/components/index.native.js.map +1 -1
- package/build/components/index.production.web.js +37 -31
- package/build/components/index.production.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/build/utils/index.development.web.js +1 -5
- package/build/utils/index.development.web.js.map +1 -1
- package/build/utils/index.native.js +3 -5
- package/build/utils/index.native.js.map +1 -1
- package/build/utils/index.production.web.js +1 -5
- package/build/utils/index.production.web.js.map +1 -1
- package/package.json +1 -1
|
@@ -1936,7 +1936,7 @@ type IconProps$1 = {
|
|
|
1936
1936
|
/**
|
|
1937
1937
|
* Color token (not to be confused with actual hsla value)
|
|
1938
1938
|
*/
|
|
1939
|
-
color
|
|
1939
|
+
color?:
|
|
1940
1940
|
| ActionIconColors$1
|
|
1941
1941
|
| SurfaceActionIconColors$1
|
|
1942
1942
|
| FeedbackIconColors$1
|
|
@@ -1944,7 +1944,7 @@ type IconProps$1 = {
|
|
|
1944
1944
|
| TextIconColors$1
|
|
1945
1945
|
| BadgeIconColors$1
|
|
1946
1946
|
| 'currentColor'; // currentColor is useful for letting the SVG inherit color property from its container
|
|
1947
|
-
size
|
|
1947
|
+
size?: IconSize$1;
|
|
1948
1948
|
} & StyledPropsBlade$1;
|
|
1949
1949
|
type IconComponent$1 = React.ComponentType<IconProps$1>;
|
|
1950
1950
|
|
|
@@ -5590,8 +5590,8 @@ declare type IconProps = {
|
|
|
5590
5590
|
/**
|
|
5591
5591
|
* Color token (not to be confused with actual hsla value)
|
|
5592
5592
|
*/
|
|
5593
|
-
color
|
|
5594
|
-
size
|
|
5593
|
+
color?: ActionIconColors | SurfaceActionIconColors | FeedbackIconColors | FeedbackActionIconColors | TextIconColors | BadgeIconColors | 'currentColor';
|
|
5594
|
+
size?: IconSize;
|
|
5595
5595
|
} & StyledPropsBlade$1;
|
|
5596
5596
|
declare type IconComponent = React.ComponentType<IconProps>;
|
|
5597
5597
|
|
|
@@ -6016,8 +6016,10 @@ var iconSize$1 = {
|
|
|
6016
6016
|
'2xlarge': size[32]
|
|
6017
6017
|
};
|
|
6018
6018
|
function useIconProps(_ref) {
|
|
6019
|
-
var size = _ref.size,
|
|
6020
|
-
|
|
6019
|
+
var _ref$size = _ref.size,
|
|
6020
|
+
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
6021
|
+
_ref$color = _ref.color,
|
|
6022
|
+
color = _ref$color === void 0 ? 'surface.text.normal.lowContrast' : _ref$color;
|
|
6021
6023
|
var _useTheme = useTheme(),
|
|
6022
6024
|
theme = _useTheme.theme;
|
|
6023
6025
|
var height = makeSize(iconSize$1[size]);
|
|
@@ -18777,6 +18779,7 @@ function _objectSpread$13(target) { for (var i = 1; i < arguments.length; i++) {
|
|
|
18777
18779
|
var Indicators = function Indicators(props) {
|
|
18778
18780
|
var _useCarouselContext = useCarouselContext(),
|
|
18779
18781
|
carouselId = _useCarouselContext.carouselId,
|
|
18782
|
+
isResponsive = _useCarouselContext.isResponsive,
|
|
18780
18783
|
visibleItems = _useCarouselContext.visibleItems;
|
|
18781
18784
|
return /*#__PURE__*/jsx(BaseBox, _objectSpread$13(_objectSpread$13({
|
|
18782
18785
|
display: "flex",
|
|
@@ -18787,7 +18790,6 @@ var Indicators = function Indicators(props) {
|
|
|
18787
18790
|
label: 'Slides'
|
|
18788
18791
|
})), {}, {
|
|
18789
18792
|
children: new Array(props.totalItems).fill(0).map(function (_, idx) {
|
|
18790
|
-
var isResponsive = visibleItems === 'autofit';
|
|
18791
18793
|
var _visibleItems = visibleItems;
|
|
18792
18794
|
if (isResponsive) {
|
|
18793
18795
|
_visibleItems = 1;
|
|
@@ -18948,6 +18950,28 @@ var getCarouselItemId = function getCarouselItemId(containerId, index) {
|
|
|
18948
18950
|
|
|
18949
18951
|
var CAROUSEL_AUTOPLAY_INTERVAL = 6000;
|
|
18950
18952
|
|
|
18953
|
+
/**
|
|
18954
|
+
* Hook to run an effect on dependencies change after the component has *mounted*.
|
|
18955
|
+
* Core difference from `useEffect` is this will trigger effects after the very first render.
|
|
18956
|
+
*
|
|
18957
|
+
* @param effectCallback `useEffect` callback
|
|
18958
|
+
* @param dependencies `useEffect` dependencies
|
|
18959
|
+
*/
|
|
18960
|
+
var useDidUpdate = function useDidUpdate(effectCallback, dependencies) {
|
|
18961
|
+
var isMounted = useRef(false);
|
|
18962
|
+
useEffect(function () {
|
|
18963
|
+
if (isMounted.current) {
|
|
18964
|
+
// run normally after the very first render / mount
|
|
18965
|
+
return effectCallback();
|
|
18966
|
+
}
|
|
18967
|
+
isMounted.current = true;
|
|
18968
|
+
return undefined;
|
|
18969
|
+
|
|
18970
|
+
// we don't want to rerun every time effectCallback changes
|
|
18971
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
18972
|
+
}, dependencies);
|
|
18973
|
+
};
|
|
18974
|
+
|
|
18951
18975
|
function ownKeys$11(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; }
|
|
18952
18976
|
function _objectSpread$10(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$11(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$11(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
18953
18977
|
var Controls = function Controls(_ref) {
|
|
@@ -19023,7 +19047,6 @@ var CarouselContainer = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19023
19047
|
flexWrap: 'nowrap',
|
|
19024
19048
|
scrollSnapType: 'x mandatory',
|
|
19025
19049
|
scrollSnapPointsY: "repeat(100%)",
|
|
19026
|
-
scrollBehavior: 'smooth',
|
|
19027
19050
|
msOverflowStyle: 'none' /* IE and Edge */,
|
|
19028
19051
|
scrollbarWidth: 'none' /* Firefox */,
|
|
19029
19052
|
|
|
@@ -19244,6 +19267,8 @@ var Carousel = function Carousel(_ref4) {
|
|
|
19244
19267
|
|
|
19245
19268
|
// Sync the indicators with scroll
|
|
19246
19269
|
React__default.useEffect(function () {
|
|
19270
|
+
// do not sync indicators on desktop, we are already in sync because we can only use the next/prev buttons
|
|
19271
|
+
if (!isMobile) return;
|
|
19247
19272
|
var carouselContainer = containerRef.current;
|
|
19248
19273
|
if (!carouselContainer) return;
|
|
19249
19274
|
var handleScroll = debounce_1(function () {
|
|
@@ -19272,7 +19297,7 @@ var Carousel = function Carousel(_ref4) {
|
|
|
19272
19297
|
return function () {
|
|
19273
19298
|
carouselContainer === null || carouselContainer === void 0 ? void 0 : carouselContainer.removeEventListener('scroll', handleScroll);
|
|
19274
19299
|
};
|
|
19275
|
-
}, [_visibleItems, isResponsive, shouldAddStartEndSpacing]);
|
|
19300
|
+
}, [_visibleItems, isMobile, isResponsive, shouldAddStartEndSpacing]);
|
|
19276
19301
|
|
|
19277
19302
|
// auto play
|
|
19278
19303
|
useInterval(function () {
|
|
@@ -19284,7 +19309,8 @@ var Carousel = function Carousel(_ref4) {
|
|
|
19284
19309
|
});
|
|
19285
19310
|
var carouselContext = React__default.useMemo(function () {
|
|
19286
19311
|
return {
|
|
19287
|
-
|
|
19312
|
+
isResponsive: isResponsive,
|
|
19313
|
+
visibleItems: _visibleItems,
|
|
19288
19314
|
carouselItemWidth: carouselItemWidth,
|
|
19289
19315
|
carouselContainerRef: containerRef,
|
|
19290
19316
|
setActiveIndicator: setActiveIndicator,
|
|
@@ -19294,8 +19320,8 @@ var Carousel = function Carousel(_ref4) {
|
|
|
19294
19320
|
startEndMargin: startEndMargin,
|
|
19295
19321
|
shouldAddStartEndSpacing: shouldAddStartEndSpacing
|
|
19296
19322
|
};
|
|
19297
|
-
}, [id, startEndMargin,
|
|
19298
|
-
|
|
19323
|
+
}, [id, startEndMargin, isResponsive, _visibleItems, carouselItemWidth, totalNumberOfSlides, activeSlide, shouldAddStartEndSpacing]);
|
|
19324
|
+
useDidUpdate(function () {
|
|
19299
19325
|
onChange === null || onChange === void 0 ? void 0 : onChange(activeSlide);
|
|
19300
19326
|
}, [activeSlide, onChange]);
|
|
19301
19327
|
return /*#__PURE__*/jsx(CarouselContext.Provider, {
|
|
@@ -19398,6 +19424,7 @@ var StyledCarouselItem = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19398
19424
|
componentId: "sc-56ppo3-0"
|
|
19399
19425
|
})(function (_ref) {
|
|
19400
19426
|
var visibleItems = _ref.visibleItems,
|
|
19427
|
+
isResponsive = _ref.isResponsive,
|
|
19401
19428
|
shouldAddStartEndSpacing = _ref.shouldAddStartEndSpacing,
|
|
19402
19429
|
shouldHaveStartSpacing = _ref.shouldHaveStartSpacing,
|
|
19403
19430
|
shouldHaveEndSpacing = _ref.shouldHaveEndSpacing,
|
|
@@ -19407,7 +19434,6 @@ var StyledCarouselItem = /*#__PURE__*/styled(BaseBox).withConfig({
|
|
|
19407
19434
|
}),
|
|
19408
19435
|
matchedDeviceType = _useBreakpoint.matchedDeviceType;
|
|
19409
19436
|
var isMobile = matchedDeviceType === 'mobile';
|
|
19410
|
-
var isResponsive = visibleItems === 'autofit';
|
|
19411
19437
|
var gap = isMobile ? theme.spacing[4] : theme.spacing[5];
|
|
19412
19438
|
var calculatedWidth = "calc(100% / ".concat(visibleItems, " - ").concat(gap, "px * (").concat(visibleItems, " - 1) / ").concat(visibleItems, ")");
|
|
19413
19439
|
return _objectSpread$$({
|
|
@@ -19433,6 +19459,7 @@ var CarouselItem = function CarouselItem(_ref2) {
|
|
|
19433
19459
|
var _useCarouselContext = useCarouselContext(),
|
|
19434
19460
|
totalNumberOfSlides = _useCarouselContext.totalNumberOfSlides,
|
|
19435
19461
|
visibleItems = _useCarouselContext.visibleItems,
|
|
19462
|
+
isResponsive = _useCarouselContext.isResponsive,
|
|
19436
19463
|
carouselItemWidth = _useCarouselContext.carouselItemWidth,
|
|
19437
19464
|
shouldAddStartEndSpacing = _useCarouselContext.shouldAddStartEndSpacing;
|
|
19438
19465
|
var _useTheme = useTheme(),
|
|
@@ -19447,6 +19474,7 @@ var CarouselItem = function CarouselItem(_ref2) {
|
|
|
19447
19474
|
id: id,
|
|
19448
19475
|
isMobile: isMobile,
|
|
19449
19476
|
"data-slide-index": index,
|
|
19477
|
+
isResponsive: isResponsive,
|
|
19450
19478
|
visibleItems: visibleItems,
|
|
19451
19479
|
maxWidth: carouselItemWidth,
|
|
19452
19480
|
shouldAddStartEndSpacing: shouldAddStartEndSpacing,
|
|
@@ -29151,28 +29179,6 @@ var CollapsibleButton = /*#__PURE__*/assignWithoutSideEffects( /*#__PURE__*/forw
|
|
|
29151
29179
|
componentId: MetaConstants.CollapsibleButton
|
|
29152
29180
|
});
|
|
29153
29181
|
|
|
29154
|
-
/**
|
|
29155
|
-
* Hook to run an effect on dependencies change after the component has *mounted*.
|
|
29156
|
-
* Core difference from `useEffect` is this will trigger effects after the very first render.
|
|
29157
|
-
*
|
|
29158
|
-
* @param effectCallback `useEffect` callback
|
|
29159
|
-
* @param dependencies `useEffect` dependencies
|
|
29160
|
-
*/
|
|
29161
|
-
var useDidUpdate = function useDidUpdate(effectCallback, dependencies) {
|
|
29162
|
-
var isMounted = useRef(false);
|
|
29163
|
-
useEffect(function () {
|
|
29164
|
-
if (isMounted.current) {
|
|
29165
|
-
// run normally after the very first render / mount
|
|
29166
|
-
return effectCallback();
|
|
29167
|
-
}
|
|
29168
|
-
isMounted.current = true;
|
|
29169
|
-
return undefined;
|
|
29170
|
-
|
|
29171
|
-
// we don't want to rerun every time effectCallback changes
|
|
29172
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
29173
|
-
}, dependencies);
|
|
29174
|
-
};
|
|
29175
|
-
|
|
29176
29182
|
function ownKeys$6(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; }
|
|
29177
29183
|
function _objectSpread$6(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys$6(Object(source), !0).forEach(function (key) { _defineProperty$1(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys$6(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
29178
29184
|
/**
|