@salutejs/plasma-new-hope 0.326.0-canary.2013.15518408913.0 → 0.326.0-canary.2013.15538813402.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.
Files changed (101) hide show
  1. package/cjs/components/Carousel/CarouselNew/Carousel.css +40 -9
  2. package/cjs/components/Carousel/CarouselNew/Carousel.js +46 -31
  3. package/cjs/components/Carousel/CarouselNew/Carousel.js.map +1 -1
  4. package/cjs/components/Carousel/CarouselNew/Carousel.styles.js +43 -2
  5. package/cjs/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -1
  6. package/cjs/components/Carousel/CarouselNew/Carousel.styles_1fs4wwn.css +5 -0
  7. package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  8. package/cjs/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -1
  9. package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  10. package/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -1
  11. package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.css +5 -5
  12. package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +1 -1
  13. package/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js.map +1 -1
  14. package/cjs/components/Carousel/CarouselNew/ui/Dots/{Dots.styles_1i4srxq.css → Dots.styles_ea836d.css} +1 -1
  15. package/cjs/components/DatePicker/SingleDate/SingleDate.js +12 -3
  16. package/cjs/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  17. package/cjs/components/Sheet/hooks/useOverflow.js +2 -1
  18. package/cjs/components/Sheet/hooks/useOverflow.js.map +1 -1
  19. package/cjs/index.css +10 -9
  20. package/emotion/cjs/components/Carousel/CarouselNew/Carousel.js +48 -35
  21. package/emotion/cjs/components/Carousel/CarouselNew/Carousel.styles.js +39 -31
  22. package/emotion/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  23. package/emotion/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  24. package/emotion/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +9 -9
  25. package/emotion/cjs/components/DatePicker/SingleDate/SingleDate.js +12 -3
  26. package/emotion/cjs/components/Sheet/hooks/useOverflow.js +2 -1
  27. package/emotion/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +9 -20
  28. package/emotion/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +12 -3
  29. package/emotion/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +11 -3
  30. package/emotion/es/components/Carousel/CarouselNew/Carousel.js +47 -37
  31. package/emotion/es/components/Carousel/CarouselNew/Carousel.styles.js +38 -30
  32. package/emotion/es/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  33. package/emotion/es/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  34. package/emotion/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +9 -9
  35. package/emotion/es/components/DatePicker/SingleDate/SingleDate.js +12 -3
  36. package/emotion/es/components/Sheet/hooks/useOverflow.js +2 -1
  37. package/emotion/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +9 -20
  38. package/emotion/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +12 -3
  39. package/emotion/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +11 -3
  40. package/es/components/Carousel/CarouselNew/Carousel.css +40 -9
  41. package/es/components/Carousel/CarouselNew/Carousel.js +48 -33
  42. package/es/components/Carousel/CarouselNew/Carousel.js.map +1 -1
  43. package/es/components/Carousel/CarouselNew/Carousel.styles.js +39 -3
  44. package/es/components/Carousel/CarouselNew/Carousel.styles.js.map +1 -1
  45. package/es/components/Carousel/CarouselNew/Carousel.styles_1fs4wwn.css +5 -0
  46. package/es/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  47. package/es/components/Carousel/CarouselNew/Carousel.tokens.js.map +1 -1
  48. package/es/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  49. package/es/components/Carousel/CarouselNew/hooks/useCarousel.js.map +1 -1
  50. package/es/components/Carousel/CarouselNew/ui/Dots/Dots.css +5 -5
  51. package/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +1 -1
  52. package/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js.map +1 -1
  53. package/es/components/Carousel/CarouselNew/ui/Dots/{Dots.styles_1i4srxq.css → Dots.styles_ea836d.css} +1 -1
  54. package/es/components/DatePicker/SingleDate/SingleDate.js +12 -3
  55. package/es/components/DatePicker/SingleDate/SingleDate.js.map +1 -1
  56. package/es/components/Sheet/hooks/useOverflow.js +2 -1
  57. package/es/components/Sheet/hooks/useOverflow.js.map +1 -1
  58. package/es/index.css +10 -9
  59. package/package.json +5 -5
  60. package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.js +48 -35
  61. package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.styles.js +19 -20
  62. package/styled-components/cjs/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  63. package/styled-components/cjs/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  64. package/styled-components/cjs/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +1 -1
  65. package/styled-components/cjs/components/DatePicker/SingleDate/SingleDate.js +12 -3
  66. package/styled-components/cjs/components/Sheet/hooks/useOverflow.js +2 -1
  67. package/styled-components/cjs/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +9 -20
  68. package/styled-components/cjs/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +12 -3
  69. package/styled-components/cjs/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +11 -3
  70. package/styled-components/es/components/Carousel/CarouselNew/Carousel.js +47 -37
  71. package/styled-components/es/components/Carousel/CarouselNew/Carousel.styles.js +18 -19
  72. package/styled-components/es/components/Carousel/CarouselNew/Carousel.tokens.js +2 -1
  73. package/styled-components/es/components/Carousel/CarouselNew/hooks/useCarousel.js +1 -1
  74. package/styled-components/es/components/Carousel/CarouselNew/ui/Dots/Dots.styles.js +1 -1
  75. package/styled-components/es/components/DatePicker/SingleDate/SingleDate.js +12 -3
  76. package/styled-components/es/components/Sheet/hooks/useOverflow.js +2 -1
  77. package/styled-components/es/examples/plasma_b2c/components/Carousel/Carousel.stories.tsx +9 -20
  78. package/styled-components/es/examples/plasma_b2c/components/DatePicker/DatePicker.stories.tsx +12 -3
  79. package/styled-components/es/examples/plasma_web/components/DatePicker/DatePicker.stories.tsx +11 -3
  80. package/types/components/Carousel/CarouselNew/Carousel.d.ts +2 -8
  81. package/types/components/Carousel/CarouselNew/Carousel.d.ts.map +1 -1
  82. package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts +88 -9
  83. package/types/components/Carousel/CarouselNew/Carousel.styles.d.ts.map +1 -1
  84. package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts +1 -0
  85. package/types/components/Carousel/CarouselNew/Carousel.tokens.d.ts.map +1 -1
  86. package/types/components/Carousel/CarouselNew/Carousel.types.d.ts +7 -52
  87. package/types/components/Carousel/CarouselNew/Carousel.types.d.ts.map +1 -1
  88. package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts +8 -4
  89. package/types/components/Carousel/CarouselNew/hooks/useCarousel.d.ts.map +1 -1
  90. package/types/components/Carousel/CarouselNew/ui/Dots/Dots.styles.d.ts.map +1 -1
  91. package/types/components/DatePicker/RangeDate/RangeDate.d.ts +0 -2
  92. package/types/components/DatePicker/RangeDate/RangeDate.d.ts.map +1 -1
  93. package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts +0 -4
  94. package/types/components/DatePicker/RangeDate/RangeDate.types.d.ts.map +1 -1
  95. package/types/components/DatePicker/SingleDate/SingleDate.d.ts +3 -3
  96. package/types/components/DatePicker/SingleDate/SingleDate.d.ts.map +1 -1
  97. package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts +4 -0
  98. package/types/components/DatePicker/SingleDate/SingleDate.types.d.ts.map +1 -1
  99. package/types/components/Sheet/hooks/useOverflow.d.ts.map +1 -1
  100. package/cjs/components/Carousel/CarouselNew/Carousel.styles_1gx7oht.css +0 -4
  101. package/es/components/Carousel/CarouselNew/Carousel.styles_1gx7oht.css +0 -4
