@itcase/ui 1.8.119 → 1.8.121

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.
@@ -30,8 +30,9 @@ require('../../Text_cjs_0EINiUq4.js');
30
30
 
31
31
  function Swiper(props) {
32
32
  var id = props.id, className = props.className, direction = props.direction, title = props.title, titleAfter = props.titleAfter, titleSize = props.titleSize, titleTextColor = props.titleTextColor, titleWeight = props.titleWeight, setNextBtnDisabled = props.setNextBtnDisabled, setPrevBtnDisabled = props.setPrevBtnDisabled, _a = props.activeSlideIndex, activeSlideIndex = _a === void 0 ? 0 : _a, allowTouchMove = props.allowTouchMove, autoHeight = props.autoHeight, breakpoints = props.breakpoints, forwardedRef = props.forwardedRef, // https://github.com/vercel/next.js/issues/4957
33
- freeMode = props.freeMode, items = props.items, keyboard = props.keyboard, loop = props.loop, modules = props.modules, mousewheel = props.mousewheel, nextButton = props.nextButton, normalizeSlideIndex = props.normalizeSlideIndex, pagination = props.pagination, prevButton = props.prevButton, preventClicks = props.preventClicks, preventClicksPropagation = props.preventClicksPropagation, simulateTouch = props.simulateTouch, slidesPerView = props.slidesPerView, spaceBetween = props.spaceBetween, speed = props.speed, swiperClass = props.swiperClass, swiperSlideClass = props.swiperSlideClass, isChangeOnClickSlide = props.isChangeOnClickSlide, isInit = props.isInit, _b = props.isNavigation, isNavigation = _b === void 0 ? false : _b, isScrollbar = props.isScrollbar, set = props.set, onSlideNextTransitionEnd = props.onSlideNextTransitionEnd, onSlidePrevTransitionEnd = props.onSlidePrevTransitionEnd, onSwiper = props.onSwiper, onUpdate = props.onUpdate, children = props.children;
33
+ freeMode = props.freeMode, items = props.items, keyboard = props.keyboard, loop = props.loop, modules = props.modules, mousewheel = props.mousewheel, nextButton = props.nextButton, normalizeSlideIndex = props.normalizeSlideIndex, pagination = props.pagination, prevButton = props.prevButton, preventClicks = props.preventClicks, preventClicksPropagation = props.preventClicksPropagation, set = props.set, simulateTouch = props.simulateTouch, slidesPerView = props.slidesPerView, spaceBetween = props.spaceBetween, speed = props.speed, swiperClass = props.swiperClass, swiperSlideClass = props.swiperSlideClass, isChangeOnClickSlide = props.isChangeOnClickSlide, isInit = props.isInit, _b = props.isNavigation, isNavigation = _b === void 0 ? false : _b, isScrollbar = props.isScrollbar, onSlideNextTransitionEnd = props.onSlideNextTransitionEnd, onSlidePrevTransitionEnd = props.onSlidePrevTransitionEnd, onSwiper = props.onSwiper, onUpdate = props.onUpdate, children = props.children;
34
34
  var swiperRef = React.useRef(null);
35
+ var isMountedRef = React.useRef(false);
35
36
  var _c = useSwiperRef(), nextEl = _c[0], nextRef = _c[1];
36
37
  var _d = useSwiperRef(), prevEl = _d[0], prevRef = _d[1];
37
38
  var isLoop = loop !== null && loop !== void 0 ? loop : true;
@@ -60,16 +61,21 @@ function Swiper(props) {
60
61
  React.useImperativeHandle(forwardedRef, function () { return swiperRef.current; }, []);
61
62
  React.useEffect(function () {
62
63
  var _a;
63
- var swiperInstance = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper;
64
- // @ts-expect-error
65
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateActiveIndex(activeSlideIndex);
66
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateSlidesClasses();
64
+ if (isMountedRef.current) {
65
+ var swiperInstance = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper;
66
+ // @ts-expect-error
67
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateActiveIndex(activeSlideIndex);
68
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateSlidesClasses();
69
+ }
70
+ else {
71
+ isMountedRef.current = true;
72
+ }
67
73
  }, [activeSlideIndex]);
68
74
  var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
69
75
  var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, shapeClass = propsGenerator.shapeClass;
70
76
  // @ts-expect-error
71
77
  var style = useStyles.useStyles(props).styles;
72
- return (jsxRuntime.jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass && "fill_".concat(fillClass), shapeClass && "swiper_shape_".concat(shapeClass), className, set && "swiper-block_set_".concat(set)), style: style, children: [(title || (prevButton && nextButton)) && (jsxRuntime.jsxs("div", { className: "swiper-block__wrapper", children: [title && (jsxRuntime.jsx(Icon.Title, { className: "swiper-block__title", size: titleSize, textColor: titleTextColor, textWeight: titleWeight, children: title })), titleAfter, prevButton && nextButton && (jsxRuntime.jsxs("div", { className: "swiper-block__navigation", children: [jsxRuntime.jsx("div", { className: "swiper-block__prev swiper-button", ref: prevRef, children: prevButton }), jsxRuntime.jsx("div", { className: "swiper-block__next swiper-button", ref: nextRef, children: nextButton })] }))] })), jsxRuntime.jsx(react.Swiper, { className: clsx('swiper-block__swiper', swiperClass), direction: direction, allowTouchMove: allowTouchMove, autoHeight: autoHeight !== null && autoHeight !== void 0 ? autoHeight : false, breakpoints: breakpoints, centeredSlides: true, freeMode: freeMode, init: isInit !== null && isInit !== void 0 ? isInit : true, keyboard: keyboard, loop: isLoop, modules: modules, mousewheel: mousewheel, navigation: isNavigation ? { nextEl: nextEl, prevEl: prevEl } : false, normalizeSlideIndex: normalizeSlideIndex, pagination: pagination, preventClicks: preventClicks, preventClicksPropagation: preventClicksPropagation, ref: swiperRef, scrollbar: isScrollbar, simulateTouch: simulateTouch, slidesPerView: slidesPerView, spaceBetween: spaceBetween, speed: speed !== null && speed !== void 0 ? speed : 500, onInit: onInitSwiper, onSlideChange: onSlideChange, onSlideNextTransitionEnd: onSlideNextTransitionEnd, onSlidePrevTransitionEnd: onSlidePrevTransitionEnd, onSwiper: onSwiper, onTransitionStart: onTransitionStart, onUpdate: onUpdate, children: children ||
78
+ return (jsxRuntime.jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass && "fill_".concat(fillClass), shapeClass && "swiper_shape_".concat(shapeClass), className, set && "swiper-block_set_".concat(set)), style: style, children: [(title || (prevButton && nextButton)) && (jsxRuntime.jsxs("div", { className: "swiper-block__wrapper", children: [title && (jsxRuntime.jsx(Icon.Title, { className: "swiper-block__title", size: titleSize, textColor: titleTextColor, textWeight: titleWeight, children: title })), titleAfter, prevButton && nextButton && (jsxRuntime.jsxs("div", { className: "swiper-block__navigation", children: [jsxRuntime.jsx("div", { className: "swiper-block__prev swiper-button", ref: prevRef, children: prevButton }), jsxRuntime.jsx("div", { className: "swiper-block__next swiper-button", ref: nextRef, children: nextButton })] }))] })), jsxRuntime.jsx(react.Swiper, { className: clsx('swiper-block__swiper', swiperClass), ref: swiperRef, direction: direction, allowTouchMove: allowTouchMove, autoHeight: autoHeight !== null && autoHeight !== void 0 ? autoHeight : false, breakpoints: breakpoints, centeredSlides: true, freeMode: freeMode, init: isInit !== null && isInit !== void 0 ? isInit : true, keyboard: keyboard, loop: isLoop, modules: modules, mousewheel: mousewheel, navigation: isNavigation ? { nextEl: nextEl, prevEl: prevEl } : false, normalizeSlideIndex: normalizeSlideIndex, pagination: pagination, preventClicks: preventClicks, preventClicksPropagation: preventClicksPropagation, scrollbar: isScrollbar, simulateTouch: simulateTouch, slidesPerView: slidesPerView, spaceBetween: spaceBetween, speed: speed !== null && speed !== void 0 ? speed : 500, onInit: onInitSwiper, onSlideChange: onSlideChange, onSlideNextTransitionEnd: onSlideNextTransitionEnd, onSlidePrevTransitionEnd: onSlidePrevTransitionEnd, onSwiper: onSwiper, onTransitionStart: onTransitionStart, onUpdate: onUpdate, children: children ||
73
79
  (items === null || items === void 0 ? void 0 : items.map(function (item, i) { return (jsxRuntime.jsx(react.SwiperSlide, { className: clsx('swiper-block__item', swiperSlideClass, alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass)), children: item }, "swiper-slide_".concat(i))); })) })] }));
74
80
  }
