@am92/react-design-system 2.6.0 → 2.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/DsAppBar/DsAppBar.Types.js +1 -4
- package/dist/Components/DsAutocomplete/DsAutocomplete.Overrides.d.ts +0 -1
- package/dist/Components/DsAutocomplete/DsAutocomplete.Overrides.js +0 -1
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +1 -1
- package/dist/Components/DsInputBase/DsInputBase.Overrides.js +1 -0
- package/dist/Components/DsNotistack/AlertMessage.Component.d.ts +9 -11
- package/dist/Components/DsNotistack/AlertMessage.Component.js +3 -12
- package/dist/Components/DsNotistack/DsNotistack.Types.d.ts +4 -6
- package/dist/Components/DsNotistack/DsNotistack.Types.js +1 -1
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +1 -1
- package/dist/Components/DsSelect/DsSelect.Component.js +2 -2
- package/dist/Components/DsSelect/DsSelect.Types.js +2 -0
- package/dist/Components/DsToast/DsToast.Component.js +5 -5
- package/dist/Theme/componentOverrides.d.ts +0 -1
- package/package.json +2 -2
|
@@ -45,7 +45,7 @@ export class DsBottomSheet extends PureComponent {
|
|
|
45
45
|
maxHeight: 'var(--ds-rules-bottomSheetWorkingAreaHeight)',
|
|
46
46
|
...PaperProps?.sx
|
|
47
47
|
}
|
|
48
|
-
}, children: [showClose && (_jsx(DsIconButton, { onClick: this.handleCloseClick, ...CloseIconButtonProps, sx: {
|
|
48
|
+
}, onClose: this.handleDrawerClose, children: [showClose && (_jsx(DsIconButton, { onClick: this.handleCloseClick, ...CloseIconButtonProps, sx: {
|
|
49
49
|
flexGrow: 0,
|
|
50
50
|
alignSelf: 'center',
|
|
51
51
|
backgroundColor: 'var(--ds-colour-iconDefault)',
|
|
@@ -1,15 +1,13 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { OptionsObject } from 'notistack';
|
|
3
3
|
import { DsToastProps } from '../DsToast';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
import { DsNotistackProviderProps, NotiStackMessage } from './DsNotistack.Types';
|
|
5
|
+
export interface AlertMessageProps extends Omit<DsToastProps, 'variant'>, Pick<OptionsObject, Exclude<keyof OptionsObject, keyof Omit<DsToastProps, 'variant'>>>, NotiStackMessage {
|
|
6
6
|
toastVariant: DsToastProps['variant'];
|
|
7
|
-
|
|
8
|
-
variant?: VariantType & DsToastProps['color'];
|
|
9
|
-
sx?: object;
|
|
7
|
+
iconVariant: DsNotistackProviderProps['iconVariant'];
|
|
10
8
|
}
|
|
11
|
-
export declare const DsNotistackAlertDefault: React.ForwardRefExoticComponent<AlertMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
-
export declare const DsNotistackAlertSuccess: React.ForwardRefExoticComponent<AlertMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
-
export declare const DsNotistackAlertError: React.ForwardRefExoticComponent<AlertMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
14
|
-
export declare const DsNotistackAlertWarning: React.ForwardRefExoticComponent<AlertMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
15
|
-
export declare const DsNotistackAlertInfo: React.ForwardRefExoticComponent<AlertMessageProps & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
+
export declare const DsNotistackAlertDefault: React.ForwardRefExoticComponent<Omit<AlertMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
10
|
+
export declare const DsNotistackAlertSuccess: React.ForwardRefExoticComponent<Omit<AlertMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
11
|
+
export declare const DsNotistackAlertError: React.ForwardRefExoticComponent<Omit<AlertMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
12
|
+
export declare const DsNotistackAlertWarning: React.ForwardRefExoticComponent<Omit<AlertMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
13
|
+
export declare const DsNotistackAlertInfo: React.ForwardRefExoticComponent<Omit<AlertMessageProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -2,23 +2,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import React, { Component } from 'react';
|
|
3
3
|
import { closeSnackbar } from 'notistack';
|
|
4
4
|
import { DsToast } from '../DsToast';
|
|
5
|
-
const AlertMessageDefaultProps = {
|
|
6
|
-
toastVariant: 'filled',
|
|
7
|
-
message: '',
|
|
8
|
-
onClose: props => undefined
|
|
9
|
-
};
|
|
10
5
|
class AlertMessage extends Component {
|
|
11
|
-
static defaultProps = AlertMessageDefaultProps;
|
|
12
6
|
handleClose = () => {
|
|
13
|
-
const { id
|
|
14
|
-
if (onClose && typeof onClose === 'function') {
|
|
15
|
-
onClose(this.props);
|
|
16
|
-
}
|
|
7
|
+
const { id } = this.props;
|
|
17
8
|
closeSnackbar(id);
|
|
18
9
|
};
|
|
19
10
|
render() {
|
|
20
|
-
const {
|
|
21
|
-
return (_jsx(DsToast, {
|
|
11
|
+
const { ref, toastVariant, variant, message, id, autoHideDuration, hideIconVariant, anchorOrigin, persist, iconVariant, ...restProps } = this.props;
|
|
12
|
+
return (_jsx(DsToast, { ...restProps, variant: toastVariant, color: variant, onClose: this.handleClose, children: message }));
|
|
22
13
|
}
|
|
23
14
|
}
|
|
24
15
|
export const DsNotistackAlertDefault = React.forwardRef((props, ref) => {
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OptionsObject, SnackbarKey, SnackbarMessage, SnackbarProviderProps } from 'notistack';
|
|
2
2
|
import { DsToastProps } from '../DsToast';
|
|
3
3
|
export interface DsNotistackProviderProps extends SnackbarProviderProps {
|
|
4
4
|
}
|
|
5
5
|
export type DsNotistackKey = SnackbarKey;
|
|
6
|
-
export interface
|
|
6
|
+
export interface NotiStackMessage {
|
|
7
7
|
message: SnackbarMessage;
|
|
8
|
-
key?: DsNotistackKey;
|
|
9
|
-
toastVariant?: Omit<DsToastProps['variant'], 'standard'>;
|
|
10
|
-
icon?: DsToastProps['icon'];
|
|
11
8
|
}
|
|
12
|
-
export
|
|
9
|
+
export interface EnqueNotistackProps extends OptionsObject, NotiStackMessage, Pick<DsToastProps, Exclude<keyof DsToastProps, keyof OptionsObject>> {
|
|
10
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export {};
|
|
@@ -25,7 +25,7 @@ export class DsProgressIndicator extends Component {
|
|
|
25
25
|
const squareSize = this.props['ds-variant'] === 'fraction' ? '48px' : '32px';
|
|
26
26
|
const fillPercentage = Math.round((activeStep / steps) * 100);
|
|
27
27
|
const fillColor = isSuccess ? 'success' : isError ? 'error' : 'secondary';
|
|
28
|
-
return (_jsxs(DsBox, { display: "flex", position: "relative", height: squareSize, width: squareSize, children: [_jsx(DsCircularProgress, { variant: "determinate", value: 100, sx: { color: 'var(--ds-colour-stateDisabledSurface)' }, size: squareSize, thickness: 4 }), _jsx(DsCircularProgress, {
|
|
28
|
+
return (_jsxs(DsBox, { display: "flex", position: "relative", height: squareSize, width: squareSize, children: [_jsx(DsCircularProgress, { variant: "determinate", value: 100, sx: { color: 'var(--ds-colour-stateDisabledSurface)' }, size: squareSize, thickness: 4 }), _jsx(DsCircularProgress, { variant: "determinate", color: fillColor, value: fillPercentage, size: squareSize, thickness: 4, style: {
|
|
29
29
|
position: 'absolute'
|
|
30
30
|
} }), _jsx(DsTypography, { variant: "subheadingSemiboldDefault", sx: {
|
|
31
31
|
position: 'absolute',
|
|
@@ -13,13 +13,13 @@ export class DsSelect extends PureComponent {
|
|
|
13
13
|
static defaultProps = DsSelectDefaultProps;
|
|
14
14
|
selectRef = React.createRef();
|
|
15
15
|
render() {
|
|
16
|
-
const { id, name, placeholder, label, labelSupportText, color, helperText, success, error, sx, fullWidth, children, options, disabled, FormControlProps, InputLabelProps, FormHelperTextProps, ...selectProps } = this.props;
|
|
16
|
+
const { id, name, placeholder, label, labelSupportText, color, helperText, success, error, sx, fullWidth, children, options, disabled, FormControlProps, InputLabelProps, FormHelperTextProps, required, ...selectProps } = this.props;
|
|
17
17
|
const customColor = success ? 'success' : color;
|
|
18
18
|
const valueMap = options.reduce((acc, item) => {
|
|
19
19
|
acc.set(item.value, item.label);
|
|
20
20
|
return acc;
|
|
21
21
|
}, new Map());
|
|
22
|
-
return (_jsxs(DsFormControl, { fullWidth: fullWidth, color: customColor, error: error, sx: sx, disabled: disabled, ...FormControlProps, children: [_jsx(DsInputLabel, { label: label, labelSupportText: labelSupportText, error: error, success: success, htmlFor: id || name, disabled: disabled, ...InputLabelProps }), _jsxs(Select, { ref: this.selectRef, id: id, name: name, IconComponent: IconComponent, displayEmpty: true, input: _jsx(DsInputBase, {}), renderValue: value => {
|
|
22
|
+
return (_jsxs(DsFormControl, { fullWidth: fullWidth, color: customColor, error: error, sx: sx, disabled: disabled, required: required, ...FormControlProps, children: [_jsx(DsInputLabel, { label: label, labelSupportText: labelSupportText, error: error, success: success, htmlFor: id || name, disabled: disabled, ...InputLabelProps }), _jsxs(Select, { ref: this.selectRef, id: id, name: name, IconComponent: IconComponent, displayEmpty: true, input: _jsx(DsInputBase, {}), renderValue: value => {
|
|
23
23
|
if (!value || (value instanceof Array && !value.length)) {
|
|
24
24
|
return (_jsx(DsTypography, { variant: "bodyRegularMedium", color: "text.disabled", children: placeholder }));
|
|
25
25
|
}
|
|
@@ -2,13 +2,13 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { PureComponent } from 'react';
|
|
3
3
|
import Alert from '@mui/material/Alert';
|
|
4
4
|
import { DsRemixIcon } from '../DsRemixIcon';
|
|
5
|
-
const CloseIcon = (props) =>
|
|
5
|
+
const CloseIcon = (props) => {
|
|
6
|
+
const { ownerState, ...restProps } = props;
|
|
7
|
+
return (_jsx(DsRemixIcon, { fontSize: "mild", className: "ri-close-line", ...restProps }));
|
|
8
|
+
};
|
|
6
9
|
export class DsToast extends PureComponent {
|
|
7
10
|
render() {
|
|
8
11
|
const { forwardedRef, ...restProps } = this.props;
|
|
9
|
-
return (_jsx(Alert, { ref: forwardedRef, ...restProps,
|
|
10
|
-
...this.props.components,
|
|
11
|
-
CloseIcon
|
|
12
|
-
} }));
|
|
12
|
+
return (_jsx(Alert, { ref: forwardedRef, ...restProps, slots: { closeIcon: CloseIcon, ...restProps?.slots } }));
|
|
13
13
|
}
|
|
14
14
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@am92/react-design-system",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.0",
|
|
4
4
|
"description": "ReactJS Design System using Material UI",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"@mui/lab": "5.0.0-alpha.155",
|
|
20
20
|
"@mui/material": "~5.16.7",
|
|
21
21
|
"@mui/system": "~5.16.7",
|
|
22
|
-
"@mui/x-charts": "
|
|
22
|
+
"@mui/x-charts": "7.15.0",
|
|
23
23
|
"@mui/x-date-pickers": "~6.19.5",
|
|
24
24
|
"date-fns": "~2.30.0",
|
|
25
25
|
"lottie-react": "~2.4.0",
|