@@ -1,24 +1,23 @@
1
1
  import styled from 'styled-components';
2
2
  import { css } from 'styled-components';
3
- export var base = /*#__PURE__*/css(["position:relative;padding:20px 0;border-top:2px solid #ff000038;&:before{content:'';position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;background:#ff000038;}"]);
4
-
5
- /**
6
- * Компонент применяется, если требуется компенсировать отступы контейнера в сетке.
7
- * При обертывании вокруг ``Carousel``, добавляет карусели и ее прокрутке дополнительные отступы.
8
- * Стилизованный компонент, обладающий всеми свойствами ``div``.
9
- */
10
- export var CarouselGridWrapper = /*#__PURE__*/styled.div.withConfig({
11
- componentId: "plasma-new-hope__sc-vln28v-0"
12
- })(["overflow:hidden;margin-left:calc(var(--plasma-grid-margin) * -1);margin-right:calc(var(--plasma-grid-margin) * -1);"]);
3
+ import { component, mergeConfig } from "../../../engines";
4
+ import { iconButtonConfig, iconButtonTokens } from "../../IconButton";
5
+ import { classes } from "./Carousel.tokens";
6
+ var mergedConfig = /*#__PURE__*/mergeConfig(iconButtonConfig);
7
+ export var IconButtonComponent = /*#__PURE__*/component(mergedConfig);
8
+ export var base = /*#__PURE__*/css(["position:relative;"]);
13
9
  export var CarouselWrapper = /*#__PURE__*/styled.div.withConfig({
14
- componentId: "plasma-new-hope__sc-vln28v-1"
15
- })(["position:relative;margin:0;padding:0;list-style:none;-ms-overflow-style:none;scrollbar-width:none;::-webkit-scrollbar{display:none;}overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:", ";", " &{scroll-padding:0 var(--plasma-grid-margin);padding-left:var(--plasma-grid-margin);}user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);"], function (_ref) {
16
- var scrollSnapType = _ref.scrollSnapType;
17
- return "x ".concat(scrollSnapType);
18
- }, CarouselGridWrapper);
10
+ componentId: "plasma-new-hope__sc-vln28v-0"
11
+ })(["position:relative;margin:0;padding:0;list-style:none;-ms-overflow-style:none;scrollbar-width:none;::-webkit-scrollbar{display:none;}overflow-x:auto;overflow-y:hidden;scroll-behavior:smooth;scroll-snap-type:x mandatory;user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0);"]);
19
12
  export var CarouselTrack = /*#__PURE__*/styled.div.withConfig({
20
- componentId: "plasma-new-hope__sc-vln28v-2"
21
- })(["display:inline-flex;flex-direction:row;gap:", ";"], function (_ref2) {
22
- var gap = _ref2.gap;
13
+ componentId: "plasma-new-hope__sc-vln28v-1"
14
+ })(["display:inline-flex;flex-direction:row;gap:", ";"], function (_ref) {
15
+ var gap = _ref.gap;
23
16
  return gap || 0;
24
- });
17
+ });
18
+ export var IconButton = /*#__PURE__*/styled(IconButtonComponent).withConfig({
19
+ componentId: "plasma-new-hope__sc-vln28v-2"
20
+ })(["position:absolute;top:50%;transform:translateY(-50%);left:0.75rem;z-index:10;", ":var(--text-primary);", ":var(--surface-transparent-secondary);", ":var(", ");", ":var(--surface-transparent-secondary-hover);", ":var(--surface-transparent-secondary-active);", ":2.5rem;", ":2.5rem;", ":1rem;", ":0.625rem;&.", "{left:auto;right:0.75rem;}"], iconButtonTokens.iconButtonColor, iconButtonTokens.iconButtonBackgroundColor, iconButtonTokens.iconButtonLoadingBackgroundColor, iconButtonTokens.iconButtonBackgroundColor, iconButtonTokens.iconButtonBackgroundColorHover, iconButtonTokens.iconButtonBackgroundColorActive, iconButtonTokens.iconButtonHeight, iconButtonTokens.iconButtonWidth, iconButtonTokens.iconButtonPadding, iconButtonTokens.iconButtonRadius, classes.rightControlButton);
21
+ export var ControlsWrapper = /*#__PURE__*/styled.div.withConfig({
22
+ componentId: "plasma-new-hope__sc-vln28v-3"
23
+ })(["position:relative;"]);
@@ -7,7 +7,8 @@ export var classes = {
7
7
  temporaryNatural: 'dot-temporary-natural',
8
8
  shrinking: 'dot-shrinking',
9
9
  availableDotsLeft: 'dot-available-dots-left',
10
- availableDotsRight: 'dot-available-dots-right'
10
+ availableDotsRight: 'dot-available-dots-right',
11
+ rightControlButton: 'carousel-right-control-button'
11
12
  };
