@am92/react-design-system 2.9.9 → 2.9.12

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.
@@ -2,7 +2,7 @@ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import { DsRemixIcon } from '../DsRemixIcon';
3
3
  export const DsAutocompleteDefaultProps = {
4
4
  popupIcon: _jsx(DsRemixIcon, { className: "ri-arrow-down-s-line" }),
5
- clearIcon: _jsx(DsRemixIcon, { color: "secondary", className: "ri-close-line" }),
5
+ clearIcon: _jsx(DsRemixIcon, { className: "ri-close-fill" }),
6
6
  multiple: false,
7
7
  disableClearable: false,
8
8
  freeSolo: false,
@@ -9,7 +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
- export const DsBottomSheet = (inProps) => {
12
+ export const DsBottomSheet = inProps => {
13
13
  const props = { ...DsBottomSheetDefaultProps, ...inProps };
14
14
  const handleDrawerClose = (event, reason) => {
15
15
  const { onClose } = props;
@@ -23,7 +23,7 @@ export const DsBottomSheet = (inProps) => {
23
23
  onClose(event, 'backdropClick');
24
24
  }
25
25
  };
26
- const { kicker, title, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, ContainerProps, KickerProps, TitleProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, onClose, ...DrawerProps } = props;
26
+ const { kicker, title, description, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, ContainerProps, KickerProps, DescriptionProps, TitleProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, onClose, ...DrawerProps } = props;
27
27
  const actionsAvailable = !!(primaryButtonText || secondaryButtonText);
28
28
  const isFlushed = primaryButtonText &&
29
29
  !secondaryButtonText &&
@@ -41,6 +41,7 @@ export const DsBottomSheet = (inProps) => {
41
41
  sx: {
42
42
  background: 'transparent',
43
43
  maxHeight: 'var(--ds-rules-bottomSheetWorkingAreaHeight)',
44
+ // top: 'var(--ds-spacing-bitterCold)',
44
45
  ...PaperProps?.sx
45
46
  }
46
47
  }, onClose: handleDrawerClose, children: [showClose && (_jsx(DsIconButton, { onClick: handleCloseClick, ...CloseIconButtonProps, sx: {
@@ -58,9 +59,9 @@ export const DsBottomSheet = (inProps) => {
58
59
  flexDirection: 'column',
59
60
  flexGrow: 1,
60
61
  pt: 'var(--ds-spacing-mild)',
62
+ pb: isFlushed ? undefined : 'var(--ds-spacing-bitterCold)',
61
63
  borderTopLeftRadius: 'var(--ds-radius-bitterCold)',
62
64
  borderTopRightRadius: 'var(--ds-radius-bitterCold)',
63
- pb: isFlushed ? undefined : 'var(--ds-spacing-bitterCold)',
64
65
  ...ContainerProps?.sx
65
66
  }, children: [kicker && (_jsx(DsTypography, { variant: "subheadingSemiboldDefault", color: "text.tertiary", ...KickerProps, sx: {
66
67
  px: 'var(--ds-spacing-bitterCold)',
@@ -71,12 +72,18 @@ export const DsBottomSheet = (inProps) => {
71
72
  mb: 'var(--ds-spacing-zero)',
72
73
  px: 'var(--ds-spacing-bitterCold)',
73
74
  ...TitleProps?.sx
74
- }, children: title })), children && (_jsx(DsDialogContent, { ...ContentProps, sx: {
75
+ }, children: title })), description && (_jsx(DsTypography, { variant: "bodyRegularMedium", color: "text.secondary", ...DescriptionProps, sx: {
76
+ px: 'var(--ds-spacing-bitterCold)',
77
+ mt: 'var(--ds-spacing-quickFreeze)',
78
+ ...DescriptionProps?.sx
79
+ }, children: description })), children && (_jsx(DsDialogContent, { ...ContentProps, sx: {
75
80
  px: 'var(--ds-spacing-bitterCold)',
76
81
  marginTop: 'var(--ds-spacing-mild)',
77
82
  ...ContentProps?.sx
78
83
  }, children: children })), actionsAvailable && (_jsxs(DsDialogActions, { ...ActionsProps, sx: {
79
84
  px: isFlushed ? undefined : 'var(--ds-spacing-bitterCold)',
85
+ mt: 'var(--ds-spacing-bitterCold)',
86
+ pt: isFlushed ? undefined : 'var(--ds-spacing-bitterCold)',
80
87
  ...ActionsProps?.sx
81
88
  }, children: [(secondaryButtonText || secondaryButtonProps?.children) && (_jsx(DsButton, { color: "secondary", size: "large", fullWidth: true, ...secondaryButtonProps, children: secondaryButtonText || secondaryButtonProps?.children })), (primaryButtonText || primaryButtonProps?.children) && (_jsx(DsButton, { size: "large", fullWidth: true, ...primaryButtonProps, children: primaryButtonText || primaryButtonProps?.children }))] }))] })] }));
82
89
  };
@@ -10,11 +10,13 @@ import { DsTypographyProps } from '../DsTypography';
10
10
  export interface DsBottomSheetProps extends Omit<DsDrawerProps, 'title'> {
11
11
  kicker?: string;
12
12
  title?: string;
13
+ description?: string;
13
14
  showClose?: boolean;
14
15
  primaryButtonText?: DsButtonProps['children'];
15
16
  secondaryButtonText?: DsButtonProps['children'];
16
17
  ContainerProps?: DsPaperProps;
17
18
  KickerProps?: DsTypographyProps;
19
+ DescriptionProps?: DsTypographyProps;
18
20
  TitleProps?: DsDialogTitleProps;
19
21
  CloseIconButtonProps?: DsIconButtonProps;
20
22
  CloseIconProps?: Omit<DsRemixIconProps, 'ref'>;
@@ -1,4 +1,5 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { DsDialogDefaultProps } from './DsDialog.Types';
2
3
  import { DsDialogTitle } from '../DsDialogTitle';
3
4
  import { Dialog } from '@mui/material';
4
5
  import { DsIconButton } from '../DsIconButton';
@@ -7,20 +8,15 @@ import { DsTypography } from '../DsTypography';
7
8
  import { DsDialogContent } from '../DsDialogContent';
8
9
  import { DsDialogActions } from '../DsDialogActions';
9
10
  import { DsButton } from '../DsButton';
10
- export const DsDialog = (props) => {
11
- const handleDialogClose = (event, reason) => {
12
- const { onClose } = props;
13
- if (typeof onClose === 'function') {
14
- onClose(event, reason);
15
- }
16
- };
11
+ export const DsDialog = inProps => {
12
+ const props = { ...DsDialogDefaultProps, ...inProps };
17
13
  const handleCloseClick = (event) => {
18
14
  const { onClose } = props;
19
15
  if (typeof onClose === 'function') {
20
16
  onClose(event, 'backdropClick');
21
17
  }
22
18
  };
23
- const { title, description, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, TitleProps, DescriptionProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, ...DialogProps } = props;
19
+ const { title, description, kicker, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, TitleProps, DescriptionProps, CloseIconButtonProps, CloseIconProps, KickerProps, ContentProps, ActionsProps, children, ...DialogProps } = props;
24
20
  const actionsAvailable = !!(primaryButtonText || secondaryButtonText);
25
21
  const accessibilityProps = {};
26
22
  const isFlushed = primaryButtonText &&
@@ -48,14 +44,22 @@ export const DsDialog = (props) => {
48
44
  },
49
45
  ...PaperProps?.sx
50
46
  }
51
- }, children: [title && (_jsx(DsDialogTitle, { ...TitleProps, sx: {
47
+ }, children: [kicker && (_jsx(DsTypography, { variant: "subheadingSemiboldDefault", color: "var(--ds-colour-typoTertiary)", ...KickerProps, sx: {
48
+ px: {
49
+ xs: 'var(--ds-spacing-bitterCold)',
50
+ md: 'var(--ds-spacing-warm)'
51
+ },
52
+ mb: 'var(--ds-spacing-quickFreeze)',
53
+ textTransform: 'uppercase',
54
+ ...KickerProps?.sx
55
+ }, children: kicker })), title && (_jsx(DsDialogTitle, { ...TitleProps, sx: {
52
56
  width: showClose ? 'calc(100% - 44px)' : '100%',
53
57
  px: {
54
58
  xs: 'var(--ds-spacing-bitterCold)',
55
59
  md: 'var(--ds-spacing-warm)'
56
60
  },
57
61
  ...TitleProps?.sx
58
- }, children: title })), description && (_jsx(DsTypography, { variant: "subheadingSemiboldDefault", color: "text.secondary", ...DescriptionProps, sx: {
62
+ }, children: title })), description && (_jsx(DsTypography, { variant: "bodyRegularMedium", color: "var(--ds-colour-typoSecondary)", ...DescriptionProps, sx: {
59
63
  px: {
60
64
  xs: 'var(--ds-spacing-bitterCold)',
61
65
  md: 'var(--ds-spacing-warm)'
@@ -88,6 +92,13 @@ export const DsDialog = (props) => {
88
92
  xs: 'var(--ds-spacing-bitterCold)',
89
93
  md: 'var(--ds-spacing-warm)'
90
94
  },
95
+ pt: isFlushed
96
+ ? undefined
97
+ : {
98
+ xs: 'var(--ds-spacing-bitterCold)',
99
+ md: 'var(--ds-spacing-warm)'
100
+ },
101
+ mt: 'var(--ds-spacing-glacial)',
91
102
  ...ActionsProps?.sx
92
- }, children: [(secondaryButtonText || secondaryButtonProps?.children) && (_jsx(DsButton, { color: "secondary", size: "large", fullWidth: true, ...secondaryButtonProps, children: secondaryButtonText || secondaryButtonProps?.children })), (primaryButtonText || primaryButtonProps?.children) && (_jsx(DsButton, { size: "large", fullWidth: true, ...primaryButtonProps, children: primaryButtonText || primaryButtonProps?.children }))] }))] }));
103
+ }, children: [(secondaryButtonText || secondaryButtonProps?.children) && (_jsx(DsButton, { color: "secondary", size: "medium", fullWidth: true, ...secondaryButtonProps, children: secondaryButtonText || secondaryButtonProps?.children })), (primaryButtonText || primaryButtonProps?.children) && (_jsx(DsButton, { size: "medium", fullWidth: true, ...primaryButtonProps, children: primaryButtonText || primaryButtonProps?.children }))] }))] }));
93
104
  };
