@semcore/carousel 3.42.5 → 3.43.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/CHANGELOG.md +6 -0
- package/lib/cjs/Carousel.js +79 -57
- package/lib/cjs/Carousel.js.map +1 -1
- package/lib/cjs/style/carousel.shadow.css +48 -4
- package/lib/cjs/translations/de.json +4 -2
- package/lib/cjs/translations/en.json +4 -2
- package/lib/cjs/translations/es.json +4 -2
- package/lib/cjs/translations/fr.json +4 -2
- package/lib/cjs/translations/it.json +4 -2
- package/lib/cjs/translations/ja.json +4 -2
- package/lib/cjs/translations/ko.json +4 -2
- package/lib/cjs/translations/nl.json +4 -2
- package/lib/cjs/translations/pl.json +4 -2
- package/lib/cjs/translations/pt.json +4 -2
- package/lib/cjs/translations/sv.json +4 -2
- package/lib/cjs/translations/tr.json +4 -2
- package/lib/cjs/translations/vi.json +4 -2
- package/lib/cjs/translations/zh.json +4 -2
- package/lib/es6/Carousel.js +79 -57
- package/lib/es6/Carousel.js.map +1 -1
- package/lib/es6/style/carousel.shadow.css +48 -4
- package/lib/es6/translations/de.json +4 -2
- package/lib/es6/translations/en.json +4 -2
- package/lib/es6/translations/es.json +4 -2
- package/lib/es6/translations/fr.json +4 -2
- package/lib/es6/translations/it.json +4 -2
- package/lib/es6/translations/ja.json +4 -2
- package/lib/es6/translations/ko.json +4 -2
- package/lib/es6/translations/nl.json +4 -2
- package/lib/es6/translations/pl.json +4 -2
- package/lib/es6/translations/pt.json +4 -2
- package/lib/es6/translations/sv.json +4 -2
- package/lib/es6/translations/tr.json +4 -2
- package/lib/es6/translations/vi.json +4 -2
- package/lib/es6/translations/zh.json +4 -2
- package/lib/types/translations/__intergalactic-dynamic-locales.d.ts +28 -0
- package/package.json +7 -7
- package/src/Carousel.tsx +62 -32
- package/src/style/carousel.shadow.css +48 -4
- package/src/translations/de.json +4 -2
- package/src/translations/en.json +4 -2
- package/src/translations/es.json +4 -2
- package/src/translations/fr.json +4 -2
- package/src/translations/it.json +4 -2
- package/src/translations/ja.json +4 -2
- package/src/translations/ko.json +4 -2
- package/src/translations/nl.json +4 -2
- package/src/translations/pl.json +4 -2
- package/src/translations/pt.json +4 -2
- package/src/translations/sv.json +4 -2
- package/src/translations/tr.json +4 -2
- package/src/translations/vi.json +4 -2
- package/src/translations/zh.json +4 -2
|
@@ -4,10 +4,6 @@ SCarousel {
|
|
|
4
4
|
user-select: none;
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
-
SCarousel[keyboardFocused] {
|
|
8
|
-
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
|
9
|
-
z-index: 1;
|
|
10
|
-
}
|
|
11
7
|
|
|
12
8
|
SContainer {
|
|
13
9
|
display: flex;
|
|
@@ -15,8 +11,22 @@ SContainer {
|
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
SContentBox, SModalBox {
|
|
14
|
+
position: relative;
|
|
18
15
|
overflow: hidden;
|
|
19
16
|
border-radius: var(--intergalactic-surface-rounded, 6px);
|
|
17
|
+
&:has(SItem[keyboardFocused]) {
|
|
18
|
+
&:after {
|
|
19
|
+
content: '';
|
|
20
|
+
display: block;
|
|
21
|
+
position: absolute;
|
|
22
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
|
23
|
+
z-index: 1;
|
|
24
|
+
width: calc(100% - 3px * 2);
|
|
25
|
+
height: calc(100% - 3px * 2);
|
|
26
|
+
top: 3px;
|
|
27
|
+
left: 3px;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
20
30
|
}
|
|
21
31
|
|
|
22
32
|
SModalContainer {
|
|
@@ -31,6 +41,7 @@ SItem {
|
|
|
31
41
|
transform: var(--transform);
|
|
32
42
|
border-radius: var(--intergalactic-surface-rounded, 6px);
|
|
33
43
|
overflow: hidden;
|
|
44
|
+
outline: none;
|
|
34
45
|
}
|
|
35
46
|
|
|
36
47
|
SItem[zoomIn] {
|
|
@@ -44,6 +55,20 @@ SIndicators {
|
|
|
44
55
|
display: flex;
|
|
45
56
|
justify-content: center;
|
|
46
57
|
margin-top: var(--intergalactic-spacing-4x, 16px);
|
|
58
|
+
outline: none;
|
|
59
|
+
position: relative;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
SIndicators[keyboardFocused]:after {
|
|
63
|
+
content: '';
|
|
64
|
+
display: block;
|
|
65
|
+
position: absolute;
|
|
66
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
|
67
|
+
z-index: 1;
|
|
68
|
+
width: calc(100% - 3px * 2);
|
|
69
|
+
height: calc(100% - 3px);
|
|
70
|
+
top: 0;
|
|
71
|
+
left: 3px;
|
|
47
72
|
}
|
|
48
73
|
|
|
49
74
|
SIndicator {
|
|
@@ -83,6 +108,25 @@ SNext {
|
|
|
83
108
|
margin-left: calc(2 * var(--intergalactic-spacing-1x, 4px) - 1px);
|
|
84
109
|
margin-right: calc(2 * var(--intergalactic-spacing-1x, 4px) - 1px);
|
|
85
110
|
}
|
|
111
|
+
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
SPrevButton, SNextButton {
|
|
115
|
+
&:focus-visible {
|
|
116
|
+
box-shadow: none;
|
|
117
|
+
&:after {
|
|
118
|
+
content: '';
|
|
119
|
+
display: block;
|
|
120
|
+
position: absolute;
|
|
121
|
+
box-shadow: var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));
|
|
122
|
+
z-index: 1;
|
|
123
|
+
width: calc(100% - 3px * 2);
|
|
124
|
+
height: calc(100% - 3px * 2);
|
|
125
|
+
top: 3px;
|
|
126
|
+
left: 3px;
|
|
127
|
+
border-radius: var(--intergalactic-control-rounded, 6px);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
86
130
|
}
|
|
87
131
|
|
|
88
132
|
SPrev {
|
package/lib/es6/Carousel.js
CHANGED
|
@@ -29,27 +29,27 @@ import i18nEnhance from '@semcore/utils/lib/enhances/i18nEnhance';
|
|
|
29
29
|
import { localizedMessages } from './translations/__intergalactic-dynamic-locales';
|
|
30
30
|
import logger from '@semcore/utils/lib/logger';
|
|
31
31
|
/*__reshadow-styles__:"./style/carousel.shadow.css"*/
|
|
32
|
-
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".
|
|
33
|
-
"__SCarousel": "
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"
|
|
45
|
-
"
|
|
46
|
-
"
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
"__SPrevButton": "
|
|
52
|
-
"__SNextButton": "
|
|
32
|
+
var style = ( /*__reshadow_css_start__*/_sstyled.insert( /*__inner_css_start__*/".___SCarousel_11eq6_gg_{overflow:hidden;outline:0;-webkit-user-select:none;-moz-user-select:none;user-select:none}.___SContainer_11eq6_gg_{display:flex;transition:transform var(--duration_11eq6) ease-in-out}.___SContentBox_11eq6_gg_,.___SModalBox_11eq6_gg_{position:relative;overflow:hidden;border-radius:var(--intergalactic-surface-rounded, 6px)}.___SContentBox_11eq6_gg_:has(.___SItem_11eq6_gg_.__keyboardFocused_11eq6_gg_):after,.___SModalBox_11eq6_gg_:has(.___SItem_11eq6_gg_.__keyboardFocused_11eq6_gg_):after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px}.___SModalContainer_11eq6_gg_{display:flex;transition:transform var(--duration_11eq6) ease-in-out}.___SItem_11eq6_gg_{flex:0 0 100%;max-width:100%;box-sizing:border-box;transform:var(--transform_11eq6);border-radius:var(--intergalactic-surface-rounded, 6px);overflow:hidden;outline:0}.___SItem_11eq6_gg_.__zoomIn_11eq6_gg_{cursor:zoom-in}.___SItem_11eq6_gg_.__zoomOut_11eq6_gg_{cursor:zoom-out}.___SIndicators_11eq6_gg_{display:flex;justify-content:center;margin-top:var(--intergalactic-spacing-4x, 16px);outline:0;position:relative}.___SIndicators_11eq6_gg_.__keyboardFocused_11eq6_gg_:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px);top:0;left:3px}.___SIndicator_11eq6_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, #a9abb6);opacity:var(--intergalactic-disabled-opacity, 0.3);-o-object-fit:cover;object-fit:cover;transition:ease-in-out opacity .1s}@media (hover:hover){.___SIndicator_11eq6_gg_:hover{opacity:calc(2*var(--intergalactic-disabled-opacity, 0.3))}}.___SIndicator_11eq6_gg_.__active_11eq6_gg_{opacity:1}.___SIndicator_11eq6_gg_.__inverted_11eq6_gg_{background-color:var(--intergalactic-icon-primary-invert, #ffffff)}.___SNext_11eq6_gg_,.___SPrev_11eq6_gg_{display:inline-flex;align-items:center;justify-content:center;cursor:pointer;color:var(--intergalactic-icon-primary-neutral, #6c6e79)}.___SNext_11eq6_gg_ .___SNextButton_11eq6_gg_ span:has(>svg:only-child),.___SNext_11eq6_gg_ .___SPrevButton_11eq6_gg_ span:has(>svg:only-child),.___SPrev_11eq6_gg_ .___SNextButton_11eq6_gg_ span:has(>svg:only-child),.___SPrev_11eq6_gg_ .___SPrevButton_11eq6_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_11eq6_gg_:focus-visible,.___SPrevButton_11eq6_gg_:focus-visible{box-shadow:none}.___SNextButton_11eq6_gg_:focus-visible:after,.___SPrevButton_11eq6_gg_:focus-visible:after{content:\"\";display:block;position:absolute;box-shadow:var(--intergalactic-keyboard-focus, 0px 0px 0px 3px rgba(0, 143, 248, 0.5));z-index:1;width:calc(100% - 3px*2);height:calc(100% - 3px*2);top:3px;left:3px;border-radius:var(--intergalactic-control-rounded, 6px)}.___SPrev_11eq6_gg_{margin-right:var(--intergalactic-spacing-2x, 8px)}.___SNext_11eq6_gg_{margin-left:var(--intergalactic-spacing-2x, 8px)}.___SNext_11eq6_gg_.__disabled_11eq6_gg_,.___SPrev_11eq6_gg_.__disabled_11eq6_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}@media (prefers-reduced-motion){.___SContainer_11eq6_gg_{transition:none}}" /*__inner_css_end__*/, "11eq6_gg_") /*__reshadow_css_end__*/, {
|
|
33
|
+
"__SCarousel": "___SCarousel_11eq6_gg_",
|
|
34
|
+
"__SContainer": "___SContainer_11eq6_gg_",
|
|
35
|
+
"--duration": "--duration_11eq6",
|
|
36
|
+
"__SModalContainer": "___SModalContainer_11eq6_gg_",
|
|
37
|
+
"__SItem": "___SItem_11eq6_gg_",
|
|
38
|
+
"--transform": "--transform_11eq6",
|
|
39
|
+
"_zoomIn": "__zoomIn_11eq6_gg_",
|
|
40
|
+
"_zoomOut": "__zoomOut_11eq6_gg_",
|
|
41
|
+
"__SIndicators": "___SIndicators_11eq6_gg_",
|
|
42
|
+
"_keyboardFocused": "__keyboardFocused_11eq6_gg_",
|
|
43
|
+
"__SIndicator": "___SIndicator_11eq6_gg_",
|
|
44
|
+
"_active": "__active_11eq6_gg_",
|
|
45
|
+
"_inverted": "__inverted_11eq6_gg_",
|
|
46
|
+
"__SPrev": "___SPrev_11eq6_gg_",
|
|
47
|
+
"__SNext": "___SNext_11eq6_gg_",
|
|
48
|
+
"_disabled": "__disabled_11eq6_gg_",
|
|
49
|
+
"__SContentBox": "___SContentBox_11eq6_gg_",
|
|
50
|
+
"__SModalBox": "___SModalBox_11eq6_gg_",
|
|
51
|
+
"__SPrevButton": "___SPrevButton_11eq6_gg_",
|
|
52
|
+
"__SNextButton": "___SNextButton_11eq6_gg_"
|
|
53
53
|
});
|
|
54
54
|
import { findAllComponents } from '@semcore/utils/lib/findComponent';
|
|
55
55
|
import { createBreakpoints } from '@semcore/breakpoints';
|
|
@@ -60,8 +60,7 @@ var MAP_TRANSFORM = {
|
|
|
60
60
|
};
|
|
61
61
|
var enhance = {
|
|
62
62
|
uid: uniqueIDEnhancement(),
|
|
63
|
-
|
|
64
|
-
keyboardFocusEnhance: keyboardFocusEnhance()
|
|
63
|
+
i18nEnahnce: i18nEnhance(localizedMessages)
|
|
65
64
|
};
|
|
66
65
|
var media = ['(min-width: 481px)', '(max-width: 480px)'];
|
|
67
66
|
var BreakPoints = createBreakpoints(media);
|
|
@@ -348,7 +347,8 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
348
347
|
value: function getPrevProps() {
|
|
349
348
|
var _this$asProps = this.asProps,
|
|
350
349
|
bounded = _this$asProps.bounded,
|
|
351
|
-
getI18nText = _this$asProps.getI18nText
|
|
350
|
+
getI18nText = _this$asProps.getI18nText,
|
|
351
|
+
uid = _this$asProps.uid;
|
|
352
352
|
var _this$state3 = this.state,
|
|
353
353
|
items = _this$state3.items,
|
|
354
354
|
selectedIndex = _this$state3.selectedIndex;
|
|
@@ -361,7 +361,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
361
361
|
onKeyDown: this.bindHandlerKeydownControl('left'),
|
|
362
362
|
disabled: disabled,
|
|
363
363
|
label: getI18nText('prev'),
|
|
364
|
-
|
|
364
|
+
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
365
365
|
};
|
|
366
366
|
}
|
|
367
367
|
}, {
|
|
@@ -369,7 +369,8 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
369
369
|
value: function getNextProps() {
|
|
370
370
|
var _this$asProps2 = this.asProps,
|
|
371
371
|
bounded = _this$asProps2.bounded,
|
|
372
|
-
getI18nText = _this$asProps2.getI18nText
|
|
372
|
+
getI18nText = _this$asProps2.getI18nText,
|
|
373
|
+
uid = _this$asProps2.uid;
|
|
373
374
|
var _this$state4 = this.state,
|
|
374
375
|
items = _this$state4.items,
|
|
375
376
|
selectedIndex = _this$state4.selectedIndex;
|
|
@@ -382,7 +383,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
382
383
|
onKeyDown: this.bindHandlerKeydownControl('right'),
|
|
383
384
|
disabled: disabled,
|
|
384
385
|
label: getI18nText('next'),
|
|
385
|
-
|
|
386
|
+
'aria-controls': "igc-".concat(uid, "-carousel")
|
|
386
387
|
};
|
|
387
388
|
}
|
|
388
389
|
}, {
|
|
@@ -390,6 +391,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
390
391
|
value: function getIndicatorsProps() {
|
|
391
392
|
var _this4 = this;
|
|
392
393
|
var items = this.state.items;
|
|
394
|
+
var getI18nText = this.asProps.getI18nText;
|
|
393
395
|
return {
|
|
394
396
|
items: items.map(function (item, key) {
|
|
395
397
|
return {
|
|
@@ -397,6 +399,22 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
397
399
|
onClick: _this4.bindHandlerClickIndicator(key),
|
|
398
400
|
key: key
|
|
399
401
|
};
|
|
402
|
+
}),
|
|
403
|
+
role: 'tablist',
|
|
404
|
+
'aria-label': getI18nText('slides')
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
}, {
|
|
408
|
+
key: "getIndicatorProps",
|
|
409
|
+
value: function getIndicatorProps(_, index) {
|
|
410
|
+
var isCurrent = this.isSelected(index);
|
|
411
|
+
var getI18nText = this.asProps.getI18nText;
|
|
412
|
+
return {
|
|
413
|
+
role: 'tab',
|
|
414
|
+
'aria-selected': isCurrent,
|
|
415
|
+
'aria-controls': "igc-".concat(this.asProps.uid, "-carousel-item-").concat(index),
|
|
416
|
+
'aria-label': getI18nText('slide', {
|
|
417
|
+
slideNumber: index + 1
|
|
400
418
|
})
|
|
401
419
|
};
|
|
402
420
|
}
|
|
@@ -428,9 +446,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
428
446
|
}, {
|
|
429
447
|
key: "isSelected",
|
|
430
448
|
value: function isSelected(index) {
|
|
431
|
-
var
|
|
432
|
-
items = _this$state7.items,
|
|
433
|
-
selectedIndex = _this$state7.selectedIndex;
|
|
449
|
+
var items = this.state.items;
|
|
434
450
|
if (items.length === 0) {
|
|
435
451
|
return true;
|
|
436
452
|
}
|
|
@@ -448,10 +464,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
448
464
|
styles = _this$asProps3.styles,
|
|
449
465
|
uid = _this$asProps3.uid,
|
|
450
466
|
duration = _this$asProps3.duration,
|
|
451
|
-
|
|
452
|
-
zoomWidth = _this$asProps3.zoomWidth,
|
|
453
|
-
ariaLabel = _this$asProps3['aria-label'],
|
|
454
|
-
ariaRoledescription = _this$asProps3['aria-roledescription'];
|
|
467
|
+
zoomWidth = _this$asProps3.zoomWidth;
|
|
455
468
|
var isOpenZoom = this.state.isOpenZoom;
|
|
456
469
|
return _ref9 = sstyled(styles), /*#__PURE__*/React.createElement(Modal, _ref9.cn("Modal", {
|
|
457
470
|
"visible": isOpenZoom,
|
|
@@ -463,7 +476,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
463
476
|
}), !isSmall && /*#__PURE__*/React.createElement(Carousel.Prev, {
|
|
464
477
|
inverted: true
|
|
465
478
|
}), /*#__PURE__*/React.createElement(SModalBox, _ref9.cn("SModalBox", {}), /*#__PURE__*/React.createElement(SModalContainer, _ref9.cn("SModalContainer", _objectSpread({}, _assignProps({
|
|
466
|
-
"
|
|
479
|
+
"aria-live": 'polite',
|
|
467
480
|
"use:duration": "".concat(duration, "ms"),
|
|
468
481
|
"ref": this.refModalContainer,
|
|
469
482
|
"use:w": undefined,
|
|
@@ -503,6 +516,7 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
503
516
|
var _this$asProps4 = this.asProps,
|
|
504
517
|
styles = _this$asProps4.styles,
|
|
505
518
|
Children = _this$asProps4.Children,
|
|
519
|
+
uid = _this$asProps4.uid,
|
|
506
520
|
hasZoom = _this$asProps4.zoom,
|
|
507
521
|
ariaLabel = _this$asProps4['aria-label'],
|
|
508
522
|
ariaRoledescription = _this$asProps4['aria-roledescription'],
|
|
@@ -510,13 +524,15 @@ var CarouselRoot = /*#__PURE__*/function (_Component) {
|
|
|
510
524
|
var ComponentItems = findAllComponents(Children, ['Carousel.Item']);
|
|
511
525
|
var Controls = findAllComponents(Children, ['Carousel.Prev', 'Carousel.Next', 'Carousel.Indicators']);
|
|
512
526
|
return _ref10 = sstyled(styles), /*#__PURE__*/React.createElement(SCarousel, _ref10.cn("SCarousel", _objectSpread({}, _assignProps2({
|
|
513
|
-
"role": '
|
|
527
|
+
"role": 'region',
|
|
528
|
+
"roledescription": 'carousel',
|
|
514
529
|
"onKeyDown": this.handlerKeyDown,
|
|
515
530
|
"onTouchStart": this.handlerTouchStart,
|
|
516
531
|
"onTouchEnd": this.handlerTouchEnd,
|
|
517
|
-
"ref": this.refCarousel
|
|
532
|
+
"ref": this.refCarousel,
|
|
533
|
+
"id": "igc-".concat(uid, "-carousel"),
|
|
534
|
+
"aria-roledescription": ariaRoledescription
|
|
518
535
|
}, _ref2))), Controls.length === 0 ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Flex, _ref10.cn("Flex", {}), /*#__PURE__*/React.createElement(Carousel.Prev, null), /*#__PURE__*/React.createElement(SContentBox, _ref10.cn("SContentBox", {}), /*#__PURE__*/React.createElement(Carousel.Container, {
|
|
519
|
-
"aria-roledescription": ariaRoledescription,
|
|
520
536
|
"aria-label": ariaLabel
|
|
521
537
|
}, /*#__PURE__*/React.createElement(Children, _ref10.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 () {
|
|
522
538
|
return ComponentItems.map(function (item, index) {
|
|
@@ -555,8 +571,8 @@ var Container = function Container(props) {
|
|
|
555
571
|
var styles = props.styles,
|
|
556
572
|
duration = props.duration;
|
|
557
573
|
return _ref11 = sstyled(styles), /*#__PURE__*/React.createElement(SContainer, _ref11.cn("SContainer", _objectSpread({}, _assignProps3({
|
|
558
|
-
"
|
|
559
|
-
"
|
|
574
|
+
"use:duration": "".concat(duration, "ms"),
|
|
575
|
+
"aria-live": 'polite'
|
|
560
576
|
}, _ref3))));
|
|
561
577
|
};
|
|
562
578
|
var Item = /*#__PURE__*/function (_Component2) {
|
|
@@ -570,6 +586,7 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
570
586
|
}
|
|
571
587
|
_this7 = _super2.call.apply(_super2, [this].concat(args));
|
|
572
588
|
_defineProperty(_assertThisInitialized(_this7), "refItem", /*#__PURE__*/React.createRef());
|
|
589
|
+
_defineProperty(_assertThisInitialized(_this7), "keepFocusTimeout", void 0);
|
|
573
590
|
return _this7;
|
|
574
591
|
}
|
|
575
592
|
_createClass(Item, [{
|
|
@@ -594,15 +611,25 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
594
611
|
toggleItem && refItem && toggleItem({
|
|
595
612
|
node: refItem
|
|
596
613
|
}, true);
|
|
614
|
+
clearTimeout(this.keepFocusTimeout);
|
|
597
615
|
}
|
|
598
616
|
}, {
|
|
599
617
|
key: "componentDidUpdate",
|
|
600
618
|
value: function componentDidUpdate(prevProps) {
|
|
619
|
+
clearTimeout(this.keepFocusTimeout);
|
|
601
620
|
var transform = this.props.transform;
|
|
602
621
|
var refItem = this.refItem.current;
|
|
603
622
|
if (prevProps.transform !== transform && refItem) {
|
|
604
623
|
refItem.style.transform = "translateX(".concat(transform, "%)");
|
|
605
624
|
}
|
|
625
|
+
if (this.props.current) {
|
|
626
|
+
this.keepFocusTimeout = setTimeout(function () {
|
|
627
|
+
var _document$activeEleme;
|
|
628
|
+
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)) {
|
|
629
|
+
refItem === null || refItem === void 0 ? void 0 : refItem.focus();
|
|
630
|
+
}
|
|
631
|
+
}, 100);
|
|
632
|
+
}
|
|
606
633
|
}
|
|
607
634
|
}, {
|
|
608
635
|
key: "render",
|
|
@@ -615,14 +642,15 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
615
642
|
uid = _this$props2.uid,
|
|
616
643
|
current = _this$props2.current,
|
|
617
644
|
zoomIn = _this$props2.zoomIn,
|
|
618
|
-
onToggleZoomModal = _this$props2.onToggleZoomModal
|
|
619
|
-
transform = _this$props2.transform;
|
|
645
|
+
onToggleZoomModal = _this$props2.onToggleZoomModal;
|
|
620
646
|
var SItem = Box;
|
|
621
647
|
return _ref12 = sstyled(styles), /*#__PURE__*/React.createElement(SItem, _ref12.cn("SItem", _objectSpread({}, _assignProps4({
|
|
622
648
|
"ref": this.refItem,
|
|
623
|
-
"role": '
|
|
649
|
+
"role": 'tabpanel',
|
|
650
|
+
"data-carousel": "igc-".concat(uid, "-carousel"),
|
|
624
651
|
"id": "igc-".concat(uid, "-carousel-item-").concat(index),
|
|
625
652
|
"aria-current": current,
|
|
653
|
+
"use:tabIndex": current ? 0 : -1,
|
|
626
654
|
"onClick": zoomIn ? onToggleZoomModal : undefined,
|
|
627
655
|
"zoomIn": zoomIn
|
|
628
656
|
}, _ref4))));
|
|
@@ -630,6 +658,7 @@ var Item = /*#__PURE__*/function (_Component2) {
|
|
|
630
658
|
}]);
|
|
631
659
|
return Item;
|
|
632
660
|
}(Component);
|
|
661
|
+
_defineProperty(Item, "enhance", [keyboardFocusEnhance(false)]);
|
|
633
662
|
var Prev = function Prev(props) {
|
|
634
663
|
var _ref5 = arguments[0],
|
|
635
664
|
_ref13;
|
|
@@ -639,8 +668,7 @@ var Prev = function Prev(props) {
|
|
|
639
668
|
label = props.label,
|
|
640
669
|
_props$top = props.top,
|
|
641
670
|
top = _props$top === void 0 ? 0 : _props$top,
|
|
642
|
-
inverted = props.inverted
|
|
643
|
-
tabIndex = props.tabIndex;
|
|
671
|
+
inverted = props.inverted;
|
|
644
672
|
var SPrev = Box;
|
|
645
673
|
var SPrevButton = Button;
|
|
646
674
|
return _ref13 = sstyled(styles), /*#__PURE__*/React.createElement(SPrev, _ref13.cn("SPrev", _objectSpread({}, _assignProps5({
|
|
@@ -650,8 +678,7 @@ var Prev = function Prev(props) {
|
|
|
650
678
|
"aria-label": label,
|
|
651
679
|
"theme": inverted ? 'invert' : 'muted',
|
|
652
680
|
"use": 'tertiary',
|
|
653
|
-
"size": 'l'
|
|
654
|
-
"tabIndex": tabIndex
|
|
681
|
+
"size": 'l'
|
|
655
682
|
})));
|
|
656
683
|
};
|
|
657
684
|
var Next = function Next(props) {
|
|
@@ -663,8 +690,7 @@ var Next = function Next(props) {
|
|
|
663
690
|
label = props.label,
|
|
664
691
|
_props$top2 = props.top,
|
|
665
692
|
top = _props$top2 === void 0 ? 0 : _props$top2,
|
|
666
|
-
inverted = props.inverted
|
|
667
|
-
tabIndex = props.tabIndex;
|
|
693
|
+
inverted = props.inverted;
|
|
668
694
|
var SNext = Box;
|
|
669
695
|
var SNextButton = Button;
|
|
670
696
|
return _ref14 = sstyled(styles), /*#__PURE__*/React.createElement(SNext, _ref14.cn("SNext", _objectSpread({}, _assignProps6({
|
|
@@ -674,8 +700,7 @@ var Next = function Next(props) {
|
|
|
674
700
|
"aria-label": label,
|
|
675
701
|
"theme": inverted ? 'invert' : 'muted',
|
|
676
702
|
"use": 'tertiary',
|
|
677
|
-
"size": 'l'
|
|
678
|
-
"tabIndex": tabIndex
|
|
703
|
+
"size": 'l'
|
|
679
704
|
})));
|
|
680
705
|
};
|
|
681
706
|
var Indicators = function Indicators(_ref19) {
|
|
@@ -688,13 +713,9 @@ var Indicators = function Indicators(_ref19) {
|
|
|
688
713
|
var SIndicators = Box;
|
|
689
714
|
if (Children.origin) {
|
|
690
715
|
var _ref15;
|
|
691
|
-
return _ref15 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref15.cn("SIndicators", _objectSpread({}, _assignProps7({
|
|
692
|
-
"aria-hidden": 'true'
|
|
693
|
-
}, _ref7))), /*#__PURE__*/React.createElement(Children, _ref15.cn("Children", {})));
|
|
716
|
+
return _ref15 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref15.cn("SIndicators", _objectSpread({}, _assignProps7({}, _ref7))), /*#__PURE__*/React.createElement(Children, _ref15.cn("Children", {})));
|
|
694
717
|
}
|
|
695
|
-
return _ref16 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref16.cn("SIndicators", _objectSpread({}, _assignProps8({
|
|
696
|
-
"aria-hidden": 'true'
|
|
697
|
-
}, _ref7))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
718
|
+
return _ref16 = sstyled(styles), /*#__PURE__*/React.createElement(SIndicators, _ref16.cn("SIndicators", _objectSpread({}, _assignProps8({}, _ref7))), items === null || items === void 0 ? void 0 : items.map(function (item, index) {
|
|
698
719
|
return /*#__PURE__*/React.createElement(Carousel.Indicator, _extends({
|
|
699
720
|
key: index
|
|
700
721
|
}, item, {
|
|
@@ -702,6 +723,7 @@ var Indicators = function Indicators(_ref19) {
|
|
|
702
723
|
}));
|
|
703
724
|
}));
|
|
704
725
|
};
|
|
726
|
+
Indicators.enhance = [keyboardFocusEnhance()];
|
|
705
727
|
var Indicator = function Indicator(_ref20) {
|
|
706
728
|
var _ref8 = arguments[0],
|
|
707
729
|
_ref17;
|