@am92/react-design-system 2.9.1 → 2.9.6
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/DsAccordion/DsAccordion.Component.js +1 -1
- package/dist/Components/DsAccordion/DsAccordion.Overrides.d.ts +4 -2
- package/dist/Components/DsAccordion/DsAccordion.Overrides.js +4 -2
- package/dist/Components/DsAccordion/DsAccordion.Types.js +2 -1
- package/dist/Components/DsAccordionDetails/DsAccordionDetails.Overrides.d.ts +0 -1
- package/dist/Components/DsAccordionDetails/DsAccordionDetails.Overrides.js +4 -5
- package/dist/Components/DsAccordionSummary/DsAccordionSummary.Overrides.d.ts +0 -1
- package/dist/Components/DsAccordionSummary/DsAccordionSummary.Overrides.js +4 -5
- package/dist/Components/DsCarousel/DsCarousel.Component/index.js +1 -1
- package/dist/Components/DsDialog/DsDialog.Component.js +0 -1
- package/dist/Components/DsFormControlLabel/DsFormControlLabel.Overrides.d.ts +6 -0
- package/dist/Components/DsFormControlLabel/DsFormControlLabel.Overrides.js +6 -0
- package/dist/Components/DsInputBase/DsInputBase.Overrides.js +2 -3
- package/dist/Components/DsOtp/DsOtp.Component.d.ts +3 -3
- package/dist/Components/DsOtp/DsOtp.Component.js +16 -7
- package/dist/Components/DsOtp/DsOtp.Types.d.ts +5 -0
- package/dist/Components/DsProgressTracker/{DsProgressStepper.Component.d.ts → Components/DsProgressStepper.Component.d.ts} +1 -1
- package/dist/Components/DsProgressTracker/{DsProgressStepper.Component.js → Components/DsProgressStepper.Component.js} +9 -9
- package/dist/Components/DsProgressTracker/Components/DsProgressTrackerHeader.Component.d.ts +2 -0
- package/dist/Components/DsProgressTracker/Components/DsProgressTrackerHeader.Component.js +37 -0
- package/dist/Components/DsProgressTracker/DsProgressTracker.Component.js +6 -21
- package/dist/Components/DsProgressTracker/DsProgressTracker.Types.d.ts +22 -2
- package/dist/Components/DsProgressTracker/DsProgressTracker.Types.js +2 -1
- package/dist/Constants/TYPOGRAPGHY.js +2 -1
- package/dist/Theme/componentOverrides.d.ts +10 -4
- package/dist/Theme/getTypography.d.ts +3 -0
- package/dist/Theme/getTypography.js +11 -1
- package/dist/Types/DsTypography.d.ts +1 -1
- package/package.json +1 -1
|
@@ -9,6 +9,6 @@ export const DsAccordion = inProps => {
|
|
|
9
9
|
props: inProps,
|
|
10
10
|
name: 'MuiAccordion'
|
|
11
11
|
});
|
|
12
|
-
const { header, HeaderProps, summary, SummaryProps, expandIcon = (_jsx(DsRemixIcon, { className: "ri-arrow-
|
|
12
|
+
const { header, HeaderProps, summary, SummaryProps, expandIcon = (_jsx(DsRemixIcon, { className: "ri-arrow-down-s-line", fontSize: "bitterCold" })), ...AccordionProps } = props;
|
|
13
13
|
return (_jsxs(Accordion, { ...AccordionProps, children: [_jsx(DsAccordionSummary, { expandIcon: expandIcon, ...HeaderProps, children: header }), summary && (_jsx(DsAccordionDetails, { ...SummaryProps, children: summary }))] }));
|
|
14
14
|
};
|
|
@@ -6,8 +6,10 @@ export declare const DsAccordionOverrides: {
|
|
|
6
6
|
backgroundColor: string;
|
|
7
7
|
backgroundImage: string;
|
|
8
8
|
overflow: string;
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
paddingTop: string;
|
|
10
|
+
paddingBottom: string;
|
|
11
|
+
'&.MuiAccordion-root:not(:last-of-type)': {
|
|
12
|
+
borderBottom: string;
|
|
11
13
|
};
|
|
12
14
|
};
|
|
13
15
|
};
|
|
@@ -7,8 +7,10 @@ export const DsAccordionOverrides = {
|
|
|
7
7
|
backgroundColor: 'var(--ds-colour-surfacePrimary)',
|
|
8
8
|
backgroundImage: 'none',
|
|
9
9
|
overflow: 'hidden',
|
|
10
|
-
'
|
|
11
|
-
|
|
10
|
+
paddingTop: 'var(--ds-spacing-glacial)',
|
|
11
|
+
paddingBottom: 'var(--ds-spacing-glacial)',
|
|
12
|
+
'&.MuiAccordion-root:not(:last-of-type)': {
|
|
13
|
+
borderBottom: '1px solid var(--ds-colour-stateDisabledSurface)',
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
16
|
}
|
|
@@ -3,12 +3,11 @@ export const DsAccordionDetailsOverrides = {
|
|
|
3
3
|
styleOverrides: {
|
|
4
4
|
root: {
|
|
5
5
|
border: 'none',
|
|
6
|
-
borderBottom: '1px solid var(--ds-colour-strokeDefault)',
|
|
7
6
|
padding: 'var(--ds-spacing-bitterCold)',
|
|
8
|
-
fontWeight: 'var(--ds-typo-
|
|
9
|
-
fontSize: 'var(--ds-typo-
|
|
10
|
-
lineHeight: 'var(--ds-typo-
|
|
11
|
-
letterSpacing: 'var(--ds-typo-
|
|
7
|
+
fontWeight: 'var(--ds-typo-bodyRegularMedium-fontWeight)',
|
|
8
|
+
fontSize: 'var(--ds-typo-bodyRegularMedium-fontSize)',
|
|
9
|
+
lineHeight: 'var(--ds-typo-bodyRegularMedium-lineHeight)',
|
|
10
|
+
letterSpacing: 'var(--ds-typo-bodyRegularMedium-letterSpacing)'
|
|
12
11
|
}
|
|
13
12
|
}
|
|
14
13
|
}
|
|
@@ -5,17 +5,16 @@ export const DsAccordionSummaryOverrides = {
|
|
|
5
5
|
padding: 'var(--ds-spacing-frostbite) var(--ds-spacing-bitterCold)',
|
|
6
6
|
'&.Mui-expanded': {
|
|
7
7
|
minHeight: '0px',
|
|
8
|
-
backgroundColor: 'var(--ds-colour-surfaceSecondary)'
|
|
9
8
|
}
|
|
10
9
|
},
|
|
11
10
|
content: {
|
|
12
11
|
margin: 'var(--ds-spacing-zero)',
|
|
13
12
|
width: 'calc(100% - 40px)',
|
|
14
13
|
marginRight: 'var(--ds-spacing-bitterCold)',
|
|
15
|
-
fontWeight: 'var(--ds-typo-
|
|
16
|
-
fontSize: 'var(--ds-typo-
|
|
17
|
-
lineHeight: 'var(--ds-typo-
|
|
18
|
-
letterSpacing: 'var(--ds-typo-
|
|
14
|
+
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
15
|
+
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
16
|
+
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
17
|
+
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)',
|
|
19
18
|
'&.Mui-expanded': {
|
|
20
19
|
margin: 'var(--ds-spacing-zero)',
|
|
21
20
|
marginRight: 'var(--ds-spacing-bitterCold)'
|
|
@@ -90,5 +90,5 @@ export const DsCarousel = (props) => {
|
|
|
90
90
|
...SwiperContainerStyles
|
|
91
91
|
}, ...swiperProps,
|
|
92
92
|
// Vertical mode not supported
|
|
93
|
-
direction:
|
|
93
|
+
direction: "horizontal", children: [React.Children.map(children, (child, index) => (_jsx(SwiperSlide, { children: child }))), _jsx(DsCarouselNavigation, { isEnabled: _isNavigationEnabled(), NavigationProps: NavigationProps })] }) }));
|
|
94
94
|
};
|
|
@@ -21,7 +21,6 @@ export const DsDialog = (props) => {
|
|
|
21
21
|
}
|
|
22
22
|
};
|
|
23
23
|
const { title, description, showClose, primaryButtonText, primaryButtonProps, secondaryButtonText, secondaryButtonProps, PaperProps, TitleProps, DescriptionProps, CloseIconButtonProps, CloseIconProps, ContentProps, ActionsProps, children, ...DialogProps } = props;
|
|
24
|
-
console.log('props', props);
|
|
25
24
|
const actionsAvailable = !!(primaryButtonText || secondaryButtonText);
|
|
26
25
|
const accessibilityProps = {};
|
|
27
26
|
const isFlushed = primaryButtonText &&
|
|
@@ -7,6 +7,12 @@ export const DsFormControlLabelOverrides = {
|
|
|
7
7
|
pointerEvents: 'all',
|
|
8
8
|
cursor: 'not-allowed'
|
|
9
9
|
}
|
|
10
|
+
},
|
|
11
|
+
'.Mui-checked ~ *': {
|
|
12
|
+
fontWeight: 'var(--ds-typo-bodyBoldMedium-fontWeight)',
|
|
13
|
+
fontSize: 'var(--ds-typo-bodyBoldMedium-fontSize)',
|
|
14
|
+
lineHeight: 'var(--ds-typo-bodyBoldMedium-lineHeight)',
|
|
15
|
+
letterSpacing: 'var(--ds-typo-bodyBoldMedium-letterSpacing)'
|
|
10
16
|
}
|
|
11
17
|
},
|
|
12
18
|
label: {
|
|
@@ -115,10 +115,9 @@ export const DsInputBaseOverrides = {
|
|
|
115
115
|
padding: 'var(--ds-spacing-deepFreeze)',
|
|
116
116
|
height: 'auto'
|
|
117
117
|
},
|
|
118
|
-
|
|
119
|
-
'> :nth-child(even)': {
|
|
118
|
+
'> :first-of-type + *': {
|
|
120
119
|
marginLeft: 'var(--ds-spacing-quickFreeze)'
|
|
121
|
-
}
|
|
120
|
+
},
|
|
122
121
|
},
|
|
123
122
|
input: {
|
|
124
123
|
padding: 'var(--ds-spacing-quickFreeze) var(--ds-spacing-zero)',
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { DsOtpProps } from './DsOtp.Types';
|
|
3
|
-
export declare const DsOtp:
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { DsOtpProps, DsOtpRef } from './DsOtp.Types';
|
|
3
|
+
export declare const DsOtp: React.ForwardRefExoticComponent<Omit<DsOtpProps, "ref"> & React.RefAttributes<DsOtpRef>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { useState } from 'react';
|
|
2
|
+
import { forwardRef, useEffect, useImperativeHandle, useRef, useState } from 'react';
|
|
3
3
|
import { DsBox } from '../DsBox';
|
|
4
4
|
import { DsStack } from '../DsStack';
|
|
5
5
|
import { DsInputLabel } from '../DsInputLabel';
|
|
@@ -9,10 +9,11 @@ import { DsOtpDefaultProps } from './DsOtp.Types';
|
|
|
9
9
|
const KEY_CODES = {
|
|
10
10
|
BACK_SPACE: 'Backspace'
|
|
11
11
|
};
|
|
12
|
-
export const DsOtp = (inProps) => {
|
|
12
|
+
export const DsOtp = forwardRef((inProps, ref) => {
|
|
13
13
|
const props = { ...DsOtpDefaultProps, ...inProps };
|
|
14
|
+
const domRef = useRef(null);
|
|
14
15
|
const optInputRefs = new Map();
|
|
15
|
-
const { initialOtp = '', length } = props;
|
|
16
|
+
const { initialOtp = '', length, autoFocus } = props;
|
|
16
17
|
const [otp, setOtp] = useState(initialOtp ? [...initialOtp].slice(0, length) : []);
|
|
17
18
|
const handleFocus = (event) => {
|
|
18
19
|
const { onFocus } = props;
|
|
@@ -85,9 +86,17 @@ export const DsOtp = (inProps) => {
|
|
|
85
86
|
onComplete(otpString);
|
|
86
87
|
}
|
|
87
88
|
};
|
|
89
|
+
useImperativeHandle(ref, () => ({
|
|
90
|
+
resetOtpValues,
|
|
91
|
+
domNode: domRef?.current
|
|
92
|
+
}));
|
|
88
93
|
const resetOtpValues = () => {
|
|
89
94
|
setOtp([]);
|
|
90
95
|
};
|
|
96
|
+
useEffect(() => {
|
|
97
|
+
if (autoFocus)
|
|
98
|
+
_handleNavigation(-1);
|
|
99
|
+
}, [autoFocus]);
|
|
91
100
|
const renderOtpBoxes = () => {
|
|
92
101
|
const { label, labelSupportText, name, length, helperText, inputProps = {}, HelperTextProps, BoxProps, InputLabelProps, ...restProps } = props;
|
|
93
102
|
const lengthArray = Array(length).fill('');
|
|
@@ -99,12 +108,12 @@ export const DsOtp = (inProps) => {
|
|
|
99
108
|
textAlign: 'center'
|
|
100
109
|
}
|
|
101
110
|
};
|
|
102
|
-
return lengthArray.map((value, index) => (_jsx(DsTextField, { type:
|
|
111
|
+
return lengthArray.map((value, index) => (_jsx(DsTextField, { type: 'tel', inputMode: 'tel', ...restProps, name: `${name}.${index}`, "ds-variant": 'otp', inputProps: otpInputProps, onPaste: handlePaste, onFocus: handleFocus, onChange: handleChange, onKeyDown: handleKeyDown, value: otp[index] || '', inputRef: ref => {
|
|
103
112
|
optInputRefs.set(index, ref);
|
|
104
113
|
} }, index)));
|
|
105
114
|
};
|
|
106
115
|
const { id, name, label, labelSupportText, helperText, success, color, error, inputProps, disabled, InputLabelProps, HelperTextProps, BoxProps } = props;
|
|
107
|
-
return (_jsxs(DsBox, { ...BoxProps, children: [_jsx(DsInputLabel, { label: label, labelSupportText: labelSupportText,
|
|
116
|
+
return (_jsxs(DsBox, { ref: domRef, ...BoxProps, children: [_jsx(DsInputLabel, { label: label, labelSupportText: labelSupportText,
|
|
108
117
|
// error={error}
|
|
109
|
-
success: success, htmlFor: id || name, disabled: disabled, ...InputLabelProps }), _jsx(DsStack, { direction:
|
|
110
|
-
};
|
|
118
|
+
success: success, htmlFor: id || name, disabled: disabled, ...InputLabelProps }), _jsx(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-glacial)', style: {}, children: renderOtpBoxes() }), _jsx(DsHelperText, { helperText: helperText, color: color, success: success, error: error, ...HelperTextProps })] }));
|
|
119
|
+
});
|
|
@@ -6,8 +6,13 @@ export interface DsOtpProps extends DsTextFieldProps {
|
|
|
6
6
|
length?: number;
|
|
7
7
|
initialOtp?: string;
|
|
8
8
|
BoxProps?: DsBoxProps;
|
|
9
|
+
autoFocus?: boolean;
|
|
9
10
|
}
|
|
10
11
|
export declare const DsOtpDefaultProps: DsOtpProps;
|
|
12
|
+
export type DsOtpRef = {
|
|
13
|
+
resetOtpValues: () => void;
|
|
14
|
+
domNode: HTMLDivElement | null;
|
|
15
|
+
};
|
|
11
16
|
export interface DsOtpState {
|
|
12
17
|
otp: string[];
|
|
13
18
|
}
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { DsProgressStepperDefaultProps } from '
|
|
3
|
-
import {
|
|
4
|
-
import { DsStep } from '
|
|
5
|
-
import { DsStepLabel } from '
|
|
6
|
-
import {
|
|
7
|
-
export const DsProgressStepper =
|
|
2
|
+
import { DsProgressStepperDefaultProps } from '../DsProgressStepper.Types';
|
|
3
|
+
import { DsRemixIcon } from '../../DsRemixIcon';
|
|
4
|
+
import { DsStep } from '../../DsStep';
|
|
5
|
+
import { DsStepLabel } from '../../DsStepLabel';
|
|
6
|
+
import { DsStepper } from '../../DsStepper';
|
|
7
|
+
export const DsProgressStepper = inProps => {
|
|
8
8
|
const props = { ...DsProgressStepperDefaultProps, ...inProps };
|
|
9
9
|
const renderStepIcon = (stepProps) => {
|
|
10
10
|
const { active, error, completed, icon } = stepProps;
|
|
11
11
|
if (error) {
|
|
12
|
-
return (_jsx(DsRemixIcon, { className:
|
|
12
|
+
return (_jsx(DsRemixIcon, { className: 'ri-close-circle-fill', sx: { color: 'var(--ds-colour-iconNegative)' } }));
|
|
13
13
|
}
|
|
14
14
|
if (completed) {
|
|
15
|
-
return (_jsx(DsRemixIcon, { className:
|
|
15
|
+
return (_jsx(DsRemixIcon, { className: 'ri-checkbox-circle-fill', sx: { color: 'var(--ds-colour-iconPositive)' } }));
|
|
16
16
|
}
|
|
17
17
|
if (active) {
|
|
18
|
-
return (_jsx(DsRemixIcon, { className:
|
|
18
|
+
return (_jsx(DsRemixIcon, { className: 'ri-play-circle-fill', color: 'iconActionSecondary' }));
|
|
19
19
|
}
|
|
20
20
|
return _jsx(_Fragment, { children: icon });
|
|
21
21
|
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { DsLinearProgress } from '../../DsLinearProgress';
|
|
3
|
+
import { DsProgressIndicator } from '../../DsProgressIndicator';
|
|
4
|
+
import { DsRemixIcon } from '../../DsRemixIcon';
|
|
5
|
+
import { DsStack } from '../../DsStack';
|
|
6
|
+
import { DsTypography } from '../../DsTypography';
|
|
7
|
+
export const DsProgressTrackerHeader = (props) => {
|
|
8
|
+
const { activeStep, steps, nextStepLabelPrefix, dense, onClick, StepperProps, ...wrapperProps } = props;
|
|
9
|
+
const currentStep = steps[activeStep] || {};
|
|
10
|
+
const nextStepIndex = activeStep + 1;
|
|
11
|
+
const nextStep = steps[nextStepIndex];
|
|
12
|
+
const haveNextStep = nextStepIndex <= steps.length;
|
|
13
|
+
const isNextStepLastStep = nextStepIndex === steps.length;
|
|
14
|
+
const fillPercentage = Math.round((nextStepIndex / steps.length) * 100);
|
|
15
|
+
const renderStepsLabel = () => {
|
|
16
|
+
return (_jsx(DsTypography, { component: 'div', textAlign: 'right', color: 'var(--ds-colour-typoTertiary)', variant: 'subheadingSemiboldDefault', children: isNextStepLastStep
|
|
17
|
+
? 'Yay! you are almost done'
|
|
18
|
+
: `${nextStepLabelPrefix} ${nextStep.stepName}` }));
|
|
19
|
+
};
|
|
20
|
+
return (_jsx(_Fragment, { children: dense ? (_jsxs(DsStack, { sx: {
|
|
21
|
+
backgroundColor: 'var(--ds-colour-surfaceSecondary)',
|
|
22
|
+
...wrapperProps?.sx
|
|
23
|
+
}, ...wrapperProps, children: [_jsxs(DsStack, { direction: 'row', justifyContent: 'space-between', px: 'var(--ds-spacing-bitterCold)', pt: 'var(--ds-spacing-frostbite)', pb: 'calc(var(--ds-spacing-frostbite) - var(--ds-spacing-deepFreeze))', onClick: onClick, children: [_jsx(DsTypography, { variant: 'subheadingSemiboldDefault', children: `STEP ${activeStep + 1} OF ${steps.length}` }), _jsxs(DsStack, { direction: 'row', spacing: 'var(--ds-spacing-frostbite)', children: [haveNextStep && renderStepsLabel(), props['ds-variant'] !== 'header' && (_jsx(DsRemixIcon, { fontSize: 'bitterCold', className: 'ri-arrow-right-s-line' }))] })] }), _jsx(DsLinearProgress, { color: 'secondary', value: fillPercentage, variant: 'determinate', sx: {
|
|
24
|
+
backgroundColor: 'transparent',
|
|
25
|
+
height: '2px',
|
|
26
|
+
'.MuiLinearProgress-bar1Determinate ': {
|
|
27
|
+
borderRadius: '1px'
|
|
28
|
+
}
|
|
29
|
+
} })] })) : (_jsxs(DsStack, { sx: {
|
|
30
|
+
p: 'var(--ds-spacing-bitterCold)',
|
|
31
|
+
alignItems: 'center',
|
|
32
|
+
borderBottom: '1px solid var(--ds-colour-strokeDefault)',
|
|
33
|
+
backgroundColor: 'var(--ds-colour-surfaceBackground)',
|
|
34
|
+
cursor: props['ds-variant'] === 'default' ? 'pointer' : 'unset',
|
|
35
|
+
...wrapperProps?.sx
|
|
36
|
+
}, spacing: 'var(--ds-spacing-bitterCold)', direction: 'row', onClick: onClick, ...wrapperProps, children: [_jsx(DsProgressIndicator, { activeStep: activeStep + 1, steps: steps.length }), _jsxs(DsStack, { flexGrow: 1, spacing: 'var(--ds-spacing-quickFreeze)', children: [_jsx(DsTypography, { component: 'div', textAlign: 'right', color: 'var(--ds-colour-actionSecondary)', variant: 'headingBoldExtraSmall', children: currentStep.stepName }), haveNextStep && renderStepsLabel()] })] })) }));
|
|
37
|
+
};
|
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { DsProgressTrackerDefaultProps } from './DsProgressTracker.Types';
|
|
4
|
-
import { DsProgressStepper } from './DsProgressStepper.Component';
|
|
5
|
-
import { DsProgressIndicator } from '../DsProgressIndicator';
|
|
6
4
|
import { DsCollapse } from '../DsCollapse';
|
|
7
5
|
import { DsBox } from '../DsBox';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
export const DsProgressTracker =
|
|
6
|
+
import { DsProgressTrackerHeader } from './Components/DsProgressTrackerHeader.Component';
|
|
7
|
+
import { DsProgressStepper } from './Components/DsProgressStepper.Component';
|
|
8
|
+
export const DsProgressTracker = inProps => {
|
|
11
9
|
const props = { ...DsProgressTrackerDefaultProps, ...inProps };
|
|
12
10
|
const [open, setOpen] = useState(props['ds-variant'] === 'steps' ? true : false);
|
|
13
11
|
const getMergedProps = () => {
|
|
@@ -36,21 +34,8 @@ export const DsProgressTracker = (inProps) => {
|
|
|
36
34
|
if (mergedProps['ds-variant'] === 'steps') {
|
|
37
35
|
return null;
|
|
38
36
|
}
|
|
39
|
-
const {
|
|
40
|
-
|
|
41
|
-
const nextStepIndex = activeStep + 1;
|
|
42
|
-
const nextStep = steps[nextStepIndex];
|
|
43
|
-
const haveNextStep = nextStepIndex <= steps.length;
|
|
44
|
-
const isNextStepLastStep = nextStepIndex === steps.length;
|
|
45
|
-
return (_jsxs(DsStack, { sx: {
|
|
46
|
-
p: 'var(--ds-spacing-bitterCold)',
|
|
47
|
-
alignItems: 'center',
|
|
48
|
-
borderBottom: '1px solid var(--ds-colour-strokeDefault)',
|
|
49
|
-
backgroundColor: 'var(--ds-colour-surfaceBackground)',
|
|
50
|
-
cursor: mergedProps['ds-variant'] === 'default' ? 'pointer' : 'unset'
|
|
51
|
-
}, spacing: "var(--ds-spacing-bitterCold)", direction: "row", onClick: handleToggleCollapse, children: [_jsx(DsProgressIndicator, { activeStep: activeStep + 1, steps: steps.length }), _jsxs(DsStack, { flexGrow: 1, direction: "column", spacing: "var(--ds-spacing-quickFreeze)", children: [_jsx(DsTypography, { component: "div", textAlign: "right", color: "var(--ds-colour-actionSecondary)", variant: "headingBoldExtraSmall", children: currentStep.stepName }), haveNextStep && (_jsx(DsTypography, { component: "div", textAlign: "right", color: "var(--ds-colour-typoTertiary)", variant: "subheadingSemiboldDefault", children: isNextStepLastStep
|
|
52
|
-
? 'Yay! you are almost done'
|
|
53
|
-
: `${nextStepLabelPrefix}${nextStep.stepName}` }))] })] }));
|
|
37
|
+
const { onClick } = mergedProps;
|
|
38
|
+
return (_jsx(_Fragment, { children: _jsx(DsProgressTrackerHeader, { ...mergedProps, onClick: typeof onClick === 'function' ? onClick : handleToggleCollapse }) }));
|
|
54
39
|
};
|
|
55
40
|
const mergedProps = props;
|
|
56
41
|
const { sx } = mergedProps;
|
|
@@ -1,13 +1,33 @@
|
|
|
1
1
|
import { DsBoxProps } from '../DsBox';
|
|
2
|
+
import { DsStackProps } from '../DsStack';
|
|
2
3
|
import { DsProgressStepperProps, DsProgressStepperStepProps } from './DsProgressStepper.Types';
|
|
3
|
-
export interface DsProgressTrackerProps {
|
|
4
|
+
export interface DsProgressTrackerProps extends DsStackProps {
|
|
4
5
|
/** This property can be used to switch between different variants of Progress Indicator where Default will provide a view with expand functionality on click, setsp only provide setp names without header and header provides a header with steps indicator without expandable stepper. */
|
|
5
6
|
'ds-variant': 'default' | 'header' | 'steps';
|
|
7
|
+
/**
|
|
8
|
+
* This prop can be used to provide steps array to the component.
|
|
9
|
+
*/
|
|
6
10
|
steps: DsProgressStepperStepProps[];
|
|
11
|
+
/**
|
|
12
|
+
* This prop can be used to change the state of progress tarcker from normal to compressed.
|
|
13
|
+
*/
|
|
14
|
+
dense?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* This prop can be used to provide the current active step in the component.
|
|
17
|
+
*/
|
|
7
18
|
activeStep: number;
|
|
19
|
+
/**
|
|
20
|
+
* This prop can be used to provide props to the stepper component.
|
|
21
|
+
*/
|
|
8
22
|
StepperProps?: Omit<DsProgressStepperProps, 'activeStep' | 'steps' | 'ref'>;
|
|
23
|
+
/**
|
|
24
|
+
* This prop can be used to provide styles to the main element.
|
|
25
|
+
*/
|
|
9
26
|
sx?: DsBoxProps;
|
|
10
|
-
|
|
27
|
+
/**
|
|
28
|
+
* This prop can be used to provide a custom prefix string to the step label.
|
|
29
|
+
*/
|
|
30
|
+
nextStepLabelPrefix?: React.ReactNode;
|
|
11
31
|
}
|
|
12
32
|
export declare const DsProgressTrackerDefaultProps: DsProgressTrackerProps;
|
|
13
33
|
export interface DsProgressTrackerState {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
export const DsProgressTrackerDefaultProps = {
|
|
2
2
|
activeStep: 0,
|
|
3
3
|
'ds-variant': 'steps',
|
|
4
|
+
dense: false,
|
|
4
5
|
steps: [],
|
|
5
6
|
StepperProps: { orientation: 'vertical' },
|
|
6
7
|
sx: {},
|
|
7
|
-
nextStepLabelPrefix: 'Next Step: '
|
|
8
|
+
nextStepLabelPrefix: 'Next Step : '
|
|
8
9
|
};
|
|
9
10
|
export const DsProgressTrackerDefaultState = {
|
|
10
11
|
open: false
|
|
@@ -26,7 +26,8 @@ export const DSTYPOGRAPHY_TOKENS = [
|
|
|
26
26
|
'supportRegularInfo',
|
|
27
27
|
'supportRegularFootnote',
|
|
28
28
|
'supportBoldTextButton',
|
|
29
|
-
'supportRegularMetadata'
|
|
29
|
+
'supportRegularMetadata',
|
|
30
|
+
'supportBlackProductName'
|
|
30
31
|
];
|
|
31
32
|
export const DS_TYPOGRAPHY_DEFAULT_HTML_FONT_SIZE = 16;
|
|
32
33
|
export const DS_TYPOGRAPHY_MIN_HTML_FONT_SIZE = 16;
|
|
@@ -1003,6 +1003,12 @@ declare const componentOverrides: {
|
|
|
1003
1003
|
cursor: string;
|
|
1004
1004
|
};
|
|
1005
1005
|
};
|
|
1006
|
+
'.Mui-checked ~ *': {
|
|
1007
|
+
fontWeight: string;
|
|
1008
|
+
fontSize: string;
|
|
1009
|
+
lineHeight: string;
|
|
1010
|
+
letterSpacing: string;
|
|
1011
|
+
};
|
|
1006
1012
|
};
|
|
1007
1013
|
label: {
|
|
1008
1014
|
padding: string;
|
|
@@ -1386,7 +1392,6 @@ declare const componentOverrides: {
|
|
|
1386
1392
|
padding: string;
|
|
1387
1393
|
'&.Mui-expanded': {
|
|
1388
1394
|
minHeight: string;
|
|
1389
|
-
backgroundColor: string;
|
|
1390
1395
|
};
|
|
1391
1396
|
};
|
|
1392
1397
|
content: {
|
|
@@ -1411,7 +1416,6 @@ declare const componentOverrides: {
|
|
|
1411
1416
|
styleOverrides: {
|
|
1412
1417
|
root: {
|
|
1413
1418
|
border: string;
|
|
1414
|
-
borderBottom: string;
|
|
1415
1419
|
padding: string;
|
|
1416
1420
|
fontWeight: string;
|
|
1417
1421
|
fontSize: string;
|
|
@@ -1427,8 +1431,10 @@ declare const componentOverrides: {
|
|
|
1427
1431
|
backgroundColor: string;
|
|
1428
1432
|
backgroundImage: string;
|
|
1429
1433
|
overflow: string;
|
|
1430
|
-
|
|
1431
|
-
|
|
1434
|
+
paddingTop: string;
|
|
1435
|
+
paddingBottom: string;
|
|
1436
|
+
'&.MuiAccordion-root:not(:last-of-type)': {
|
|
1437
|
+
borderBottom: string;
|
|
1432
1438
|
};
|
|
1433
1439
|
};
|
|
1434
1440
|
};
|
|
@@ -29,6 +29,7 @@ export default function getTypography(fontFamilyName?: string): {
|
|
|
29
29
|
supportRegularFootnote?: import("react").CSSProperties | undefined;
|
|
30
30
|
supportBoldTextButton?: import("react").CSSProperties | undefined;
|
|
31
31
|
supportRegularMetadata?: import("react").CSSProperties | undefined;
|
|
32
|
+
supportBlackProductName?: import("react").CSSProperties | undefined;
|
|
32
33
|
primaryFont: string;
|
|
33
34
|
fontFamily: string;
|
|
34
35
|
fontSizeScorched: string;
|
|
@@ -49,6 +50,7 @@ export default function getTypography(fontFamilyName?: string): {
|
|
|
49
50
|
fontWeightRegular: string;
|
|
50
51
|
fontWeightSemibold: string;
|
|
51
52
|
fontWeightBold: string;
|
|
53
|
+
fontWeightBlackItalic: string;
|
|
52
54
|
lineHeightIceAge: string;
|
|
53
55
|
lineHeightGlacial: string;
|
|
54
56
|
lineHeightGelid: string;
|
|
@@ -98,6 +100,7 @@ export default function getTypography(fontFamilyName?: string): {
|
|
|
98
100
|
supportRegularFootnote: import("react").CSSProperties | undefined;
|
|
99
101
|
supportBoldTextButton: import("react").CSSProperties | undefined;
|
|
100
102
|
supportRegularMetadata: import("react").CSSProperties | undefined;
|
|
103
|
+
supportBlackProductName: import("react").CSSProperties | undefined;
|
|
101
104
|
};
|
|
102
105
|
};
|
|
103
106
|
declare module '@mui/material/styles' {
|
|
@@ -21,6 +21,7 @@ export default function getTypography(fontFamilyName = '') {
|
|
|
21
21
|
fontWeightRegular: '400',
|
|
22
22
|
fontWeightSemibold: '600',
|
|
23
23
|
fontWeightBold: '700',
|
|
24
|
+
fontWeightBlackItalic: '900',
|
|
24
25
|
lineHeightIceAge: '10px',
|
|
25
26
|
lineHeightGlacial: '8px',
|
|
26
27
|
lineHeightGelid: '6px',
|
|
@@ -242,6 +243,14 @@ export default function getTypography(fontFamilyName = '') {
|
|
|
242
243
|
lineHeight: lineHeightCalculator(dsTypoPrimitive.fontSizeFrostbite, dsTypoPrimitive.lineHeightZero),
|
|
243
244
|
letterSpacing: dsTypoPrimitive.characterSpacingAlps,
|
|
244
245
|
textTransform: 'uppercase'
|
|
246
|
+
},
|
|
247
|
+
supportBlackProductName: {
|
|
248
|
+
fontFamily,
|
|
249
|
+
fontWeight: dsTypoPrimitive.fontWeightBlackItalic,
|
|
250
|
+
fontSize: dsTypoPrimitive.fontSizeFrostbite,
|
|
251
|
+
lineHeight: lineHeightCalculator(dsTypoPrimitive.fontSizeFrostbite, dsTypoPrimitive.lineHeightZero),
|
|
252
|
+
letterSpacing: dsTypoPrimitive.characterSpacingHimalayas,
|
|
253
|
+
textTransform: 'uppercase'
|
|
245
254
|
}
|
|
246
255
|
};
|
|
247
256
|
const dsTypo = {
|
|
@@ -283,7 +292,8 @@ export default function getTypography(fontFamilyName = '') {
|
|
|
283
292
|
supportRegularInfo: dsTypo.supportRegularInfo,
|
|
284
293
|
supportRegularFootnote: dsTypo.supportRegularFootnote,
|
|
285
294
|
supportBoldTextButton: dsTypo.supportBoldTextButton,
|
|
286
|
-
supportRegularMetadata: dsTypo.supportRegularMetadata
|
|
295
|
+
supportRegularMetadata: dsTypo.supportRegularMetadata,
|
|
296
|
+
supportBlackProductName: dsTypo.supportBlackProductName
|
|
287
297
|
};
|
|
288
298
|
return { dsTypo, typography };
|
|
289
299
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type DsFontSizeTokens = 'scorched' | 'torrid' | 'blazzing' | 'hot' | 'tropical' | 'warm' | 'mild' | 'cool' | 'cold' | 'bitterCold' | 'frigid' | 'frostbite' | 'blizzard' | 'iceAge';
|
|
2
2
|
export type DsFontSizeClassTokens = 'scorched' | 'torrid' | 'blazzing' | 'hot' | 'tropical' | 'warm' | 'mild' | 'cool' | 'cold' | 'bitterCold' | 'frigid' | 'frostbite' | 'blizzard' | 'iceAge';
|
|
3
|
-
export type DsTypographyTokens = 'displayBoldLarge' | 'displayBoldMedium' | 'displayBoldSmall' | 'displayBoldItalicLarge' | 'displayBoldItalicMedium' | 'displayBoldItalicSmall' | 'headingBoldExtraLarge' | 'headingBoldLarge' | 'headingBoldMedium' | 'headingBoldSmall' | 'headingBoldExtraSmall' | 'subheadingSemiboldLarge' | 'subheadingSemiboldDefault' | 'headingBoldItalicExtraLarge' | 'headingBoldItalicLarge' | 'headingBoldItalicMedium' | 'headingBoldItalicSmall' | 'headingBoldItalicExtraSmall' | 'bodyRegularLarge' | 'bodyRegularMedium' | 'bodyRegularSmall' | 'bodyBoldLarge' | 'bodyBoldMedium' | 'bodyBoldSmall' | 'supportRegularInfo' | 'supportRegularFootnote' | 'supportBoldTextButton' | 'supportRegularMetadata';
|
|
3
|
+
export type DsTypographyTokens = 'displayBoldLarge' | 'displayBoldMedium' | 'displayBoldSmall' | 'displayBoldItalicLarge' | 'displayBoldItalicMedium' | 'displayBoldItalicSmall' | 'headingBoldExtraLarge' | 'headingBoldLarge' | 'headingBoldMedium' | 'headingBoldSmall' | 'headingBoldExtraSmall' | 'subheadingSemiboldLarge' | 'subheadingSemiboldDefault' | 'headingBoldItalicExtraLarge' | 'headingBoldItalicLarge' | 'headingBoldItalicMedium' | 'headingBoldItalicSmall' | 'headingBoldItalicExtraSmall' | 'bodyRegularLarge' | 'bodyRegularMedium' | 'bodyRegularSmall' | 'bodyBoldLarge' | 'bodyBoldMedium' | 'bodyBoldSmall' | 'supportRegularInfo' | 'supportRegularFootnote' | 'supportBoldTextButton' | 'supportRegularMetadata' | 'supportBlackProductName';
|
|
4
4
|
interface DsFontSizeGenerics<T> extends Partial<Record<DsFontSizeTokens, T>> {
|
|
5
5
|
}
|
|
6
6
|
interface DsFontSizeClassGenerics<T> extends Partial<Record<DsFontSizeClassTokens, T>> {
|