@am92/react-design-system 2.7.7 → 2.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/DsAppBar/DsAppBar.Component.d.ts +2 -5
- package/dist/Components/DsAppBar/DsAppBar.Component.js +19 -24
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.d.ts +2 -7
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +62 -65
- package/dist/Components/DsButton/DsButton.Component.d.ts +2 -4
- package/dist/Components/DsButton/DsButton.Component.js +4 -7
- package/dist/Components/DsButton/DsButton.Overrides.js +2 -2
- package/dist/Components/DsButtonGroup/DsButtonGroup.Component.d.ts +2 -6
- package/dist/Components/DsButtonGroup/DsButtonGroup.Component.js +16 -18
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.d.ts +2 -3
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.js +42 -44
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.d.ts +2 -6
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.js +109 -110
- package/dist/Components/DsCarousel/DsCarousel.Component/index.d.ts +3 -19
- package/dist/Components/DsCarousel/DsCarousel.Component/index.js +55 -57
- package/dist/Components/DsChip/DsChip.Component.d.ts +1 -6
- package/dist/Components/DsChip/DsChip.Component.js +1 -10
- package/dist/Components/DsChip/DsChip.Types.d.ts +1 -0
- package/dist/Components/DsChip/DsChip.Types.js +2 -1
- package/dist/Components/DsChipGroup/DsChipGroup.Component.d.ts +2 -5
- package/dist/Components/DsChipGroup/DsChipGroup.Component.js +5 -8
- package/dist/Components/DsContentSlider/DsContentSlider.Component.d.ts +3 -8
- package/dist/Components/DsContentSlider/DsContentSlider.Component.js +13 -20
- package/dist/Components/DsDialog/DsDialog.Component.d.ts +1 -6
- package/dist/Components/DsDialog/DsDialog.Component.js +71 -75
- package/dist/Components/DsDialog/DsDialog.Overrides.d.ts +1 -0
- package/dist/Components/DsDialog/DsDialog.Overrides.js +2 -0
- package/dist/Components/DsDivider/DsDivider.Overrides.js +6 -0
- package/dist/Components/DsFileUploader/DsFileUploader.Component.d.ts +3 -16
- package/dist/Components/DsFileUploader/DsFileUploader.Component.js +68 -71
- package/dist/Components/DsHeader/DsHeader.Component.d.ts +2 -5
- package/dist/Components/DsHeader/DsHeader.Component.js +29 -32
- package/dist/Components/DsHelperText/DsHelperText.Component.d.ts +2 -5
- package/dist/Components/DsHelperText/DsHelperText.Component.js +16 -21
- package/dist/Components/DsHelperText/DsHelperText.Overrides.d.ts +5 -1
- package/dist/Components/DsHelperText/DsHelperText.Overrides.js +6 -1
- package/dist/Components/DsImage/DsImage.Component.d.ts +3 -12
- package/dist/Components/DsImage/DsImage.Component.js +40 -45
- package/dist/Components/DsImage/DsImage.Types.d.ts +0 -1
- package/dist/Components/DsImage/DsImage.Types.js +0 -3
- package/dist/Components/DsInputLabel/DsInputLabel.Component.d.ts +2 -4
- package/dist/Components/DsInputLabel/DsInputLabel.Component.js +6 -9
- package/dist/Components/DsNotistack/AlertMessage.Component.js +7 -9
- package/dist/Components/DsNotistack/DsNotistack.Component.d.ts +2 -7
- package/dist/Components/DsNotistack/DsNotistack.Component.js +12 -16
- package/dist/Components/DsNotistack/DsNotistack.Types.d.ts +1 -0
- package/dist/Components/DsNotistack/DsNotistack.Types.js +3 -1
- package/dist/Components/DsOtp/DsOtp.Component.d.ts +3 -15
- package/dist/Components/DsOtp/DsOtp.Component.js +41 -51
- package/dist/Components/DsPopup/DsPopup.Types.d.ts +1 -1
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.d.ts +2 -6
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +18 -21
- package/dist/Components/DsProgressTracker/DsProgressStepper.Component.d.ts +3 -9
- package/dist/Components/DsProgressTracker/DsProgressStepper.Component.js +8 -11
- package/dist/Components/DsProgressTracker/DsProgressTracker.Component.d.ts +3 -21
- package/dist/Components/DsProgressTracker/DsProgressTracker.Component.js +17 -26
- package/dist/Components/DsRadio/DsRadio.Component.d.ts +2 -5
- package/dist/Components/DsRadio/DsRadio.Component.js +5 -8
- package/dist/Components/DsRadio/DsRadio.Overrides.d.ts +9 -1
- package/dist/Components/DsRadio/DsRadio.Overrides.js +9 -1
- package/dist/Components/DsRadioGroup/DsRadioGroup.Component.d.ts +3 -1
- package/dist/Components/DsRadioGroup/DsRadioGroup.Component.js +10 -1
- package/dist/Components/DsRemixIcon/DsRemixIcon.Component.d.ts +2 -4
- package/dist/Components/DsRemixIcon/DsRemixIcon.Component.js +5 -7
- package/dist/Components/DsSelect/DsSelect.Component.d.ts +2 -6
- package/dist/Components/DsSelect/DsSelect.Component.js +49 -53
- package/dist/Components/DsSelect/DsSelect.Overrides.d.ts +3 -0
- package/dist/Components/DsSelect/DsSelect.Overrides.js +4 -1
- package/dist/Components/DsSelect/DsSelect.Types.d.ts +8 -0
- package/dist/Components/DsSelect/DsSelect.Types.js +1 -1
- package/dist/Components/DsSlider/DsSlider.Component.d.ts +1 -5
- package/dist/Components/DsSlider/DsSlider.Component.js +1 -10
- package/dist/Components/DsSlider/DsSlider.Overrides.d.ts +1 -1
- package/dist/Components/DsSlider/DsSlider.Overrides.js +2 -2
- package/dist/Components/DsStepConnector/DsStepConnector.Overrides.d.ts +2 -1
- package/dist/Components/DsStepConnector/DsStepConnector.Overrides.js +9 -2
- package/dist/Components/DsStepLabel/DsStepLabel.Overrides.js +4 -4
- package/dist/Components/DsSwitch/DsSwitch.Component.d.ts +2 -6
- package/dist/Components/DsSwitch/DsSwitch.Component.js +7 -10
- package/dist/Components/DsTag/DsTag.Component.d.ts +2 -7
- package/dist/Components/DsTag/DsTag.Component.js +10 -13
- package/dist/Components/DsTagGroup/DsTagGroup.Component.d.ts +2 -7
- package/dist/Components/DsTagGroup/DsTagGroup.Component.js +25 -27
- package/dist/Components/DsTextArea/DsTextArea.Component.d.ts +3 -10
- package/dist/Components/DsTextArea/DsTextArea.Component.js +49 -54
- package/dist/Components/DsTextArea/DsTextArea.Types.d.ts +0 -1
- package/dist/Components/DsTextArea/DsTextArea.Types.js +1 -3
- package/dist/Components/DsTextField/DsTextField.Component.d.ts +2 -4
- package/dist/Components/DsTextField/DsTextField.Component.js +7 -8
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.d.ts +3 -10
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.js +15 -26
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.d.ts +0 -1
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.js +0 -3
- package/dist/Components/DsToast/DsToast.Component.d.ts +2 -4
- package/dist/Components/DsToast/DsToast.Component.js +9 -7
- package/dist/Components/DsToggle/DsToggle.Component.d.ts +2 -5
- package/dist/Components/DsToggle/DsToggle.Component.js +11 -9
- package/dist/Components/DsToggle/DsToggle.Types.js +1 -1
- package/dist/Components/DsTooltip/DsTooltip.Component.d.ts +2 -5
- package/dist/Components/DsTooltip/DsTooltip.Component.js +7 -9
- package/dist/Theme/componentOverrides.d.ts +15 -5
- package/dist/Theme/getColorScheme/dark.js +4 -4
- package/dist/Theme/getColorScheme/highContrast.js +1 -1
- package/dist/Theme/getColorScheme/light.js +1 -1
- package/package.json +1 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
import { DsBox } from '../../DsBox';
|
|
4
|
-
|
|
5
|
-
paginationRef = React.
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
handleFirstTransition = () => {
|
|
10
|
-
const firstActiveBullet =
|
|
4
|
+
const DsCarouselPagination = (props) => {
|
|
5
|
+
const paginationRef = React.useRef();
|
|
6
|
+
React.useEffect(() => {
|
|
7
|
+
handleFirstTransition();
|
|
8
|
+
}, []);
|
|
9
|
+
const handleFirstTransition = () => {
|
|
10
|
+
const firstActiveBullet = paginationRef.current?.getElementsByClassName('swiper-pagination-bullet-active')[0];
|
|
11
11
|
if (firstActiveBullet) {
|
|
12
12
|
firstActiveBullet.classList.remove('swiper-pagination-bullet-active');
|
|
13
13
|
setTimeout(() => {
|
|
@@ -15,117 +15,116 @@ export default class DsCarouselPagination extends React.PureComponent {
|
|
|
15
15
|
}, 0);
|
|
16
16
|
}
|
|
17
17
|
};
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
18
|
+
const { uid, isEnabled, isAutoplayEnabled, PaginationSettings, AutoplaySettings, PaginationProps } = props;
|
|
19
|
+
if (!isEnabled) {
|
|
20
|
+
return false;
|
|
21
|
+
}
|
|
22
|
+
let className = `swiper-pagination-${uid}`;
|
|
23
|
+
let transitionSpeed = 0;
|
|
24
|
+
if (isAutoplayEnabled) {
|
|
25
|
+
className = `swiper-pagination-${uid} rds-pilled`;
|
|
26
|
+
transitionSpeed =
|
|
27
|
+
(typeof AutoplaySettings !== 'boolean' && AutoplaySettings?.delay) ||
|
|
28
|
+
3000;
|
|
29
|
+
}
|
|
30
|
+
return (_jsx(DsBox, { ref: paginationRef, className: className, ...PaginationProps, sx: {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
textAlign: 'center',
|
|
33
|
+
transition: '300ms opacity',
|
|
34
|
+
transform: 'translate3d(0, 0, 0)',
|
|
35
|
+
zIndex: 1,
|
|
36
|
+
'&.swiper-pagination-hidden': {
|
|
37
|
+
opacity: 0
|
|
38
|
+
},
|
|
39
|
+
'&.swiper-pagination-disabled': {
|
|
40
40
|
'&.swiper-pagination-disabled': {
|
|
41
|
-
'
|
|
41
|
+
display: 'none !important'
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
'&.swiper-pagination-bullets': {
|
|
45
|
+
'> .swiper-pagination-bullet': {
|
|
46
|
+
width: '6px',
|
|
47
|
+
height: '6px',
|
|
48
|
+
display: 'inline-block',
|
|
49
|
+
borderRadius: 'var(--ds-radius-bitterCold)',
|
|
50
|
+
opacity: 1,
|
|
51
|
+
mx: 'var(--ds-spacing-deepFreeze)',
|
|
52
|
+
background: 'linear-gradient(to right, var(--ds-colour-actionSecondary), var(--ds-colour-actionSecondary)) no-repeat, linear-gradient(to right, var(--ds-colour-stateUnselectedDefault), var(--ds-colour-stateUnselectedDefault)) no-repeat',
|
|
53
|
+
backgroundSize: '0% 100%, 100% 100%',
|
|
54
|
+
backgroundPosition: '0 0, 0 0',
|
|
55
|
+
'&:only-child': {
|
|
42
56
|
display: 'none !important'
|
|
57
|
+
},
|
|
58
|
+
'&.swiper-pagination-bullet-active': {
|
|
59
|
+
width: '16px',
|
|
60
|
+
background: 'var(--ds-colour-actionSecondary)',
|
|
61
|
+
opacity: 1
|
|
43
62
|
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
borderRadius: 'var(--ds-radius-bitterCold)',
|
|
51
|
-
opacity: 1,
|
|
52
|
-
mx: 'var(--ds-spacing-deepFreeze)',
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
'&.swiper-pagination-bullets.rds-pilled': {
|
|
66
|
+
'> .swiper-pagination-bullet': {
|
|
67
|
+
'&.swiper-pagination-bullet-active': {
|
|
68
|
+
width: '20px',
|
|
53
69
|
background: 'linear-gradient(to right, var(--ds-colour-actionSecondary), var(--ds-colour-actionSecondary)) no-repeat, linear-gradient(to right, var(--ds-colour-stateUnselectedDefault), var(--ds-colour-stateUnselectedDefault)) no-repeat',
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
'
|
|
57
|
-
|
|
58
|
-
},
|
|
59
|
-
'&.swiper-pagination-bullet-active': {
|
|
60
|
-
width: '16px',
|
|
61
|
-
background: 'var(--ds-colour-actionSecondary)',
|
|
62
|
-
opacity: 1
|
|
63
|
-
}
|
|
70
|
+
borderRadius: 'var(--ds-radius-bitterCold)',
|
|
71
|
+
backgroundSize: '100% 100%, 100% 100%',
|
|
72
|
+
backgroundPosition: '0 0 , 100% 0',
|
|
73
|
+
transition: `width 0.5s, background-size ${transitionSpeed / 1000}s`
|
|
64
74
|
}
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
'&.swiper-pagination-clickable': {
|
|
78
|
+
'> .swiper-pagination-bullet': {
|
|
79
|
+
cursor: 'pointer'
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
'&.swiper-pagination-bullets-dynamic': {
|
|
83
|
+
overflow: 'hidden',
|
|
84
|
+
fontSize: 0,
|
|
85
|
+
'> .swiper-pagination-bullet': {
|
|
86
|
+
transform: 'scale(0.33)',
|
|
87
|
+
position: 'relative',
|
|
88
|
+
'&.swiper-pagination-bullet-active': {
|
|
89
|
+
transform: 'scale(1)'
|
|
90
|
+
},
|
|
91
|
+
'&.swiper-pagination-bullet-active-main': {
|
|
92
|
+
transform: 'scale(1)'
|
|
93
|
+
},
|
|
94
|
+
'&.swiper-pagination-bullet-active-prev': {
|
|
95
|
+
transform: 'scale(0.66)'
|
|
96
|
+
},
|
|
97
|
+
'&.swiper-pagination-bullet-active-prev-prev': {
|
|
98
|
+
transform: 'scale(0.33)'
|
|
99
|
+
},
|
|
100
|
+
'&.swiper-pagination-bullet-active-next': {
|
|
101
|
+
transform: 'scale(0.66)'
|
|
102
|
+
},
|
|
103
|
+
'&.swiper-pagination-bullet-active-next-next': {
|
|
104
|
+
transform: 'scale(0.33)'
|
|
76
105
|
}
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
'&.swiper-pagination-horizontal.swiper-pagination-bullets': {
|
|
109
|
+
bottom: PaginationSettings?.mode === 'internal'
|
|
110
|
+
? 'var(--ds-spacing-frostbite)'
|
|
111
|
+
: 'var(--ds-spacing-zero)',
|
|
112
|
+
top: 'auto',
|
|
113
|
+
left: 0,
|
|
114
|
+
width: '100%',
|
|
83
115
|
'&.swiper-pagination-bullets-dynamic': {
|
|
84
|
-
|
|
85
|
-
|
|
116
|
+
left: '50%',
|
|
117
|
+
transform: 'translateX(-50%)',
|
|
118
|
+
whiteSpace: 'nowrap',
|
|
86
119
|
'> .swiper-pagination-bullet': {
|
|
87
|
-
|
|
88
|
-
position: 'relative',
|
|
120
|
+
transition: `200ms transform, 200ms left`,
|
|
89
121
|
'&.swiper-pagination-bullet-active': {
|
|
90
|
-
|
|
91
|
-
},
|
|
92
|
-
'&.swiper-pagination-bullet-active-main': {
|
|
93
|
-
transform: 'scale(1)'
|
|
94
|
-
},
|
|
95
|
-
'&.swiper-pagination-bullet-active-prev': {
|
|
96
|
-
transform: 'scale(0.66)'
|
|
97
|
-
},
|
|
98
|
-
'&.swiper-pagination-bullet-active-prev-prev': {
|
|
99
|
-
transform: 'scale(0.33)'
|
|
100
|
-
},
|
|
101
|
-
'&.swiper-pagination-bullet-active-next': {
|
|
102
|
-
transform: 'scale(0.66)'
|
|
103
|
-
},
|
|
104
|
-
'&.swiper-pagination-bullet-active-next-next': {
|
|
105
|
-
transform: 'scale(0.33)'
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
},
|
|
109
|
-
'&.swiper-pagination-horizontal.swiper-pagination-bullets': {
|
|
110
|
-
bottom: PaginationSettings?.mode === 'internal'
|
|
111
|
-
? 'var(--ds-spacing-frostbite)'
|
|
112
|
-
: 'var(--ds-spacing-zero)',
|
|
113
|
-
top: 'auto',
|
|
114
|
-
left: 0,
|
|
115
|
-
width: '100%',
|
|
116
|
-
'&.swiper-pagination-bullets-dynamic': {
|
|
117
|
-
left: '50%',
|
|
118
|
-
transform: 'translateX(-50%)',
|
|
119
|
-
whiteSpace: 'nowrap',
|
|
120
|
-
'> .swiper-pagination-bullet': {
|
|
121
|
-
transition: `200ms transform, 200ms left`,
|
|
122
|
-
'&.swiper-pagination-bullet-active': {
|
|
123
|
-
transition: `width 0.5s, background-size ${transitionSpeed / 1000}s, 200ms transform, 200ms left`
|
|
124
|
-
}
|
|
122
|
+
transition: `width 0.5s, background-size ${transitionSpeed / 1000}s, 200ms transform, 200ms left`
|
|
125
123
|
}
|
|
126
124
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
...PaginationProps?.sx
|
|
128
|
+
} }));
|
|
129
|
+
};
|
|
130
|
+
export default DsCarouselPagination;
|
|
@@ -1,19 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { DsCaroselPaginationSettings, DsCarouselProps } from '../DsCarousel.Types';
|
|
5
|
-
export declare class DsCarousel extends React.PureComponent<DsCarouselProps> {
|
|
6
|
-
SwiperContainer: SwiperContainer | null;
|
|
7
|
-
uid: string;
|
|
8
|
-
componentDidMount(): void;
|
|
9
|
-
_isNavigationEnabled: () => boolean;
|
|
10
|
-
_isPaginationEnabled: () => boolean;
|
|
11
|
-
_isAutoplayEnabled: () => boolean;
|
|
12
|
-
_getNavigationSettings: () => DsCarouselProps["navigation"] | undefined;
|
|
13
|
-
_getPaginationSettings: () => DsCaroselPaginationSettings | undefined;
|
|
14
|
-
_getAutoPlaySettings: () => DsCarouselProps["autoplay"] | undefined;
|
|
15
|
-
_sanitizeModuleProps: (modules: SwiperProps["modules"]) => SwiperProps["modules"];
|
|
16
|
-
initialize: () => void;
|
|
17
|
-
setRef: (swiperRef: unknown) => void;
|
|
18
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DsCarouselProps } from '../DsCarousel.Types';
|
|
3
|
+
export declare const DsCarousel: FC<DsCarouselProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React from 'react';
|
|
2
|
+
import React, { useEffect } from 'react';
|
|
3
3
|
import { Autoplay, Navigation, Pagination } from 'swiper/modules';
|
|
4
4
|
import { register } from 'swiper/element';
|
|
5
5
|
import { CAROUSEL_DEFAULT_SETTINGS, SWIPER_AUTOPLAY_SETTINGS, SWIPER_NAVIGATION_SETTINGS, SWIPER_PAGINATION_SETTINGS } from '../DsCarousel.Types';
|
|
@@ -13,58 +13,58 @@ const generateUid = () => {
|
|
|
13
13
|
const random = Math.trunc((Math.random() + 1) * 1000000);
|
|
14
14
|
return `${random.toString(36)}`;
|
|
15
15
|
};
|
|
16
|
-
export
|
|
17
|
-
SwiperContainer = null;
|
|
18
|
-
uid = generateUid();
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
_isNavigationEnabled = () => {
|
|
23
|
-
const { navigation } =
|
|
16
|
+
export const DsCarousel = (props) => {
|
|
17
|
+
let SwiperContainer = null;
|
|
18
|
+
const uid = generateUid();
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
initialize();
|
|
21
|
+
}, []);
|
|
22
|
+
const _isNavigationEnabled = () => {
|
|
23
|
+
const { navigation } = props;
|
|
24
24
|
return !(navigation === false ||
|
|
25
25
|
(navigation &&
|
|
26
26
|
typeof navigation !== 'boolean' &&
|
|
27
27
|
navigation.enabled === false));
|
|
28
28
|
};
|
|
29
|
-
_isPaginationEnabled = () => {
|
|
30
|
-
const { pagination } =
|
|
29
|
+
const _isPaginationEnabled = () => {
|
|
30
|
+
const { pagination } = props;
|
|
31
31
|
return !(pagination === false ||
|
|
32
32
|
(pagination &&
|
|
33
33
|
typeof pagination !== 'boolean' &&
|
|
34
34
|
pagination.enabled === false));
|
|
35
35
|
};
|
|
36
|
-
_isAutoplayEnabled = () => {
|
|
37
|
-
const { autoplay } =
|
|
36
|
+
const _isAutoplayEnabled = () => {
|
|
37
|
+
const { autoplay } = props;
|
|
38
38
|
return !(autoplay === false);
|
|
39
39
|
};
|
|
40
|
-
_getNavigationSettings = () => {
|
|
41
|
-
const { navigation } =
|
|
42
|
-
const isEnabled =
|
|
40
|
+
const _getNavigationSettings = () => {
|
|
41
|
+
const { navigation } = props;
|
|
42
|
+
const isEnabled = _isNavigationEnabled();
|
|
43
43
|
const defaultSettings = {
|
|
44
44
|
...SWIPER_NAVIGATION_SETTINGS,
|
|
45
|
-
nextEl: `${SWIPER_NAVIGATION_SETTINGS.nextEl}-${
|
|
46
|
-
prevEl: `${SWIPER_NAVIGATION_SETTINGS.prevEl}-${
|
|
45
|
+
nextEl: `${SWIPER_NAVIGATION_SETTINGS.nextEl}-${uid}`,
|
|
46
|
+
prevEl: `${SWIPER_NAVIGATION_SETTINGS.prevEl}-${uid}`
|
|
47
47
|
};
|
|
48
48
|
if (typeof navigation !== 'boolean') {
|
|
49
49
|
return isEnabled ? { ...defaultSettings, ...navigation } : undefined;
|
|
50
50
|
}
|
|
51
51
|
return (isEnabled && { ...defaultSettings }) || undefined;
|
|
52
52
|
};
|
|
53
|
-
_getPaginationSettings = () => {
|
|
54
|
-
const { pagination } =
|
|
55
|
-
const isEnabled =
|
|
53
|
+
const _getPaginationSettings = () => {
|
|
54
|
+
const { pagination } = props;
|
|
55
|
+
const isEnabled = _isPaginationEnabled();
|
|
56
56
|
const defaultSettings = {
|
|
57
57
|
...SWIPER_PAGINATION_SETTINGS,
|
|
58
|
-
el: `${SWIPER_PAGINATION_SETTINGS.el}-${
|
|
58
|
+
el: `${SWIPER_PAGINATION_SETTINGS.el}-${uid}`
|
|
59
59
|
};
|
|
60
60
|
if (typeof pagination !== 'boolean') {
|
|
61
61
|
return isEnabled ? { ...defaultSettings, ...pagination } : undefined;
|
|
62
62
|
}
|
|
63
63
|
return (isEnabled && { ...defaultSettings }) || undefined;
|
|
64
64
|
};
|
|
65
|
-
_getAutoPlaySettings = () => {
|
|
66
|
-
const { autoplay } =
|
|
67
|
-
const isEnabled =
|
|
65
|
+
const _getAutoPlaySettings = () => {
|
|
66
|
+
const { autoplay } = props;
|
|
67
|
+
const isEnabled = _isAutoplayEnabled();
|
|
68
68
|
if (typeof autoplay !== 'boolean') {
|
|
69
69
|
return isEnabled
|
|
70
70
|
? { ...SWIPER_AUTOPLAY_SETTINGS, ...autoplay }
|
|
@@ -72,25 +72,25 @@ export class DsCarousel extends React.PureComponent {
|
|
|
72
72
|
}
|
|
73
73
|
return (isEnabled && { ...SWIPER_AUTOPLAY_SETTINGS }) || undefined;
|
|
74
74
|
};
|
|
75
|
-
_sanitizeModuleProps = (modules) => {
|
|
75
|
+
const _sanitizeModuleProps = (modules) => {
|
|
76
76
|
let sanitizedModule = modules?.filter(module => !['Pagination', 'Navigation'].includes(module.name)) || [];
|
|
77
|
-
const isNavigationEnabled =
|
|
77
|
+
const isNavigationEnabled = _isNavigationEnabled();
|
|
78
78
|
if (isNavigationEnabled) {
|
|
79
79
|
sanitizedModule = [...sanitizedModule, Navigation];
|
|
80
80
|
}
|
|
81
|
-
const isPaginationEnabled =
|
|
81
|
+
const isPaginationEnabled = _isPaginationEnabled();
|
|
82
82
|
if (isPaginationEnabled) {
|
|
83
83
|
sanitizedModule = [...sanitizedModule, Pagination];
|
|
84
84
|
}
|
|
85
|
-
const isAutoplayEnabled =
|
|
85
|
+
const isAutoplayEnabled = _isAutoplayEnabled();
|
|
86
86
|
if (isAutoplayEnabled) {
|
|
87
87
|
sanitizedModule = [...sanitizedModule, Autoplay];
|
|
88
88
|
}
|
|
89
89
|
return sanitizedModule;
|
|
90
90
|
};
|
|
91
|
-
initialize = () => {
|
|
92
|
-
const { children, PaginationProps, NavigationProps, PaginationWrapperProps, SwiperConatinerStyles, SwiperConatinerWrapperProps, modules, ...swiperProps } =
|
|
93
|
-
const sanitizedModule =
|
|
91
|
+
const initialize = () => {
|
|
92
|
+
const { children, PaginationProps, NavigationProps, PaginationWrapperProps, SwiperConatinerStyles, SwiperConatinerWrapperProps, modules, ...swiperProps } = props;
|
|
93
|
+
const sanitizedModule = _sanitizeModuleProps(modules);
|
|
94
94
|
// swiper parameters
|
|
95
95
|
const swiperParams = {
|
|
96
96
|
...CAROUSEL_DEFAULT_SETTINGS,
|
|
@@ -98,35 +98,33 @@ export class DsCarousel extends React.PureComponent {
|
|
|
98
98
|
// Vertical mode not supported
|
|
99
99
|
direction: 'horizontal',
|
|
100
100
|
modules: sanitizedModule,
|
|
101
|
-
navigation:
|
|
102
|
-
pagination:
|
|
103
|
-
autoplay:
|
|
101
|
+
navigation: _getNavigationSettings() || false,
|
|
102
|
+
pagination: _getPaginationSettings() || false,
|
|
103
|
+
autoplay: _getAutoPlaySettings() || false
|
|
104
104
|
};
|
|
105
|
-
// swiperParams =
|
|
105
|
+
// swiperParams = handleNavigationModule(swiperParams)
|
|
106
106
|
// now we need to assign all parameters to Swiper element
|
|
107
|
-
Object.assign(
|
|
107
|
+
Object.assign(SwiperContainer || {}, swiperParams);
|
|
108
108
|
// and now initialize it
|
|
109
|
-
|
|
109
|
+
SwiperContainer?.initialize();
|
|
110
110
|
// set the default theme
|
|
111
111
|
document.documentElement.style.setProperty('--swiper-theme-color', 'var(--ds-colour-actionSecondary)');
|
|
112
112
|
};
|
|
113
|
-
setRef = (swiperRef) => {
|
|
114
|
-
|
|
113
|
+
const setRef = (swiperRef) => {
|
|
114
|
+
SwiperContainer = swiperRef;
|
|
115
115
|
};
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
}
|
|
132
|
-
}
|
|
116
|
+
const { PaginationWrapperProps, SwiperConatinerWrapperProps, SwiperConatinerStyles, children, NavigationProps, PaginationProps } = props;
|
|
117
|
+
const paginationSettings = _getPaginationSettings();
|
|
118
|
+
return (_jsxs(DsBox, { ...PaginationWrapperProps, sx: {
|
|
119
|
+
position: 'relative',
|
|
120
|
+
pb: paginationSettings?.mode === 'external' ? '44px' : undefined,
|
|
121
|
+
...PaginationWrapperProps?.sx
|
|
122
|
+
}, children: [_jsxs(DsBox, { ...SwiperConatinerWrapperProps, sx: {
|
|
123
|
+
position: 'relative',
|
|
124
|
+
...SwiperConatinerWrapperProps?.sx
|
|
125
|
+
}, children: [_jsx("swiper-container", { ref: setRef, init: false, style: {
|
|
126
|
+
...SwiperConatinerStyles
|
|
127
|
+
}, children: React.Children.map(children, (child, index) => {
|
|
128
|
+
return (_jsx("swiper-slide", { children: child }, `${name}-${index}`));
|
|
129
|
+
}) }), _jsx(DsCarouselNavigation, { uid: uid, isEnabled: _isNavigationEnabled(), NavigationProps: NavigationProps })] }), _jsx(DsCarouselPagination, { uid: uid, isEnabled: _isPaginationEnabled(), isAutoplayEnabled: _isAutoplayEnabled(), AutoplaySettings: _getAutoPlaySettings(), PaginationSettings: paginationSettings, PaginationProps: PaginationProps })] }));
|
|
130
|
+
};
|
|
@@ -1,6 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { DsChipProps } from './DsChip.Types';
|
|
3
|
-
export declare class DsChip extends PureComponent<DsChipProps> {
|
|
4
|
-
static defaultProps: DsChipProps;
|
|
5
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
}
|
|
1
|
+
export { default as DsChip } from '@mui/material/Chip';
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
|
-
import Chip from '@mui/material/Chip';
|
|
4
|
-
import { DsChipDefaultProps } from './DsChip.Types';
|
|
5
|
-
export class DsChip extends PureComponent {
|
|
6
|
-
static defaultProps = DsChipDefaultProps;
|
|
7
|
-
render() {
|
|
8
|
-
return _jsx(Chip, { ...this.props, "ds-variant": "chip" });
|
|
9
|
-
}
|
|
10
|
-
}
|
|
1
|
+
export { default as DsChip } from '@mui/material/Chip';
|
|
@@ -2,5 +2,6 @@ import { ChipProps } from '@mui/material';
|
|
|
2
2
|
export interface DsChipProps extends Omit<ChipProps, 'color'> {
|
|
3
3
|
type?: 'status' | 'nudge';
|
|
4
4
|
color?: Extract<ChipProps['color'], 'default' | 'info' | 'success' | 'warning' | 'error'>;
|
|
5
|
+
'ds-variant'?: 'chip';
|
|
5
6
|
}
|
|
6
7
|
export declare const DsChipDefaultProps: DsChipProps;
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { DsChipGroupProps } from './DsChipGroup.Types';
|
|
3
|
-
export declare
|
|
4
|
-
static defaultProps: import("../DsStack").DsStackProps;
|
|
5
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
}
|
|
3
|
+
export declare const DsChipGroup: FC<DsChipGroupProps>;
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
2
|
import { DsStack } from '../DsStack';
|
|
4
3
|
import { DsChipGroupDefaultProps } from './DsChipGroup.Types';
|
|
5
|
-
export
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
}
|
|
4
|
+
export const DsChipGroup = (inProps) => {
|
|
5
|
+
const props = { ...DsChipGroupDefaultProps, ...inProps };
|
|
6
|
+
const { children, ...restStackProps } = props;
|
|
7
|
+
return (_jsx(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-glacial)', ...restStackProps, children: children }));
|
|
8
|
+
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DsContentSliderProps
|
|
3
|
-
export declare
|
|
4
|
-
constructor(props: DsContentSliderProps);
|
|
5
|
-
renderStep(index: number): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
renderSteps(): JSX.Element[];
|
|
7
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DsContentSliderProps } from './DsContentSlider.Types';
|
|
3
|
+
export declare const DsContentSlider: FC<DsContentSliderProps>;
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { useState } from 'react';
|
|
3
3
|
import { DsBox } from '../DsBox';
|
|
4
4
|
import { DsStack } from '../DsStack';
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
};
|
|
11
|
-
this.state = state;
|
|
12
|
-
}
|
|
13
|
-
renderStep(index) {
|
|
14
|
-
const { active } = this.state;
|
|
5
|
+
import { DsContentSliderDefaultProps } from './DsContentSlider.Types';
|
|
6
|
+
export const DsContentSlider = (inProps) => {
|
|
7
|
+
const props = { ...DsContentSliderDefaultProps, ...inProps };
|
|
8
|
+
const [active, setActive] = useState(0);
|
|
9
|
+
function renderStep(index) {
|
|
15
10
|
const isActiveStep = index === active;
|
|
16
11
|
if (isActiveStep) {
|
|
17
|
-
const isTimed =
|
|
12
|
+
const isTimed = props['ds-variant'] === 'timed';
|
|
18
13
|
if (isTimed) {
|
|
19
14
|
return (_jsxs(DsBox, { sx: {
|
|
20
15
|
width: '20px',
|
|
@@ -52,17 +47,15 @@ export class DsContentSlider extends PureComponent {
|
|
|
52
47
|
backgroundColor: 'var(--ds-colour-stateDisabledSurface)'
|
|
53
48
|
} }));
|
|
54
49
|
}
|
|
55
|
-
renderSteps() {
|
|
56
|
-
const { steps } =
|
|
50
|
+
function renderSteps() {
|
|
51
|
+
const { steps } = props;
|
|
57
52
|
const indicators = [];
|
|
58
53
|
for (let index = 0; index < steps; index++) {
|
|
59
|
-
const indicator =
|
|
54
|
+
const indicator = renderStep(index);
|
|
60
55
|
indicators.push(indicator);
|
|
61
56
|
}
|
|
62
57
|
return indicators;
|
|
63
58
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}
|
|
68
|
-
}
|
|
59
|
+
const { steps } = props;
|
|
60
|
+
return (_jsx(DsStack, { direction: "row", spacing: "var(--ds-spacing-quickFreeze)", children: renderSteps() }));
|
|
61
|
+
};
|
|
@@ -1,8 +1,3 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { DsDialogProps } from './DsDialog.Types';
|
|
3
|
-
export declare
|
|
4
|
-
static defaultProps: DsDialogProps;
|
|
5
|
-
handleDialogClose: (event: React.SyntheticEvent, reason: "backdropClick" | "escapeKeyDown") => void;
|
|
6
|
-
handleCloseClick: (event: React.SyntheticEvent) => void;
|
|
7
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
}
|
|
3
|
+
export declare const DsDialog: React.FC<DsDialogProps>;
|