@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.
Files changed (105) hide show
  1. package/dist/Components/DsAppBar/DsAppBar.Component.d.ts +2 -5
  2. package/dist/Components/DsAppBar/DsAppBar.Component.js +19 -24
  3. package/dist/Components/DsBottomSheet/DsBottomSheet.Component.d.ts +2 -7
  4. package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +62 -65
  5. package/dist/Components/DsButton/DsButton.Component.d.ts +2 -4
  6. package/dist/Components/DsButton/DsButton.Component.js +4 -7
  7. package/dist/Components/DsButton/DsButton.Overrides.js +2 -2
  8. package/dist/Components/DsButtonGroup/DsButtonGroup.Component.d.ts +2 -6
  9. package/dist/Components/DsButtonGroup/DsButtonGroup.Component.js +16 -18
  10. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.d.ts +2 -3
  11. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.js +42 -44
  12. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.d.ts +2 -6
  13. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.js +109 -110
  14. package/dist/Components/DsCarousel/DsCarousel.Component/index.d.ts +3 -19
  15. package/dist/Components/DsCarousel/DsCarousel.Component/index.js +55 -57
  16. package/dist/Components/DsChip/DsChip.Component.d.ts +1 -6
  17. package/dist/Components/DsChip/DsChip.Component.js +1 -10
  18. package/dist/Components/DsChip/DsChip.Types.d.ts +1 -0
  19. package/dist/Components/DsChip/DsChip.Types.js +2 -1
  20. package/dist/Components/DsChipGroup/DsChipGroup.Component.d.ts +2 -5
  21. package/dist/Components/DsChipGroup/DsChipGroup.Component.js +5 -8
  22. package/dist/Components/DsContentSlider/DsContentSlider.Component.d.ts +3 -8
  23. package/dist/Components/DsContentSlider/DsContentSlider.Component.js +13 -20
  24. package/dist/Components/DsDialog/DsDialog.Component.d.ts +1 -6
  25. package/dist/Components/DsDialog/DsDialog.Component.js +71 -75
  26. package/dist/Components/DsDialog/DsDialog.Overrides.d.ts +1 -0
  27. package/dist/Components/DsDialog/DsDialog.Overrides.js +2 -0
  28. package/dist/Components/DsDivider/DsDivider.Overrides.js +6 -0
  29. package/dist/Components/DsFileUploader/DsFileUploader.Component.d.ts +3 -16
  30. package/dist/Components/DsFileUploader/DsFileUploader.Component.js +68 -71
  31. package/dist/Components/DsHeader/DsHeader.Component.d.ts +2 -5
  32. package/dist/Components/DsHeader/DsHeader.Component.js +29 -32
  33. package/dist/Components/DsHelperText/DsHelperText.Component.d.ts +2 -5
  34. package/dist/Components/DsHelperText/DsHelperText.Component.js +16 -21
  35. package/dist/Components/DsHelperText/DsHelperText.Overrides.d.ts +5 -1
  36. package/dist/Components/DsHelperText/DsHelperText.Overrides.js +6 -1
  37. package/dist/Components/DsImage/DsImage.Component.d.ts +3 -12
  38. package/dist/Components/DsImage/DsImage.Component.js +40 -45
  39. package/dist/Components/DsImage/DsImage.Types.d.ts +0 -1
  40. package/dist/Components/DsImage/DsImage.Types.js +0 -3
  41. package/dist/Components/DsInputLabel/DsInputLabel.Component.d.ts +2 -4
  42. package/dist/Components/DsInputLabel/DsInputLabel.Component.js +6 -9
  43. package/dist/Components/DsNotistack/AlertMessage.Component.js +7 -9
  44. package/dist/Components/DsNotistack/DsNotistack.Component.d.ts +2 -7
  45. package/dist/Components/DsNotistack/DsNotistack.Component.js +12 -16
  46. package/dist/Components/DsNotistack/DsNotistack.Types.d.ts +1 -0
  47. package/dist/Components/DsNotistack/DsNotistack.Types.js +3 -1
  48. package/dist/Components/DsOtp/DsOtp.Component.d.ts +3 -15
  49. package/dist/Components/DsOtp/DsOtp.Component.js +41 -51
  50. package/dist/Components/DsPopup/DsPopup.Types.d.ts +1 -1
  51. package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.d.ts +2 -6
  52. package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +18 -21
  53. package/dist/Components/DsProgressTracker/DsProgressStepper.Component.d.ts +3 -9
  54. package/dist/Components/DsProgressTracker/DsProgressStepper.Component.js +8 -11
  55. package/dist/Components/DsProgressTracker/DsProgressTracker.Component.d.ts +3 -21
  56. package/dist/Components/DsProgressTracker/DsProgressTracker.Component.js +17 -26
  57. package/dist/Components/DsRadio/DsRadio.Component.d.ts +2 -5
  58. package/dist/Components/DsRadio/DsRadio.Component.js +5 -8
  59. package/dist/Components/DsRadio/DsRadio.Overrides.d.ts +9 -1
  60. package/dist/Components/DsRadio/DsRadio.Overrides.js +9 -1
  61. package/dist/Components/DsRadioGroup/DsRadioGroup.Component.d.ts +3 -1
  62. package/dist/Components/DsRadioGroup/DsRadioGroup.Component.js +10 -1
  63. package/dist/Components/DsRemixIcon/DsRemixIcon.Component.d.ts +2 -4
  64. package/dist/Components/DsRemixIcon/DsRemixIcon.Component.js +5 -7
  65. package/dist/Components/DsSelect/DsSelect.Component.d.ts +2 -6
  66. package/dist/Components/DsSelect/DsSelect.Component.js +49 -53
  67. package/dist/Components/DsSelect/DsSelect.Overrides.d.ts +3 -0
  68. package/dist/Components/DsSelect/DsSelect.Overrides.js +4 -1
  69. package/dist/Components/DsSelect/DsSelect.Types.d.ts +8 -0
  70. package/dist/Components/DsSelect/DsSelect.Types.js +1 -1
  71. package/dist/Components/DsSlider/DsSlider.Component.d.ts +1 -5
  72. package/dist/Components/DsSlider/DsSlider.Component.js +1 -10
  73. package/dist/Components/DsSlider/DsSlider.Overrides.d.ts +1 -1
  74. package/dist/Components/DsSlider/DsSlider.Overrides.js +2 -2
  75. package/dist/Components/DsStepConnector/DsStepConnector.Overrides.d.ts +2 -1
  76. package/dist/Components/DsStepConnector/DsStepConnector.Overrides.js +9 -2
  77. package/dist/Components/DsStepLabel/DsStepLabel.Overrides.js +4 -4
  78. package/dist/Components/DsSwitch/DsSwitch.Component.d.ts +2 -6
  79. package/dist/Components/DsSwitch/DsSwitch.Component.js +7 -10
  80. package/dist/Components/DsTag/DsTag.Component.d.ts +2 -7
  81. package/dist/Components/DsTag/DsTag.Component.js +10 -13
  82. package/dist/Components/DsTagGroup/DsTagGroup.Component.d.ts +2 -7
  83. package/dist/Components/DsTagGroup/DsTagGroup.Component.js +25 -27
  84. package/dist/Components/DsTextArea/DsTextArea.Component.d.ts +3 -10
  85. package/dist/Components/DsTextArea/DsTextArea.Component.js +49 -54
  86. package/dist/Components/DsTextArea/DsTextArea.Types.d.ts +0 -1
  87. package/dist/Components/DsTextArea/DsTextArea.Types.js +1 -3
  88. package/dist/Components/DsTextField/DsTextField.Component.d.ts +2 -4
  89. package/dist/Components/DsTextField/DsTextField.Component.js +7 -8
  90. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.d.ts +3 -10
  91. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.js +15 -26
  92. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.d.ts +0 -1
  93. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.js +0 -3
  94. package/dist/Components/DsToast/DsToast.Component.d.ts +2 -4
  95. package/dist/Components/DsToast/DsToast.Component.js +9 -7
  96. package/dist/Components/DsToggle/DsToggle.Component.d.ts +2 -5
  97. package/dist/Components/DsToggle/DsToggle.Component.js +11 -9
  98. package/dist/Components/DsToggle/DsToggle.Types.js +1 -1
  99. package/dist/Components/DsTooltip/DsTooltip.Component.d.ts +2 -5
  100. package/dist/Components/DsTooltip/DsTooltip.Component.js +7 -9
  101. package/dist/Theme/componentOverrides.d.ts +15 -5
  102. package/dist/Theme/getColorScheme/dark.js +4 -4
  103. package/dist/Theme/getColorScheme/highContrast.js +1 -1
  104. package/dist/Theme/getColorScheme/light.js +1 -1
  105. 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