@@ -9,12 +9,14 @@ import { DsButtonProps } from '../DsButton';
9
9
  export interface DsDialogProps extends DialogProps {
10
10
  title?: string;
11
11
  description?: string;
12
+ kicker?: string;
12
13
  showClose?: boolean;
13
14
  primaryButtonText?: DsButtonProps['children'];
14
15
  primaryButtonProps?: Omit<DsButtonProps, 'ref'>;
15
16
  secondaryButtonText?: DsButtonProps['children'];
16
17
  secondaryButtonProps?: Omit<DsButtonProps, 'ref'>;
17
18
  TitleProps?: DsDialogTitleProps;
19
+ KickerProps?: DsTypographyProps;
18
20
  DescriptionProps?: DsTypographyProps;
19
21
  CloseIconButtonProps?: DsIconButtonProps;
20
22
  CloseIconProps?: Omit<DsRemixIconProps, 'ref'>;
@@ -2,7 +2,7 @@ export declare const DsDialogActionsOverrides: {
2
2
  MuiDialogActions: {
3
3
  styleOverrides: {
4
4
  root: {
5
- marginTop: string;
5
+ boxShadow: string;
6
6
  padding: string;
7
7
  '> *': {
8
8
  flex: number;
@@ -2,7 +2,7 @@ export const DsDialogActionsOverrides = {
2
2
  MuiDialogActions: {
3
3
  styleOverrides: {
4
4
  root: {
5
- marginTop: 'var(--ds-spacing-mild)',
5
+ boxShadow: 'var(--ds-elevation-1)',
6
6
  padding: 'var(--ds-spacing-zero)',
7
7
  '> *': {
8
8
  flex: 1
@@ -1084,7 +1084,7 @@ declare const componentOverrides: {
1084
1084
  MuiDialogActions: {
1085
1085
  styleOverrides: {
1086
1086
  root: {
1087
- marginTop: string;
1087
+ boxShadow: string;
1088
1088
  padding: string;
1089
1089
  '> *': {
1090
1090
  flex: number;
@@ -8,7 +8,7 @@ const dsRules = {
8
8
  drawerWidth: '240px',
9
9
  drawerMiniWidth: '56px',
10
10
  dialogMdMaxWidth: '600px',
11
- bottomSheetWorkingAreaHeight: '68vh',
11
+ bottomSheetWorkingAreaHeight: 'calc(100vh - var(--ds-spacing-bitterCold))',
12
12
  avatarSSize: '24px',
13
13
  avatarMSize: '32px',
14
14
  avatarLSize: '40px',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@am92/react-design-system",
3
- "version": "2.9.9",
3
+ "version": "2.9.12",
4
4
  "description": "ReactJS Design System using Material UI",
5
5
  "sideEffects": false,
6
6
  "types": "dist/index.d.ts",