@am92/react-design-system 2.10.2 → 3.0.1-beta.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.
- package/dist/Components/DsAddItem/DsAddItem.Component.d.ts +2 -0
- package/dist/Components/DsAddItem/DsAddItem.Component.js +105 -0
- package/dist/Components/DsAddItem/DsAddItem.Overrides.d.ts +5 -0
- package/dist/Components/DsAddItem/DsAddItem.Overrides.js +6 -0
- package/dist/Components/DsAddItem/DsAddItem.Types.d.ts +78 -0
- package/dist/Components/DsAddItem/DsAddItem.Types.js +35 -0
- package/dist/Components/DsAddItem/Slots/DsAddItemActionIcon.Slot.d.ts +3 -0
- package/dist/Components/DsAddItem/Slots/DsAddItemActionIcon.Slot.js +9 -0
- package/dist/Components/DsAddItem/Slots/DsAddItemCounterText.Slot.d.ts +3 -0
- package/dist/Components/DsAddItem/Slots/DsAddItemCounterText.Slot.js +15 -0
- package/dist/Components/DsAddItem/index.d.ts +3 -0
- package/dist/Components/DsAddItem/index.js +3 -0
- package/dist/Components/DsAvatar/DsAvatar.Overrides.d.ts +54 -50
- package/dist/Components/DsAvatar/DsAvatar.Overrides.js +107 -103
- package/dist/Components/DsBadge/DsBadge.Component.d.ts +2 -1
- package/dist/Components/DsBadge/DsBadge.Component.js +11 -1
- package/dist/Components/DsBadge/DsBadge.Overrides.d.ts +23 -1
- package/dist/Components/DsBadge/DsBadge.Overrides.js +23 -0
- package/dist/Components/DsBadge/DsBadge.Types.d.ts +5 -1
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +16 -10
- package/dist/Components/DsButton/DsButton.Overrides.d.ts +8 -12
- package/dist/Components/DsButton/DsButton.Overrides.js +26 -26
- package/dist/Components/DsButtonBase/DsButtonBase.Overrides.d.ts +10 -1
- package/dist/Components/DsButtonBase/DsButtonBase.Overrides.js +11 -1
- package/dist/Components/DsChip/DsChip.Overrides.d.ts +9 -6
- package/dist/Components/DsChip/DsChip.Overrides.js +136 -133
- package/dist/Components/DsDialog/DsDialog.Component.js +22 -16
- package/dist/Components/DsDialog/DsDialog.Types.d.ts +3 -1
- package/dist/Components/DsDivider/DsDivider.Overrides.d.ts +5 -5
- package/dist/Components/DsDivider/DsDivider.Overrides.js +32 -32
- package/dist/Components/DsFab/DsFab.Overrides.js +1 -0
- package/dist/Components/DsInputBase/DsInputBase.Overrides.d.ts +3 -7
- package/dist/Components/DsInputBase/DsInputBase.Overrides.js +61 -61
- package/dist/Components/DsInputLabel/DsInputLabel.Component.js +5 -1
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +6 -1
- package/dist/Components/DsProgressTracker/Components/DsProgressStepper.Component.js +4 -1
- package/dist/Components/DsProgressTracker/Components/DsProgressTrackerHeader.Component.js +16 -3
- package/dist/Components/DsSearchbar/DsSearchbar.Component.js +4 -1
- package/dist/Components/DsSelect/DsSelect.Component.js +3 -1
- package/dist/Components/DsSelect/DsSelect.Types.d.ts +1 -0
- package/dist/Components/DsSlider/DsSlider.Overrides.d.ts +13 -13
- package/dist/Components/DsSlider/DsSlider.Overrides.js +16 -16
- package/dist/Components/DsTabs/DsTabs.Overrides.d.ts +3 -7
- package/dist/Components/DsTabs/DsTabs.Overrides.js +84 -44
- package/dist/Components/DsTabs/DsTabs.Types.d.ts +2 -2
- package/dist/Components/DsTabs/DsTabs.Types.js +2 -2
- package/dist/Components/DsTag/DsTag.Component.js +29 -9
- package/dist/Components/DsToggleButtonGroup/DsToggleButtonGroup.Overrides.d.ts +9 -5
- package/dist/Components/DsToggleButtonGroup/DsToggleButtonGroup.Overrides.js +47 -43
- package/dist/Components/index.d.ts +1 -0
- package/dist/Components/index.js +1 -0
- package/dist/Theme/componentOverrides.d.ts +165 -129
- package/dist/Theme/componentOverrides.js +2 -1
- package/dist/Theme/getColorScheme/dark.d.ts +28 -1
- package/dist/Theme/getColorScheme/getPalette.d.ts +2 -2
- package/dist/Theme/getColorScheme/getPalette.js +3 -1
- package/dist/Theme/getColorScheme/highContrast.d.ts +28 -1
- package/dist/Theme/getColorScheme/light.d.ts +28 -1
- package/dist/Theme/index.d.ts +5 -0
- package/dist/Theme/index.js +2 -1
- package/dist/Theme/radius.js +1 -0
- package/dist/Theme/spacing.js +1 -0
- package/dist/Types/DsRadius.d.ts +1 -1
- package/dist/Types/DsSpacing.d.ts +1 -1
- package/dist/material.d.ts +0 -2
- package/dist/material.js +0 -2
- package/dist/x-charts/Components/index.d.ts +2 -6
- package/dist/x-charts/Components/index.js +2 -6
- package/dist/x-charts/Hooks/index.d.ts +3 -0
- package/dist/x-charts/Hooks/index.js +5 -0
- package/dist/x-charts/Types/index.d.ts +0 -6
- package/dist/x-charts/index.d.ts +1 -0
- package/dist/x-charts/index.js +1 -0
- package/dist/x-datepicker/Components/DsDatePicker/DateCalenderHeader.d.ts +1 -1
- package/dist/x-datepicker/Components/DsDatePicker/DateCalenderHeader.js +17 -4
- package/dist/x-datepicker/Components/DsDatePicker/DatePickerTextField.d.ts +4 -4
- package/dist/x-datepicker/Components/DsDatePicker/DatePickerTextField.js +4 -3
- package/dist/x-datepicker/Components/DsDatePicker/DefaultActionBar.d.ts +4 -7
- package/dist/x-datepicker/Components/DsDatePicker/DefaultActionBar.js +8 -8
- package/dist/x-datepicker/Components/DsDatePicker/DefaultToolbar.d.ts +1 -3
- package/dist/x-datepicker/Components/DsDatePicker/DefaultToolbar.js +4 -7
- package/dist/x-datepicker/Components/DsDatePicker/DsDatePicker.Component.d.ts +1 -1
- package/dist/x-datepicker/Components/DsDatePicker/DsDatePicker.Component.js +6 -12
- package/dist/x-datepicker/Components/DsDatePicker/DsDatePicker.Overrides.d.ts +36 -31
- package/dist/x-datepicker/Components/DsDatePicker/DsDatePicker.Overrides.js +11 -22
- package/dist/x-datepicker/Components/DsDatePicker/DsDatePicker.Types.d.ts +3 -3
- package/dist/x-datepicker/Components/DsDatePicker/utils.d.ts +3 -3
- package/dist/x-datepicker/Locale/DsDatePickerLocaleBeBY.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleBeBY.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleCaES.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleCaES.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleCsCZ.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleCsCZ.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleDaDK.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleDaDK.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleDeDE.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleDeDE.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleElGR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleElGR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEnUS.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEnUS.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEsES.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEsES.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEu.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleEu.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFaIR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFaIR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFiFI.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFiFI.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFrFR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleFrFR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleHeIL.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleHeIL.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleHuHU.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleHuHU.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleIsIS.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleIsIS.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleItIT.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleItIT.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleJaJP.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleJaJP.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleKoKR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleKoKR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleKzKZ.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleKzKZ.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleMk.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleMk.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleNbNO.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleNbNO.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleNlNL.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleNlNL.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocalePlPL.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocalePlPL.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocalePtBR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocalePtBR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleRoRO.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleRoRO.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleRuRU.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleRuRU.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleSkSK.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleSkSK.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleSvSE.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleSvSE.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleTrTR.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleTrTR.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleUkUA.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleUkUA.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleUrPK.d.ts +23 -7
- package/dist/x-datepicker/Locale/DsDatePickerLocaleViVN.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleViVN.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleZhCN.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleZhCN.js +1 -1
- package/dist/x-datepicker/Locale/DsDatePickerLocaleZhHK.d.ts +24 -8
- package/dist/x-datepicker/Locale/DsDatePickerLocaleZhHK.js +1 -1
- package/dist/x-datepicker/componentOverrides.d.ts +36 -31
- package/package.json +11 -11
|
@@ -1,7 +1,29 @@
|
|
|
1
|
+
import { DsBadgeProps } from './DsBadge.Types';
|
|
1
2
|
export declare const DsBadgeOverrides: {
|
|
2
3
|
MuiBadge: {
|
|
3
|
-
defaultProps:
|
|
4
|
+
defaultProps: DsBadgeProps;
|
|
4
5
|
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
variants: ({
|
|
8
|
+
props: Partial<DsBadgeProps>;
|
|
9
|
+
style: {
|
|
10
|
+
'& .MuiBadge-badge': {
|
|
11
|
+
backgroundColor: string;
|
|
12
|
+
color: string;
|
|
13
|
+
pointerEvents?: undefined;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
} | {
|
|
17
|
+
props: Partial<DsBadgeProps>;
|
|
18
|
+
style: {
|
|
19
|
+
'& .MuiBadge-badge': {
|
|
20
|
+
backgroundColor: string;
|
|
21
|
+
color: string;
|
|
22
|
+
pointerEvents: string;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
})[];
|
|
26
|
+
};
|
|
5
27
|
standard: {
|
|
6
28
|
fontWeight: string;
|
|
7
29
|
fontSize: string;
|
|
@@ -3,6 +3,29 @@ export const DsBadgeOverrides = {
|
|
|
3
3
|
MuiBadge: {
|
|
4
4
|
defaultProps: DsBadgeDefaultProps,
|
|
5
5
|
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
variants: [
|
|
8
|
+
{
|
|
9
|
+
props: { color: 'inverse' },
|
|
10
|
+
style: {
|
|
11
|
+
'& .MuiBadge-badge': {
|
|
12
|
+
backgroundColor: 'var(--ds-colour-iconOnSurface)',
|
|
13
|
+
color: 'var(--ds-colour-actionSecondary)',
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
props: { disabled: true },
|
|
19
|
+
style: {
|
|
20
|
+
'& .MuiBadge-badge': {
|
|
21
|
+
backgroundColor: 'var(--ds-colour-iconDisabled)',
|
|
22
|
+
color: 'var(--ds-colour-typoOnSurface)',
|
|
23
|
+
pointerEvents: 'none'
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
},
|
|
6
29
|
standard: {
|
|
7
30
|
fontWeight: 'var(--ds-typo-supportRegularInfo-fontWeight)',
|
|
8
31
|
fontSize: 'var(--ds-typo-supportRegularInfo-fontSize)',
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { BadgeProps } from '@mui/material';
|
|
2
|
-
|
|
2
|
+
type TDsBadgeExtendedColor = BadgeProps['color'] | 'inverse';
|
|
3
|
+
export interface DsBadgeProps extends Omit<BadgeProps, 'color'> {
|
|
4
|
+
color?: TDsBadgeExtendedColor;
|
|
5
|
+
disabled?: boolean;
|
|
3
6
|
}
|
|
4
7
|
export declare const DsBadgeDefaultProps: DsBadgeProps;
|
|
8
|
+
export {};
|
|
@@ -9,6 +9,7 @@ import { DsDialogContent } from '../DsDialogContent';
|
|
|
9
9
|
import { DsButton } from '../DsButton';
|
|
10
10
|
import { DsDialogActions } from '../DsDialogActions';
|
|
11
11
|
import { DsPaper } from '../DsPaper';
|
|
12
|
+
import { mergeSlotProps } from '../../utils';
|
|
12
13
|
export const DsBottomSheet = (inProps) => {
|
|
13
14
|
const props = { ...DsBottomSheetDefaultProps, ...inProps };
|
|
14
15
|
const handleDrawerClose = (event, reason) => {
|
|
@@ -23,7 +24,7 @@ export const DsBottomSheet = (inProps) => {
|
|
|
23
24
|
onClose(event, 'backdropClick');
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
const { kicker, title, description, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, ContainerProps, KickerProps, DescriptionProps, TitleProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, onClose, ...DrawerProps } = props;
|
|
27
|
+
const { kicker, title, description, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, ContainerProps, KickerProps, DescriptionProps, TitleProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, onClose, slotProps, ...DrawerProps } = props;
|
|
27
28
|
const actionsAvailable = !!(primaryButtonText || secondaryButtonText);
|
|
28
29
|
const isFlushed = primaryButtonText &&
|
|
29
30
|
!secondaryButtonText &&
|
|
@@ -36,14 +37,18 @@ export const DsBottomSheet = (inProps) => {
|
|
|
36
37
|
if (kicker) {
|
|
37
38
|
accessibilityProps['aria-describedby'] = kicker;
|
|
38
39
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
40
|
+
const paperProps = {
|
|
41
|
+
...PaperProps,
|
|
42
|
+
...slotProps?.paper
|
|
43
|
+
};
|
|
44
|
+
return (_jsxs(DsDrawer, { ...accessibilityProps, ...DrawerProps, anchor: 'bottom', slotProps: {
|
|
45
|
+
...slotProps,
|
|
46
|
+
paper: mergeSlotProps(paperProps, {
|
|
47
|
+
sx: {
|
|
48
|
+
background: 'transparent',
|
|
49
|
+
maxHeight: 'var(--ds-rules-bottomSheetWorkingAreaHeight)',
|
|
50
|
+
},
|
|
51
|
+
}),
|
|
47
52
|
}, onClose: handleDrawerClose, children: [showClose && (_jsx(DsIconButton, { onClick: handleCloseClick, ...CloseIconButtonProps, sx: {
|
|
48
53
|
flexGrow: 0,
|
|
49
54
|
alignSelf: 'center',
|
|
@@ -63,7 +68,8 @@ export const DsBottomSheet = (inProps) => {
|
|
|
63
68
|
borderTopLeftRadius: 'var(--ds-radius-bitterCold)',
|
|
64
69
|
borderTopRightRadius: 'var(--ds-radius-bitterCold)',
|
|
65
70
|
...ContainerProps?.sx
|
|
66
|
-
}, children: [kicker && (_jsx(DsTypography, { variant: 'subheadingSemiboldDefault',
|
|
71
|
+
}, children: [kicker && (_jsx(DsTypography, { variant: 'subheadingSemiboldDefault', ...KickerProps, sx: {
|
|
72
|
+
color: 'text.tertiary',
|
|
67
73
|
px: 'var(--ds-spacing-bitterCold)',
|
|
68
74
|
mb: 'var(--ds-spacing-quickFreeze)',
|
|
69
75
|
textTransform: 'uppercase',
|
|
@@ -1,26 +1,22 @@
|
|
|
1
1
|
import { DsButtonProps } from './DsButton.Types';
|
|
2
|
-
import {
|
|
2
|
+
import { CSSObject } from '@mui/system';
|
|
3
3
|
export declare const DsButtonOverrides: {
|
|
4
4
|
MuiButton: {
|
|
5
5
|
defaultProps: DsButtonProps;
|
|
6
|
-
variants: {
|
|
7
|
-
props: Partial<DsButtonProps>;
|
|
8
|
-
style: CSSInterpolation;
|
|
9
|
-
}[];
|
|
10
6
|
styleOverrides: {
|
|
11
|
-
root:
|
|
12
|
-
contained:
|
|
13
|
-
sizeLarge:
|
|
14
|
-
sizeMedium:
|
|
15
|
-
sizeSmall:
|
|
16
|
-
icon:
|
|
7
|
+
root: CSSObject;
|
|
8
|
+
contained: CSSObject;
|
|
9
|
+
sizeLarge: CSSObject;
|
|
10
|
+
sizeMedium: CSSObject;
|
|
11
|
+
sizeSmall: CSSObject;
|
|
12
|
+
icon: CSSObject;
|
|
17
13
|
startIcon: {
|
|
18
14
|
marginRight: string;
|
|
19
15
|
};
|
|
20
16
|
endIcon: {
|
|
21
17
|
marginLeft: string;
|
|
22
18
|
};
|
|
23
|
-
text:
|
|
19
|
+
text: CSSObject;
|
|
24
20
|
};
|
|
25
21
|
};
|
|
26
22
|
};
|
|
@@ -3,29 +3,6 @@ import STATE_STYLES from '../../Theme/STATE_STYLES';
|
|
|
3
3
|
export const DsButtonOverrides = {
|
|
4
4
|
MuiButton: {
|
|
5
5
|
defaultProps: DsButtonDefaultProps,
|
|
6
|
-
variants: [
|
|
7
|
-
{
|
|
8
|
-
props: { variant: 'flushed' },
|
|
9
|
-
style: {
|
|
10
|
-
borderRadius: 'var(--ds-radius-zero)'
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
props: {
|
|
15
|
-
variant: 'flushed',
|
|
16
|
-
color: 'primary'
|
|
17
|
-
},
|
|
18
|
-
style: {
|
|
19
|
-
color: 'var(--ds-colour-typoOnSurface)',
|
|
20
|
-
backgroundColor: 'var(--ds-colour-actionPrimary)',
|
|
21
|
-
'&:disabled': {
|
|
22
|
-
color: 'var(--ds-colour-typoOnSurface)',
|
|
23
|
-
backgroundColor: 'var(--ds-colour-stateUnselectedDefault)'
|
|
24
|
-
},
|
|
25
|
-
...STATE_STYLES.ACTION_PRIMARY_STATE_PRIMARY
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
],
|
|
29
6
|
styleOverrides: {
|
|
30
7
|
root: {
|
|
31
8
|
borderRadius: 'var(--ds-radius-glacial)',
|
|
@@ -33,10 +10,33 @@ export const DsButtonOverrides = {
|
|
|
33
10
|
'&.Mui-disabled': {
|
|
34
11
|
cursor: 'not-allowed',
|
|
35
12
|
pointerEvents: 'all'
|
|
36
|
-
}
|
|
13
|
+
},
|
|
14
|
+
variants: [
|
|
15
|
+
{
|
|
16
|
+
props: { variant: 'flushed' },
|
|
17
|
+
style: {
|
|
18
|
+
borderRadius: 'var(--ds-radius-zero)'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
props: {
|
|
23
|
+
variant: 'flushed',
|
|
24
|
+
color: 'primary'
|
|
25
|
+
},
|
|
26
|
+
style: {
|
|
27
|
+
color: 'var(--ds-colour-typoOnSurface)',
|
|
28
|
+
backgroundColor: 'var(--ds-colour-actionPrimary)',
|
|
29
|
+
'&:disabled': {
|
|
30
|
+
color: 'var(--ds-colour-typoOnSurface)',
|
|
31
|
+
backgroundColor: 'var(--ds-colour-stateUnselectedDefault)'
|
|
32
|
+
},
|
|
33
|
+
...STATE_STYLES.ACTION_PRIMARY_STATE_PRIMARY
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
],
|
|
37
37
|
},
|
|
38
38
|
contained: {
|
|
39
|
-
|
|
39
|
+
"&.MuiButton-contained.MuiButton-colorPrimary": {
|
|
40
40
|
color: 'var(--ds-colour-typoOnSurface)',
|
|
41
41
|
backgroundColor: 'var(--ds-colour-actionPrimary)',
|
|
42
42
|
'&:disabled': {
|
|
@@ -45,7 +45,7 @@ export const DsButtonOverrides = {
|
|
|
45
45
|
},
|
|
46
46
|
...STATE_STYLES.ACTION_PRIMARY_STATE_PRIMARY
|
|
47
47
|
},
|
|
48
|
-
|
|
48
|
+
"&.MuiButton-contained.MuiButton-colorSecondary": {
|
|
49
49
|
backgroundColor: 'var(--ds-colour-surfaceSecondary)',
|
|
50
50
|
borderWidth: '1px',
|
|
51
51
|
borderStyle: 'solid',
|
|
@@ -1 +1,11 @@
|
|
|
1
|
-
|
|
1
|
+
import { DsButtonBaseDefaultProps } from "./DsButtonBase.Types";
|
|
2
|
+
export const DsButtonBaseOverrides = {
|
|
3
|
+
MuiButtonBase: {
|
|
4
|
+
defaultProps: DsButtonBaseDefaultProps,
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
fontFamily: 'inherit'
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
};
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CSSObject } from '@mui/system';
|
|
2
2
|
import { DsChipProps } from './DsChip.Types';
|
|
3
3
|
export declare const DsChipOverrides: {
|
|
4
4
|
MuiChip: {
|
|
5
5
|
defaultProps: DsChipProps;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
6
|
+
styleOverrides: {
|
|
7
|
+
root: {
|
|
8
|
+
variants: {
|
|
9
|
+
props: Partial<DsChipProps>;
|
|
10
|
+
style: CSSObject;
|
|
11
|
+
}[];
|
|
12
|
+
};
|
|
13
|
+
};
|
|
11
14
|
};
|
|
12
15
|
};
|
|
@@ -2,141 +2,144 @@ import { DsChipDefaultProps } from './DsChip.Types';
|
|
|
2
2
|
export const DsChipOverrides = {
|
|
3
3
|
MuiChip: {
|
|
4
4
|
defaultProps: DsChipDefaultProps,
|
|
5
|
-
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
5
|
+
styleOverrides: {
|
|
6
|
+
root: {
|
|
7
|
+
variants: [
|
|
8
|
+
{
|
|
9
|
+
props: { variant: 'chip' },
|
|
10
|
+
style: {
|
|
11
|
+
border: 'none',
|
|
12
|
+
borderRadius: 'var(--ds-radius-quickFreeze)',
|
|
13
|
+
paddingLeft: 'var(--ds-spacing-glacial)',
|
|
14
|
+
paddingRight: 'var(--ds-spacing-glacial)',
|
|
15
|
+
height: '20px',
|
|
16
|
+
'.MuiChip-icon': {
|
|
17
|
+
fontSize: 'var(--ds-typo-fontSizeIceAge)',
|
|
18
|
+
marginRight: 'var(--ds-spacing-quickFreeze)',
|
|
19
|
+
marginLeft: 'var(--ds-spacing-zero)',
|
|
20
|
+
color: 'inherit'
|
|
21
|
+
},
|
|
22
|
+
'> .MuiChip-label': {
|
|
23
|
+
paddingLeft: 'var(--ds-spacing-zero)',
|
|
24
|
+
paddingRight: 'var(--ds-spacing-zero)'
|
|
25
|
+
}
|
|
26
|
+
}
|
|
19
27
|
},
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
28
|
+
{
|
|
29
|
+
props: { variant: 'chip', type: 'status' },
|
|
30
|
+
style: {
|
|
31
|
+
fontWeight: 'var(--ds-typo-supportRegularMetadata-fontWeight)',
|
|
32
|
+
fontSize: 'var(--ds-typo-supportRegularMetadata-fontSize)',
|
|
33
|
+
lineHeight: 'var(--ds-typo-supportRegularMetadata-lineHeight)',
|
|
34
|
+
letterSpacing: 'var(--ds-typo-supportRegularMetadata-letterSpacing)',
|
|
35
|
+
textTransform: 'uppercase',
|
|
36
|
+
paddingTop: 'var(--ds-spacing-quickFreeze)',
|
|
37
|
+
paddingBottom: 'var(--ds-spacing-quickFreeze)',
|
|
38
|
+
backgroundColor: 'var(--ds-colour-supportTypical)',
|
|
39
|
+
color: 'var(--ds-colour-typoOnSurface)'
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
props: {
|
|
44
|
+
variant: 'chip',
|
|
45
|
+
type: 'status',
|
|
46
|
+
color: 'success'
|
|
47
|
+
},
|
|
48
|
+
style: {
|
|
49
|
+
backgroundColor: 'var(--ds-colour-supportPositive)'
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
props: {
|
|
54
|
+
variant: 'chip',
|
|
55
|
+
type: 'status',
|
|
56
|
+
color: 'warning'
|
|
57
|
+
},
|
|
58
|
+
style: {
|
|
59
|
+
backgroundColor: 'var(--ds-colour-supportWarning)'
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
props: {
|
|
64
|
+
variant: 'chip',
|
|
65
|
+
type: 'status',
|
|
66
|
+
color: 'error'
|
|
67
|
+
},
|
|
68
|
+
style: {
|
|
69
|
+
backgroundColor: 'var(--ds-colour-supportNegative)'
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
props: {
|
|
74
|
+
variant: 'chip',
|
|
75
|
+
type: 'status',
|
|
76
|
+
color: 'info'
|
|
77
|
+
},
|
|
78
|
+
style: {
|
|
79
|
+
backgroundColor: 'var(--ds-colour-neutral1)',
|
|
80
|
+
color: 'var(--ds-colour-typoPrimary)'
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
props: { variant: 'chip', type: 'nudge' },
|
|
85
|
+
style: {
|
|
86
|
+
fontWeight: 'var(--ds-typo-supportRegularInfo-fontWeight)',
|
|
87
|
+
fontSize: 'var(--ds-typo-supportRegularInfo-fontSize)',
|
|
88
|
+
lineHeight: 'var(--ds-typo-supportRegularInfo-lineHeight)',
|
|
89
|
+
letterSpacing: 'var(--ds-typo-supportRegularInfo-letterSpacing)',
|
|
90
|
+
textTransform: 'none',
|
|
91
|
+
paddingTop: 'var(--ds-spacing-deepFreeze)',
|
|
92
|
+
paddingBottom: 'var(--ds-spacing-deepFreeze)',
|
|
93
|
+
backgroundColor: 'var(--ds-colour-supportTypicalNeutral)',
|
|
94
|
+
color: 'var(--ds-colour-supportTypical)'
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
props: {
|
|
99
|
+
variant: 'chip',
|
|
100
|
+
type: 'nudge',
|
|
101
|
+
color: 'success'
|
|
102
|
+
},
|
|
103
|
+
style: {
|
|
104
|
+
backgroundColor: 'var(--ds-colour-supportPositiveNeutral)',
|
|
105
|
+
color: 'var(--ds-colour-supportPositive)'
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
props: {
|
|
110
|
+
variant: 'chip',
|
|
111
|
+
type: 'nudge',
|
|
112
|
+
color: 'warning'
|
|
113
|
+
},
|
|
114
|
+
style: {
|
|
115
|
+
backgroundColor: 'var(--ds-colour-supportWarningNeutral)',
|
|
116
|
+
color: 'var(--ds-colour-supportWarning)'
|
|
117
|
+
}
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
props: {
|
|
121
|
+
variant: 'chip',
|
|
122
|
+
type: 'nudge',
|
|
123
|
+
color: 'error'
|
|
124
|
+
},
|
|
125
|
+
style: {
|
|
126
|
+
backgroundColor: 'var(--ds-colour-supportNegativeNeutral)',
|
|
127
|
+
color: 'var(--ds-colour-supportNegative)'
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
props: {
|
|
132
|
+
variant: 'chip',
|
|
133
|
+
type: 'nudge',
|
|
134
|
+
color: 'info'
|
|
135
|
+
},
|
|
136
|
+
style: {
|
|
137
|
+
backgroundColor: 'var(--ds-colour-neutral1)',
|
|
138
|
+
color: 'var(--ds-colour-typoPrimary)'
|
|
139
|
+
}
|
|
23
140
|
}
|
|
24
|
-
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
props: { variant: 'chip', type: 'status' },
|
|
28
|
-
style: {
|
|
29
|
-
fontWeight: 'var(--ds-typo-supportRegularMetadata-fontWeight)',
|
|
30
|
-
fontSize: 'var(--ds-typo-supportRegularMetadata-fontSize)',
|
|
31
|
-
lineHeight: 'var(--ds-typo-supportRegularMetadata-lineHeight)',
|
|
32
|
-
letterSpacing: 'var(--ds-typo-supportRegularMetadata-letterSpacing)',
|
|
33
|
-
textTransform: 'uppercase',
|
|
34
|
-
paddingTop: 'var(--ds-spacing-quickFreeze)',
|
|
35
|
-
paddingBottom: 'var(--ds-spacing-quickFreeze)',
|
|
36
|
-
backgroundColor: 'var(--ds-colour-supportTypical)',
|
|
37
|
-
color: 'var(--ds-colour-typoOnSurface)'
|
|
38
|
-
}
|
|
39
|
-
},
|
|
40
|
-
{
|
|
41
|
-
props: {
|
|
42
|
-
variant: 'chip',
|
|
43
|
-
type: 'status',
|
|
44
|
-
color: 'success'
|
|
45
|
-
},
|
|
46
|
-
style: {
|
|
47
|
-
backgroundColor: 'var(--ds-colour-supportPositive)'
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
props: {
|
|
52
|
-
variant: 'chip',
|
|
53
|
-
type: 'status',
|
|
54
|
-
color: 'warning'
|
|
55
|
-
},
|
|
56
|
-
style: {
|
|
57
|
-
backgroundColor: 'var(--ds-colour-supportWarning)'
|
|
58
|
-
}
|
|
59
|
-
},
|
|
60
|
-
{
|
|
61
|
-
props: {
|
|
62
|
-
variant: 'chip',
|
|
63
|
-
type: 'status',
|
|
64
|
-
color: 'error'
|
|
65
|
-
},
|
|
66
|
-
style: {
|
|
67
|
-
backgroundColor: 'var(--ds-colour-supportNegative)'
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
props: {
|
|
72
|
-
variant: 'chip',
|
|
73
|
-
type: 'status',
|
|
74
|
-
color: 'info'
|
|
75
|
-
},
|
|
76
|
-
style: {
|
|
77
|
-
backgroundColor: 'var(--ds-colour-neutral1)',
|
|
78
|
-
color: 'var(--ds-colour-typoPrimary)'
|
|
79
|
-
}
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
props: { variant: 'chip', type: 'nudge' },
|
|
83
|
-
style: {
|
|
84
|
-
fontWeight: 'var(--ds-typo-supportRegularInfo-fontWeight)',
|
|
85
|
-
fontSize: 'var(--ds-typo-supportRegularInfo-fontSize)',
|
|
86
|
-
lineHeight: 'var(--ds-typo-supportRegularInfo-lineHeight)',
|
|
87
|
-
letterSpacing: 'var(--ds-typo-supportRegularInfo-letterSpacing)',
|
|
88
|
-
textTransform: 'none',
|
|
89
|
-
paddingTop: 'var(--ds-spacing-deepFreeze)',
|
|
90
|
-
paddingBottom: 'var(--ds-spacing-deepFreeze)',
|
|
91
|
-
backgroundColor: 'var(--ds-colour-supportTypicalNeutral)',
|
|
92
|
-
color: 'var(--ds-colour-supportTypical)'
|
|
93
|
-
}
|
|
94
|
-
},
|
|
95
|
-
{
|
|
96
|
-
props: {
|
|
97
|
-
variant: 'chip',
|
|
98
|
-
type: 'nudge',
|
|
99
|
-
color: 'success'
|
|
100
|
-
},
|
|
101
|
-
style: {
|
|
102
|
-
backgroundColor: 'var(--ds-colour-supportPositiveNeutral)',
|
|
103
|
-
color: 'var(--ds-colour-supportPositive)'
|
|
104
|
-
}
|
|
105
|
-
},
|
|
106
|
-
{
|
|
107
|
-
props: {
|
|
108
|
-
variant: 'chip',
|
|
109
|
-
type: 'nudge',
|
|
110
|
-
color: 'warning'
|
|
111
|
-
},
|
|
112
|
-
style: {
|
|
113
|
-
backgroundColor: 'var(--ds-colour-supportWarningNeutral)',
|
|
114
|
-
color: 'var(--ds-colour-supportWarning)'
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
{
|
|
118
|
-
props: {
|
|
119
|
-
variant: 'chip',
|
|
120
|
-
type: 'nudge',
|
|
121
|
-
color: 'error'
|
|
122
|
-
},
|
|
123
|
-
style: {
|
|
124
|
-
backgroundColor: 'var(--ds-colour-supportNegativeNeutral)',
|
|
125
|
-
color: 'var(--ds-colour-supportNegative)'
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
{
|
|
129
|
-
props: {
|
|
130
|
-
variant: 'chip',
|
|
131
|
-
type: 'nudge',
|
|
132
|
-
color: 'info'
|
|
133
|
-
},
|
|
134
|
-
style: {
|
|
135
|
-
backgroundColor: 'var(--ds-colour-neutral1)',
|
|
136
|
-
color: 'var(--ds-colour-typoPrimary)'
|
|
137
|
-
}
|
|
141
|
+
]
|
|
138
142
|
}
|
|
139
|
-
|
|
140
|
-
styleOverrides: {}
|
|
143
|
+
}
|
|
141
144
|
}
|
|
142
145
|
};
|
|
@@ -8,15 +8,16 @@ import { DsTypography } from '../DsTypography';
|
|
|
8
8
|
import { DsDialogContent } from '../DsDialogContent';
|
|
9
9
|
import { DsDialogActions } from '../DsDialogActions';
|
|
10
10
|
import { DsButton } from '../DsButton';
|
|
11
|
+
import { mergeSlotProps } from '../../utils';
|
|
11
12
|
export const DsDialog = inProps => {
|
|
12
13
|
const props = { ...DsDialogDefaultProps, ...inProps };
|
|
13
|
-
const handleCloseClick = (event) => {
|
|
14
|
+
const handleCloseClick = (reason) => (event) => {
|
|
14
15
|
const { onClose } = props;
|
|
15
16
|
if (typeof onClose === 'function') {
|
|
16
|
-
onClose(event, 'backdropClick');
|
|
17
|
+
onClose(event, reason ? reason : 'backdropClick');
|
|
17
18
|
}
|
|
18
19
|
};
|
|
19
|
-
const { title, description, kicker, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, TitleProps, DescriptionProps, CloseIconButtonProps, CloseIconProps, KickerProps, ContentProps, ActionsProps, children, ...DialogProps } = props;
|
|
20
|
+
const { title, description, kicker, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, TitleProps, DescriptionProps, CloseIconButtonProps, CloseIconProps, KickerProps, ContentProps, ActionsProps, children, slotProps, ...DialogProps } = props;
|
|
20
21
|
const actionsAvailable = !!(primaryButtonText || secondaryButtonText);
|
|
21
22
|
const accessibilityProps = {};
|
|
22
23
|
const isFlushed = primaryButtonText &&
|
|
@@ -29,21 +30,26 @@ export const DsDialog = inProps => {
|
|
|
29
30
|
if (description) {
|
|
30
31
|
accessibilityProps['aria-describedby'] = description;
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
33
|
+
const paperProps = {
|
|
34
|
+
...PaperProps,
|
|
35
|
+
...slotProps?.paper
|
|
36
|
+
};
|
|
37
|
+
return (_jsxs(Dialog, { keepMounted: true, ...accessibilityProps, ...DialogProps, slotProps: {
|
|
38
|
+
...slotProps,
|
|
39
|
+
paper: mergeSlotProps(paperProps, {
|
|
40
|
+
sx: {
|
|
41
|
+
pb: isFlushed
|
|
42
|
+
? undefined
|
|
43
|
+
: {
|
|
44
|
+
xs: 'var(--ds-spacing-bitterCold)',
|
|
45
|
+
md: 'var(--ds-spacing-warm)'
|
|
46
|
+
},
|
|
47
|
+
pt: {
|
|
48
|
+
xs: 'var(--ds-spacing-mild)',
|
|
39
49
|
md: 'var(--ds-spacing-warm)'
|
|
40
50
|
},
|
|
41
|
-
pt: {
|
|
42
|
-
xs: 'var(--ds-spacing-mild)',
|
|
43
|
-
md: 'var(--ds-spacing-warm)'
|
|
44
51
|
},
|
|
45
|
-
|
|
46
|
-
}
|
|
52
|
+
}),
|
|
47
53
|
}, children: [kicker && (_jsx(DsTypography, { variant: 'subheadingSemiboldDefault', color: 'var(--ds-colour-typoTertiary)', ...KickerProps, sx: {
|
|
48
54
|
px: {
|
|
49
55
|
xs: 'var(--ds-spacing-bitterCold)',
|
|
@@ -65,7 +71,7 @@ export const DsDialog = inProps => {
|
|
|
65
71
|
md: 'var(--ds-spacing-warm)'
|
|
66
72
|
},
|
|
67
73
|
...DescriptionProps?.sx
|
|
68
|
-
}, children: description })), showClose && (_jsx(DsIconButton, { onClick: handleCloseClick, ...CloseIconButtonProps, sx: {
|
|
74
|
+
}, children: description })), showClose && (_jsx(DsIconButton, { onClick: handleCloseClick('closeButtonClick'), ...CloseIconButtonProps, sx: {
|
|
69
75
|
position: 'absolute',
|
|
70
76
|
padding: 'var(--ds-spacing-quickFreeze)',
|
|
71
77
|
borderRadius: 'var(--ds-radius-mild)',
|
|
@@ -6,7 +6,8 @@ import { DsRemixIconProps } from '../DsRemixIcon';
|
|
|
6
6
|
import { DsDialogContentProps } from '../DsDialogContent';
|
|
7
7
|
import { DsDialogActionsProps } from '../DsDialogActions';
|
|
8
8
|
import { DsButtonProps } from '../DsButton';
|
|
9
|
-
export
|
|
9
|
+
export type DsDialogCloseReason = 'backdropClick' | 'escapeKeyDown' | 'closeButtonClick';
|
|
10
|
+
export interface DsDialogProps extends Omit<DialogProps, 'onClose'> {
|
|
10
11
|
title?: string;
|
|
11
12
|
description?: string;
|
|
12
13
|
kicker?: string;
|
|
@@ -22,5 +23,6 @@ export interface DsDialogProps extends DialogProps {
|
|
|
22
23
|
CloseIconProps?: Omit<DsRemixIconProps, 'ref'>;
|
|
23
24
|
ContentProps?: DsDialogContentProps;
|
|
24
25
|
ActionsProps?: DsDialogActionsProps;
|
|
26
|
+
onClose?: (event: React.SyntheticEvent, reason: DsDialogCloseReason) => void;
|
|
25
27
|
}
|
|
26
28
|
export declare const DsDialogDefaultProps: DsDialogProps;
|