- export default class DsCarouselPagination extends React.PureComponent {
5
- paginationRef = React.createRef();
6
- componentDidMount() {
7
- this.handleFirstTransition();
8
- }
9
- handleFirstTransition = () => {
10
- const firstActiveBullet = this.paginationRef.current?.getElementsByClassName('swiper-pagination-bullet-active')[0];
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
- render() {
19
- const { uid, isEnabled, isAutoplayEnabled, PaginationSettings, AutoplaySettings, PaginationProps } = this.props;
20
- if (!isEnabled) {
21
- return false;
22
- }
23
- let className = `swiper-pagination-${uid}`;
24
- let transitionSpeed = 0;
25
- if (isAutoplayEnabled) {
26
- className = `swiper-pagination-${uid} rds-pilled`;
27
- transitionSpeed =
28
- (typeof AutoplaySettings !== 'boolean' && AutoplaySettings?.delay) ||
29
- 3000;
30
- }
31
- return (_jsx(DsBox, { ref: this.paginationRef, className: className, ...PaginationProps, sx: {
32
- position: 'absolute',
33
- textAlign: 'center',
34
- transition: '300ms opacity',
35
- transform: 'translate3d(0, 0, 0)',
36
- zIndex: 1,
37
- '&.swiper-pagination-hidden': {
38
- opacity: 0
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
- '&.swiper-pagination-disabled': {
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
- '&.swiper-pagination-bullets': {
46
- '> .swiper-pagination-bullet': {
47
- width: '6px',
48
- height: '6px',
49
- display: 'inline-block',
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
- backgroundSize: '0% 100%, 100% 100%',
55
- backgroundPosition: '0 0, 0 0',
56
- '&:only-child': {
57
- display: 'none !important'
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
- '&.swiper-pagination-bullets.rds-pilled': {
67
- '> .swiper-pagination-bullet': {
68
- '&.swiper-pagination-bullet-active': {
69
- width: '20px',
70
- 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',
71
- borderRadius: 'var(--ds-radius-bitterCold)',
72
- backgroundSize: '100% 100%, 100% 100%',
73
- backgroundPosition: '0 0 , 100% 0',
74
- transition: `width 0.5s, background-size ${transitionSpeed / 1000}s`
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
- '&.swiper-pagination-clickable': {
79
- '> .swiper-pagination-bullet': {
80
- cursor: 'pointer'
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
- overflow: 'hidden',
85
- fontSize: 0,
116
+ left: '50%',
117
+ transform: 'translateX(-50%)',
118
+ whiteSpace: 'nowrap',
86
119
  '> .swiper-pagination-bullet': {
87
- transform: 'scale(0.33)',
88
- position: 'relative',
120
+ transition: `200ms transform, 200ms left`,
89
121
  '&.swiper-pagination-bullet-active': {
90
- transform: 'scale(1)'
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
- ...PaginationProps?.sx
129
- } }));
130
- }
131
- }
125
+ }
126
+ },
127
+ ...PaginationProps?.sx
128
+ } }));
129
+ };
130
+ export default DsCarouselPagination;
@@ -1,19 +1,3 @@
1
- import React from 'react';
2
- import { SwiperContainer } from 'swiper/element';
3
- import { SwiperProps } from 'swiper/swiper-react';
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 class DsCarousel extends React.PureComponent {
17
- SwiperContainer = null;
18
- uid = generateUid();
19
- componentDidMount() {
20
- this.initialize();
21
- }
22
- _isNavigationEnabled = () => {
23
- const { navigation } = this.props;
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 } = this.props;
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 } = this.props;
36
+ const _isAutoplayEnabled = () => {
37
+ const { autoplay } = props;
38
38
  return !(autoplay === false);
39
39
  };
40
- _getNavigationSettings = () => {
41
- const { navigation } = this.props;
42
- const isEnabled = this._isNavigationEnabled();
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}-${this.uid}`,
46
- prevEl: `${SWIPER_NAVIGATION_SETTINGS.prevEl}-${this.uid}`
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 } = this.props;
55
- const isEnabled = this._isPaginationEnabled();
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}-${this.uid}`
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 } = this.props;
67
- const isEnabled = this._isAutoplayEnabled();
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 = this._isNavigationEnabled();
77
+ const isNavigationEnabled = _isNavigationEnabled();
78
78
  if (isNavigationEnabled) {
79
79
  sanitizedModule = [...sanitizedModule, Navigation];
80
80
  }
81
- const isPaginationEnabled = this._isPaginationEnabled();
81
+ const isPaginationEnabled = _isPaginationEnabled();
82
82
  if (isPaginationEnabled) {
83
83
  sanitizedModule = [...sanitizedModule, Pagination];
84
84
  }
85
- const isAutoplayEnabled = this._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 } = this.props;
93
- const sanitizedModule = this._sanitizeModuleProps(modules);
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: this._getNavigationSettings() || false,
102
- pagination: this._getPaginationSettings() || false,
103
- autoplay: this._getAutoPlaySettings() || false
101
+ navigation: _getNavigationSettings() || false,
102
+ pagination: _getPaginationSettings() || false,
103
+ autoplay: _getAutoPlaySettings() || false
104
104
  };
105
- // swiperParams = this.handleNavigationModule(swiperParams)
105
+ // swiperParams = handleNavigationModule(swiperParams)
106
106
  // now we need to assign all parameters to Swiper element
107
- Object.assign(this.SwiperContainer || {}, swiperParams);
107
+ Object.assign(SwiperContainer || {}, swiperParams);
108
108
  // and now initialize it
109
- this.SwiperContainer?.initialize();
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
- this.SwiperContainer = swiperRef;
113
+ const setRef = (swiperRef) => {
114
+ SwiperContainer = swiperRef;
115
115
  };
116
- render() {
117
- const { PaginationWrapperProps, SwiperConatinerWrapperProps, SwiperConatinerStyles, children, NavigationProps, PaginationProps } = this.props;
118
- const paginationSettings = this._getPaginationSettings();
119
- return (_jsxs(DsBox, { ...PaginationWrapperProps, sx: {
120
- position: 'relative',
121
- pb: paginationSettings?.mode === 'external' ? '44px' : undefined,
122
- ...PaginationWrapperProps?.sx
123
- }, children: [_jsxs(DsBox, { ...SwiperConatinerWrapperProps, sx: {
124
- position: 'relative',
125
- ...SwiperConatinerWrapperProps?.sx
126
- }, children: [_jsx("swiper-container", { ref: this.setRef, init: false, style: {
127
- ...SwiperConatinerStyles
128
- }, children: React.Children.map(children, (child, index) => {
129
- return (_jsx("swiper-slide", { children: child }, `${name}-${index}`));
130
- }) }), _jsx(DsCarouselNavigation, { uid: this.uid, isEnabled: this._isNavigationEnabled(), NavigationProps: NavigationProps })] }), _jsx(DsCarouselPagination, { uid: this.uid, isEnabled: this._isPaginationEnabled(), isAutoplayEnabled: this._isAutoplayEnabled(), AutoplaySettings: this._getAutoPlaySettings(), PaginationSettings: paginationSettings, PaginationProps: PaginationProps })] }));
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
- import { PureComponent } from 'react';
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
- import { jsx as _jsx } from "react/jsx-runtime";
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,3 +1,4 @@
1
1
  export const DsChipDefaultProps = {
2
- type: 'status'
2
+ type: 'status',
3
+ 'ds-variant': 'chip'
3
4
  };
@@ -1,6 +1,3 @@
1
- import { PureComponent } from 'react';
1
+ import { FC } from 'react';
2
2
  import { DsChipGroupProps } from './DsChipGroup.Types';
3
- export declare class DsChipGroup extends PureComponent<DsChipGroupProps> {
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 class DsChipGroup extends PureComponent {
6
- static defaultProps = DsChipGroupDefaultProps;
7
- render() {
8
- const { children, ...restStackProps } = this.props;
9
- return (_jsx(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-glacial)', ...restStackProps, children: children }));
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 { PureComponent } from 'react';
2
- import { DsContentSliderProps, DsContentSliderState } from './DsContentSlider.Types';
3
- export declare class DsContentSlider extends PureComponent<DsContentSliderProps, DsContentSliderState> {
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 { PureComponent } from 'react';
2
+ import { useState } from 'react';
3
3
  import { DsBox } from '../DsBox';
4
4
  import { DsStack } from '../DsStack';
5
- export class DsContentSlider extends PureComponent {
6
- constructor(props) {
7
- super(props);
8
- const state = {
9
- active: props.activeStep
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 = this.props['ds-variant'] === 'timed';
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 } = this.props;
50
+ function renderSteps() {
51
+ const { steps } = props;
57
52
  const indicators = [];
58
53
  for (let index = 0; index < steps; index++) {
59
- const indicator = this.renderStep(index);
54
+ const indicator = renderStep(index);
60
55
  indicators.push(indicator);
61
56
  }
62
57
  return indicators;
63
58
  }
64
- render() {
65
- const { steps } = this.props;
66
- return (_jsx(DsStack, { direction: "row", spacing: "var(--ds-spacing-quickFreeze)", children: this.renderSteps() }));
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 class DsDialog extends React.Component<DsDialogProps> {
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>;