@astral/ui 4.49.0 → 4.51.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/components/NewStepper/NewStepper.d.ts +2 -0
- package/components/NewStepper/NewStepper.js +30 -0
- package/components/NewStepper/Step/Description/Description.d.ts +7 -0
- package/components/NewStepper/Step/Description/Description.js +8 -0
- package/components/NewStepper/Step/Description/index.d.ts +1 -0
- package/components/NewStepper/Step/Description/index.js +1 -0
- package/components/NewStepper/Step/Description/styles.d.ts +11 -0
- package/components/NewStepper/Step/Description/styles.js +18 -0
- package/components/NewStepper/Step/Label/Label.d.ts +7 -0
- package/components/NewStepper/Step/Label/Label.js +9 -0
- package/components/NewStepper/Step/Label/index.d.ts +1 -0
- package/components/NewStepper/Step/Label/index.js +1 -0
- package/components/NewStepper/Step/Label/styles.d.ts +25 -0
- package/components/NewStepper/Step/Label/styles.js +23 -0
- package/components/NewStepper/Step/Step.d.ts +2 -0
- package/components/NewStepper/Step/Step.js +80 -0
- package/components/NewStepper/Step/constants.d.ts +28 -0
- package/components/NewStepper/Step/constants.js +25 -0
- package/components/NewStepper/Step/index.d.ts +3 -0
- package/components/NewStepper/Step/index.js +2 -0
- package/components/NewStepper/Step/styles.d.ts +38 -0
- package/components/NewStepper/Step/styles.js +312 -0
- package/components/NewStepper/Step/types.d.ts +44 -0
- package/components/NewStepper/Step/types.js +1 -0
- package/components/NewStepper/Step/useLogic/index.d.ts +1 -0
- package/components/NewStepper/Step/useLogic/index.js +1 -0
- package/components/NewStepper/Step/useLogic/useLogic.d.ts +23 -0
- package/components/NewStepper/Step/useLogic/useLogic.js +55 -0
- package/components/NewStepper/StepIcon/StepIcon.d.ts +28 -0
- package/components/NewStepper/StepIcon/StepIcon.js +34 -0
- package/components/NewStepper/StepIcon/constants.d.ts +7 -0
- package/components/NewStepper/StepIcon/constants.js +8 -0
- package/components/NewStepper/StepIcon/index.d.ts +2 -0
- package/components/NewStepper/StepIcon/index.js +2 -0
- package/components/NewStepper/StepperContext/StepperContext.d.ts +10 -0
- package/components/NewStepper/StepperContext/StepperContext.js +9 -0
- package/components/NewStepper/StepperContext/StepperContextProvider/StepperContextProvider.d.ts +7 -0
- package/components/NewStepper/StepperContext/StepperContextProvider/StepperContextProvider.js +21 -0
- package/components/NewStepper/StepperContext/StepperContextProvider/index.d.ts +1 -0
- package/components/NewStepper/StepperContext/StepperContextProvider/index.js +1 -0
- package/components/NewStepper/StepperContext/index.d.ts +2 -0
- package/components/NewStepper/StepperContext/index.js +2 -0
- package/components/NewStepper/constants.d.ts +13 -0
- package/components/NewStepper/constants.js +14 -0
- package/components/NewStepper/index.d.ts +4 -0
- package/components/NewStepper/index.js +3 -0
- package/components/NewStepper/public.d.ts +4 -0
- package/components/NewStepper/public.js +3 -0
- package/components/NewStepper/styles.d.ts +5 -0
- package/components/NewStepper/styles.js +44 -0
- package/components/NewStepper/types.d.ts +33 -0
- package/components/NewStepper/types.js +1 -0
- package/components/NewStepper/useLogic/index.d.ts +1 -0
- package/components/NewStepper/useLogic/index.js +1 -0
- package/components/NewStepper/useLogic/useLogic.d.ts +15 -0
- package/components/NewStepper/useLogic/useLogic.js +47 -0
- package/components/NewStepper/useLogic/utils/index.d.ts +1 -0
- package/components/NewStepper/useLogic/utils/index.js +1 -0
- package/components/NewStepper/useLogic/utils/validateStepperProps/index.d.ts +1 -0
- package/components/NewStepper/useLogic/utils/validateStepperProps/index.js +1 -0
- package/components/NewStepper/useLogic/utils/validateStepperProps/validateStepperProps.d.ts +5 -0
- package/components/NewStepper/useLogic/utils/validateStepperProps/validateStepperProps.js +16 -0
- package/components/Stepper/Stepper.d.ts +3 -0
- package/components/Stepper/Stepper.js +3 -0
- package/components/StepperWizard/StepperWizard.d.ts +3 -0
- package/components/StepperWizard/StepperWizard.js +3 -0
- package/components/Typography/Typography.js +1 -1
- package/components/Typography/constants.d.ts +1 -0
- package/components/Typography/constants.js +2 -0
- package/hook-form/FormWizard/FormWizard.js +4 -3
- package/hook-form/FormWizard/styles.d.ts +1 -4
- package/hook-form/FormWizard/styles.js +4 -6
- package/hook-form/FormWizard/useLogic/useLogic.d.ts +5 -6
- package/hook-form/FormWizard/useLogic/useLogic.js +4 -5
- package/hook-form/useFormWizard/useFormWizard.js +4 -2
- package/node/components/NewStepper/NewStepper.d.ts +2 -0
- package/node/components/NewStepper/NewStepper.js +34 -0
- package/node/components/NewStepper/Step/Description/Description.d.ts +7 -0
- package/node/components/NewStepper/Step/Description/Description.js +12 -0
- package/node/components/NewStepper/Step/Description/index.d.ts +1 -0
- package/node/components/NewStepper/Step/Description/index.js +17 -0
- package/node/components/NewStepper/Step/Description/styles.d.ts +11 -0
- package/node/components/NewStepper/Step/Description/styles.js +21 -0
- package/node/components/NewStepper/Step/Label/Label.d.ts +7 -0
- package/node/components/NewStepper/Step/Label/Label.js +13 -0
- package/node/components/NewStepper/Step/Label/index.d.ts +1 -0
- package/node/components/NewStepper/Step/Label/index.js +5 -0
- package/node/components/NewStepper/Step/Label/styles.d.ts +25 -0
- package/node/components/NewStepper/Step/Label/styles.js +26 -0
- package/node/components/NewStepper/Step/Step.d.ts +2 -0
- package/node/components/NewStepper/Step/Step.js +84 -0
- package/node/components/NewStepper/Step/constants.d.ts +28 -0
- package/node/components/NewStepper/Step/constants.js +28 -0
- package/node/components/NewStepper/Step/index.d.ts +3 -0
- package/node/components/NewStepper/Step/index.js +7 -0
- package/node/components/NewStepper/Step/styles.d.ts +38 -0
- package/node/components/NewStepper/Step/styles.js +315 -0
- package/node/components/NewStepper/Step/types.d.ts +44 -0
- package/node/components/NewStepper/Step/types.js +2 -0
- package/node/components/NewStepper/Step/useLogic/index.d.ts +1 -0
- package/node/components/NewStepper/Step/useLogic/index.js +17 -0
- package/node/components/NewStepper/Step/useLogic/useLogic.d.ts +23 -0
- package/node/components/NewStepper/Step/useLogic/useLogic.js +59 -0
- package/node/components/NewStepper/StepIcon/StepIcon.d.ts +28 -0
- package/node/components/NewStepper/StepIcon/StepIcon.js +38 -0
- package/node/components/NewStepper/StepIcon/constants.d.ts +7 -0
- package/node/components/NewStepper/StepIcon/constants.js +11 -0
- package/node/components/NewStepper/StepIcon/index.d.ts +2 -0
- package/node/components/NewStepper/StepIcon/index.js +7 -0
- package/node/components/NewStepper/StepperContext/StepperContext.d.ts +10 -0
- package/node/components/NewStepper/StepperContext/StepperContext.js +12 -0
- package/node/components/NewStepper/StepperContext/StepperContextProvider/StepperContextProvider.d.ts +7 -0
- package/node/components/NewStepper/StepperContext/StepperContextProvider/StepperContextProvider.js +25 -0
- package/node/components/NewStepper/StepperContext/StepperContextProvider/index.d.ts +1 -0
- package/node/components/NewStepper/StepperContext/StepperContextProvider/index.js +17 -0
- package/node/components/NewStepper/StepperContext/index.d.ts +2 -0
- package/node/components/NewStepper/StepperContext/index.js +18 -0
- package/node/components/NewStepper/constants.d.ts +13 -0
- package/node/components/NewStepper/constants.js +17 -0
- package/node/components/NewStepper/index.d.ts +4 -0
- package/node/components/NewStepper/index.js +10 -0
- package/node/components/NewStepper/public.d.ts +4 -0
- package/node/components/NewStepper/public.js +10 -0
- package/node/components/NewStepper/styles.d.ts +5 -0
- package/node/components/NewStepper/styles.js +47 -0
- package/node/components/NewStepper/types.d.ts +33 -0
- package/node/components/NewStepper/types.js +2 -0
- package/node/components/NewStepper/useLogic/index.d.ts +1 -0
- package/node/components/NewStepper/useLogic/index.js +17 -0
- package/node/components/NewStepper/useLogic/useLogic.d.ts +15 -0
- package/node/components/NewStepper/useLogic/useLogic.js +51 -0
- package/node/components/NewStepper/useLogic/utils/index.d.ts +1 -0
- package/node/components/NewStepper/useLogic/utils/index.js +17 -0
- package/node/components/NewStepper/useLogic/utils/validateStepperProps/index.d.ts +1 -0
- package/node/components/NewStepper/useLogic/utils/validateStepperProps/index.js +17 -0
- package/node/components/NewStepper/useLogic/utils/validateStepperProps/validateStepperProps.d.ts +5 -0
- package/node/components/NewStepper/useLogic/utils/validateStepperProps/validateStepperProps.js +20 -0
- package/node/components/Stepper/Stepper.d.ts +3 -0
- package/node/components/Stepper/Stepper.js +3 -0
- package/node/components/StepperWizard/StepperWizard.d.ts +3 -0
- package/node/components/StepperWizard/StepperWizard.js +3 -0
- package/node/components/Typography/Typography.js +1 -1
- package/node/components/Typography/constants.d.ts +1 -0
- package/node/components/Typography/constants.js +2 -0
- package/node/hook-form/FormWizard/FormWizard.js +3 -2
- package/node/hook-form/FormWizard/styles.d.ts +1 -4
- package/node/hook-form/FormWizard/styles.js +5 -7
- package/node/hook-form/FormWizard/useLogic/useLogic.d.ts +5 -6
- package/node/hook-form/FormWizard/useLogic/useLogic.js +4 -5
- package/node/hook-form/useFormWizard/useFormWizard.js +4 -2
- package/package.json +1 -1
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from '../utils/classNames';
|
|
3
|
+
import { cva } from '../utils/cva';
|
|
4
|
+
import { stepperClassnames } from './constants';
|
|
5
|
+
import { StepperContextProvider } from './StepperContext';
|
|
6
|
+
import { Wrapper } from './styles';
|
|
7
|
+
import { useLogic } from './useLogic';
|
|
8
|
+
const stepper = cva(stepperClassnames.root, {
|
|
9
|
+
variants: {
|
|
10
|
+
orientation: {
|
|
11
|
+
horizontal: stepperClassnames.orientationHorizontal,
|
|
12
|
+
vertical: stepperClassnames.orientationVertical,
|
|
13
|
+
},
|
|
14
|
+
alternativeLabel: {
|
|
15
|
+
true: stepperClassnames.alternativeLabel,
|
|
16
|
+
},
|
|
17
|
+
connector: {
|
|
18
|
+
arrow: stepperClassnames.arrowConnector,
|
|
19
|
+
line: stepperClassnames.lineConnector,
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
});
|
|
23
|
+
export const NewStepper = (props) => {
|
|
24
|
+
const { containerRef, stepperConnector, stepperAlternativeLabel, activeStep, onClickPrevStep, onClickStep, orientation, className, children, } = useLogic(props);
|
|
25
|
+
return (_jsx(StepperContextProvider, { orientation: orientation, activeStep: activeStep, connector: stepperConnector, alternativeLabel: stepperAlternativeLabel, onClickPrevStep: onClickPrevStep, onClickStep: onClickStep, children: _jsx(Wrapper, { ref: containerRef, role: "group", className: classNames(stepper({
|
|
26
|
+
alternativeLabel: stepperAlternativeLabel,
|
|
27
|
+
connector: stepperConnector,
|
|
28
|
+
orientation,
|
|
29
|
+
}), className), children: children }) }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { StyledTypography } from './styles';
|
|
3
|
+
export const Description = ({ children, className }) => {
|
|
4
|
+
if (typeof children === 'string') {
|
|
5
|
+
return (_jsx(StyledTypography, { variant: "caption", className: className, children: children }));
|
|
6
|
+
}
|
|
7
|
+
return (_jsx(StyledTypography, { component: "div", className: className, children: children }));
|
|
8
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Description';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Description';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledTypography: import("../../../styled").StyledComponent<import("../../../Typography/types").TypographyPropsBase & {
|
|
3
|
+
color?: import("../../../Typography").TypographyColor | undefined;
|
|
4
|
+
variant?: import("../../../Typography").TypographyVariant | undefined;
|
|
5
|
+
colorIntensity?: import("../../../Typography").Intensity | undefined;
|
|
6
|
+
component?: import("../../../Typography/types").ComponentProp | undefined;
|
|
7
|
+
isUpperCase?: boolean | undefined;
|
|
8
|
+
withoutCalt?: boolean | undefined;
|
|
9
|
+
} & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
|
|
10
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { styled } from '../../../styled';
|
|
2
|
+
import { Typography } from '../../../Typography';
|
|
3
|
+
export const StyledTypography = styled(Typography) `
|
|
4
|
+
min-height: 22px;
|
|
5
|
+
margin-bottom: ${({ theme }) => theme.microSpacing(1)};
|
|
6
|
+
margin-left: 9px;
|
|
7
|
+
padding-left: 13px;
|
|
8
|
+
|
|
9
|
+
text-align: start;
|
|
10
|
+
|
|
11
|
+
border-left: 2px solid ${({ theme }) => theme.palette.grey[300]};
|
|
12
|
+
|
|
13
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
14
|
+
margin-bottom: 0;
|
|
15
|
+
margin-left: 11px;
|
|
16
|
+
padding-left: 15px;
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { Collapse } from '../../../Collapse';
|
|
3
|
+
import { Typography } from '../../../Typography';
|
|
4
|
+
import { Fade } from '../../../transitions/Fade';
|
|
5
|
+
import { stepClassnames } from '../constants';
|
|
6
|
+
import { DesktopLabel, MobileCompactLabel, MobileLabelGroup } from './styles';
|
|
7
|
+
export const Label = ({ label, isActiveStep }) => {
|
|
8
|
+
return (_jsxs(_Fragment, { children: [_jsx(DesktopLabel, { className: stepClassnames.label, variant: "caption", children: label }), _jsxs(MobileLabelGroup, { className: stepClassnames.labelMobile, children: [_jsx(Collapse, { in: !isActiveStep, orientation: "horizontal", children: _jsx(Fade, { in: !isActiveStep, children: _jsx(MobileCompactLabel, { className: stepClassnames.label, component: "span" }) }) }), _jsx(Collapse, { in: isActiveStep, orientation: "horizontal", children: _jsx(Fade, { in: isActiveStep, children: _jsx(Typography, { className: stepClassnames.label, children: label }) }) })] })] }));
|
|
9
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label } from './Label';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label } from './Label';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MobileLabelGroup: import("../../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const MobileCompactLabel: import("../../../styled").StyledComponent<import("../../../Typography/types").TypographyPropsBase & {
|
|
7
|
+
color?: import("../../../Typography").TypographyColor | undefined;
|
|
8
|
+
variant?: import("../../../Typography").TypographyVariant | undefined;
|
|
9
|
+
colorIntensity?: import("../../../Typography").Intensity | undefined;
|
|
10
|
+
component?: import("../../../Typography/types").ComponentProp | undefined;
|
|
11
|
+
isUpperCase?: boolean | undefined;
|
|
12
|
+
withoutCalt?: boolean | undefined;
|
|
13
|
+
} & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
|
|
14
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
15
|
+
}, {}, {}>;
|
|
16
|
+
export declare const DesktopLabel: import("../../../styled").StyledComponent<import("../../../Typography/types").TypographyPropsBase & {
|
|
17
|
+
color?: import("../../../Typography").TypographyColor | undefined;
|
|
18
|
+
variant?: import("../../../Typography").TypographyVariant | undefined;
|
|
19
|
+
colorIntensity?: import("../../../Typography").Intensity | undefined;
|
|
20
|
+
component?: import("../../../Typography/types").ComponentProp | undefined;
|
|
21
|
+
isUpperCase?: boolean | undefined;
|
|
22
|
+
withoutCalt?: boolean | undefined;
|
|
23
|
+
} & import("react").HTMLAttributes<HTMLParagraphElement> & import("react").RefAttributes<HTMLSpanElement> & {
|
|
24
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
25
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { styled } from '../../../styled';
|
|
2
|
+
import { Typography } from '../../../Typography';
|
|
3
|
+
import { STEPPER_ORDER_COUNTER_NAME } from '../../constants';
|
|
4
|
+
export const MobileLabelGroup = styled.div `
|
|
5
|
+
display: none;
|
|
6
|
+
|
|
7
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
8
|
+
display: flex;
|
|
9
|
+
align-items: center;
|
|
10
|
+
}
|
|
11
|
+
`;
|
|
12
|
+
export const MobileCompactLabel = styled(Typography) `
|
|
13
|
+
display: inline-block;
|
|
14
|
+
|
|
15
|
+
&::before {
|
|
16
|
+
content: counter(${STEPPER_ORDER_COUNTER_NAME});
|
|
17
|
+
}
|
|
18
|
+
`;
|
|
19
|
+
export const DesktopLabel = styled(Typography) `
|
|
20
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
`;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { classNames } from '../../utils/classNames';
|
|
3
|
+
import { cva } from '../../utils/cva';
|
|
4
|
+
import { StepIcon } from '../StepIcon';
|
|
5
|
+
import { stepClassnames } from './constants';
|
|
6
|
+
import { Description } from './Description';
|
|
7
|
+
import { Label } from './Label';
|
|
8
|
+
import { ArrowConnector, IconWrapper, LabelWrapper, LineConnector, StepContentWrapper, StyledButton, Wrapper, } from './styles';
|
|
9
|
+
import { useLogic } from './useLogic';
|
|
10
|
+
const step = cva(stepClassnames.root, {
|
|
11
|
+
variants: {
|
|
12
|
+
isError: {
|
|
13
|
+
true: stepClassnames.error,
|
|
14
|
+
},
|
|
15
|
+
isCompleted: {
|
|
16
|
+
true: stepClassnames.completed,
|
|
17
|
+
},
|
|
18
|
+
connector: {
|
|
19
|
+
arrow: stepClassnames.connectorArrow,
|
|
20
|
+
line: stepClassnames.connectorLine,
|
|
21
|
+
},
|
|
22
|
+
activeStep: {
|
|
23
|
+
true: stepClassnames.active,
|
|
24
|
+
},
|
|
25
|
+
alternativeLabel: {
|
|
26
|
+
true: stepClassnames.alternativeLabel,
|
|
27
|
+
},
|
|
28
|
+
orientation: {
|
|
29
|
+
horizontal: stepClassnames.orientationHorizontal,
|
|
30
|
+
vertical: stepClassnames.orientationVertical,
|
|
31
|
+
},
|
|
32
|
+
isDisabled: {
|
|
33
|
+
true: stepClassnames.disabled,
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
});
|
|
37
|
+
const connector = cva(stepClassnames.connector, {
|
|
38
|
+
variants: {
|
|
39
|
+
connector: {
|
|
40
|
+
arrow: stepClassnames.connectorArrow,
|
|
41
|
+
line: stepClassnames.connectorLine,
|
|
42
|
+
},
|
|
43
|
+
alternativeLabel: {
|
|
44
|
+
true: stepClassnames.alternativeLabel,
|
|
45
|
+
},
|
|
46
|
+
orientation: {
|
|
47
|
+
horizontal: stepClassnames.orientationHorizontal,
|
|
48
|
+
vertical: stepClassnames.orientationVertical,
|
|
49
|
+
},
|
|
50
|
+
hasDescription: {
|
|
51
|
+
true: stepClassnames.hasDescription,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
});
|
|
55
|
+
export const Step = (props) => {
|
|
56
|
+
const { isCompletedStep, isRenderButton, handleClick, connectorVariant, alternativeLabel, orientation, children, isError, isWarning, icon, className, label, isRenderVerticalLineConnector, isRenderHorizontalLineConnector, isDisabled, isActiveStep, } = useLogic(props);
|
|
57
|
+
const StepContent = isRenderButton ? StyledButton : StepContentWrapper;
|
|
58
|
+
return (_jsxs(Wrapper, { "data-active-step": isActiveStep, className: classNames(step({
|
|
59
|
+
isError,
|
|
60
|
+
isCompleted: isCompletedStep,
|
|
61
|
+
connector: connectorVariant,
|
|
62
|
+
activeStep: isActiveStep,
|
|
63
|
+
alternativeLabel,
|
|
64
|
+
orientation,
|
|
65
|
+
isDisabled,
|
|
66
|
+
}), className), children: [_jsxs(StepContent, { variant: "text", onClick: handleClick, disabled: isDisabled, className: classNames(stepClassnames.content, {
|
|
67
|
+
[stepClassnames.active]: isActiveStep,
|
|
68
|
+
}), children: [_jsxs(LabelWrapper, { className: stepClassnames.labelContainer, children: [_jsx(IconWrapper, { className: stepClassnames.iconContainer, children: _jsx(StepIcon, { icon: icon, isActive: isActiveStep, isCompleted: isCompletedStep, isError: isError, isWarning: isWarning }) }), _jsx(Label, { label: label, isActiveStep: isActiveStep }), connectorVariant === 'arrow' && (_jsx(ArrowConnector, { className: connector({
|
|
69
|
+
connector: connectorVariant,
|
|
70
|
+
alternativeLabel,
|
|
71
|
+
orientation,
|
|
72
|
+
}) }))] }), children && (_jsx(Description, { className: stepClassnames.description, children: children })), isRenderVerticalLineConnector && (_jsx(LineConnector, { className: connector({
|
|
73
|
+
connector: connectorVariant,
|
|
74
|
+
orientation,
|
|
75
|
+
}) }))] }), isRenderHorizontalLineConnector && (_jsx(LineConnector, { className: connector({
|
|
76
|
+
connector: connectorVariant,
|
|
77
|
+
alternativeLabel,
|
|
78
|
+
orientation,
|
|
79
|
+
}) }))] }));
|
|
80
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export declare const stepStateClassnames: {
|
|
2
|
+
active: string;
|
|
3
|
+
completed: string;
|
|
4
|
+
error: string;
|
|
5
|
+
warning: string;
|
|
6
|
+
disabled: string;
|
|
7
|
+
};
|
|
8
|
+
export declare const stepClassnames: {
|
|
9
|
+
active: string;
|
|
10
|
+
completed: string;
|
|
11
|
+
error: string;
|
|
12
|
+
warning: string;
|
|
13
|
+
disabled: string;
|
|
14
|
+
root: string;
|
|
15
|
+
label: string;
|
|
16
|
+
description: string;
|
|
17
|
+
iconContainer: string;
|
|
18
|
+
connector: string;
|
|
19
|
+
connectorLine: string;
|
|
20
|
+
connectorArrow: string;
|
|
21
|
+
alternativeLabel: string;
|
|
22
|
+
orientationHorizontal: string;
|
|
23
|
+
orientationVertical: string;
|
|
24
|
+
labelContainer: string;
|
|
25
|
+
labelMobile: string;
|
|
26
|
+
content: string;
|
|
27
|
+
hasDescription: string;
|
|
28
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { createUIKitClassname } from '../../utils/createUIKitClassname';
|
|
2
|
+
export const stepStateClassnames = {
|
|
3
|
+
active: createUIKitClassname('step_active'),
|
|
4
|
+
completed: createUIKitClassname('step_completed'),
|
|
5
|
+
error: createUIKitClassname('step_error'),
|
|
6
|
+
warning: createUIKitClassname('step_warning'),
|
|
7
|
+
disabled: createUIKitClassname('step_disabled'),
|
|
8
|
+
};
|
|
9
|
+
export const stepClassnames = {
|
|
10
|
+
root: createUIKitClassname('step'),
|
|
11
|
+
label: createUIKitClassname('step__label'),
|
|
12
|
+
description: createUIKitClassname('step__description'),
|
|
13
|
+
iconContainer: createUIKitClassname('step__icon-container'),
|
|
14
|
+
connector: createUIKitClassname('step__connector'),
|
|
15
|
+
connectorLine: createUIKitClassname('step_connector-line'),
|
|
16
|
+
connectorArrow: createUIKitClassname('step_connector-arrow'),
|
|
17
|
+
alternativeLabel: createUIKitClassname('step_alternative-label'),
|
|
18
|
+
orientationHorizontal: createUIKitClassname('step_orientation-horizontal'),
|
|
19
|
+
orientationVertical: createUIKitClassname('step_orientation-vertical'),
|
|
20
|
+
labelContainer: createUIKitClassname('step__label-container'),
|
|
21
|
+
labelMobile: createUIKitClassname('step__label-mobile'),
|
|
22
|
+
content: createUIKitClassname('step__content'),
|
|
23
|
+
hasDescription: createUIKitClassname('step_has-description'),
|
|
24
|
+
...stepStateClassnames,
|
|
25
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("../../styled").StyledComponent<{
|
|
3
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
4
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
5
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
+
export declare const IconWrapper: import("../../styled").StyledComponent<{
|
|
7
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
8
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
+
export declare const ArrowConnector: import("../../styled").StyledComponent<{
|
|
11
|
+
children?: import("react").ReactNode;
|
|
12
|
+
color?: string | undefined;
|
|
13
|
+
titleAccess?: string | undefined;
|
|
14
|
+
size?: "sm" | "md" | undefined;
|
|
15
|
+
} & import("react").SVGProps<SVGSVGElement> & {
|
|
16
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
17
|
+
}, {}, {}>;
|
|
18
|
+
export declare const LineConnector: import("../../styled").StyledComponent<{
|
|
19
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
20
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
21
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
22
|
+
export declare const LabelWrapper: import("../../styled").StyledComponent<{
|
|
23
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
24
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
25
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
26
|
+
export declare const StepContentWrapper: import("../../styled").StyledComponent<{
|
|
27
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
28
|
+
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
29
|
+
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
30
|
+
export declare const StyledButton: import("../../styled").StyledComponent<Omit<import("../..").WithoutEmotionSpecific<import("@mui/material").ButtonProps>, "color" | "component" | "variant" | "centerRipple" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple"> & {
|
|
31
|
+
variant?: "light" | "link" | "text" | "contained" | "outlined" | undefined;
|
|
32
|
+
loading?: boolean | undefined;
|
|
33
|
+
color?: "primary" | "success" | "warning" | "error" | "grey" | undefined;
|
|
34
|
+
component?: import("react").ElementType | undefined;
|
|
35
|
+
selected?: boolean | undefined;
|
|
36
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, ""> & import("react").RefAttributes<HTMLButtonElement> & {
|
|
37
|
+
theme?: import("@emotion/react").Theme | undefined;
|
|
38
|
+
}, {}, {}>;
|
|
@@ -0,0 +1,312 @@
|
|
|
1
|
+
import { NextOutlineMd } from '../../../icons/NextOutlineMd';
|
|
2
|
+
import { Button } from '../../Button';
|
|
3
|
+
import { styled } from '../../styled';
|
|
4
|
+
import { typographyClassnames } from '../../Typography/constants';
|
|
5
|
+
import { STEPPER_ORDER_COUNTER_NAME } from '../constants';
|
|
6
|
+
import { stepIconClassnames } from '../StepIcon/constants';
|
|
7
|
+
import { stepClassnames } from './constants';
|
|
8
|
+
export const Wrapper = styled.div `
|
|
9
|
+
counter-increment: ${STEPPER_ORDER_COUNTER_NAME};
|
|
10
|
+
|
|
11
|
+
display: flex;
|
|
12
|
+
gap: ${({ theme }) => theme.microSpacing(5)};
|
|
13
|
+
align-items: center;
|
|
14
|
+
|
|
15
|
+
&.${stepClassnames.alternativeLabel} {
|
|
16
|
+
position: relative;
|
|
17
|
+
|
|
18
|
+
flex: 1;
|
|
19
|
+
flex-direction: column;
|
|
20
|
+
|
|
21
|
+
& .${stepClassnames.labelContainer} {
|
|
22
|
+
flex-direction: column;
|
|
23
|
+
|
|
24
|
+
text-align: center;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
&:first-of-type {
|
|
28
|
+
& .${stepClassnames.connector} {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
&.${stepClassnames.connectorArrow} {
|
|
35
|
+
& .${stepClassnames.content} {
|
|
36
|
+
padding: ${({ theme }) => theme.microSpacing(5, 0)};
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
&:not(:first-of-type) .${stepClassnames.content} {
|
|
40
|
+
margin-left: ${({ theme }) => theme.spacing(2)};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:last-of-type .${stepClassnames.connector} {
|
|
44
|
+
display: none;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
&.${stepClassnames.connectorLine} {
|
|
49
|
+
&.${stepClassnames.orientationHorizontal} {
|
|
50
|
+
& .${stepClassnames.content} {
|
|
51
|
+
align-items: center;
|
|
52
|
+
|
|
53
|
+
padding: ${({ theme }) => theme.spacing(0, 1)};
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
&.${stepClassnames.alternativeLabel} {
|
|
58
|
+
& .${stepClassnames.content} {
|
|
59
|
+
padding: ${({ theme }) => theme.microSpacing(3, 0)};
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
&.${stepClassnames.orientationVertical} {
|
|
65
|
+
|
|
66
|
+
& .${stepClassnames.label} {
|
|
67
|
+
font-size: ${({ theme }) => theme.typography.body1.fontSize};
|
|
68
|
+
line-height: ${({ theme }) => theme.typography.body1.lineHeight};
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
& .${stepClassnames.content} {
|
|
72
|
+
padding: ${({ theme }) => theme.spacing(1, 0, 0)};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
& .${stepClassnames.connector}:not(.${stepClassnames.hasDescription}) {
|
|
76
|
+
margin-bottom: ${({ theme }) => theme.microSpacing(1)};
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
&:last-of-type {
|
|
80
|
+
& .${stepClassnames.description} {
|
|
81
|
+
min-height: 0;
|
|
82
|
+
margin: 0;
|
|
83
|
+
padding-left: ${({ theme }) => theme.spacing(6)};
|
|
84
|
+
|
|
85
|
+
border-left: none;
|
|
86
|
+
|
|
87
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
88
|
+
padding-left: ${({ theme }) => theme.spacing(7)};
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
& .${stepClassnames.connector} {
|
|
93
|
+
display: none;
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
&:last-of-type {
|
|
98
|
+
& .${stepClassnames.content} {
|
|
99
|
+
padding: ${({ theme }) => theme.spacing(1, 0)};
|
|
100
|
+
|
|
101
|
+
& .${stepClassnames.description} {
|
|
102
|
+
margin-bottom: 0;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
& .${stepClassnames.labelMobile} {
|
|
108
|
+
display: none;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
& .${stepClassnames.label} {
|
|
112
|
+
display: block;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
& .${stepClassnames.content} {
|
|
118
|
+
&.${stepClassnames.active} {
|
|
119
|
+
& .${stepClassnames.label} {
|
|
120
|
+
color: ${({ theme }) => theme.palette.grey[900]};
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
& .${stepIconClassnames.root} {
|
|
124
|
+
color: ${({ theme }) => theme.palette.primary[800]};
|
|
125
|
+
|
|
126
|
+
&.${stepIconClassnames.success} {
|
|
127
|
+
color: ${({ theme }) => theme.palette.success[800]};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
&.${stepIconClassnames.error} {
|
|
131
|
+
color: ${({ theme }) => theme.palette.error[800]};
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
&.${stepIconClassnames.warning} {
|
|
135
|
+
color: ${({ theme }) => theme.palette.warning[800]};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`;
|
|
141
|
+
export const IconWrapper = styled.div `
|
|
142
|
+
display: flex;
|
|
143
|
+
|
|
144
|
+
& .${stepIconClassnames.root} {
|
|
145
|
+
width: 20px;
|
|
146
|
+
height: 20px;
|
|
147
|
+
|
|
148
|
+
color: ${({ theme }) => theme.palette.grey[300]};
|
|
149
|
+
|
|
150
|
+
transition: ${({ theme }) => theme.transitions.create(['color'], {
|
|
151
|
+
duration: theme.transitions.duration.shorter,
|
|
152
|
+
})};
|
|
153
|
+
|
|
154
|
+
&.${stepIconClassnames.active} {
|
|
155
|
+
color: ${({ theme }) => theme.palette.primary[800]};
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
&.${stepIconClassnames.success} {
|
|
159
|
+
color: ${({ theme }) => theme.palette.success[800]};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
&.${stepIconClassnames.error} {
|
|
163
|
+
color: ${({ theme }) => theme.palette.error[800]};
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
&.${stepIconClassnames.warning} {
|
|
167
|
+
color: ${({ theme }) => theme.palette.warning[800]};
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
171
|
+
width: 24px;
|
|
172
|
+
height: 24px;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
`;
|
|
176
|
+
export const ArrowConnector = styled(NextOutlineMd) `
|
|
177
|
+
width: 20px;
|
|
178
|
+
height: 20px;
|
|
179
|
+
|
|
180
|
+
color: ${({ theme }) => theme.palette.grey[400]};
|
|
181
|
+
|
|
182
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
183
|
+
width: 24px;
|
|
184
|
+
height: 24px;
|
|
185
|
+
}
|
|
186
|
+
`;
|
|
187
|
+
export const LineConnector = styled.div `
|
|
188
|
+
flex: 1 1 auto;
|
|
189
|
+
|
|
190
|
+
height: 2px;
|
|
191
|
+
|
|
192
|
+
border-top: 2px solid ${({ theme }) => theme.palette.grey[300]};
|
|
193
|
+
|
|
194
|
+
&.${stepClassnames.alternativeLabel} {
|
|
195
|
+
position: absolute;
|
|
196
|
+
top: 15px;
|
|
197
|
+
right: calc(50% + 14px);
|
|
198
|
+
left: calc(-50% + 14px);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
&.${stepClassnames.orientationVertical} {
|
|
202
|
+
min-height: 16px;
|
|
203
|
+
|
|
204
|
+
/* Смещение необходимо для центрирования линии относительно иконки, т.к. линия шириной 2px, то для выравнивания необходимо число не кратное 2ум */
|
|
205
|
+
margin-left: 9px;
|
|
206
|
+
|
|
207
|
+
border-top: unset;
|
|
208
|
+
border-left: 2px solid ${({ theme }) => theme.palette.grey[300]};
|
|
209
|
+
|
|
210
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
211
|
+
margin-left: 11px;
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
`;
|
|
215
|
+
export const LabelWrapper = styled.div `
|
|
216
|
+
display: flex;
|
|
217
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
218
|
+
align-items: center;
|
|
219
|
+
|
|
220
|
+
color: ${({ theme }) => theme.palette.grey[600]};
|
|
221
|
+
|
|
222
|
+
& .${typographyClassnames.root} {
|
|
223
|
+
transition: ${({ theme }) => theme.transitions.create(['color'], {
|
|
224
|
+
duration: theme.transitions.duration.shorter,
|
|
225
|
+
})};
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
229
|
+
white-space: nowrap;
|
|
230
|
+
}
|
|
231
|
+
`;
|
|
232
|
+
export const StepContentWrapper = styled.div `
|
|
233
|
+
display: flex;
|
|
234
|
+
flex-direction: column;
|
|
235
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
236
|
+
|
|
237
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
238
|
+
gap: ${({ theme }) => theme.microSpacing(1)};
|
|
239
|
+
}
|
|
240
|
+
`;
|
|
241
|
+
export const StyledButton = styled(Button) `
|
|
242
|
+
cursor: pointer;
|
|
243
|
+
|
|
244
|
+
display: flex;
|
|
245
|
+
flex-direction: column;
|
|
246
|
+
gap: ${({ theme }) => theme.spacing(1)};
|
|
247
|
+
align-items: flex-start;
|
|
248
|
+
justify-content: flex-start;
|
|
249
|
+
|
|
250
|
+
width: 100%;
|
|
251
|
+
height: auto;
|
|
252
|
+
padding: 0;
|
|
253
|
+
|
|
254
|
+
background: transparent;
|
|
255
|
+
border: 0;
|
|
256
|
+
|
|
257
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
258
|
+
gap: ${({ theme }) => theme.microSpacing(1)};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
&:hover {
|
|
262
|
+
background: transparent;
|
|
263
|
+
|
|
264
|
+
& .${stepClassnames.label} {
|
|
265
|
+
color: ${({ theme }) => theme.palette.grey[700]};
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
& .${stepIconClassnames.root} {
|
|
269
|
+
color: ${({ theme }) => theme.palette.primary[700]};
|
|
270
|
+
|
|
271
|
+
&.${stepIconClassnames.success} {
|
|
272
|
+
color: ${({ theme }) => theme.palette.success[700]};
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
&.${stepIconClassnames.error} {
|
|
276
|
+
color: ${({ theme }) => theme.palette.error[700]};
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
&.${stepIconClassnames.warning} {
|
|
280
|
+
color: ${({ theme }) => theme.palette.warning[700]};
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
&:active {
|
|
286
|
+
background: transparent;
|
|
287
|
+
& .${stepClassnames.label} {
|
|
288
|
+
color: ${({ theme }) => theme.palette.grey[900]};
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
& .${stepIconClassnames.root} {
|
|
292
|
+
color: ${({ theme }) => theme.palette.primary[800]};
|
|
293
|
+
|
|
294
|
+
&.${stepIconClassnames.success} {
|
|
295
|
+
color: ${({ theme }) => theme.palette.success[800]};
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
&.${stepIconClassnames.error} {
|
|
299
|
+
color: ${({ theme }) => theme.palette.error[800]};
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
&.${stepIconClassnames.warning} {
|
|
303
|
+
color: ${({ theme }) => theme.palette.warning[700]};
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
&:focus-visible {
|
|
309
|
+
border-radius: ${({ theme }) => theme.shape.medium};
|
|
310
|
+
outline: 1px solid ${({ theme }) => theme.palette.components.focused};
|
|
311
|
+
}
|
|
312
|
+
`;
|