@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.
@@ -1,8 +1,5 @@
1
1
  export const DsAppBarDefaultProps = {
2
2
  color: 'default',
3
3
  enableColorOnDark: true,
4
- elevation: 0,
5
- appBarTitle: '',
6
- navigation: false,
7
- actions: false
4
+ elevation: 0
8
5
  };
@@ -22,7 +22,6 @@ export declare const DsAutocompleteOverrides: {
22
22
  };
23
23
  };
24
24
  endAdornment: {
25
- top: string;
26
25
  right: string;
27
26
  display: string;
28
27
  alignItems: string;
@@ -23,7 +23,6 @@ export const DsAutocompleteOverrides = {
23
23
  }
24
24
  },
25
25
  endAdornment: {
26
- top: 'unset',
27
26
  right: '8px',
28
27
  display: 'flex',
29
28
  alignItems: 'center',
@@ -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)',
@@ -115,6 +115,7 @@ export const DsInputBaseOverrides = {
115
115
  padding: 'var(--ds-spacing-deepFreeze)',
116
116
  height: 'auto'
117
117
  },
118
+ // The warning for SSR let it be
118
119
  '> :nth-child(even)': {
119
120
  marginLeft: 'var(--ds-spacing-quickFreeze)'
120
121
  }
@@ -1,15 +1,13 @@
1
1
  import React from 'react';
2
- import { VariantType } from 'notistack';
2
+ import { OptionsObject } from 'notistack';
3
3
  import { DsToastProps } from '../DsToast';
4
- export interface AlertMessageProps extends Omit<DsToastProps, 'variant' | 'color' | 'ref'> {
5
- message: string;
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
- onClose: (props: object) => void;
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, onClose } = this.props;
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 { forwardedRef, message, toastVariant, variant, icon, action, sx } = this.props;
21
- return (_jsx(DsToast, { forwardedRef: forwardedRef, variant: toastVariant, color: variant, sx: sx, icon: icon, action: action, onClose: this.handleClose, children: message }));
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 { SharedProps, SnackbarKey, SnackbarMessage, SnackbarProviderProps } from 'notistack';
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 EnqueNotistackProps extends SharedProps {
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 declare const DsNotistackDefaultProps: DsNotistackProviderProps;
9
+ export interface EnqueNotistackProps extends OptionsObject, NotiStackMessage, Pick<DsToastProps, Exclude<keyof DsToastProps, keyof OptionsObject>> {
10
+ }
@@ -1 +1 @@
1
- export const DsNotistackDefaultProps = {};
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, { disableShrink: true, variant: "determinate", color: fillColor, value: fillPercentage, size: squareSize, thickness: 4, style: {
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
  }
@@ -1,5 +1,7 @@
1
1
  export const DsSelectDefaultProps = {
2
2
  options: [],
3
+ variant: 'filled',
4
+ defaultValue: '',
3
5
  MenuProps: {
4
6
  anchorOrigin: {
5
7
  vertical: 'bottom',
@@ -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) => (_jsx(DsRemixIcon, { ...props, fontSize: "mild", className: "ri-close-line" }));
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, components: {
10
- ...this.props.components,
11
- CloseIcon
12
- } }));
12
+ return (_jsx(Alert, { ref: forwardedRef, ...restProps, slots: { closeIcon: CloseIcon, ...restProps?.slots } }));
13
13
  }
14
14
  }
@@ -1292,7 +1292,6 @@ declare const componentOverrides: {
1292
1292
  };
1293
1293
  };
1294
1294
  endAdornment: {
1295
- top: string;
1296
1295
  right: string;
1297
1296
  display: string;
1298
1297
  alignItems: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@am92/react-design-system",
3
- "version": "2.6.0",
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": "^7.17.0",
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",