@am92/react-design-system 2.7.7 → 2.8.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.Component.d.ts +2 -5
- package/dist/Components/DsAppBar/DsAppBar.Component.js +19 -24
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.d.ts +2 -7
- package/dist/Components/DsBottomSheet/DsBottomSheet.Component.js +62 -65
- package/dist/Components/DsButton/DsButton.Component.d.ts +2 -4
- package/dist/Components/DsButton/DsButton.Component.js +4 -7
- package/dist/Components/DsButton/DsButton.Overrides.js +2 -2
- package/dist/Components/DsButtonGroup/DsButtonGroup.Component.d.ts +2 -6
- package/dist/Components/DsButtonGroup/DsButtonGroup.Component.js +16 -18
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.d.ts +2 -3
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselNavigation.js +42 -44
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.d.ts +2 -6
- package/dist/Components/DsCarousel/DsCarousel.Component/DsCarouselPagination.js +109 -110
- package/dist/Components/DsCarousel/DsCarousel.Component/index.d.ts +3 -19
- package/dist/Components/DsCarousel/DsCarousel.Component/index.js +55 -57
- package/dist/Components/DsChip/DsChip.Component.d.ts +1 -6
- package/dist/Components/DsChip/DsChip.Component.js +1 -10
- package/dist/Components/DsChip/DsChip.Types.d.ts +1 -0
- package/dist/Components/DsChip/DsChip.Types.js +2 -1
- package/dist/Components/DsChipGroup/DsChipGroup.Component.d.ts +2 -5
- package/dist/Components/DsChipGroup/DsChipGroup.Component.js +5 -8
- package/dist/Components/DsContentSlider/DsContentSlider.Component.d.ts +3 -8
- package/dist/Components/DsContentSlider/DsContentSlider.Component.js +13 -20
- package/dist/Components/DsDialog/DsDialog.Component.d.ts +1 -6
- package/dist/Components/DsDialog/DsDialog.Component.js +71 -75
- package/dist/Components/DsDialog/DsDialog.Overrides.d.ts +1 -0
- package/dist/Components/DsDialog/DsDialog.Overrides.js +2 -0
- package/dist/Components/DsDivider/DsDivider.Overrides.js +6 -0
- package/dist/Components/DsFileUploader/DsFileUploader.Component.d.ts +3 -16
- package/dist/Components/DsFileUploader/DsFileUploader.Component.js +68 -71
- package/dist/Components/DsHeader/DsHeader.Component.d.ts +2 -5
- package/dist/Components/DsHeader/DsHeader.Component.js +29 -32
- package/dist/Components/DsHelperText/DsHelperText.Component.d.ts +2 -5
- package/dist/Components/DsHelperText/DsHelperText.Component.js +16 -21
- package/dist/Components/DsHelperText/DsHelperText.Overrides.d.ts +5 -1
- package/dist/Components/DsHelperText/DsHelperText.Overrides.js +6 -1
- package/dist/Components/DsImage/DsImage.Component.d.ts +3 -12
- package/dist/Components/DsImage/DsImage.Component.js +40 -45
- package/dist/Components/DsImage/DsImage.Types.d.ts +0 -1
- package/dist/Components/DsImage/DsImage.Types.js +0 -3
- package/dist/Components/DsInputLabel/DsInputLabel.Component.d.ts +2 -4
- package/dist/Components/DsInputLabel/DsInputLabel.Component.js +6 -9
- package/dist/Components/DsNotistack/AlertMessage.Component.js +7 -9
- package/dist/Components/DsNotistack/DsNotistack.Component.d.ts +2 -7
- package/dist/Components/DsNotistack/DsNotistack.Component.js +12 -16
- package/dist/Components/DsNotistack/DsNotistack.Types.d.ts +1 -0
- package/dist/Components/DsNotistack/DsNotistack.Types.js +3 -1
- package/dist/Components/DsOtp/DsOtp.Component.d.ts +3 -15
- package/dist/Components/DsOtp/DsOtp.Component.js +41 -51
- package/dist/Components/DsPopup/DsPopup.Types.d.ts +1 -1
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.d.ts +2 -6
- package/dist/Components/DsProgressIndicator/DsProgressIndicator.Component.js +18 -21
- package/dist/Components/DsProgressTracker/DsProgressStepper.Component.d.ts +3 -9
- package/dist/Components/DsProgressTracker/DsProgressStepper.Component.js +8 -11
- package/dist/Components/DsProgressTracker/DsProgressTracker.Component.d.ts +3 -21
- package/dist/Components/DsProgressTracker/DsProgressTracker.Component.js +17 -26
- package/dist/Components/DsRadio/DsRadio.Component.d.ts +2 -5
- package/dist/Components/DsRadio/DsRadio.Component.js +5 -8
- package/dist/Components/DsRadio/DsRadio.Overrides.d.ts +9 -1
- package/dist/Components/DsRadio/DsRadio.Overrides.js +9 -1
- package/dist/Components/DsRadioGroup/DsRadioGroup.Component.d.ts +3 -1
- package/dist/Components/DsRadioGroup/DsRadioGroup.Component.js +10 -1
- package/dist/Components/DsRemixIcon/DsRemixIcon.Component.d.ts +2 -4
- package/dist/Components/DsRemixIcon/DsRemixIcon.Component.js +5 -7
- package/dist/Components/DsSelect/DsSelect.Component.d.ts +2 -6
- package/dist/Components/DsSelect/DsSelect.Component.js +49 -53
- package/dist/Components/DsSelect/DsSelect.Overrides.d.ts +3 -0
- package/dist/Components/DsSelect/DsSelect.Overrides.js +4 -1
- package/dist/Components/DsSelect/DsSelect.Types.d.ts +8 -0
- package/dist/Components/DsSelect/DsSelect.Types.js +1 -1
- package/dist/Components/DsSlider/DsSlider.Component.d.ts +1 -5
- package/dist/Components/DsSlider/DsSlider.Component.js +1 -10
- package/dist/Components/DsSlider/DsSlider.Overrides.d.ts +1 -1
- package/dist/Components/DsSlider/DsSlider.Overrides.js +2 -2
- package/dist/Components/DsStepConnector/DsStepConnector.Overrides.d.ts +2 -1
- package/dist/Components/DsStepConnector/DsStepConnector.Overrides.js +9 -2
- package/dist/Components/DsStepLabel/DsStepLabel.Overrides.js +4 -4
- package/dist/Components/DsSwitch/DsSwitch.Component.d.ts +2 -6
- package/dist/Components/DsSwitch/DsSwitch.Component.js +7 -10
- package/dist/Components/DsTag/DsTag.Component.d.ts +2 -7
- package/dist/Components/DsTag/DsTag.Component.js +10 -13
- package/dist/Components/DsTagGroup/DsTagGroup.Component.d.ts +2 -7
- package/dist/Components/DsTagGroup/DsTagGroup.Component.js +25 -27
- package/dist/Components/DsTextArea/DsTextArea.Component.d.ts +3 -10
- package/dist/Components/DsTextArea/DsTextArea.Component.js +49 -54
- package/dist/Components/DsTextArea/DsTextArea.Types.d.ts +0 -1
- package/dist/Components/DsTextArea/DsTextArea.Types.js +1 -3
- package/dist/Components/DsTextField/DsTextField.Component.d.ts +2 -4
- package/dist/Components/DsTextField/DsTextField.Component.js +7 -8
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.d.ts +3 -10
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Component.js +15 -26
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.d.ts +0 -1
- package/dist/Components/DsTextFieldPassword/DsTextFieldPassword.Types.js +0 -3
- package/dist/Components/DsToast/DsToast.Component.d.ts +2 -4
- package/dist/Components/DsToast/DsToast.Component.js +9 -7
- package/dist/Components/DsToggle/DsToggle.Component.d.ts +2 -5
- package/dist/Components/DsToggle/DsToggle.Component.js +11 -9
- package/dist/Components/DsToggle/DsToggle.Types.js +1 -1
- package/dist/Components/DsTooltip/DsTooltip.Component.d.ts +2 -5
- package/dist/Components/DsTooltip/DsTooltip.Component.js +7 -9
- package/dist/Theme/componentOverrides.d.ts +15 -5
- package/dist/Theme/getColorScheme/dark.js +4 -4
- package/dist/Theme/getColorScheme/highContrast.js +1 -1
- package/dist/Theme/getColorScheme/light.js +1 -1
- package/package.json +1 -1
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DsTextAreaProps
|
|
3
|
-
export declare
|
|
4
|
-
state: DsTextAreaState;
|
|
5
|
-
areRef: React.RefObject<unknown>;
|
|
6
|
-
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
7
|
-
componentDidMount(): void;
|
|
8
|
-
componentDidUpdate(prevProps: Readonly<DsTextAreaProps>, prevState: Readonly<DsTextAreaState>, snapshot?: any): void;
|
|
9
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DsTextAreaProps } from './DsTextArea.Types';
|
|
3
|
+
export declare const DsTextArea: FC<DsTextAreaProps>;
|
|
@@ -1,67 +1,62 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { useEffect, useRef, useState } from 'react';
|
|
3
3
|
import { DsFormControl } from '../DsFormControl';
|
|
4
4
|
import { DsTextField } from '../DsTextField';
|
|
5
5
|
import { DsTypography } from '../DsTypography';
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
const { onChange } = this.props;
|
|
6
|
+
export const DsTextArea = (props) => {
|
|
7
|
+
const [count, setCount] = useState(0);
|
|
8
|
+
const areRef = useRef();
|
|
9
|
+
const handleChange = (event) => {
|
|
10
|
+
const { onChange } = props;
|
|
12
11
|
const { target } = event;
|
|
13
12
|
const { value = '' } = target;
|
|
14
|
-
let count = value
|
|
15
|
-
|
|
13
|
+
let count = value?.length;
|
|
14
|
+
setCount(count);
|
|
16
15
|
if (onChange && typeof onChange === 'function') {
|
|
17
16
|
onChange(event);
|
|
18
17
|
}
|
|
19
18
|
};
|
|
20
|
-
|
|
21
|
-
const { value = '' } =
|
|
22
|
-
const count = value.length;
|
|
23
|
-
this.setState({ count });
|
|
24
|
-
}
|
|
25
|
-
componentDidUpdate(prevProps, prevState, snapshot) {
|
|
26
|
-
const { count: currentStateCount } = this.state;
|
|
27
|
-
const { value } = this.props;
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const { value = '' } = props;
|
|
28
21
|
const count = value?.length;
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// Provide counter if MaxLength Provided
|
|
37
|
-
const hasMaxLength = !!maxLength;
|
|
38
|
-
const maxLengthHandlingInputStyle = hasMaxLength
|
|
39
|
-
? { mb: 'var(--ds-spacing-bittercold)' }
|
|
40
|
-
: {};
|
|
41
|
-
const counterStyle = {
|
|
42
|
-
position: 'absolute',
|
|
43
|
-
bottom: '8px',
|
|
44
|
-
right: '8px',
|
|
45
|
-
overflow: 'auto'
|
|
46
|
-
};
|
|
47
|
-
if (helperText) {
|
|
48
|
-
// Adjust the helper text size
|
|
49
|
-
counterStyle.bottom = 'calc(8px + 36px)';
|
|
22
|
+
setCount(count);
|
|
23
|
+
}, []);
|
|
24
|
+
useEffect(() => {
|
|
25
|
+
const { value } = props;
|
|
26
|
+
const stringCount = value?.length;
|
|
27
|
+
if (stringCount && count !== count) {
|
|
28
|
+
setCount(stringCount);
|
|
50
29
|
}
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
30
|
+
}, [count, props.value]);
|
|
31
|
+
const { maxLength, hideCharacterCount, helperText, inputProps, ref, fullWidth, ...rest } = props;
|
|
32
|
+
// Provide counter if MaxLength Provided
|
|
33
|
+
const hasMaxLength = !!maxLength;
|
|
34
|
+
const maxLengthHandlingInputStyle = hasMaxLength
|
|
35
|
+
? { mb: 'var(--ds-spacing-bittercold)' }
|
|
36
|
+
: {};
|
|
37
|
+
const counterStyle = {
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
bottom: '8px',
|
|
40
|
+
right: '8px',
|
|
41
|
+
overflow: 'auto'
|
|
42
|
+
};
|
|
43
|
+
if (helperText) {
|
|
44
|
+
// Adjust the helper text size
|
|
45
|
+
counterStyle.bottom = 'calc(8px + 36px)';
|
|
66
46
|
}
|
|
67
|
-
|
|
47
|
+
return (_jsxs(DsFormControl, { fullWidth: fullWidth, children: [_jsx(DsTextField, { maxRows: 3, minRows: 3, ...rest, fullWidth: fullWidth, onChange: handleChange, multiline: true, inputProps: {
|
|
48
|
+
ref: ref || areRef,
|
|
49
|
+
...inputProps,
|
|
50
|
+
sx: {
|
|
51
|
+
minWidth: '288px',
|
|
52
|
+
...maxLengthHandlingInputStyle,
|
|
53
|
+
...inputProps?.sx
|
|
54
|
+
},
|
|
55
|
+
maxLength: maxLength || ''
|
|
56
|
+
}, helperText: helperText,
|
|
57
|
+
// TODO: To be fixed when we fix the sx passing to inputbase
|
|
58
|
+
style: {
|
|
59
|
+
paddingBottom: 'var(--ds-spacing-mild)',
|
|
60
|
+
...rest?.style
|
|
61
|
+
} }), hasMaxLength && !hideCharacterCount && (_jsx(DsTypography, { sx: counterStyle, variant: "supportRegularFootnote", children: `${count}/${maxLength}` }))] }));
|
|
62
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { DsTextFieldProps } from './DsTextField.Types';
|
|
3
|
-
export declare
|
|
4
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
}
|
|
3
|
+
export declare const DsTextField: FC<DsTextFieldProps>;
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { DsTextFieldDefaultProps } from './DsTextField.Types';
|
|
3
3
|
import { DsFormControl } from '../DsFormControl';
|
|
4
4
|
import { DsInputLabel } from '../DsInputLabel';
|
|
5
5
|
import { DsInputBase } from '../DsInputBase';
|
|
6
6
|
import { DsHelperText } from '../DsHelperText';
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
7
|
+
export const DsTextField = (inProps) => {
|
|
8
|
+
const props = { ...DsTextFieldDefaultProps, ...inProps };
|
|
9
|
+
const { id, name, label, labelSupportText, color, helperText, success, error, sx, fullWidth, ref, inputRef, disabled, required, FormControlProps, InputLabelProps, HelperTextProps, ...inputBaseProps } = props;
|
|
10
|
+
const customColor = success ? 'success' : color;
|
|
11
|
+
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, required: required, ...InputLabelProps }), _jsx(DsInputBase, { fullWidth: fullWidth, color: customColor, error: error, id: id || name, name: name, inputRef: ref || inputRef, disabled: disabled, required: required, ...inputBaseProps }), _jsx(DsHelperText, { helperText: helperText, color: color, success: success, error: error, ...HelperTextProps })] }));
|
|
12
|
+
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { DsTextFieldPasswordProps
|
|
3
|
-
export declare
|
|
4
|
-
static defaultProps: DsTextFieldPasswordProps;
|
|
5
|
-
state: DsTextFieldPasswordState;
|
|
6
|
-
constructor(props: DsTextFieldPasswordProps);
|
|
7
|
-
getMergedProps: () => DsTextFieldPasswordProps;
|
|
8
|
-
handleTogglePassword: () => void;
|
|
9
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
10
|
-
}
|
|
1
|
+
import { FC } from 'react';
|
|
2
|
+
import { DsTextFieldPasswordProps } from './DsTextFieldPassword.Types';
|
|
3
|
+
export declare const DsTextFieldPassword: FC<DsTextFieldPasswordProps>;
|
|
@@ -1,30 +1,19 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import React, {
|
|
2
|
+
import React, { useState } from 'react';
|
|
3
3
|
import { DsInputAdornment } from '../DsInputAdornment';
|
|
4
4
|
import { DsTextField } from '../DsTextField';
|
|
5
|
-
import { DsTextFieldPasswordDefaultProps
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
super(props);
|
|
11
|
-
this.state = {
|
|
12
|
-
...DsTextFieldPasswordDefaultState,
|
|
13
|
-
isVisible: props.isVisible
|
|
14
|
-
};
|
|
15
|
-
}
|
|
16
|
-
getMergedProps = () => {
|
|
17
|
-
return { ...DsTextFieldPasswordDefaultProps, ...this.props };
|
|
5
|
+
import { DsTextFieldPasswordDefaultProps } from './DsTextFieldPassword.Types';
|
|
6
|
+
export const DsTextFieldPassword = (props) => {
|
|
7
|
+
const [isVisible, setIsVisible] = useState(false);
|
|
8
|
+
const getMergedProps = () => {
|
|
9
|
+
return { ...DsTextFieldPasswordDefaultProps, ...props };
|
|
18
10
|
};
|
|
19
|
-
handleTogglePassword = () =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return (_jsx(DsTextField, { ...restProps, disabled: disabled, type: inputType, endAdornment: _jsx(DsInputAdornment, { position: "end", onClick: (!disabled && this.handleTogglePassword) || undefined, children: endAdornment }) }));
|
|
29
|
-
}
|
|
30
|
-
}
|
|
11
|
+
const handleTogglePassword = () => setIsVisible(!isVisible);
|
|
12
|
+
const mergedProps = getMergedProps();
|
|
13
|
+
const { type, isVisible: isVisibleProp, disabled, toggleNode, ...restProps } = mergedProps;
|
|
14
|
+
const inputType = (isVisible && type) || 'password';
|
|
15
|
+
const endAdornment = isVisible
|
|
16
|
+
? React.cloneElement(toggleNode?.toHide || _jsx(_Fragment, {}), { disabled })
|
|
17
|
+
: React.cloneElement(toggleNode?.toShow || _jsx(_Fragment, {}), { disabled });
|
|
18
|
+
return (_jsx(DsTextField, { ...restProps, disabled: disabled, type: inputType, endAdornment: _jsx(DsInputAdornment, { position: "end", onClick: (!disabled && handleTogglePassword) || undefined, children: endAdornment }) }));
|
|
19
|
+
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { DsToastProps } from './DsToast.Types';
|
|
3
|
-
export declare
|
|
4
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
}
|
|
3
|
+
export declare const DsToast: FC<DsToastProps>;
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
2
|
import Alert from '@mui/material/Alert';
|
|
4
3
|
import { DsRemixIcon } from '../DsRemixIcon';
|
|
4
|
+
import { useThemeProps } from '@mui/system';
|
|
5
5
|
const CloseIcon = (props) => {
|
|
6
6
|
const { ownerState, ...restProps } = props;
|
|
7
7
|
return (_jsx(DsRemixIcon, { fontSize: "mild", className: "ri-close-line", ...restProps }));
|
|
8
8
|
};
|
|
9
|
-
export
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
}
|
|
14
|
-
}
|
|
9
|
+
export const DsToast = (inProps) => {
|
|
10
|
+
const props = useThemeProps({
|
|
11
|
+
props: inProps,
|
|
12
|
+
name: 'MuiAlert'
|
|
13
|
+
});
|
|
14
|
+
const { forwardedRef, ...restProps } = props;
|
|
15
|
+
return (_jsx(Alert, { ref: forwardedRef, ...restProps, slots: { closeIcon: CloseIcon, ...restProps?.slots } }));
|
|
16
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { DsToggleProps } from './DsToggle.Types';
|
|
3
|
-
export declare
|
|
4
|
-
handleChange: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
5
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
}
|
|
3
|
+
export declare const DsToggle: FC<DsToggleProps>;
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { PureComponent } from 'react';
|
|
3
2
|
import Switch from '@mui/material/Switch';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
import { useThemeProps } from '@mui/system';
|
|
4
|
+
export const DsToggle = (inProps) => {
|
|
5
|
+
const props = useThemeProps({
|
|
6
|
+
props: inProps,
|
|
7
|
+
name: 'DsToggle'
|
|
8
|
+
});
|
|
9
|
+
const handleChange = (event) => {
|
|
10
|
+
const { onChange } = props;
|
|
7
11
|
const { name, checked } = event.target;
|
|
8
12
|
if (typeof onChange === 'function') {
|
|
9
13
|
onChange(name, checked);
|
|
10
14
|
}
|
|
11
15
|
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
}
|
|
16
|
+
const { value, onChange, ...restProps } = props;
|
|
17
|
+
return (_jsx(Switch, { ...restProps, color: "secondary", checked: value, onChange: handleChange }));
|
|
18
|
+
};
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FC } from 'react';
|
|
2
2
|
import { DsTooltipProps } from './DsTooltip.Types';
|
|
3
|
-
export declare
|
|
4
|
-
renderTitle: () => import("react/jsx-runtime").JSX.Element;
|
|
5
|
-
render(): import("react/jsx-runtime").JSX.Element;
|
|
6
|
-
}
|
|
3
|
+
export declare const DsTooltip: FC<DsTooltipProps>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import React
|
|
2
|
+
import React from 'react';
|
|
3
3
|
import Tooltip from '@mui/material/Tooltip';
|
|
4
4
|
import { DsTypography } from '../DsTypography';
|
|
5
5
|
import { DsLink } from '../DsLink';
|
|
6
|
-
export
|
|
7
|
-
renderTitle = () => {
|
|
8
|
-
const { heading, description, buttonGroup } =
|
|
6
|
+
export const DsTooltip = (props) => {
|
|
7
|
+
const renderTitle = () => {
|
|
8
|
+
const { heading, description, buttonGroup } = props;
|
|
9
9
|
const tooltipButtonGroup = buttonGroup
|
|
10
10
|
? React.cloneElement(buttonGroup, {
|
|
11
11
|
size: 'small',
|
|
@@ -16,8 +16,6 @@ export class DsTooltip extends PureComponent {
|
|
|
16
16
|
: false;
|
|
17
17
|
return (_jsxs(_Fragment, { children: [heading && (_jsx(DsTypography, { component: "div", variant: "bodyBoldMedium", sx: { mb: 'var(--ds-spacing-glacial)' }, children: heading })), description && (_jsx(DsTypography, { component: "div", variant: "bodyRegularMedium", children: description })), tooltipButtonGroup] }));
|
|
18
18
|
};
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
}
|
|
19
|
+
const { heading, description, buttonGroup, children, ...tooltipProps } = props;
|
|
20
|
+
return (_jsx(Tooltip, { title: renderTitle(), ...tooltipProps, children: _jsx(DsLink, { component: "span", underline: "always", color: "inherit", variant: "inherit", sx: { textDecorationColor: 'inherit' }, children: children }) }));
|
|
21
|
+
};
|
|
@@ -599,12 +599,13 @@ declare const componentOverrides: {
|
|
|
599
599
|
};
|
|
600
600
|
MuiStepConnector: {
|
|
601
601
|
styleOverrides: {
|
|
602
|
+
horizontal: import("@mui/system").CSSInterpolation;
|
|
602
603
|
lineVertical: import("@mui/system").CSSInterpolation;
|
|
603
|
-
|
|
604
|
+
lineHorizontal: import("@mui/system").CSSInterpolation;
|
|
604
605
|
};
|
|
605
606
|
};
|
|
606
607
|
MuiSlider: {
|
|
607
|
-
defaultProps:
|
|
608
|
+
defaultProps: import("../Components").DsSliderProps;
|
|
608
609
|
variants: {
|
|
609
610
|
props: Partial<import("../Components").DsSliderProps>;
|
|
610
611
|
style: {
|
|
@@ -714,6 +715,16 @@ declare const componentOverrides: {
|
|
|
714
715
|
styleOverrides: {
|
|
715
716
|
icon: {
|
|
716
717
|
color: string;
|
|
718
|
+
'.MuiInputBase-root.Mui-readOnly &': {
|
|
719
|
+
color: string;
|
|
720
|
+
};
|
|
721
|
+
};
|
|
722
|
+
};
|
|
723
|
+
};
|
|
724
|
+
MuiRadio: {
|
|
725
|
+
styleOverrides: {
|
|
726
|
+
root: {
|
|
727
|
+
padding: string;
|
|
717
728
|
};
|
|
718
729
|
};
|
|
719
730
|
};
|
|
@@ -968,9 +979,7 @@ declare const componentOverrides: {
|
|
|
968
979
|
};
|
|
969
980
|
};
|
|
970
981
|
MuiFormHelperText: {
|
|
971
|
-
|
|
972
|
-
root: import("@mui/system").CSSInterpolation;
|
|
973
|
-
};
|
|
982
|
+
defaultProps: import("../Components").DsHelperTextProps;
|
|
974
983
|
};
|
|
975
984
|
MuiFormControlLabel: {
|
|
976
985
|
styleOverrides: {
|
|
@@ -1063,6 +1072,7 @@ declare const componentOverrides: {
|
|
|
1063
1072
|
};
|
|
1064
1073
|
};
|
|
1065
1074
|
MuiDialog: {
|
|
1075
|
+
defaultProps: import("../Components").DsDialogProps;
|
|
1066
1076
|
styleOverrides: {
|
|
1067
1077
|
paper: {
|
|
1068
1078
|
backgroundColor: string;
|
|
@@ -18,7 +18,7 @@ export default function getDarkModeColorScheme(colorPalette) {
|
|
|
18
18
|
typoActionTertiary: tertiary10,
|
|
19
19
|
typoOnSurface: primaryWhite,
|
|
20
20
|
typoDisabled: secondaryGrey60,
|
|
21
|
-
typoTypical:
|
|
21
|
+
typoTypical: snackBlueNeutralDark,
|
|
22
22
|
typoOnSurfaceDynamic: primaryBlackLight,
|
|
23
23
|
neutral1: neutral1Dark,
|
|
24
24
|
neutral2: neutral2Dark,
|
|
@@ -35,7 +35,7 @@ export default function getDarkModeColorScheme(colorPalette) {
|
|
|
35
35
|
iconOnSurface: primaryWhite,
|
|
36
36
|
iconDisabled: secondaryGrey60,
|
|
37
37
|
iconDefault: primaryWhite,
|
|
38
|
-
iconTypical:
|
|
38
|
+
iconTypical: snackBlueNeutralDark,
|
|
39
39
|
iconOnSurfaceDynamic: primaryBlackLight,
|
|
40
40
|
strokeDefault: secondaryGrey80,
|
|
41
41
|
strokeSelected: secondary60,
|
|
@@ -47,7 +47,7 @@ export default function getDarkModeColorScheme(colorPalette) {
|
|
|
47
47
|
supportPositive: successGreenDark,
|
|
48
48
|
supportWarning: warningOrangeDark,
|
|
49
49
|
supportVariable: snackBlue,
|
|
50
|
-
supportTypical:
|
|
50
|
+
supportTypical: snackBlueNeutralDark,
|
|
51
51
|
supportNegativeNeutral: errorRedNeutralDark,
|
|
52
52
|
supportPositiveNeutral: successGreenNeutralDark,
|
|
53
53
|
supportWarningNeutral: warningOrangeNeutralDark,
|
|
@@ -61,7 +61,7 @@ export default function getDarkModeColorScheme(colorPalette) {
|
|
|
61
61
|
stateUnselectedHover: hexToRgbA(secondaryGrey50, 0.2),
|
|
62
62
|
stateUnselectedPressed: hexToRgbA(secondaryGrey50, 0.25),
|
|
63
63
|
stateDisabledSurface: secondaryGrey100,
|
|
64
|
-
overlay: hexToRgbA(primaryBlack, 0.
|
|
64
|
+
overlay: hexToRgbA(primaryBlack, 0.5),
|
|
65
65
|
overlayLoader: hexToRgbA(primaryBlack, 0.3),
|
|
66
66
|
dotLoader: primaryWhite
|
|
67
67
|
};
|
|
@@ -61,7 +61,7 @@ export default function getHighContrastModeColorScheme(colorPalette) {
|
|
|
61
61
|
stateUnselectedHover: hexToRgbA(secondaryGrey50, 0.2),
|
|
62
62
|
stateUnselectedPressed: hexToRgbA(secondaryGrey50, 0.25),
|
|
63
63
|
stateDisabledSurface: secondaryGrey100,
|
|
64
|
-
overlay: hexToRgbA(primaryBlack, 0.
|
|
64
|
+
overlay: hexToRgbA(primaryBlack, 0.5),
|
|
65
65
|
overlayLoader: hexToRgbA(primaryBlack, 0.3),
|
|
66
66
|
dotLoader: primaryWhite
|
|
67
67
|
};
|
|
@@ -61,7 +61,7 @@ export default function getLightModeColorScheme(colorPalette) {
|
|
|
61
61
|
stateUnselectedHover: hexToRgbA(secondaryGrey50, 0.12),
|
|
62
62
|
stateUnselectedPressed: hexToRgbA(secondaryGrey50, 0.16),
|
|
63
63
|
stateDisabledSurface: secondaryGrey20,
|
|
64
|
-
overlay: hexToRgbA(primaryBlack, 0.
|
|
64
|
+
overlay: hexToRgbA(primaryBlack, 0.5),
|
|
65
65
|
overlayLoader: hexToRgbA(primaryWhite, 0.3),
|
|
66
66
|
dotLoader: secondary100
|
|
67
67
|
};
|