@am92/react-design-system 2.7.8 → 2.8.1

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 (114) 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/DsAvatar/DsAvatar.Component.d.ts +3 -1
  4. package/dist/Components/DsAvatar/DsAvatar.Component.js +5 -1
  5. package/dist/Components/DsBottomSheet/DsBottomSheet.Component.d.ts +2 -7
  6. package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +62 -65
  7. package/dist/Components/DsButton/DsButton.Component.d.ts +2 -4
  8. package/dist/Components/DsButton/DsButton.Component.js +4 -7
  9. package/dist/Components/DsButtonGroup/DsButtonGroup.Component.d.ts +2 -6
  10. package/dist/Components/DsButtonGroup/DsButtonGroup.Component.js +16 -18
  11. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.d.ts +2 -3
  12. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.js +42 -44
  13. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.d.ts +2 -6
  14. package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.js +109 -110
  15. package/dist/Components/DsCarousel/DsCarousel.Component/index.d.ts +3 -19
  16. package/dist/Components/DsCarousel/DsCarousel.Component/index.js +55 -57
  17. package/dist/Components/DsChip/DsChip.Component.d.ts +2 -5
  18. package/dist/Components/DsChip/DsChip.Component.js +3 -8
  19. package/dist/Components/DsChip/DsChip.Overrides.d.ts +1 -8
  20. package/dist/Components/DsChip/DsChip.Overrides.js +12 -57
  21. package/dist/Components/DsChip/DsChip.Types.d.ts +9 -2
  22. package/dist/Components/DsChipGroup/DsChipGroup.Component.d.ts +2 -5
  23. package/dist/Components/DsChipGroup/DsChipGroup.Component.js +5 -8
  24. package/dist/Components/DsContentSlider/DsContentSlider.Component.d.ts +3 -8
  25. package/dist/Components/DsContentSlider/DsContentSlider.Component.js +13 -20
  26. package/dist/Components/DsDialog/DsDialog.Component.d.ts +1 -6
  27. package/dist/Components/DsDialog/DsDialog.Component.js +71 -75
  28. package/dist/Components/DsDialog/DsDialog.Overrides.d.ts +1 -0
  29. package/dist/Components/DsDialog/DsDialog.Overrides.js +2 -0
  30. package/dist/Components/DsFileUploader/DsFileUploader.Component.d.ts +3 -16
  31. package/dist/Components/DsFileUploader/DsFileUploader.Component.js +68 -71
  32. package/dist/Components/DsHeader/DsHeader.Component.d.ts +2 -5
  33. package/dist/Components/DsHeader/DsHeader.Component.js +29 -32
  34. package/dist/Components/DsHelperText/DsHelperText.Component.d.ts +2 -5
  35. package/dist/Components/DsHelperText/DsHelperText.Component.js +16 -21
  36. package/dist/Components/DsHelperText/DsHelperText.Overrides.d.ts +5 -1
  37. package/dist/Components/DsHelperText/DsHelperText.Overrides.js +6 -1
  38. package/dist/Components/DsImage/DsImage.Component.d.ts +3 -12
  39. package/dist/Components/DsImage/DsImage.Component.js +40 -45
  40. package/dist/Components/DsImage/DsImage.Types.d.ts +0 -1
  41. package/dist/Components/DsImage/DsImage.Types.js +0 -3
  42. package/dist/Components/DsInputLabel/DsInputLabel.Component.d.ts +2 -4
  43. package/dist/Components/DsInputLabel/DsInputLabel.Component.js +6 -9
  44. package/dist/Components/DsNotistack/AlertMessage.Component.js +7 -9
  45. package/dist/Components/DsNotistack/DsNotistack.Component.d.ts +2 -7
  46. package/dist/Components/DsNotistack/DsNotistack.Component.js +12 -16
  47. package/dist/Components/DsNotistack/DsNotistack.Types.d.ts +1 -0
  48. package/dist/Components/DsNotistack/DsNotistack.Types.js +3 -1
  49. package/dist/Components/DsOtp/DsOtp.Component.d.ts +3 -15
  50. package/dist/Components/DsOtp/DsOtp.Component.js +41 -51
  51. package/dist/Components/DsPopup/DsPopup.Types.d.ts +1 -1
  52. package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.d.ts +2 -6
  53. package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +18 -21
  54. package/dist/Components/DsProgressTracker/DsProgressStepper.Component.d.ts +3 -9
  55. package/dist/Components/DsProgressTracker/DsProgressStepper.Component.js +8 -11
  56. package/dist/Components/DsProgressTracker/DsProgressTracker.Component.d.ts +3 -21
  57. package/dist/Components/DsProgressTracker/DsProgressTracker.Component.js +17 -26
  58. package/dist/Components/DsRadio/DsRadio.Component.d.ts +2 -5
  59. package/dist/Components/DsRadio/DsRadio.Component.js +5 -8
  60. package/dist/Components/DsRadio/DsRadio.Overrides.d.ts +1 -0
  61. package/dist/Components/DsRadio/DsRadio.Overrides.js +2 -1
  62. package/dist/Components/DsRemixIcon/DsRemixIcon.Component.d.ts +2 -4
  63. package/dist/Components/DsRemixIcon/DsRemixIcon.Component.js +5 -7
  64. package/dist/Components/DsSelect/DsSelect.Component.d.ts +2 -6
  65. package/dist/Components/DsSelect/DsSelect.Component.js +49 -53
  66. package/dist/Components/DsSelect/DsSelect.Types.d.ts +8 -0
  67. package/dist/Components/DsSlider/DsSlider.Component.d.ts +1 -5
  68. package/dist/Components/DsSlider/DsSlider.Component.js +1 -10
  69. package/dist/Components/DsSlider/DsSlider.Overrides.d.ts +1 -1
  70. package/dist/Components/DsSlider/DsSlider.Overrides.js +2 -2
  71. package/dist/Components/DsSwitch/DsSwitch.Component.d.ts +2 -6
  72. package/dist/Components/DsSwitch/DsSwitch.Component.js +7 -10
  73. package/dist/Components/DsTag/DsTag.Component.d.ts +2 -7
  74. package/dist/Components/DsTag/DsTag.Component.js +50 -14
  75. package/dist/Components/DsTag/DsTag.Overrides.d.ts +5 -1
  76. package/dist/Components/DsTag/DsTag.Overrides.js +6 -2
  77. package/dist/Components/DsTagGroup/DsTagGroup.Component.d.ts +2 -7
  78. package/dist/Components/DsTagGroup/DsTagGroup.Component.js +25 -27
  79. package/dist/Components/DsTextArea/DsTextArea.Component.d.ts +3 -10
  80. package/dist/Components/DsTextArea/DsTextArea.Component.js +49 -54
  81. package/dist/Components/DsTextArea/DsTextArea.Types.d.ts +0 -1
  82. package/dist/Components/DsTextArea/DsTextArea.Types.js +1 -3
  83. package/dist/Components/DsTextField/DsTextField.Component.d.ts +2 -4
  84. package/dist/Components/DsTextField/DsTextField.Component.js +7 -8
  85. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.d.ts +3 -10
  86. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.js +15 -26
  87. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.d.ts +0 -1
  88. package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.js +0 -3
  89. package/dist/Components/DsToast/DsToast.Component.d.ts +2 -4
  90. package/dist/Components/DsToast/DsToast.Component.js +9 -7
  91. package/dist/Components/DsToggle/DsToggle.Component.d.ts +2 -5
  92. package/dist/Components/DsToggle/DsToggle.Component.js +11 -9
  93. package/dist/Components/DsToggle/DsToggle.Types.js +1 -1
  94. package/dist/Components/DsTooltip/DsTooltip.Component.d.ts +2 -5
  95. package/dist/Components/DsTooltip/DsTooltip.Component.js +7 -9
  96. package/dist/Constants/TYPOGRAPGHY.d.ts +4 -1
  97. package/dist/Constants/TYPOGRAPGHY.js +3 -0
  98. package/dist/Helpers/accessibility.d.ts +3 -0
  99. package/dist/Helpers/accessibility.js +14 -0
  100. package/dist/Helpers/index.d.ts +1 -0
  101. package/dist/Helpers/index.js +1 -0
  102. package/dist/Hooks/accessibility.d.ts +9 -0
  103. package/dist/Hooks/accessibility.js +35 -0
  104. package/dist/Hooks/index.d.ts +1 -0
  105. package/dist/Hooks/index.js +1 -0
  106. package/dist/Theme/componentOverrides.d.ts +8 -12
  107. package/dist/Theme/getColorScheme/dark.js +1 -1
  108. package/dist/Types/DsAccessibility.d.ts +1 -0
  109. package/dist/Types/DsAccessibility.js +1 -0
  110. package/dist/Types/index.d.ts +1 -0
  111. package/dist/Types/index.js +1 -0
  112. package/dist/index.d.ts +1 -0
  113. package/dist/index.js +1 -0
  114. 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,3 @@