12
13
  export var tokens = {
13
14
  paginationDotBackground: '--plasma-carousel-pagination-dot-background',
@@ -226,13 +226,13 @@ var THROTTLE_DEFAULT_MS = 100;
226
226
  var DEBOUNCE_DEFAULT_MS = 150;
227
227
  export var useCarousel = function useCarousel(_ref4) {
228
228
  var index = _ref4.index,
229
+ onIndexChange = _ref4.onIndexChange,
229
230
  _ref4$detectActive = _ref4.detectActive,
230
231
  detectActive = _ref4$detectActive === void 0 ? false : _ref4$detectActive,
231
232
  _ref4$detectThreshold = _ref4.detectThreshold,
232
233
  detectThreshold = _ref4$detectThreshold === void 0 ? 0.5 : _ref4$detectThreshold,
233
234
  _ref4$scrollAlign = _ref4.scrollAlign,
234
235
  scrollAlign = _ref4$scrollAlign === void 0 ? 'center' : _ref4$scrollAlign,
235
- onIndexChange = _ref4.onIndexChange,
236
236
  _ref4$throttleMs = _ref4.throttleMs,
237
237
  throttleMs = _ref4$throttleMs === void 0 ? THROTTLE_DEFAULT_MS : _ref4$throttleMs,
238
238
  _ref4$debounceMs = _ref4.debounceMs,
@@ -2,7 +2,7 @@ import styled from 'styled-components';
2
2
  import { classes, tokens } from "../../Carousel.tokens";
3
3
  export var Wrapper = /*#__PURE__*/styled.div.withConfig({
4
4
  componentId: "plasma-new-hope__sc-feybgn-0"
5
- })(["display:flex;align-items:center;justify-content:center;--duration:0.3s;--half-duration:0.15s;"]);
5
+ })(["display:flex;align-items:center;justify-content:center;margin-top:0.75rem;--duration:0.3s;--half-duration:0.15s;"]);
6
6
  export var TransitionWrapper = /*#__PURE__*/styled.div.withConfig({
7
7
  componentId: "plasma-new-hope__sc-feybgn-1"
8
8
  })(["position:relative;display:flex;transition:transform 0s ease;&.", "{transition:transform var(--duration) ease;}& .", "{width:0.5rem;height:0.5rem;margin:0 0.25rem;cursor:pointer;background-color:var(", ");border-radius:100%;&.", "{background-color:var(", ");}@keyframes fadeOut{from{transform:scale(0.75);opacity:1;}to{transform:scale(0);opacity:0;}}&.", "{animation:fadeOut var(--half-duration) ease forwards;}@keyframes shrinking{from{transform:scale(1);}to{transform:scale(0.75);}}&.", "{animation:shrinking var(--half-duration) var(--half-duration) ease forwards;}}"], classes.animating, classes.dot, tokens.paginationDotBackground, classes.active, tokens.paginationDotActiveBackground, classes.animateOut, classes.shrinking);
@@ -1,5 +1,5 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- var _excluded = ["className", "opened", "value", "label", "labelPlacement", "keepPlaceholder", "required", "requiredPlacement", "hasRequiredIndicator", "placeholder", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "view", "size", "readOnly", "disabled", "name", "defaultDate", "valueError", "valueSuccess", "format", "lang", "maskWithFormat", "min", "max", "renderFromDate", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "frame", "usePortal", "placement", "closeOnOverlayClick", "closeOnEsc", "offset", "calendarContainerWidth", "calendarContainerHeight", "stretched", "onChangeValue", "onCommitDate", "onToggle", "onFocus", "onBlur", "onChange", "autoComplete"];
2
+ var _excluded = ["className", "opened", "value", "label", "labelPlacement", "keepPlaceholder", "required", "requiredPlacement", "hasRequiredIndicator", "placeholder", "leftHelper", "contentLeft", "contentRight", "textBefore", "textAfter", "view", "size", "readOnly", "disabled", "name", "defaultDate", "valueError", "valueSuccess", "format", "lang", "maskWithFormat", "min", "max", "renderFromDate", "includeEdgeDates", "eventList", "disabledList", "eventMonthList", "disabledMonthList", "eventQuarterList", "disabledQuarterList", "eventYearList", "disabledYearList", "type", "frame", "usePortal", "placement", "closeOnOverlayClick", "closeOnEsc", "closeAfterDateSelect", "offset", "calendarContainerWidth", "calendarContainerHeight", "stretched", "onChangeValue", "onCommitDate", "onToggle", "onFocus", "onBlur", "onChange", "autoComplete"];
3
3
  function _extends() { return _extends = Object.assign ? Object.assign.bind() : function (n) { for (var e = 1; e < arguments.length; e++) { var t = arguments[e]; for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]); } return n; }, _extends.apply(null, arguments); }
4
4
  function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: !0, configurable: !0, writable: !0 }) : e[r] = t, e; }
