@semcore/carousel 3.50.0-prerelease.0 → 3.50.0-prerelease.4
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/lib/cjs/Carousel.js +178 -165
- package/lib/cjs/Carousel.js.map +1 -1
- package/lib/cjs/Carousel.types.js.map +1 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/carousel.shadow.css +46 -44
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js +5 -4
- package/lib/cjs/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/cjs/translations/de.json +1 -3
- package/lib/cjs/translations/en.json +1 -3
- package/lib/cjs/translations/es.json +1 -3
- package/lib/cjs/translations/fr.json +1 -3
- package/lib/cjs/translations/it.json +1 -3
- package/lib/cjs/translations/ja.json +1 -3
- package/lib/cjs/translations/ko.json +1 -3
- package/lib/cjs/translations/nl.json +1 -3
- package/lib/cjs/translations/pl.json +1 -3
- package/lib/cjs/translations/pt.json +1 -3
- package/lib/cjs/translations/sv.json +1 -3
- package/lib/cjs/translations/tr.json +1 -3
- package/lib/cjs/translations/vi.json +1 -3
- package/lib/cjs/translations/zh.json +1 -3
- package/lib/es6/Carousel.js +162 -152
- package/lib/es6/Carousel.js.map +1 -1
- package/lib/es6/Carousel.types.js.map +1 -1
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/carousel.shadow.css +46 -44
- package/lib/es6/translations/__intergalactic-dynamic-locales.js +2 -2
- package/lib/es6/translations/__intergalactic-dynamic-locales.js.map +1 -1
- package/lib/es6/translations/de.json +1 -3
- package/lib/es6/translations/en.json +1 -3
- package/lib/es6/translations/es.json +1 -3
- package/lib/es6/translations/fr.json +1 -3
- package/lib/es6/translations/it.json +1 -3
- package/lib/es6/translations/ja.json +1 -3
- package/lib/es6/translations/ko.json +1 -3
- package/lib/es6/translations/nl.json +1 -3
- package/lib/es6/translations/pl.json +1 -3
- package/lib/es6/translations/pt.json +1 -3
- package/lib/es6/translations/sv.json +1 -3
- package/lib/es6/translations/tr.json +1 -3
- package/lib/es6/translations/vi.json +1 -3
- package/lib/es6/translations/zh.json +1 -3
- package/lib/esm/Carousel.mjs +160 -148
- package/lib/esm/index.mjs +0 -1
- package/lib/esm/style/carousel.shadow.css +46 -44
- package/lib/esm/translations/__intergalactic-dynamic-locales.mjs +2 -2
- package/lib/esm/translations/de.json.mjs +1 -3
- package/lib/esm/translations/en.json.mjs +1 -3
- package/lib/esm/translations/es.json.mjs +1 -3
- package/lib/esm/translations/fr.json.mjs +1 -3
- package/lib/esm/translations/it.json.mjs +1 -3
- package/lib/esm/translations/ja.json.mjs +1 -3
- package/lib/esm/translations/ko.json.mjs +1 -3
- package/lib/esm/translations/nl.json.mjs +1 -3
- package/lib/esm/translations/pl.json.mjs +1 -3
- package/lib/esm/translations/pt.json.mjs +1 -3
- package/lib/esm/translations/sv.json.mjs +1 -3
- package/lib/esm/translations/tr.json.mjs +1 -3
- package/lib/esm/translations/vi.json.mjs +1 -3
- package/lib/esm/translations/zh.json.mjs +1 -3
- package/lib/types/Carousel.d.ts +1 -1
- package/lib/types/Carousel.types.d.ts +12 -4
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +0 -28
- package/package.json +8 -8
- package/src/style/carousel.shadow.css +11 -11
- package/lib/esm/Carousel.types.mjs +0 -1
package/lib/es6/Carousel.js
CHANGED
|
@@ -3,11 +3,12 @@ import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
|
3
3
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
4
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
5
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
6
|
-
import
|
|
6
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
7
7
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
8
|
+
import _createSuper from "@babel/runtime/helpers/createSuper";
|
|
8
9
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import { sstyled as _sstyled } from "@semcore/core";
|
|
10
|
-
import { assignProps as
|
|
10
|
+
import { sstyled as _sstyled } from "@semcore/utils/lib/core/index";
|
|
11
|
+
import { assignProps as _assignProps10 } from "@semcore/core";
|
|
11
12
|
import { assignProps as _assignProps9 } from "@semcore/core";
|
|
12
13
|
import { assignProps as _assignProps8 } from "@semcore/core";
|
|
13
14
|
import { assignProps as _assignProps7 } from "@semcore/core";
|
|
@@ -17,43 +18,45 @@ import { assignProps as _assignProps4 } from "@semcore/core";
|
|
|
17
18
|
import { assignProps as _assignProps3 } from "@semcore/core";
|
|
18
19
|
import { assignProps as _assignProps2 } from "@semcore/core";
|
|
19
20
|
import { assignProps as _assignProps } from "@semcore/core";
|
|
20
|
-
import
|
|
21
|
+
import React from 'react';
|
|
22
|
+
import createComponent, { Component, sstyled, Root } from '@semcore/core';
|
|
21
23
|
import Button from '@semcore/button';
|
|
22
|
-
import { createComponent, Component, sstyled, Root } from '@semcore/core';
|
|
23
|
-
import i18nEnhance from '@semcore/core/lib/utils/enhances/i18nEnhance';
|
|
24
|
-
import { findAllComponents } from '@semcore/core/lib/utils/findComponent';
|
|
25
|
-
import logger from '@semcore/core/lib/utils/logger';
|
|
26
|
-
import uniqueIDEnhancement from '@semcore/core/lib/utils/uniqueID';
|
|
27
|
-
import ChevronLeft from '@semcore/icon/ChevronLeft/l';
|
|
28
|
-
import ChevronRight from '@semcore/icon/ChevronRight/l';
|
|
29
24
|
import Modal from '@semcore/modal';
|
|
30
|
-
import
|
|
25
|
+
import { Box, Flex } from '@semcore/flex-box';
|
|
26
|
+
import ChevronRight from '@semcore/icon/ChevronRight/l';
|
|
27
|
+
import ChevronLeft from '@semcore/icon/ChevronLeft/l';
|
|
28
|
+
import uniqueIDEnhancement from '@semcore/utils/lib/uniqueID';
|
|
29
|
+
import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
30
|
+
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
31
|
+
import logger from '@semcore/utils/lib/logger';
|
|
31
32
|
/*!__reshadow-styles__:"./style/carousel.shadow.css"*/
|
|
32
|
-
var style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".
|
|
33
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SCarousel_1a2c8_gg_{overflow:hidden;outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SContainer_1a2c8_gg_{display:flex;transition:transform var(--duration_1a2c8) ease-in-out}.___SContentBox_1a2c8_gg_,.___SModalBox_1a2c8_gg_{position:relative;overflow:hidden;border-radius:var(--intergalactic-surface-rounded, calc(6px + 2px))}.___SContentBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after,.___SModalBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px}@supports (color:color(display-p3 0 0 0)){.___SContentBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after,.___SModalBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469))}@media (color-gamut:p3){.___SContentBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after,.___SModalBox_1a2c8_gg_:has(.___SItem_1a2c8_gg_.__keyboardFocused_1a2c8_gg_):after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SModalContainer_1a2c8_gg_{display:flex;transition:transform var(--duration_1a2c8) ease-in-out}.___SItem_1a2c8_gg_{flex:0 0 100%;max-width:100%;box-sizing:border-box;transform:var(--transform_1a2c8);border-radius:var(--intergalactic-surface-rounded, calc(6px + 2px));overflow:hidden;outline:0}.___SItem_1a2c8_gg_.__zoomIn_1a2c8_gg_{cursor:zoom-in}.___SItem_1a2c8_gg_.__zoomOut_1a2c8_gg_{cursor:zoom-out}.___SIndicators_1a2c8_gg_{display:flex;justify-content:center;margin-top:var(--intergalactic-spacing-4x, 16px);outline:0;position:relative}.___SIndicators_1a2c8_gg_.__keyboardFocused_1a2c8_gg_:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px);top:0;left:3px}@supports (color:color(display-p3 0 0 0)){.___SIndicators_1a2c8_gg_.__keyboardFocused_1a2c8_gg_:after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469))}@media (color-gamut:p3){.___SIndicators_1a2c8_gg_.__keyboardFocused_1a2c8_gg_:after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SIndicator_1a2c8_gg_{margin:0 calc(.5*var(--intergalactic-spacing-3x, 12px));cursor:pointer;display:block;width:12px;height:12px;border-radius:var(--intergalactic-control-rounded, 6px);background-color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385));opacity:var(--intergalactic-disabled-opacity, 0.4);-o-object-fit:cover;object-fit:cover;transition:ease-in-out opacity .1s}@supports (color:color(display-p3 0 0 0)){.___SIndicator_1a2c8_gg_{background-color:var(--intergalactic-icon-secondary-neutral, rgba(0, 5, 2, 0.385))}@media (color-gamut:p3){.___SIndicator_1a2c8_gg_{background-color:var(--intergalactic-icon-secondary-neutral, color(display-p3 0.0036 0.02041 0.00996 / 0.385))}}}@media (hover:hover){.___SIndicator_1a2c8_gg_:hover{opacity:calc(2*var(--intergalactic-disabled-opacity, 0.4))}}.___SIndicator_1a2c8_gg_.__active_1a2c8_gg_{opacity:1}.___SIndicator_1a2c8_gg_.__inverted_1a2c8_gg_{background-color:var(--intergalactic-icon-primary-invert, rgba(253, 255, 254, 0.808))}@supports (color:color(display-p3 0 0 0)){.___SIndicator_1a2c8_gg_.__inverted_1a2c8_gg_{background-color:var(--intergalactic-icon-primary-invert, rgba(253, 255, 254, 0.808))}@media (color-gamut:p3){.___SIndicator_1a2c8_gg_.__inverted_1a2c8_gg_{background-color:var(--intergalactic-icon-primary-invert, color(display-p3 0.99189 0.99995 0.99683 / 0.808))}}}.___SNext_1a2c8_gg_,.___SPrev_1a2c8_gg_{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--intergalactic-icon-primary-neutral, rgba(0, 4, 1, 0.526))}.___SNext_1a2c8_gg_ .___SNextButton_1a2c8_gg_ span:has(>svg:only-child),.___SNext_1a2c8_gg_ .___SPrevButton_1a2c8_gg_ span:has(>svg:only-child),.___SPrev_1a2c8_gg_ .___SNextButton_1a2c8_gg_ span:has(>svg:only-child),.___SPrev_1a2c8_gg_ .___SPrevButton_1a2c8_gg_ span:has(>svg:only-child){margin-left:calc(2*var(--intergalactic-spacing-1x, 4px) - 1px);margin-right:calc(2*var(--intergalactic-spacing-1x, 4px) - 1px)}.___SNextButton_1a2c8_gg_:focus-visible,.___SPrevButton_1a2c8_gg_:focus-visible{box-shadow:none}.___SNextButton_1a2c8_gg_:focus-visible:after,.___SPrevButton_1a2c8_gg_:focus-visible:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px;border-radius:var(--intergalactic-control-rounded, 6px)}@supports (color:color(display-p3 0 0 0)){.___SNextButton_1a2c8_gg_:focus-visible:after,.___SPrevButton_1a2c8_gg_:focus-visible:after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 33, 220, 0.469))}@media (color-gamut:p3){.___SNextButton_1a2c8_gg_:focus-visible:after,.___SPrevButton_1a2c8_gg_:focus-visible:after{box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SPrev_1a2c8_gg_{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SNext_1a2c8_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNext_1a2c8_gg_.__disabled_1a2c8_gg_,.___SPrev_1a2c8_gg_.__disabled_1a2c8_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SContainer_1a2c8_gg_{transition:none}}", /*__inner_css_end__*/"1a2c8_gg_"),
|
|
33
34
|
/*__reshadow_css_end__*/
|
|
34
35
|
{
|
|
35
|
-
"__SCarousel": "
|
|
36
|
-
"__SContainer": "
|
|
37
|
-
"--duration": "--
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"_active": "
|
|
47
|
-
"_inverted": "
|
|
48
|
-
"__SPrev": "
|
|
49
|
-
"__SNext": "
|
|
50
|
-
"_disabled": "
|
|
51
|
-
"
|
|
52
|
-
"
|
|
53
|
-
"__SPrevButton": "
|
|
54
|
-
"__SNextButton": "
|
|
36
|
+
"__SCarousel": "___SCarousel_1a2c8_gg_",
|
|
37
|
+
"__SContainer": "___SContainer_1a2c8_gg_",
|
|
38
|
+
"--duration": "--duration_1a2c8",
|
|
39
|
+
"__SModalContainer": "___SModalContainer_1a2c8_gg_",
|
|
40
|
+
"__SItem": "___SItem_1a2c8_gg_",
|
|
41
|
+
"--transform": "--transform_1a2c8",
|
|
42
|
+
"_zoomIn": "__zoomIn_1a2c8_gg_",
|
|
43
|
+
"_zoomOut": "__zoomOut_1a2c8_gg_",
|
|
44
|
+
"__SIndicators": "___SIndicators_1a2c8_gg_",
|
|
45
|
+
"_keyboardFocused": "__keyboardFocused_1a2c8_gg_",
|
|
46
|
+
"__SIndicator": "___SIndicator_1a2c8_gg_",
|
|
47
|
+
"_active": "__active_1a2c8_gg_",
|
|
48
|
+
"_inverted": "__inverted_1a2c8_gg_",
|
|
49
|
+
"__SPrev": "___SPrev_1a2c8_gg_",
|
|
50
|
+
"__SNext": "___SNext_1a2c8_gg_",
|
|
51
|
+
"_disabled": "__disabled_1a2c8_gg_",
|
|
52
|
+
"__SContentBox": "___SContentBox_1a2c8_gg_",
|
|
53
|
+
"__SModalBox": "___SModalBox_1a2c8_gg_",
|
|
54
|
+
"__SPrevButton": "___SPrevButton_1a2c8_gg_",
|
|
55
|
+
"__SNextButton": "___SNextButton_1a2c8_gg_"
|
|
55
56
|
});
|
|
56
|
-
import {
|
|
57
|
+
import { findAllComponents } from '@semcore/utils/lib/findComponent';
|
|
58
|
+
import { createBreakpoints } from '@semcore/breakpoints';
|
|
59
|
+
import keyboardFocusEnhance from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
57
60
|
var MAP_TRANSFORM = {
|
|
58
61
|
ArrowLeft: 'left',
|
|
59
62
|
ArrowRight: 'right'
|
|
@@ -65,17 +68,19 @@ var isSmallScreen = function isSmallScreen(index) {
|
|
|
65
68
|
return index === 1;
|
|
66
69
|
};
|
|
67
70
|
var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
71
|
+
_inherits(CarouselRoot, _Component);
|
|
72
|
+
var _super = _createSuper(CarouselRoot);
|
|
68
73
|
function CarouselRoot(props) {
|
|
69
|
-
var
|
|
74
|
+
var _ref20, _props$index;
|
|
70
75
|
var _this;
|
|
71
76
|
_classCallCheck(this, CarouselRoot);
|
|
72
|
-
_this =
|
|
73
|
-
_defineProperty(_this, "defaultItemsCount", 0);
|
|
74
|
-
_defineProperty(_this, "refCarousel", /*#__PURE__*/React.createRef());
|
|
75
|
-
_defineProperty(_this, "refContainer", /*#__PURE__*/React.createRef());
|
|
76
|
-
_defineProperty(_this, "refModalContainer", /*#__PURE__*/React.createRef());
|
|
77
|
-
_defineProperty(_this, "_touchStartCoord", -1);
|
|
78
|
-
_defineProperty(_this, "handlerKeyDown", function (e) {
|
|
77
|
+
_this = _super.call(this, props);
|
|
78
|
+
_defineProperty(_assertThisInitialized(_this), "defaultItemsCount", 0);
|
|
79
|
+
_defineProperty(_assertThisInitialized(_this), "refCarousel", /*#__PURE__*/React.createRef());
|
|
80
|
+
_defineProperty(_assertThisInitialized(_this), "refContainer", /*#__PURE__*/React.createRef());
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "refModalContainer", /*#__PURE__*/React.createRef());
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "_touchStartCoord", -1);
|
|
83
|
+
_defineProperty(_assertThisInitialized(_this), "handlerKeyDown", function (e) {
|
|
79
84
|
var firstSlide = 1;
|
|
80
85
|
var lastSlide = _this.state.items.length + 1;
|
|
81
86
|
switch (e.key) {
|
|
@@ -113,7 +118,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
113
118
|
_this.handleToggleZoomModal();
|
|
114
119
|
}
|
|
115
120
|
});
|
|
116
|
-
_defineProperty(_this, "toggleItem", function (item) {
|
|
121
|
+
_defineProperty(_assertThisInitialized(_this), "toggleItem", function (item) {
|
|
117
122
|
var removeItem = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
118
123
|
_this.setState(function (prevState) {
|
|
119
124
|
var newItems = removeItem ? prevState.items.filter(function (element) {
|
|
@@ -127,7 +132,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
127
132
|
_this.defaultItemsCount++;
|
|
128
133
|
}
|
|
129
134
|
});
|
|
130
|
-
_defineProperty(_this, "transformContainer", function () {
|
|
135
|
+
_defineProperty(_assertThisInitialized(_this), "transformContainer", function () {
|
|
131
136
|
var transform = _this.state.selectedIndex * -1 * 100;
|
|
132
137
|
if (_this.refContainer.current) {
|
|
133
138
|
_this.refContainer.current.style.transform = "translateX(".concat(transform, "%)");
|
|
@@ -136,7 +141,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
136
141
|
_this.refModalContainer.current.style.transform = "translateX(".concat(transform, "%)");
|
|
137
142
|
}
|
|
138
143
|
});
|
|
139
|
-
_defineProperty(_this, "getDirection", function (currentIndex, nextIndex) {
|
|
144
|
+
_defineProperty(_assertThisInitialized(_this), "getDirection", function (currentIndex, nextIndex) {
|
|
140
145
|
var bounded = _this.asProps.bounded;
|
|
141
146
|
if (bounded) {
|
|
142
147
|
return currentIndex < nextIndex ? 'right' : 'left';
|
|
@@ -163,7 +168,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
163
168
|
var left = tmpArr.indexOf(nextIndex);
|
|
164
169
|
return left - tmpCurrentIndex < 0 ? 'left' : 'right';
|
|
165
170
|
});
|
|
166
|
-
_defineProperty(_this, "slideToValue", function (nextIndex) {
|
|
171
|
+
_defineProperty(_assertThisInitialized(_this), "slideToValue", function (nextIndex) {
|
|
167
172
|
var selectedIndex = _this.state.selectedIndex;
|
|
168
173
|
var direction = selectedIndex < nextIndex ? 'right' : 'left';
|
|
169
174
|
var diff = Math.abs(selectedIndex - nextIndex);
|
|
@@ -172,7 +177,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
172
177
|
diff--;
|
|
173
178
|
}
|
|
174
179
|
});
|
|
175
|
-
_defineProperty(_this, "transformItem", function (direction) {
|
|
180
|
+
_defineProperty(_assertThisInitialized(_this), "transformItem", function (direction) {
|
|
176
181
|
var bounded = _this.asProps.bounded;
|
|
177
182
|
var _this$state = _this.state,
|
|
178
183
|
items = _this$state.items,
|
|
@@ -217,12 +222,12 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
217
222
|
return;
|
|
218
223
|
}
|
|
219
224
|
});
|
|
220
|
-
_defineProperty(_this, "bindHandlerClick", function (direction) {
|
|
225
|
+
_defineProperty(_assertThisInitialized(_this), "bindHandlerClick", function (direction) {
|
|
221
226
|
return function () {
|
|
222
227
|
_this.transformItem(direction);
|
|
223
228
|
};
|
|
224
229
|
});
|
|
225
|
-
_defineProperty(_this, "bindHandlerClickIndicator", function (value) {
|
|
230
|
+
_defineProperty(_assertThisInitialized(_this), "bindHandlerClickIndicator", function (value) {
|
|
226
231
|
return function () {
|
|
227
232
|
var _this$state2 = _this.state,
|
|
228
233
|
selectedIndex = _this$state2.selectedIndex,
|
|
@@ -234,10 +239,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
234
239
|
_this.handlers.index(value);
|
|
235
240
|
};
|
|
236
241
|
});
|
|
237
|
-
_defineProperty(_this, "handlerTouchStart", function (e) {
|
|
242
|
+
_defineProperty(_assertThisInitialized(_this), "handlerTouchStart", function (e) {
|
|
238
243
|
_this._touchStartCoord = e.changedTouches[0].clientX;
|
|
239
244
|
});
|
|
240
|
-
_defineProperty(_this, "handlerTouchEnd", function (e) {
|
|
245
|
+
_defineProperty(_assertThisInitialized(_this), "handlerTouchEnd", function (e) {
|
|
241
246
|
var touchEndCoord = e.changedTouches[0].clientX;
|
|
242
247
|
var delta = touchEndCoord - _this._touchStartCoord;
|
|
243
248
|
if (delta > 50) {
|
|
@@ -246,18 +251,16 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
246
251
|
_this.transformItem('right');
|
|
247
252
|
}
|
|
248
253
|
});
|
|
249
|
-
_defineProperty(_this, "handleToggleZoomModal", function () {
|
|
254
|
+
_defineProperty(_assertThisInitialized(_this), "handleToggleZoomModal", function () {
|
|
250
255
|
_this.setState(function (prevState) {
|
|
251
256
|
return {
|
|
252
257
|
isOpenZoom: !prevState.isOpenZoom
|
|
253
258
|
};
|
|
254
259
|
}, function () {
|
|
255
|
-
|
|
256
|
-
_this.transformContainer();
|
|
257
|
-
}
|
|
260
|
+
_this.state.isOpenZoom && _this.transformContainer();
|
|
258
261
|
});
|
|
259
262
|
});
|
|
260
|
-
_defineProperty(_this, "bindHandlerKeydownControl", function (direction) {
|
|
263
|
+
_defineProperty(_assertThisInitialized(_this), "bindHandlerKeydownControl", function (direction) {
|
|
261
264
|
return function (e) {
|
|
262
265
|
if (e.key === 'Enter' || e.key === ' ') {
|
|
263
266
|
e.preventDefault();
|
|
@@ -269,22 +272,21 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
269
272
|
_this.state = {
|
|
270
273
|
items: [],
|
|
271
274
|
isOpenZoom: false,
|
|
272
|
-
selectedIndex: (
|
|
275
|
+
selectedIndex: (_ref20 = (_props$index = props.index) !== null && _props$index !== void 0 ? _props$index : props.defaultIndex) !== null && _ref20 !== void 0 ? _ref20 : 0
|
|
273
276
|
};
|
|
274
277
|
return _this;
|
|
275
278
|
}
|
|
276
|
-
|
|
277
|
-
return _createClass(CarouselRoot, [{
|
|
279
|
+
_createClass(CarouselRoot, [{
|
|
278
280
|
key: "uncontrolledProps",
|
|
279
281
|
value: function uncontrolledProps() {
|
|
280
282
|
var _this2 = this;
|
|
281
283
|
return {
|
|
282
284
|
index: [null, function (_index) {
|
|
283
285
|
var _this2$refCarousel$cu;
|
|
284
|
-
(_this2$refCarousel$cu = _this2.refCarousel.current) === null || _this2$refCarousel$cu === void 0
|
|
286
|
+
(_this2$refCarousel$cu = _this2.refCarousel.current) === null || _this2$refCarousel$cu === void 0 ? void 0 : _this2$refCarousel$cu.blur();
|
|
285
287
|
setTimeout(function () {
|
|
286
288
|
var _this2$refCarousel$cu2;
|
|
287
|
-
(_this2$refCarousel$cu2 = _this2.refCarousel.current) === null || _this2$refCarousel$cu2 === void 0
|
|
289
|
+
(_this2$refCarousel$cu2 = _this2.refCarousel.current) === null || _this2$refCarousel$cu2 === void 0 ? void 0 : _this2$refCarousel$cu2.focus();
|
|
288
290
|
}, 0);
|
|
289
291
|
}]
|
|
290
292
|
};
|
|
@@ -330,7 +332,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
330
332
|
}
|
|
331
333
|
}, {
|
|
332
334
|
key: "getItemProps",
|
|
333
|
-
value: function getItemProps(
|
|
335
|
+
value: function getItemProps(props, index) {
|
|
334
336
|
var zoom = this.asProps.zoom;
|
|
335
337
|
var isCurrent = this.isSelected(index);
|
|
336
338
|
return {
|
|
@@ -359,10 +361,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
359
361
|
disabled = selectedIndex === 0;
|
|
360
362
|
}
|
|
361
363
|
return {
|
|
362
|
-
|
|
363
|
-
|
|
364
|
+
onClick: this.bindHandlerClick('left'),
|
|
365
|
+
onKeyDown: this.bindHandlerKeydownControl('left'),
|
|
364
366
|
disabled: disabled,
|
|
365
|
-
|
|
367
|
+
label: getI18nText('prev'),
|
|
366
368
|
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
367
369
|
};
|
|
368
370
|
}
|
|
@@ -381,10 +383,10 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
381
383
|
disabled = selectedIndex === items.length - 1;
|
|
382
384
|
}
|
|
383
385
|
return {
|
|
384
|
-
|
|
385
|
-
|
|
386
|
+
onClick: this.bindHandlerClick('right'),
|
|
387
|
+
onKeyDown: this.bindHandlerKeydownControl('right'),
|
|
386
388
|
disabled: disabled,
|
|
387
|
-
|
|
389
|
+
label: getI18nText('next'),
|
|
388
390
|
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
389
391
|
};
|
|
390
392
|
}
|
|
@@ -395,15 +397,14 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
395
397
|
var items = this.state.items;
|
|
396
398
|
var getI18nText = this.asProps.getI18nText;
|
|
397
399
|
return {
|
|
398
|
-
|
|
400
|
+
items: items.map(function (item, key) {
|
|
399
401
|
return {
|
|
400
402
|
active: _this4.isSelected(key),
|
|
401
403
|
onClick: _this4.bindHandlerClickIndicator(key),
|
|
402
404
|
key: key
|
|
403
405
|
};
|
|
404
406
|
}),
|
|
405
|
-
|
|
406
|
-
'tabIndex': 0,
|
|
407
|
+
role: 'tablist',
|
|
407
408
|
'aria-label': getI18nText('slides')
|
|
408
409
|
};
|
|
409
410
|
}
|
|
@@ -413,7 +414,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
413
414
|
var isCurrent = this.isSelected(index);
|
|
414
415
|
var getI18nText = this.asProps.getI18nText;
|
|
415
416
|
return {
|
|
416
|
-
|
|
417
|
+
role: 'tab',
|
|
417
418
|
'aria-selected': isCurrent,
|
|
418
419
|
'aria-controls': "igc-".concat(this.asProps.uid, "-carousel-item-").concat(index),
|
|
419
420
|
'aria-label': getI18nText('slide', {
|
|
@@ -459,27 +460,26 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
459
460
|
key: "renderModal",
|
|
460
461
|
value: function renderModal(isSmall, ComponentItems) {
|
|
461
462
|
var _ref = this.asProps,
|
|
462
|
-
|
|
463
|
+
_ref10,
|
|
463
464
|
_this5 = this;
|
|
464
465
|
var SModalContainer = Box;
|
|
465
466
|
var SModalBox = Box;
|
|
466
|
-
var SImageBoxContainer = Box;
|
|
467
467
|
var _this$asProps3 = this.asProps,
|
|
468
468
|
styles = _this$asProps3.styles,
|
|
469
469
|
uid = _this$asProps3.uid,
|
|
470
470
|
duration = _this$asProps3.duration,
|
|
471
471
|
zoomWidth = _this$asProps3.zoomWidth;
|
|
472
472
|
var isOpenZoom = this.state.isOpenZoom;
|
|
473
|
-
return
|
|
473
|
+
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(Modal, _ref10.cn("Modal", {
|
|
474
474
|
"visible": isOpenZoom,
|
|
475
475
|
"onClose": this.handleToggleZoomModal,
|
|
476
476
|
"ghost": true,
|
|
477
477
|
"closable": !isSmall
|
|
478
|
-
}), /*#__PURE__*/React.createElement(Flex,
|
|
478
|
+
}), /*#__PURE__*/React.createElement(Flex, _ref10.cn("Flex", {
|
|
479
479
|
"direction": isSmall ? 'column' : 'row'
|
|
480
480
|
}), !isSmall && /*#__PURE__*/React.createElement(Carousel.Prev, {
|
|
481
481
|
inverted: true
|
|
482
|
-
}), /*#__PURE__*/React.createElement(
|
|
482
|
+
}), /*#__PURE__*/React.createElement(SModalBox, _ref10.cn("SModalBox", {}), /*#__PURE__*/React.createElement(SModalContainer, _ref10.cn("SModalContainer", _objectSpread({}, _assignProps({
|
|
483
483
|
"aria-live": 'polite',
|
|
484
484
|
"use:duration": "".concat(duration, "ms"),
|
|
485
485
|
"ref": this.refModalContainer,
|
|
@@ -496,7 +496,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
496
496
|
zoomOut: true,
|
|
497
497
|
transform: _this5.isSelected(i) ? _this5.getTransform() : undefined
|
|
498
498
|
}));
|
|
499
|
-
})))
|
|
499
|
+
}))), isSmall ? /*#__PURE__*/React.createElement(Flex, _ref10.cn("Flex", {
|
|
500
500
|
"justifyContent": 'center',
|
|
501
501
|
"mt": 2
|
|
502
502
|
}), /*#__PURE__*/React.createElement(Carousel.Prev, {
|
|
@@ -513,7 +513,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
513
513
|
key: "render",
|
|
514
514
|
value: function render() {
|
|
515
515
|
var _ref2 = this.asProps,
|
|
516
|
-
|
|
516
|
+
_ref11,
|
|
517
517
|
_this6 = this;
|
|
518
518
|
var SCarousel = Box;
|
|
519
519
|
var _this$asProps4 = this.asProps,
|
|
@@ -522,35 +522,38 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
522
522
|
uid = _this$asProps4.uid,
|
|
523
523
|
hasZoom = _this$asProps4.zoom,
|
|
524
524
|
ariaLabel = _this$asProps4['aria-label'],
|
|
525
|
-
|
|
526
|
-
|
|
525
|
+
ariaRoledescription = _this$asProps4['aria-roledescription'],
|
|
526
|
+
indicators = _this$asProps4.indicators;
|
|
527
527
|
var ComponentItems = findAllComponents(Children, ['Carousel.Item']);
|
|
528
528
|
var Controls = findAllComponents(Children, ['Carousel.Prev', 'Carousel.Next', 'Carousel.Indicators']);
|
|
529
|
-
return
|
|
529
|
+
return _ref11 = sstyled(styles), /*#__PURE__*/React.createElement(SCarousel, _ref11.cn("SCarousel", _objectSpread({}, _assignProps2({
|
|
530
530
|
"role": 'region',
|
|
531
|
-
"
|
|
531
|
+
"roledescription": 'carousel',
|
|
532
532
|
"onKeyDown": this.handlerKeyDown,
|
|
533
533
|
"onTouchStart": this.handlerTouchStart,
|
|
534
534
|
"onTouchEnd": this.handlerTouchEnd,
|
|
535
535
|
"ref": this.refCarousel,
|
|
536
|
-
"id": "igc-".concat(uid, "-carousel")
|
|
537
|
-
|
|
536
|
+
"id": "igc-".concat(uid, "-carousel"),
|
|
537
|
+
"aria-roledescription": ariaRoledescription
|
|
538
|
+
}, _ref2))), Controls.length === 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flex, _ref11.cn("Flex", {}), /*#__PURE__*/React.createElement(Carousel.Prev, null), /*#__PURE__*/React.createElement(Carousel.ContentBox, null, /*#__PURE__*/React.createElement(Carousel.Container, {
|
|
538
539
|
"aria-label": ariaLabel
|
|
539
|
-
}, /*#__PURE__*/React.createElement(Children,
|
|
540
|
+
}, /*#__PURE__*/React.createElement(Children, _ref11.cn("Children", {})))), /*#__PURE__*/React.createElement(Carousel.Next, null)), indicators === 'default' && /*#__PURE__*/React.createElement(Carousel.Indicators, null), indicators === 'preview' && /*#__PURE__*/React.createElement(Carousel.Indicators, null, function () {
|
|
540
541
|
return ComponentItems.map(function (item, index) {
|
|
541
542
|
return /*#__PURE__*/React.createElement(Carousel.Indicator, _extends({}, item.props, {
|
|
542
543
|
key: item.key,
|
|
543
|
-
w:
|
|
544
|
-
|
|
544
|
+
w: 100,
|
|
545
|
+
h: 100,
|
|
546
|
+
"aria-roledescription": "slide",
|
|
545
547
|
active: _this6.isSelected(index),
|
|
546
548
|
onClick: _this6.bindHandlerClickIndicator(index)
|
|
547
549
|
}));
|
|
548
550
|
});
|
|
549
|
-
})) : /*#__PURE__*/React.createElement(Children,
|
|
551
|
+
})) : /*#__PURE__*/React.createElement(Children, _ref11.cn("Children", {})), hasZoom && /*#__PURE__*/React.createElement(BreakPoints, _ref11.cn("BreakPoints", {}), /*#__PURE__*/React.createElement(BreakPoints.Context.Consumer, null, function (mediaIndex) {
|
|
550
552
|
return _this6.renderModal(isSmallScreen(mediaIndex), ComponentItems);
|
|
551
553
|
})));
|
|
552
554
|
}
|
|
553
555
|
}]);
|
|
556
|
+
return CarouselRoot;
|
|
554
557
|
}(Component);
|
|
555
558
|
_defineProperty(CarouselRoot, "displayName", 'Carousel');
|
|
556
559
|
_defineProperty(CarouselRoot, "defaultProps", {
|
|
@@ -564,48 +567,48 @@ _defineProperty(CarouselRoot, "defaultProps", {
|
|
|
564
567
|
});
|
|
565
568
|
_defineProperty(CarouselRoot, "style", style);
|
|
566
569
|
_defineProperty(CarouselRoot, "enhance", enhance);
|
|
567
|
-
function Container(props) {
|
|
570
|
+
var Container = function Container(props) {
|
|
568
571
|
var _ref3 = arguments[0],
|
|
569
|
-
|
|
572
|
+
_ref12;
|
|
570
573
|
var SContainer = Box;
|
|
571
574
|
var styles = props.styles,
|
|
572
575
|
duration = props.duration;
|
|
573
|
-
return
|
|
576
|
+
return _ref12 = sstyled(styles), /*#__PURE__*/React.createElement(SContainer, _ref12.cn("SContainer", _objectSpread({}, _assignProps3({
|
|
574
577
|
"use:duration": "".concat(duration, "ms"),
|
|
575
578
|
"aria-live": 'polite'
|
|
576
579
|
}, _ref3))));
|
|
577
|
-
}
|
|
578
|
-
function ContentBox(props) {
|
|
580
|
+
};
|
|
581
|
+
var ContentBox = function ContentBox(props) {
|
|
579
582
|
var _ref4 = arguments[0],
|
|
580
|
-
|
|
583
|
+
_ref13;
|
|
581
584
|
var SContentBox = Box;
|
|
582
585
|
var styles = props.styles;
|
|
583
|
-
return
|
|
584
|
-
}
|
|
586
|
+
return _ref13 = sstyled(styles), /*#__PURE__*/React.createElement(SContentBox, _ref13.cn("SContentBox", _objectSpread({}, _assignProps4({}, _ref4))));
|
|
587
|
+
};
|
|
585
588
|
var Item = /*#__PURE__*/function (_Component2) {
|
|
589
|
+
_inherits(Item, _Component2);
|
|
590
|
+
var _super2 = _createSuper(Item);
|
|
586
591
|
function Item() {
|
|
587
592
|
var _this7;
|
|
588
593
|
_classCallCheck(this, Item);
|
|
589
594
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
590
595
|
args[_key] = arguments[_key];
|
|
591
596
|
}
|
|
592
|
-
_this7 =
|
|
593
|
-
_defineProperty(_this7, "refItem", /*#__PURE__*/React.createRef());
|
|
597
|
+
_this7 = _super2.call.apply(_super2, [this].concat(args));
|
|
598
|
+
_defineProperty(_assertThisInitialized(_this7), "refItem", /*#__PURE__*/React.createRef());
|
|
599
|
+
_defineProperty(_assertThisInitialized(_this7), "keepFocusTimeout", void 0);
|
|
594
600
|
return _this7;
|
|
595
601
|
}
|
|
596
|
-
|
|
597
|
-
return _createClass(Item, [{
|
|
602
|
+
_createClass(Item, [{
|
|
598
603
|
key: "componentDidMount",
|
|
599
604
|
value: function componentDidMount() {
|
|
600
605
|
var _this$props = this.props,
|
|
601
606
|
toggleItem = _this$props.toggleItem,
|
|
602
607
|
transform = _this$props.transform;
|
|
603
608
|
var refItem = this.refItem.current;
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
});
|
|
608
|
-
}
|
|
609
|
+
toggleItem && refItem && toggleItem({
|
|
610
|
+
node: refItem
|
|
611
|
+
});
|
|
609
612
|
if (transform && refItem) {
|
|
610
613
|
refItem.style.transform = "translateX(".concat(transform, "%)");
|
|
611
614
|
}
|
|
@@ -615,26 +618,41 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
615
618
|
value: function componentWillUnmount() {
|
|
616
619
|
var toggleItem = this.props.toggleItem;
|
|
617
620
|
var refItem = this.refItem.current;
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
}
|
|
621
|
+
toggleItem && refItem && toggleItem({
|
|
622
|
+
node: refItem
|
|
623
|
+
}, true);
|
|
624
|
+
clearTimeout(this.keepFocusTimeout);
|
|
623
625
|
}
|
|
624
626
|
}, {
|
|
625
627
|
key: "componentDidUpdate",
|
|
626
628
|
value: function componentDidUpdate(prevProps) {
|
|
629
|
+
var _this8 = this;
|
|
630
|
+
clearTimeout(this.keepFocusTimeout);
|
|
627
631
|
var transform = this.props.transform;
|
|
628
632
|
var refItem = this.refItem.current;
|
|
629
633
|
if (prevProps.transform !== transform && refItem) {
|
|
630
634
|
refItem.style.transform = "translateX(".concat(transform, "%)");
|
|
631
635
|
}
|
|
636
|
+
if (this.props.current) {
|
|
637
|
+
this.keepFocusTimeout = setTimeout(function () {
|
|
638
|
+
var _document$activeEleme;
|
|
639
|
+
if (document.activeElement !== refItem && ((_document$activeEleme = document.activeElement) === null || _document$activeEleme === void 0 ? void 0 : _document$activeEleme.dataset.carousel) === (refItem === null || refItem === void 0 ? void 0 : refItem.dataset.carousel)) {
|
|
640
|
+
refItem === null || refItem === void 0 ? void 0 : refItem.focus();
|
|
641
|
+
}
|
|
642
|
+
}, 100);
|
|
643
|
+
}
|
|
644
|
+
if (prevProps.isOpenZoom === true && this.props.isOpenZoom === false && this.props.current && !this.props.zoomOut) {
|
|
645
|
+
this.keepFocusTimeout = setTimeout(function () {
|
|
646
|
+
var _this8$refItem$curren;
|
|
647
|
+
(_this8$refItem$curren = _this8.refItem.current) === null || _this8$refItem$curren === void 0 ? void 0 : _this8$refItem$curren.focus();
|
|
648
|
+
}, 200);
|
|
649
|
+
}
|
|
632
650
|
}
|
|
633
651
|
}, {
|
|
634
652
|
key: "render",
|
|
635
653
|
value: function render() {
|
|
636
654
|
var _ref5 = this.asProps,
|
|
637
|
-
|
|
655
|
+
_ref14;
|
|
638
656
|
var _this$props2 = this.props,
|
|
639
657
|
styles = _this$props2.styles,
|
|
640
658
|
index = _this$props2.index,
|
|
@@ -643,7 +661,7 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
643
661
|
zoomIn = _this$props2.zoomIn,
|
|
644
662
|
onToggleZoomModal = _this$props2.onToggleZoomModal;
|
|
645
663
|
var SItem = Box;
|
|
646
|
-
return
|
|
664
|
+
return _ref14 = sstyled(styles), /*#__PURE__*/React.createElement(SItem, _ref14.cn("SItem", _objectSpread({}, _assignProps5({
|
|
647
665
|
"ref": this.refItem,
|
|
648
666
|
"role": 'tabpanel',
|
|
649
667
|
"data-carousel": "igc-".concat(uid, "-carousel"),
|
|
@@ -655,10 +673,12 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
655
673
|
}, _ref5))));
|
|
656
674
|
}
|
|
657
675
|
}]);
|
|
676
|
+
return Item;
|
|
658
677
|
}(Component);
|
|
659
|
-
|
|
678
|
+
_defineProperty(Item, "enhance", [keyboardFocusEnhance(false)]);
|
|
679
|
+
var Prev = function Prev(props) {
|
|
660
680
|
var _ref6 = arguments[0],
|
|
661
|
-
|
|
681
|
+
_ref15;
|
|
662
682
|
var styles = props.styles,
|
|
663
683
|
children = props.children,
|
|
664
684
|
Children = props.Children,
|
|
@@ -668,21 +688,19 @@ function Prev(props) {
|
|
|
668
688
|
inverted = props.inverted;
|
|
669
689
|
var SPrev = Box;
|
|
670
690
|
var SPrevButton = Button;
|
|
671
|
-
return
|
|
691
|
+
return _ref15 = sstyled(styles), /*#__PURE__*/React.createElement(SPrev, _ref15.cn("SPrev", _objectSpread({}, _assignProps6({
|
|
672
692
|
"top": top
|
|
673
|
-
}, _ref6))), children ? /*#__PURE__*/React.createElement(Children,
|
|
693
|
+
}, _ref6))), children ? /*#__PURE__*/React.createElement(Children, _ref15.cn("Children", {})) : /*#__PURE__*/React.createElement(SPrevButton, _ref15.cn("SPrevButton", {
|
|
674
694
|
"addonLeft": ChevronLeft,
|
|
675
695
|
"aria-label": label,
|
|
676
696
|
"theme": inverted ? 'invert' : 'muted',
|
|
677
697
|
"use": 'tertiary',
|
|
678
|
-
"size": 'l'
|
|
679
|
-
"innerOutline": true
|
|
698
|
+
"size": 'l'
|
|
680
699
|
})));
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
function Next(props) {
|
|
700
|
+
};
|
|
701
|
+
var Next = function Next(props) {
|
|
684
702
|
var _ref7 = arguments[0],
|
|
685
|
-
|
|
703
|
+
_ref16;
|
|
686
704
|
var styles = props.styles,
|
|
687
705
|
children = props.children,
|
|
688
706
|
Children = props.Children,
|
|
@@ -692,53 +710,45 @@ function Next(props) {
|
|
|
692
710
|
inverted = props.inverted;
|
|
693
711
|
var SNext = Box;
|
|
694
712
|
var SNextButton = Button;
|
|
695
|
-
return
|
|
713
|
+
return _ref16 = sstyled(styles), /*#__PURE__*/React.createElement(SNext, _ref16.cn("SNext", _objectSpread({}, _assignProps7({
|
|
696
714
|
"top": top
|
|
697
|
-
}, _ref7))), children ? /*#__PURE__*/React.createElement(Children,
|
|
715
|
+
}, _ref7))), children ? /*#__PURE__*/React.createElement(Children, _ref16.cn("Children", {})) : /*#__PURE__*/React.createElement(SNextButton, _ref16.cn("SNextButton", {
|
|
698
716
|
"addonLeft": ChevronRight,
|
|
699
717
|
"aria-label": label,
|
|
700
718
|
"theme": inverted ? 'invert' : 'muted',
|
|
701
719
|
"use": 'tertiary',
|
|
702
|
-
"size": 'l'
|
|
703
|
-
"innerOutline": true
|
|
720
|
+
"size": 'l'
|
|
704
721
|
})));
|
|
705
|
-
}
|
|
706
|
-
|
|
707
|
-
function Indicators(_ref19) {
|
|
722
|
+
};
|
|
723
|
+
var Indicators = function Indicators(_ref21) {
|
|
708
724
|
var _ref8 = arguments[0],
|
|
709
|
-
|
|
710
|
-
var items =
|
|
711
|
-
styles =
|
|
712
|
-
Children =
|
|
713
|
-
inverted =
|
|
725
|
+
_ref18;
|
|
726
|
+
var items = _ref21.items,
|
|
727
|
+
styles = _ref21.styles,
|
|
728
|
+
Children = _ref21.Children,
|
|
729
|
+
inverted = _ref21.inverted;
|
|
714
730
|
var SIndicators = Box;
|
|
715
731
|
if (Children.origin) {
|
|
716
|
-
var
|
|
717
|
-
return
|
|
718
|
-
"innerOffset": true
|
|
719
|
-
}, _ref8))), /*#__PURE__*/React.createElement(Children, _ref15.cn("Children", {})));
|
|
732
|
+
var _ref17;
|
|
733
|
+
return _ref17 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref17.cn("SIndicators", _objectSpread({}, _assignProps8({}, _ref8))), /*#__PURE__*/React.createElement(Children, _ref17.cn("Children", {})));
|
|
720
734
|
}
|
|
721
|
-
return
|
|
722
|
-
"invertOutline": inverted
|
|
723
|
-
}, _ref8))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
735
|
+
return _ref18 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref18.cn("SIndicators", _objectSpread({}, _assignProps9({}, _ref8))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
724
736
|
return /*#__PURE__*/React.createElement(Carousel.Indicator, _extends({
|
|
725
737
|
key: index
|
|
726
738
|
}, item, {
|
|
727
739
|
inverted: inverted
|
|
728
740
|
}));
|
|
729
741
|
}));
|
|
730
|
-
}
|
|
731
|
-
;
|
|
732
|
-
function Indicator(
|
|
742
|
+
};
|
|
743
|
+
Indicators.enhance = [keyboardFocusEnhance()];
|
|
744
|
+
var Indicator = function Indicator(_ref22) {
|
|
733
745
|
var _ref9 = arguments[0],
|
|
734
|
-
|
|
735
|
-
var styles =
|
|
736
|
-
Children =
|
|
737
|
-
inverted = _ref20.inverted;
|
|
746
|
+
_ref19;
|
|
747
|
+
var styles = _ref22.styles,
|
|
748
|
+
Children = _ref22.Children;
|
|
738
749
|
var SIndicator = Box;
|
|
739
|
-
return
|
|
740
|
-
}
|
|
741
|
-
;
|
|
750
|
+
return _ref19 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicator, _ref19.cn("SIndicator", _objectSpread({}, _assignProps10({}, _ref9))), /*#__PURE__*/React.createElement(Children, _ref19.cn("Children", {})));
|
|
751
|
+
};
|
|
742
752
|
var Carousel = createComponent(CarouselRoot, {
|
|
743
753
|
Container: Container,
|
|
744
754
|
ContentBox: ContentBox,
|