1
- import { PureComponent } from 'react';
1
+ import { FC } from 'react';
2
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
- }
3
+ export declare const DsChip: FC<DsChipProps>;
@@ -1,10 +1,5 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
- import { PureComponent } from 'react';
3
2
  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
- }
3
+ export const DsChip = props => {
4
+ return _jsx(Chip, { ...props, variant: "chip" });
5
+ };
@@ -7,13 +7,6 @@ export declare const DsChipOverrides: {
7
7
  props: Partial<DsChipProps>;
8
8
  style: CSSInterpolation;
9
9
  }[];
10
- styleOverrides: {
11
- root: CSSInterpolation;
12
- filled: CSSInterpolation;
13
- filledSecondary: CSSInterpolation;
14
- label: CSSInterpolation;
15
- icon: CSSInterpolation;
16
- deleteIcon: CSSInterpolation;
17
- };
10
+ styleOverrides: {};
18
11
  };
19
12
  };
@@ -1,11 +1,10 @@
1
- import STATE_STYLES from '../../Theme/STATE_STYLES';
2
1
  import { DsChipDefaultProps } from './DsChip.Types';
3
2
  export const DsChipOverrides = {
4
3
  MuiChip: {
5
4
  defaultProps: DsChipDefaultProps,
6
5
  variants: [
7
6
  {
8
- props: { 'ds-variant': 'chip' },
7
+ props: { variant: 'chip' },
9
8
  style: {
10
9
  border: 'none',
11
10
  borderRadius: 'var(--ds-radius-quickFreeze)',
@@ -25,7 +24,7 @@ export const DsChipOverrides = {
25
24
  }
26
25
  },
27
26
  {
28
- props: { 'ds-variant': 'chip', type: 'status' },
27
+ props: { variant: 'chip', type: 'status' },
29
28
  style: {
30
29
  fontWeight: 'var(--ds-typo-supportRegularMetadata-fontWeight)',
31
30
  fontSize: 'var(--ds-typo-supportRegularMetadata-fontSize)',
@@ -40,7 +39,7 @@ export const DsChipOverrides = {
40
39
  },
41
40
  {
42
41
  props: {
43
- 'ds-variant': 'chip',
42
+ variant: 'chip',
44
43
  type: 'status',
45
44
  color: 'success'
46
45
  },
@@ -50,7 +49,7 @@ export const DsChipOverrides = {
50
49
  },
51
50
  {
52
51
  props: {
53
- 'ds-variant': 'chip',
52
+ variant: 'chip',
54
53
  type: 'status',
55
54
  color: 'warning'
56
55
  },
@@ -60,7 +59,7 @@ export const DsChipOverrides = {
60
59
  },
61
60
  {
62
61
  props: {
63
- 'ds-variant': 'chip',
62
+ variant: 'chip',
64
63
  type: 'status',
65
64
  color: 'error'
66
65
  },
@@ -70,7 +69,7 @@ export const DsChipOverrides = {
70
69
  },
71
70
  {
72
71
  props: {
73
- 'ds-variant': 'chip',
72
+ variant: 'chip',
74
73
  type: 'status',
75
74
  color: 'info'
76
75
  },
@@ -80,7 +79,7 @@ export const DsChipOverrides = {
80
79
  }
81
80
  },
82
81
  {
83
- props: { 'ds-variant': 'chip', type: 'nudge' },
82
+ props: { variant: 'chip', type: 'nudge' },
84
83
  style: {
85
84
  fontWeight: 'var(--ds-typo-supportRegularInfo-fontWeight)',
86
85
  fontSize: 'var(--ds-typo-supportRegularInfo-fontSize)',
@@ -95,7 +94,7 @@ export const DsChipOverrides = {
95
94
  },
96
95
  {
97
96
  props: {
98
- 'ds-variant': 'chip',
97
+ variant: 'chip',
99
98
  type: 'nudge',
100
99
  color: 'success'
101
100
  },
@@ -106,7 +105,7 @@ export const DsChipOverrides = {
106
105
  },
107
106
  {
108
107
  props: {
109
- 'ds-variant': 'chip',
108
+ variant: 'chip',
110
109
  type: 'nudge',
111
110
  color: 'warning'
112
111
  },
@@ -117,7 +116,7 @@ export const DsChipOverrides = {
117
116
  },
118
117
  {
119
118
  props: {
120
- 'ds-variant': 'chip',
119
+ variant: 'chip',
121
120
  type: 'nudge',
122
121
  color: 'error'
123
122
  },
@@ -128,7 +127,7 @@ export const DsChipOverrides = {
128
127
  },
129
128
  {
130
129
  props: {
131
- 'ds-variant': 'chip',
130
+ variant: 'chip',
132
131
  type: 'nudge',
133
132
  color: 'info'
134
133
  },
@@ -138,50 +137,6 @@ export const DsChipOverrides = {
138
137
  }
139
138
  }
140
139
  ],
141
- styleOverrides: {
142
- root: {
143
- paddingTop: 'var(--ds-spacing-quickFreeze)',
144
- paddingBottom: 'var(--ds-spacing-quickFreeze)',
145
- fontWeight: 'var(--ds-typo-bodyRegularMedium-fontWeight)',
146
- fontSize: 'var(--ds-typo-bodyRegularMedium-fontSize)',
147
- lineHeight: 'var(--ds-typo-bodyRegularMedium-lineHeight)',
148
- letterSpacing: 'var(--ds-typo-bodyRegularMedium-letterSpacing)'
149
- },
150
- filled: {
151
- backgroundColor: 'var(--ds-colour-surfacePrimary)',
152
- border: '1px solid var(--ds-colour-strokeDefault)',
153
- '> .MuiIcon-root': {
154
- color: 'var(--ds-colour-iconDefault)'
155
- }
156
- },
157
- filledSecondary: {
158
- backgroundColor: 'var(--ds-colour-actionSecondary)',
159
- border: '1px solid var(--ds-colour-strokeSelected)',
160
- fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
161
- fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
162
- lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
163
- letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
164
- '> .MuiIcon-root': {
165
- color: 'inherit'
166
- },
167
- ...STATE_STYLES.ACTION_SECONDARY_STATE_SECONDARY
168
- },
169
- label: {
170
- paddingTop: 'var(--ds-spacing-deepFreeze)',
171
- paddingBottom: 'var(--ds-spacing-deepFreeze)',
172
- paddingLeft: 'var(--ds-spacing-frostbite)',
173
- paddingRight: 'var(--ds-spacing-frostbite)'
174
- },
175
- icon: {
176
- fontSize: 'var(--ds-typo-fontSizeBitterCold)',
177
- marginLeft: 'var(--ds-spacing-frostbite)',
178
- marginRight: 'calc(var(--ds-spacing-quickFreeze) * -1)'
179
- },
180
- deleteIcon: {
181
- fontSize: 'var(--ds-typo-fontSizeBitterCold)',
182
- marginRight: 'var(--ds-spacing-frostbite)',
183
- marginLeft: 'calc(var(--ds-spacing-quickFreeze) * -1)'
184
- }
185
- }
140
+ styleOverrides: {}
186
141
  }
187
142
  };