75
81
  // https://github.com/nolimits4web/swiper/issues/3855#issuecomment-1050694342
@@ -25,9 +25,9 @@ require('lodash/maxBy');
25
25
  var switchAppearanceDefault = {
26
26
  defaultPrimary: {
27
27
  fill: 'surfaceTertiary',
28
- fillActive: 'successPrimary',
29
- fillToggle: 'surfaceItemInverse',
30
- fillToggleActive: 'surfaceItemInverse',
28
+ fillActive: 'successTertiary',
29
+ fillToggle: 'surfaceItemSecondary',
30
+ fillToggleActive: 'accentItemSecondary',
31
31
  titleTextColor: 'surfaceTextPrimary',
32
32
  descTextColor: 'surfaceTextPrimary',
33
33
  },
@@ -17,7 +17,7 @@ var styleAttributes = [
17
17
  /**
18
18
  * Shadow
19
19
  */
20
- 'elevation', 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
20
+ 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
21
21
  /**
22
22
  * Transform
23
23
  */
@@ -28,8 +28,9 @@ import '../Text_es_CwV9rjFD.js';
28
28
 
29
29
  function Swiper(props) {
30
30
  var id = props.id, className = props.className, direction = props.direction, title = props.title, titleAfter = props.titleAfter, titleSize = props.titleSize, titleTextColor = props.titleTextColor, titleWeight = props.titleWeight, setNextBtnDisabled = props.setNextBtnDisabled, setPrevBtnDisabled = props.setPrevBtnDisabled, _a = props.activeSlideIndex, activeSlideIndex = _a === void 0 ? 0 : _a, allowTouchMove = props.allowTouchMove, autoHeight = props.autoHeight, breakpoints = props.breakpoints, forwardedRef = props.forwardedRef, // https://github.com/vercel/next.js/issues/4957
31
- freeMode = props.freeMode, items = props.items, keyboard = props.keyboard, loop = props.loop, modules = props.modules, mousewheel = props.mousewheel, nextButton = props.nextButton, normalizeSlideIndex = props.normalizeSlideIndex, pagination = props.pagination, prevButton = props.prevButton, preventClicks = props.preventClicks, preventClicksPropagation = props.preventClicksPropagation, simulateTouch = props.simulateTouch, slidesPerView = props.slidesPerView, spaceBetween = props.spaceBetween, speed = props.speed, swiperClass = props.swiperClass, swiperSlideClass = props.swiperSlideClass, isChangeOnClickSlide = props.isChangeOnClickSlide, isInit = props.isInit, _b = props.isNavigation, isNavigation = _b === void 0 ? false : _b, isScrollbar = props.isScrollbar, set = props.set, onSlideNextTransitionEnd = props.onSlideNextTransitionEnd, onSlidePrevTransitionEnd = props.onSlidePrevTransitionEnd, onSwiper = props.onSwiper, onUpdate = props.onUpdate, children = props.children;
31
+ freeMode = props.freeMode, items = props.items, keyboard = props.keyboard, loop = props.loop, modules = props.modules, mousewheel = props.mousewheel, nextButton = props.nextButton, normalizeSlideIndex = props.normalizeSlideIndex, pagination = props.pagination, prevButton = props.prevButton, preventClicks = props.preventClicks, preventClicksPropagation = props.preventClicksPropagation, set = props.set, simulateTouch = props.simulateTouch, slidesPerView = props.slidesPerView, spaceBetween = props.spaceBetween, speed = props.speed, swiperClass = props.swiperClass, swiperSlideClass = props.swiperSlideClass, isChangeOnClickSlide = props.isChangeOnClickSlide, isInit = props.isInit, _b = props.isNavigation, isNavigation = _b === void 0 ? false : _b, isScrollbar = props.isScrollbar, onSlideNextTransitionEnd = props.onSlideNextTransitionEnd, onSlidePrevTransitionEnd = props.onSlidePrevTransitionEnd, onSwiper = props.onSwiper, onUpdate = props.onUpdate, children = props.children;
32
32
  var swiperRef = useRef(null);
33
+ var isMountedRef = useRef(false);
33
34
  var _c = useSwiperRef(), nextEl = _c[0], nextRef = _c[1];
34
35
  var _d = useSwiperRef(), prevEl = _d[0], prevRef = _d[1];
35
36
  var isLoop = loop !== null && loop !== void 0 ? loop : true;
@@ -58,16 +59,21 @@ function Swiper(props) {
58
59
  useImperativeHandle(forwardedRef, function () { return swiperRef.current; }, []);
59
60
  useEffect(function () {
60
61
  var _a;
61
- var swiperInstance = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper;
62
- // @ts-expect-error
63
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateActiveIndex(activeSlideIndex);
64
- swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateSlidesClasses();
62
+ if (isMountedRef.current) {
63
+ var swiperInstance = (_a = swiperRef.current) === null || _a === void 0 ? void 0 : _a.swiper;
64
+ // @ts-expect-error
65
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateActiveIndex(activeSlideIndex);
66
+ swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.updateSlidesClasses();
67
+ }
68
+ else {
69
+ isMountedRef.current = true;
70
+ }
65
71
  }, [activeSlideIndex]);
66
72
  var propsGenerator = useDevicePropsGenerator(props);
67
73
  var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, shapeClass = propsGenerator.shapeClass;
68
74
  // @ts-expect-error
69
75
  var style = useStyles(props).styles;
70
- return (jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass && "fill_".concat(fillClass), shapeClass && "swiper_shape_".concat(shapeClass), className, set && "swiper-block_set_".concat(set)), style: style, children: [(title || (prevButton && nextButton)) && (jsxs("div", { className: "swiper-block__wrapper", children: [title && (jsx(Title, { className: "swiper-block__title", size: titleSize, textColor: titleTextColor, textWeight: titleWeight, children: title })), titleAfter, prevButton && nextButton && (jsxs("div", { className: "swiper-block__navigation", children: [jsx("div", { className: "swiper-block__prev swiper-button", ref: prevRef, children: prevButton }), jsx("div", { className: "swiper-block__next swiper-button", ref: nextRef, children: nextButton })] }))] })), jsx(Swiper$1, { className: clsx('swiper-block__swiper', swiperClass), direction: direction, allowTouchMove: allowTouchMove, autoHeight: autoHeight !== null && autoHeight !== void 0 ? autoHeight : false, breakpoints: breakpoints, centeredSlides: true, freeMode: freeMode, init: isInit !== null && isInit !== void 0 ? isInit : true, keyboard: keyboard, loop: isLoop, modules: modules, mousewheel: mousewheel, navigation: isNavigation ? { nextEl: nextEl, prevEl: prevEl } : false, normalizeSlideIndex: normalizeSlideIndex, pagination: pagination, preventClicks: preventClicks, preventClicksPropagation: preventClicksPropagation, ref: swiperRef, scrollbar: isScrollbar, simulateTouch: simulateTouch, slidesPerView: slidesPerView, spaceBetween: spaceBetween, speed: speed !== null && speed !== void 0 ? speed : 500, onInit: onInitSwiper, onSlideChange: onSlideChange, onSlideNextTransitionEnd: onSlideNextTransitionEnd, onSlidePrevTransitionEnd: onSlidePrevTransitionEnd, onSwiper: onSwiper, onTransitionStart: onTransitionStart, onUpdate: onUpdate, children: children ||
76
+ return (jsxs("div", { id: id, className: clsx('swiper-block', slidesPerView === 'auto' && 'swiper-block_type_auto', fillClass && "fill_".concat(fillClass), shapeClass && "swiper_shape_".concat(shapeClass), className, set && "swiper-block_set_".concat(set)), style: style, children: [(title || (prevButton && nextButton)) && (jsxs("div", { className: "swiper-block__wrapper", children: [title && (jsx(Title, { className: "swiper-block__title", size: titleSize, textColor: titleTextColor, textWeight: titleWeight, children: title })), titleAfter, prevButton && nextButton && (jsxs("div", { className: "swiper-block__navigation", children: [jsx("div", { className: "swiper-block__prev swiper-button", ref: prevRef, children: prevButton }), jsx("div", { className: "swiper-block__next swiper-button", ref: nextRef, children: nextButton })] }))] })), jsx(Swiper$1, { className: clsx('swiper-block__swiper', swiperClass), ref: swiperRef, direction: direction, allowTouchMove: allowTouchMove, autoHeight: autoHeight !== null && autoHeight !== void 0 ? autoHeight : false, breakpoints: breakpoints, centeredSlides: true, freeMode: freeMode, init: isInit !== null && isInit !== void 0 ? isInit : true, keyboard: keyboard, loop: isLoop, modules: modules, mousewheel: mousewheel, navigation: isNavigation ? { nextEl: nextEl, prevEl: prevEl } : false, normalizeSlideIndex: normalizeSlideIndex, pagination: pagination, preventClicks: preventClicks, preventClicksPropagation: preventClicksPropagation, scrollbar: isScrollbar, simulateTouch: simulateTouch, slidesPerView: slidesPerView, spaceBetween: spaceBetween, speed: speed !== null && speed !== void 0 ? speed : 500, onInit: onInitSwiper, onSlideChange: onSlideChange, onSlideNextTransitionEnd: onSlideNextTransitionEnd, onSlidePrevTransitionEnd: onSlidePrevTransitionEnd, onSwiper: onSwiper, onTransitionStart: onTransitionStart, onUpdate: onUpdate, children: children ||
71
77
  (items === null || items === void 0 ? void 0 : items.map(function (item, i) { return (jsx(SwiperSlide, { className: clsx('swiper-block__item', swiperSlideClass, alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass)), children: item }, "swiper-slide_".concat(i))); })) })] }));
72
78
  }
73
79
  // https://github.com/nolimits4web/swiper/issues/3855#issuecomment-1050694342
@@ -23,9 +23,9 @@ import 'lodash/maxBy';
23
23
  var switchAppearanceDefault = {
24
24
  defaultPrimary: {
25
25
  fill: 'surfaceTertiary',
26
- fillActive: 'successPrimary',
27
- fillToggle: 'surfaceItemInverse',
28
- fillToggleActive: 'surfaceItemInverse',
26
+ fillActive: 'successTertiary',
27
+ fillToggle: 'surfaceItemSecondary',
28
+ fillToggleActive: 'accentItemSecondary',
29
29
  titleTextColor: 'surfaceTextPrimary',
30
30
  descTextColor: 'surfaceTextPrimary',
31
31
  },
@@ -188,7 +188,7 @@
188
188
  }
189
189
 
190
190
  .group {
191
- &_wrap {
191
+ &&_wrap {
192
192
  @each $val in nowrap, wrap, wrap-reverse {
193
193
  &_$(val) {
194
194
  flex-wrap: $(val);
@@ -13,7 +13,7 @@ var styleAttributes = [
13
13
  /**
14
14
  * Shadow
15
15
  */
16
- 'elevation', 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
16
+ 'shadowColor', 'shadowOffset', 'shadowOpacity', 'shadowRadius',
17
17
  /**
18
18
  * Transform
19
19
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@itcase/ui",
3
- "version": "1.8.119",
3
+ "version": "1.8.121",
4
4
  "description": "UI components (Modal, Loader, Popup, etc)",
5
5
  "keywords": [
6
6
  "Modal",
@@ -103,7 +103,7 @@
103
103
  "@emotion/is-prop-valid": "^1.3.1",
104
104
  "@itcase/common": "^1.2.29",
105
105
  "@itcase/icons": "^1.2.19",
106
- "@itcase/storybook-config": "^1.2.1",
106
+ "@itcase/storybook-config": "^1.2.5",
107
107
  "@itcase/tokens-am": "^1.1.19",
108
108
  "@itcase/tokens-baikal": "^1.1.17",
109
109
  "@itcase/tokens-palette": "^1.1.11",
@@ -139,9 +139,9 @@
139
139
  "@babel/preset-react": "^7.27.1",
140
140
  "@commitlint/cli": "^19.8.1",
141
141
  "@commitlint/config-conventional": "^19.8.1",
142
- "@itcase/config": "^1.0.56",
143
- "@itcase/lint": "^1.1.47",
144
- "@itcase/types": "^1.0.43",
142
+ "@itcase/config": "^1.0.57",
143
+ "@itcase/lint": "^1.1.48",
144
+ "@itcase/types": "^1.0.45",
145
145
  "@rollup/plugin-alias": "^5.1.1",
146
146
  "@rollup/plugin-babel": "^6.0.4",
147
147
  "@rollup/plugin-commonjs": "^28.0.6",
@@ -168,16 +168,16 @@
168
168
  "conventional-changelog-conventionalcommits": "^9.1.0",
169
169
  "eslint": "9.34.0",
170
170
  "husky": "^9.1.7",
171
- "lint-staged": "^16.1.5",
171
+ "lint-staged": "^16.1.6",
172
172
  "prettier": "^3.6.2",
173
173
  "react-docgen-typescript": "^2.4.0",
174
- "rollup": "^4.49.0",
174
+ "rollup": "^4.50.0",
175
175
  "rollup-plugin-copy": "^3.5.0",
176
176
  "rollup-plugin-dts": "^6.2.3",
177
177
  "rollup-plugin-peer-deps-external": "^2.2.4",
178
178
  "rollup-preserve-directives": "^1.1.3",
179
179
  "semantic-release": "^24.2.7",
180
- "storybook": "^9.1.3",
180
+ "storybook": "^9.1.4",
181
181
  "stylelint": "^16.23.1",
182
182
  "typescript": "^5.9.2"
183
183
  }