5
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
@@ -89,6 +89,8 @@ export var datePickerRoot = function datePickerRoot(Root) {
89
89
  closeOnOverlayClick = _ref$closeOnOverlayCl === void 0 ? true : _ref$closeOnOverlayCl,
90
90
  _ref$closeOnEsc = _ref.closeOnEsc,
91
91
  closeOnEsc = _ref$closeOnEsc === void 0 ? true : _ref$closeOnEsc,
92
+ _ref$closeAfterDateSe = _ref.closeAfterDateSelect,
93
+ closeAfterDateSelect = _ref$closeAfterDateSe === void 0 ? true : _ref$closeAfterDateSe,
92
94
  offset = _ref.offset,
93
95
  calendarContainerWidth = _ref.calendarContainerWidth,
94
96
  calendarContainerHeight = _ref.calendarContainerHeight,
@@ -163,14 +165,14 @@ export var datePickerRoot = function datePickerRoot(Root) {
163
165
  datePickerErrorClass = _useDatePicker.datePickerErrorClass,
164
166
  datePickerSuccessClass = _useDatePicker.datePickerSuccessClass,
165
167
  handleChangeValue = _useDatePicker.handleChangeValue,
166
- handleCalendarPick = _useDatePicker.handleCalendarPick,
168
+ onCalendarPick = _useDatePicker.handleCalendarPick,
167
169
  handleSearch = _useDatePicker.handleSearch,
168
170
  updateExternalDate = _useDatePicker.updateExternalDate;
169
171
  var handleToggle = function handleToggle(innerOpened, event) {
170
172
  if (disabled || readOnly) {
171
173
  return;
172
174
  }
173
- var isCalendarOpen = event.target === (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) && event.code !== keys.Escape ? true : innerOpened;
175
+ var isCalendarOpen = (event === null || event === void 0 ? void 0 : event.target) === (inputRef === null || inputRef === void 0 ? void 0 : inputRef.current) && event.code !== keys.Escape ? true : innerOpened;
174
176
  if (!innerOpened && !calendarValue) {
175
177
  setCalendarValue(function (prevValue) {
176
178
  return prevValue === undefined ? null : undefined;
@@ -211,6 +213,13 @@ export var datePickerRoot = function datePickerRoot(Root) {
211
213
  onBlur(event);
212
214
  }
213
215
  };
216
+ var handleCalendarPick = function handleCalendarPick(date, dateInfo) {
217
+ onCalendarPick(date, dateInfo);
218
+ if (closeAfterDateSelect) {
219
+ setIsInnerOpen(false);
220
+ handleToggle(false);
221
+ }
222
+ };
214
223
  var DatePickerInput = /*#__PURE__*/React.createElement(StyledInput, {
215
224
  ref: inputRef,
216
225
  className: cls(datePickerErrorClass, datePickerSuccessClass),
@@ -1,7 +1,8 @@
1
1
  import { useEffect, useRef } from 'react';
2
+ import { canUseDOM } from "../../../utils";
2
3
  export var useOverflow = function useOverflow(_ref) {
3
4
  var opened = _ref.opened;
4
- var overflow = useRef(document.body.style.overflowY);
5
+ var overflow = useRef(canUseDOM ? document.body.style.overflowY : 'initial');
5
6
 
6
7
  // linaria не поддерживает динамический global
7
8
  useEffect(function () {
@@ -35,7 +35,7 @@ const meta: Meta<StoryCarouselProps> = {
35
35
  },
36
36
  },
37
37
  align: {
38
- options: ['center', 'start', 'end'],
38
+ options: ['start', 'center', 'end'],
39
39
  control: {
40
40
  type: 'inline-radio',
41
41
  },
@@ -52,6 +52,9 @@ const meta: Meta<StoryCarouselProps> = {
52
52
  paginationCentered: {
53
53
  control: 'boolean',
54
54
  },
55
+ gap: {
56
+ control: 'text',
57
+ },
55
58
  },
56
59
  args: {
57
60
  view: 'default',
@@ -61,10 +64,11 @@ const meta: Meta<StoryCarouselProps> = {
61
64
  visibleDots: 6,
62
65
  slides: 10,
63
66
  paginationCentered: false,
67
+ gap: '20px',
64
68
  },
65
69
  parameters: {
66
70
  controls: {
67
- include: ['visibleDots', 'slides', 'paginationCentered'],
71
+ include: ['align', 'isDragScrollDisabled', 'visibleDots', 'slides', 'paginationCentered', 'gap'],
68
72
  },
69
73
  },
70
74
  };
@@ -89,10 +93,9 @@ const StoryDefault = ({
89
93
  slides,
90
94
  paginationCentered,
91
95
  isDragScrollDisabled,
96
+ gap,
92
97
  ...rest
93
98
  }: StoryCarouselProps) => {
94
- const [index, setIndex] = React.useState(0);
95
-
96
99
  const items = Array(slides)
97
100
  .fill(1)
98
101
  .map((_, i) => ({
@@ -102,26 +105,12 @@ const StoryDefault = ({
102
105
 
103
106
  return (
104
107
  <>
105
- <button type="button" onClick={() => setIndex((prev) => Math.max(prev - 1, 0))}>
106
- prev
107
- </button>
108
- <button type="button" onClick={() => setIndex((prev) => Math.min(prev + 1, slides - 1))}>
109
- next
110
- </button>
111
- <br />
112
- <span>текущий индекс: {index}</span>
113
-
114
- <br />
115
- <br />
116
-
117
- <div style={{ width: '800px' }}>
108
+ <div style={{ width: '600px' }}>
118
109
  <Carousel
119
- index={index}
120
- onIndexChange={setIndex}
121
110
  detectActive
122
111
  scrollAlign={align}
123
112
  isDragScrollDisabled={isDragScrollDisabled}
124
- gap="20px"
113
+ gap={gap}
125
114
  paginationOptions={{
126
115
  visibleDots,
127
116
  centered: paginationCentered,
@@ -14,6 +14,7 @@ const onChangeValue = action('onChangeValue');
14
14
  const onCommitDate = action('onCommitDate');
15
15
  const onBlur = action('onBlur');
16
16
  const onFocus = action('onFocus');
17
+ const onToggle = action('onToggle');
17
18
 
18
19
  const onChangeFirstValue = action('onChangeFirstValue');
19
20
  const onChangeSecondValue = action('onChangeSecondValue');
@@ -118,7 +119,10 @@ const StoryDefault = ({
118
119
  contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
119
120
  onBlur={onBlur}
120
121
  onFocus={onFocus}
121
- onToggle={(is) => setIsOpen(is)}
122
+ onToggle={(is) => {
123
+ setIsOpen(is);
124
+ onToggle(is);
125
+ }}
122
126
  onChangeValue={onChangeValue}
123
127
  onCommitDate={onCommitDate}
124
128
  lang={lang}
@@ -162,6 +166,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
162
166
  includeEdgeDates: true,
163
167
  min: new Date(2024, 1, 1),
164
168
  max: new Date(2024, 12, 29),
169
+ closeAfterDateSelect: true,
165
170
  maskWithFormat: true,
166
171
  required: false,
167
172
  requiredPlacement: 'right',
@@ -262,7 +267,10 @@ const StoryRange = ({
262
267
  secondTextfieldTextBefore={
263
268
  showDefaultTextBefore ? secondTextfieldTextBefore || 'ПО' : secondTextfieldTextBefore
264
269
  }
265
- onToggle={(is) => setIsOpen(is)}
270
+ onToggle={(is) => {
271
+ setIsOpen(is);
272
+ onToggle(is);
273
+ }}
266
274
  onChangeFirstValue={onChangeFirstValue}
267
275
  onChangeSecondValue={onChangeSecondValue}
268
276
  lang={lang}
@@ -304,11 +312,11 @@ export const Range: StoryObj<StoryPropsRange> = {
304
312
  calendarContainerHeight: 0,
305
313
  stretched: false,
306
314
  isDoubleCalendar: false,
307
- closeAfterDateSelect: true,
308
315
  dividerVariant: 'dash',
309
316
  includeEdgeDates: true,
310
317
  min: new Date(2024, 1, 1),
311
318
  max: new Date(2024, 12, 29),
319
+ closeAfterDateSelect: true,
312
320
  renderFromDate: new Date(2024, 4, 14),
313
321
  maskWithFormat: false,
314
322
  required: false,
@@ -410,6 +418,7 @@ export const Deferred: StoryObj<StoryPropsDefault> = {
410
418
  includeEdgeDates: true,
411
419
  min: new Date(2024, 1, 1),
412
420
  max: new Date(2024, 12, 29),
421
+ closeAfterDateSelect: true,
413
422
  maskWithFormat: false,
414
423
  required: false,
415
424
  requiredPlacement: 'right',
@@ -118,7 +118,10 @@ const StoryDefault = ({
118
118
  contentRight={enableContentRight ? <IconPlaceholder size={iconSize} /> : undefined}
119
119
  onBlur={onBlur}
120
120
  onFocus={onFocus}
121
- onToggle={(is) => setIsOpen(is)}
121
+ onToggle={(is) => {
122
+ setIsOpen(is);
123
+ onToggle(is);
124
+ }}
122
125
  onChangeValue={onChangeValue}
123
126
  onCommitDate={onCommitDate}
124
127
  lang={lang}
@@ -162,6 +165,7 @@ export const Default: StoryObj<StoryPropsDefault> = {
162
165
  includeEdgeDates: true,
163
166
  min: new Date(2024, 1, 1),
164
167
  max: new Date(2024, 12, 29),
168
+ closeAfterDateSelect: true,
165
169
  maskWithFormat: false,
166
170
  required: false,
167
171
  requiredPlacement: 'right',
@@ -262,7 +266,10 @@ const StoryRange = ({
262
266
  secondTextfieldTextBefore={
263
267
  showDefaultTextBefore ? secondTextfieldTextBefore || 'ПО' : secondTextfieldTextBefore
264
268
  }
265
- onToggle={(is) => setIsOpen(is)}
269
+ onToggle={(is) => {
270
+ setIsOpen(is);
271
+ onToggle(is);
272
+ }}
266
273
  onChangeFirstValue={onChangeFirstValue}
267
274
  onChangeSecondValue={onChangeSecondValue}
268
275
  lang={lang}
@@ -304,11 +311,11 @@ export const Range: StoryObj<StoryPropsRange> = {
304
311
  calendarContainerHeight: 0,
305
312
  stretched: false,
306
313
  isDoubleCalendar: false,
307
- closeAfterDateSelect: true,
308
314
  dividerVariant: 'dash',
309
315
  includeEdgeDates: true,
310
316
  min: new Date(2024, 1, 1),
311
317
  max: new Date(2024, 12, 29),
318
+ closeAfterDateSelect: true,
312
319
  renderFromDate: new Date(2024, 4, 14),
313
320
  maskWithFormat: false,
314
321
  required: false,
@@ -410,6 +417,7 @@ export const Deferred: StoryObj<StoryPropsDefault> = {
410
417
  includeEdgeDates: true,
411
418
  min: new Date(2024, 1, 1),
412
419
  max: new Date(2024, 12, 29),
420
+ closeAfterDateSelect: true,
413
421
  maskWithFormat: false,
414
422
  required: false,
415
423
  requiredPlacement: 'right',
@@ -4,17 +4,11 @@ import { CarouselNewProps } from './Carousel.types';
4
4
  /**
5
5
  * Компонент для создания списков с прокруткой.
6
6
  */
7
- export declare const carouselNewRoot: (Root: RootProps<HTMLDivElement, CarouselNewProps>) => React.ForwardRefExoticComponent<Omit<import("./Carousel.types").BasicProps & (import("./Carousel.types").DetectionProps | import("./Carousel.types").NoDetectionProps), "throttleMs" | "axis" | "animatedScrollByIndex" | "debounceMs"> & {
8
- ariaLive?: "off" | "polite";
9
- isDragScrollDisabled?: boolean;
10
- } & React.RefAttributes<HTMLDivElement>>;
7
+ export declare const carouselNewRoot: (Root: RootProps<HTMLDivElement, CarouselNewProps>) => React.ForwardRefExoticComponent<CarouselNewProps & React.RefAttributes<HTMLDivElement>>;
11
8
  export declare const carouselNewConfig: {
12
9
  name: string;
13
10
  tag: string;
14
- layout: (Root: RootProps<HTMLDivElement, CarouselNewProps>) => React.ForwardRefExoticComponent<Omit<import("./Carousel.types").BasicProps & (import("./Carousel.types").DetectionProps | import("./Carousel.types").NoDetectionProps), "throttleMs" | "axis" | "animatedScrollByIndex" | "debounceMs"> & {
15
- ariaLive?: "off" | "polite";
16
- isDragScrollDisabled?: boolean;
17
- } & React.RefAttributes<HTMLDivElement>>;
11
+ layout: (Root: RootProps<HTMLDivElement, CarouselNewProps>) => React.ForwardRefExoticComponent<CarouselNewProps & React.RefAttributes<HTMLDivElement>>;
18
12
  base: import("@linaria/core").LinariaClassName;
19
13
  variations: {
20
14
  view: {
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAsD,MAAM,OAAO,CAAC;AAO3E,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpD;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;;;wCA6E5E,CAAC;AAEN,eAAO,MAAM,iBAAiB;;;mBA/EQ,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;;;;;;;;;;;;;;;;;CAgGhF,CAAC"}
1
+ {"version":3,"file":"Carousel.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,KAAyC,MAAM,OAAO,CAAC;AAO9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAKpD;;GAEG;AACH,eAAO,MAAM,eAAe,SAAU,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC,4FA8E5E,CAAC;AAEN,eAAO,MAAM,iBAAiB;;;mBAhFQ,SAAS,CAAC,cAAc,EAAE,gBAAgB,CAAC;;;;;;;;;;;;;;CAiGhF,CAAC"}
@@ -1,15 +1,94 @@
1
1
  import { CSSProperties } from 'react';
2
+ export declare const IconButtonComponent: import("react").FunctionComponent<import("../../../engines/types").PropsType<import("../../../engines/types").Variants> & ((Omit<import("react").ButtonHTMLAttributes<HTMLElement>, "value"> & Omit<import("react").AnchorHTMLAttributes<HTMLElement>, "type"> & import("../../..").AsProps & {
3
+ text?: string;
4
+ contentLeft?: import("react").ReactNode;
5
+ contentPlacing?: "default" | "relaxed";
6
+ isLoading?: boolean;
7
+ loader?: import("react").ReactNode;
8
+ stretch?: boolean;
9
+ stretching?: "fixed" | "auto" | "filled";
10
+ square?: boolean;
11
+ focused?: boolean;
12
+ disabled?: boolean;
13
+ pin?: import("../../../utils/roundness").Pin;
14
+ view?: string;
15
+ size?: string;
16
+ outlined?: boolean;
17
+ shiftLeft?: boolean;
18
+ shiftRight?: boolean;
19
+ blur?: import("../../..").Blur;
20
+ } & {
21
+ value?: string | number;
22
+ contentRight?: never;
23
+ } & import("react").RefAttributes<HTMLButtonElement>) | (Omit<import("react").ButtonHTMLAttributes<HTMLElement>, "value"> & Omit<import("react").AnchorHTMLAttributes<HTMLElement>, "type"> & import("../../..").AsProps & {
24
+ text?: string;
25
+ contentLeft?: import("react").ReactNode;
26
+ contentPlacing?: "default" | "relaxed";
27
+ isLoading?: boolean;
28
+ loader?: import("react").ReactNode;
29
+ stretch?: boolean;
30
+ stretching?: "fixed" | "auto" | "filled";
31
+ square?: boolean;
32
+ focused?: boolean;
33
+ disabled?: boolean;
34
+ pin?: import("../../../utils/roundness").Pin;
35
+ view?: string;
36
+ size?: string;
37
+ outlined?: boolean;
38
+ shiftLeft?: boolean;
39
+ shiftRight?: boolean;
40
+ blur?: import("../../..").Blur;
41
+ } & {
42
+ value?: never;
43
+ contentRight?: import("react").ReactNode;
44
+ } & import("react").RefAttributes<HTMLButtonElement>))>;
2
45
  export declare const base: import("@linaria/core").LinariaClassName;
3
- /**
4
- * Компонент применяется, если требуется компенсировать отступы контейнера в сетке.
5
- * При обертывании вокруг ``Carousel``, добавляет карусели и ее прокрутке дополнительные отступы.
6
- * Стилизованный компонент, обладающий всеми свойствами ``div``.
7
- */
8
- export declare const CarouselGridWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
9
- export declare const CarouselWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
10
- scrollSnapType?: "mandatory" | "proximity" | "none";
11
- }>;
46
+ export declare const CarouselWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
12
47
  export declare const CarouselTrack: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & {
13
48
  gap?: CSSProperties["gap"];
14
49
  }>;
50
+ export declare const IconButton: import("@linaria/react").StyledMeta & import("react").FunctionComponent<import("../../../engines/types").PropsType<import("../../../engines/types").Variants> & ((Omit<import("react").ButtonHTMLAttributes<HTMLElement>, "value"> & Omit<import("react").AnchorHTMLAttributes<HTMLElement>, "type"> & import("../../..").AsProps & {
51
+ text?: string;
52
+ contentLeft?: import("react").ReactNode;
53
+ contentPlacing?: "default" | "relaxed";
54
+ isLoading?: boolean;
55
+ loader?: import("react").ReactNode;
56
+ stretch?: boolean;
57
+ stretching?: "fixed" | "auto" | "filled";
58
+ square?: boolean;
59
+ focused?: boolean;
60
+ disabled?: boolean;
61
+ pin?: import("../../../utils/roundness").Pin;
62
+ view?: string;
63
+ size?: string;
64
+ outlined?: boolean;
65
+ shiftLeft?: boolean;
66
+ shiftRight?: boolean;
67
+ blur?: import("../../..").Blur;
68
+ } & {
69
+ value?: string | number;
70
+ contentRight?: never;
71
+ } & import("react").RefAttributes<HTMLButtonElement>) | (Omit<import("react").ButtonHTMLAttributes<HTMLElement>, "value"> & Omit<import("react").AnchorHTMLAttributes<HTMLElement>, "type"> & import("../../..").AsProps & {
72
+ text?: string;
73
+ contentLeft?: import("react").ReactNode;
74
+ contentPlacing?: "default" | "relaxed";
75
+ isLoading?: boolean;
76
+ loader?: import("react").ReactNode;
77
+ stretch?: boolean;
78
+ stretching?: "fixed" | "auto" | "filled";
79
+ square?: boolean;
80
+ focused?: boolean;
81
+ disabled?: boolean;
82
+ pin?: import("../../../utils/roundness").Pin;
83
+ view?: string;
84
+ size?: string;
85
+ outlined?: boolean;
86
+ shiftLeft?: boolean;
87
+ shiftRight?: boolean;
88
+ blur?: import("../../..").Blur;
89
+ } & {
90
+ value?: never;
91
+ contentRight?: import("react").ReactNode;
92
+ } & import("react").RefAttributes<HTMLButtonElement>))>;
93
+ export declare const ControlsWrapper: import("@linaria/react").StyledComponent<import("react").ClassAttributes<HTMLDivElement> & import("react").HTMLAttributes<HTMLDivElement> & Record<never, unknown>>;
15
94
  //# sourceMappingURL=Carousel.styles.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAEtC,eAAO,MAAM,IAAI,0CAehB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,qKAI/B,CAAC;AAEF,eAAO,MAAM,eAAe;qBAAiC,WAAW,GAAG,WAAW,GAAG,MAAM;EAyB9F,CAAC;AAEF,eAAO,MAAM,aAAa;UAAsB,aAAa,CAAC,KAAK,CAAC;EAInE,CAAC"}
1
+ {"version":3,"file":"Carousel.styles.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.styles.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAOtC,eAAO,MAAM,mBAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAA0B,CAAC;AAE3D,eAAO,MAAM,IAAI,0CAEhB,CAAC;AAEF,eAAO,MAAM,eAAe,qKAoB3B,CAAC;AAEF,eAAO,MAAM,aAAa;UAAsB,aAAa,CAAC,KAAK,CAAC;EAInE,CAAC;AAEF,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAsBtB,CAAC;AAEF,eAAO,MAAM,eAAe,qKAE3B,CAAC"}
@@ -8,6 +8,7 @@ export declare const classes: {
8
8
  shrinking: string;
9
9
  availableDotsLeft: string;
10
10
  availableDotsRight: string;
11
+ rightControlButton: string;
11
12
  };
12
13
  export declare const tokens: {
13
14
  paginationDotBackground: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.tokens.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;CAUnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
1
+ {"version":3,"file":"Carousel.tokens.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.tokens.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;;;;;;CAWnB,CAAC;AAEF,eAAO,MAAM,MAAM;;;CAGlB,CAAC"}
@@ -6,31 +6,11 @@ export type SnapAlign = 'start' | 'center' | 'end';
6
6
  export type SnapStop = 'normal' | 'always';
7
7
  export type ScrollAxis = 'x' | 'y';
8
8
  export type ScrollAlign = 'start' | 'center' | 'end' | 'activeDirection';
9
- export interface BasicProps extends AsProps, HTMLAttributes<HTMLDivElement> {
9
+ export interface CarouselNewProps extends HTMLAttributes<HTMLDivElement> {
10
10
  /**
11
- * Индекс текущего элемента
12
- */
13
- index: number;
14
- /**
15
- * Ось прокрутки
16
- */
17
- axis: ScrollAxis;
18
- /**
19
- * Тип CSS Scroll Snap
20
- */
21
- scrollSnapType?: SnapType;
22
- /**
23
- * Центрирование активного элемента при скролле
11
+ * Центрирование активного элемента при скролле.
24
12
  */
25
13
  scrollAlign?: ScrollAlign;
26
- /**
27
- * Throttling внутренних обработчиков события onScroll
28
- */
29
- throttleMs?: number;
30
- /**
31
- * Debounce внутренних обработчиков события onScroll
32
- */
33
- debounceMs?: number;
34
14
  /**
35
15
  * Сменить WAI-ARIA Role списка.
36
16
  */
@@ -48,6 +28,11 @@ export interface BasicProps extends AsProps, HTMLAttributes<HTMLDivElement> {
48
28
  visibleDots?: number;
49
29
  centered?: boolean;
50
30
  };
31
+ /**
32
+ * Выключает драг скролл (только для десктопа).
33
+ * @default false
34
+ */
35
+ isDragScrollDisabled?: boolean;
51
36
  /**
52
37
  * Размер контрола.
53
38
  */
@@ -58,36 +43,6 @@ export interface BasicProps extends AsProps, HTMLAttributes<HTMLDivElement> {
58
43
  */
59
44
  view?: string;
60
45
  }
61
- export interface DetectionProps {
62
- /**
63
- * Вычислять активный элемент
64
- */
65
- detectActive: true;
66
- /**
67
- * Пороговое значение определения центрального элемента (0-1)
68
- */
69
- detectThreshold: number;
70
- /**
71
- * Коллбек изменения индекса
72
- */
73
- onIndexChange?: (index: number) => void;
74
- }
75
- export interface NoDetectionProps {
76
- detectActive?: false;
77
- detectThreshold?: never;
78
- onIndexChange?: never;
79
- onDetectActiveItem?: never;
80
- scaleCallback?: never;
81
- scaleResetCallback?: never;
82
- }
83
- type CarouselPropsBase = BasicProps & (DetectionProps | NoDetectionProps);
84
- export type CarouselNewProps = Omit<CarouselPropsBase, 'axis' | 'animatedScrollByIndex' | 'throttleMs' | 'debounceMs'> & {
85
- /**
86
- * При значении `polite` скринридер будет объявлять переключаемые слайды.
87
- */
88
- ariaLive?: 'off' | 'polite';
89
- isDragScrollDisabled?: boolean;
90
- };
91
46
  export type CarouselItemProps = {
92
47
  scrollSnapAlign?: SnapAlign;
93
48
  scrollSnapStop?: SnapStop;
@@ -1 +1 @@
1
- {"version":3,"file":"Carousel.types.d.ts","sourceRoot":"","sources":["../../../../src/components/Carousel/CarouselNew/Carousel.types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AAC3D,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEpC,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,wBAAwB,CAAC;AAE5E,MAAM,MAAM,QAAQ,GAAG,WAAW,GAAG,WAAW,GAAG,MAAM,CAAC;AAC1D,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,CAAC;AACnD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE3C,MAAM,MAAM,UAAU,GAAG,GAAG,GAAG,GAAG,CAAC;AACnC,MAAM,MAAM,WAAW,GAAG,OAAO,GAAG,QAAQ,GAAG,KAAK,GAAG,iBAAiB,CAAC;AAEzE,MAAM,WAAW,UAAW,SAAQ,OAAO,EAAE,cAAc,CAAC,cAAc,CAAC;IACvE;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,IAAI,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AiB,GAAG;IAC5B,eAAe,CAAC,EAAE,SAAS,CAAC;IAC5B,cAAc,CAAC,EAAE,QAAQ,CAAC;CAC7B,GAAG,OAAO,GACP,cAAc,CAAC,cAAc,CAAC,CAAC;AAEnC,UAAU,oBAAoB;IAC1B;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC;;OAEG;IACH,WAAW,CAAC,EAAE,YAAY,GAAG,UAAU,CAAC;IACxC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACtC;AAED,MAAM,WAAW,mBAAoB,SAAQ,6BAA6B,CAAC,cAAc,CAAC,EAAE,oBAAoB;CAAG;AAEnH,MAAM,WAAW,SAAS;IACtB;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAClC;;OAEG;IACH,KAAK,EAAE,MAAM,CAAC;IACd;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;IACrB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,KAAK,GAAG,MAAM,CAAC;IACnC;;;OAGG;IACH,QAAQ,CAAC,EAAE,OAAO,CAAC;CACtB"}
@@ -48,14 +48,18 @@ export declare const scrollToPos: ({ scrollEl, pos, axis, animated, duration, ti
48
48
  export declare const getItemSlot: (itemIndex: number, itemEnd: number, itemSize: number, scrollStart: number, scrollSize: number, scrollAlign: ScrollAlign, prevIndex?: number, offset?: number) => number | null;
49
49
  export declare function getCarouselItems(track: HTMLElement): HTMLCollectionOf<HTMLElement>;
50
50
  export declare function useDebouncedFunction(func: (...args: any) => any, delay: number, cleanUp?: boolean): (...args: any[]) => void;
51
- type UseCarouselOptions = Pick<CarouselProps, 'index' | 'scrollAlign' | 'detectActive' | 'detectThreshold' | 'onIndexChange'> & {
51
+ type UseCarouselOptions = Pick<CarouselProps, 'scrollAlign'> & {
52
+ index: number;
52
53
  throttleMs?: number;
53
54
  debounceMs?: number;
55
+ detectActive?: boolean;
56
+ detectThreshold?: number;
57
+ onIndexChange?: (e: any) => void;
54
58
  };
55
59
  type UseCarouselHookResult = {
56
- scrollRef: React.MutableRefObject<HTMLElement | null>;
57
- trackRef: React.MutableRefObject<HTMLElement | null>;
60
+ scrollRef: React.RefObject<HTMLDivElement>;
61
+ trackRef: React.RefObject<HTMLDivElement>;
58
62
  };
59
- export declare const useCarousel: ({ index, detectActive, detectThreshold, scrollAlign, onIndexChange, throttleMs, debounceMs, }: UseCarouselOptions) => UseCarouselHookResult;
63
+ export declare const useCarousel: ({ index, onIndexChange, detectActive, detectThreshold, scrollAlign, throttleMs, debounceMs, }: UseCarouselOptions) => UseCarouselHookResult;
60
64
  export {};
61
65
  //# sourceMappingURL=useCarousel.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useCarousel.d.ts","sourceRoot":"","sources":["../../../../../src/components/Carousel/CarouselNew/hooks/useCarousel.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAkD,MAAM,OAAO,CAAC;AAGvE,OAAO,EAAE,gBAAgB,IAAI,aAAa,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAE/F;;GAEG;AACH,eAAO,MAAM,mBAAmB,aAAc,OAAO,WAAW,OAAO,QAAQ,UAAU,WAGxF,CAAC;AAyCF;;GAEG;AACH,eAAO,MAAM,gBAAgB,2DAO1B;IACC,QAAQ,EAAE,WAAW,CAAC;IACtB,KAAK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,eAAO,MAAM,iBAAiB,qKAiD7B,CAAC;AAEF,eAAO,MAAM,UAAU,qKAkBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,qKA0ChC,CAAC;AAEF,eAAO,MAAM,qBAAqB,qKA0CjC,CAAC"}
1
+ {"version":3,"file":"Dots.styles.d.ts","sourceRoot":"","sources":["../../../../../../src/components/Carousel/CarouselNew/ui/Dots/Dots.styles.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,OAAO,qKAQnB,CAAC;AAEF,eAAO,MAAM,iBAAiB,qKAiD7B,CAAC;AAEF,eAAO,MAAM,UAAU,qKAkBtB,CAAC;AAEF,eAAO,MAAM,oBAAoB,qKA0ChC,CAAC;AAEF,eAAO,MAAM,qBAAqB,qKA0CjC,CAAC"}