@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
|
@@ -7,10 +7,7 @@ export declare const BeforeContentWrapper: import("../../components/styled").Sty
|
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any, keyof import("react").JSX.IntrinsicElements> | undefined;
|
|
9
9
|
}, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
10
|
-
export declare const
|
|
11
|
-
steps: import("../../components/StepperWizard").StepWizard[];
|
|
12
|
-
onClickPrevStep?: ((index: number) => void) | undefined;
|
|
13
|
-
} & {
|
|
10
|
+
export declare const StyledNewStepper: import("../../components/styled").StyledComponent<import("../../components/NewStepper").StepperProps & {
|
|
14
11
|
theme?: import("@emotion/react").Theme | undefined;
|
|
15
12
|
}, {}, {}>;
|
|
16
13
|
export declare const FormContent: import("../../components/styled").StyledComponent<{
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { NewStepper } from '../../components/NewStepper';
|
|
2
2
|
import { styled } from '../../components/styled';
|
|
3
3
|
export const Wrapper = styled.section `
|
|
4
4
|
display: flex;
|
|
@@ -13,14 +13,12 @@ export const BeforeContentWrapper = styled.div `
|
|
|
13
13
|
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
14
14
|
}
|
|
15
15
|
`;
|
|
16
|
-
export const
|
|
17
|
-
margin-bottom: ${({ theme }) => theme.spacing(
|
|
16
|
+
export const StyledNewStepper = styled(NewStepper) `
|
|
17
|
+
margin-bottom: ${({ theme }) => theme.spacing(5)};
|
|
18
18
|
padding: ${({ theme }) => theme.spacing(0, 6)};
|
|
19
19
|
|
|
20
20
|
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
margin-bottom: ${({ theme }) => theme.spacing(6)};
|
|
21
|
+
margin-bottom: ${({ theme }) => theme.spacing(4)};
|
|
24
22
|
padding: ${({ theme }) => theme.spacing(0, 4)};
|
|
25
23
|
}
|
|
26
24
|
`;
|
|
@@ -3,12 +3,11 @@ import { type FormWizardProps } from '../FormWizard';
|
|
|
3
3
|
type UseLogicParams<TFormValues extends Record<string, unknown>> = FormWizardProps<TFormValues>;
|
|
4
4
|
export declare const useLogic: <TFormValues extends Record<string, unknown>>({ currentStepId, steps, submitButtonText, isLastStep, }: UseLogicParams<TFormValues>) => {
|
|
5
5
|
Component: import("react").FunctionComponent<{}>;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
6
|
+
steps: {
|
|
7
|
+
label: string;
|
|
8
|
+
stepId: number;
|
|
9
|
+
}[];
|
|
10
|
+
activeStep: number;
|
|
12
11
|
footerProps: {
|
|
13
12
|
prevButtonText: string;
|
|
14
13
|
submitButtonText: string;
|
|
@@ -5,17 +5,16 @@ export const useLogic = ({ currentStepId, steps, submitButtonText, isLastStep, }
|
|
|
5
5
|
? steps?.findIndex(({ id }) => Object.is(id, currentStepId))
|
|
6
6
|
: 0, [currentStepId, steps]);
|
|
7
7
|
const currentStep = steps[indexStep];
|
|
8
|
-
const stepsByLabel = steps.map(({ label }) => ({
|
|
8
|
+
const stepsByLabel = steps.map(({ label }, index) => ({
|
|
9
9
|
label,
|
|
10
|
+
stepId: index,
|
|
10
11
|
}));
|
|
11
12
|
const prevButtonText = currentStep.prevButtonText || DEFAULT_PREV_BUTTON_TEXT;
|
|
12
13
|
const nextButtonText = currentStep.nextButtonText || DEFAULT_NEXT_BUTTON_TEXT;
|
|
13
14
|
return {
|
|
14
15
|
Component: currentStep.component,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
steps: stepsByLabel,
|
|
18
|
-
},
|
|
16
|
+
steps: stepsByLabel,
|
|
17
|
+
activeStep: indexStep,
|
|
19
18
|
footerProps: {
|
|
20
19
|
prevButtonText,
|
|
21
20
|
submitButtonText: isLastStep ? submitButtonText : nextButtonText,
|
|
@@ -65,8 +65,10 @@ export const useFormWizard = ({ initialStepId, defaultValues, isDisabled, steps,
|
|
|
65
65
|
return;
|
|
66
66
|
};
|
|
67
67
|
const handleClickStep = (index) => {
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (index < 0 || index >= visibleSteps.length) {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
setCurrentStepId(visibleSteps[index].id);
|
|
70
72
|
};
|
|
71
73
|
const handlePrevStep = () => {
|
|
72
74
|
if (isFirstStep) {
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NewStepper = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const classNames_1 = require("../utils/classNames");
|
|
6
|
+
const cva_1 = require("../utils/cva");
|
|
7
|
+
const constants_1 = require("./constants");
|
|
8
|
+
const StepperContext_1 = require("./StepperContext");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
const useLogic_1 = require("./useLogic");
|
|
11
|
+
const stepper = (0, cva_1.cva)(constants_1.stepperClassnames.root, {
|
|
12
|
+
variants: {
|
|
13
|
+
orientation: {
|
|
14
|
+
horizontal: constants_1.stepperClassnames.orientationHorizontal,
|
|
15
|
+
vertical: constants_1.stepperClassnames.orientationVertical,
|
|
16
|
+
},
|
|
17
|
+
alternativeLabel: {
|
|
18
|
+
true: constants_1.stepperClassnames.alternativeLabel,
|
|
19
|
+
},
|
|
20
|
+
connector: {
|
|
21
|
+
arrow: constants_1.stepperClassnames.arrowConnector,
|
|
22
|
+
line: constants_1.stepperClassnames.lineConnector,
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
26
|
+
const NewStepper = (props) => {
|
|
27
|
+
const { containerRef, stepperConnector, stepperAlternativeLabel, activeStep, onClickPrevStep, onClickStep, orientation, className, children, } = (0, useLogic_1.useLogic)(props);
|
|
28
|
+
return ((0, jsx_runtime_1.jsx)(StepperContext_1.StepperContextProvider, { orientation: orientation, activeStep: activeStep, connector: stepperConnector, alternativeLabel: stepperAlternativeLabel, onClickPrevStep: onClickPrevStep, onClickStep: onClickStep, children: (0, jsx_runtime_1.jsx)(styles_1.Wrapper, { ref: containerRef, role: "group", className: (0, classNames_1.classNames)(stepper({
|
|
29
|
+
alternativeLabel: stepperAlternativeLabel,
|
|
30
|
+
connector: stepperConnector,
|
|
31
|
+
orientation,
|
|
32
|
+
}), className), children: children }) }));
|
|
33
|
+
};
|
|
34
|
+
exports.NewStepper = NewStepper;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Description = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const styles_1 = require("./styles");
|
|
6
|
+
const Description = ({ children, className }) => {
|
|
7
|
+
if (typeof children === 'string') {
|
|
8
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTypography, { variant: "caption", className: className, children: children }));
|
|
9
|
+
}
|
|
10
|
+
return ((0, jsx_runtime_1.jsx)(styles_1.StyledTypography, { component: "div", className: className, children: children }));
|
|
11
|
+
};
|
|
12
|
+
exports.Description = Description;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Description';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./Description"), exports);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const StyledTypography: import("@emotion/styled/dist/declarations/src/types").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,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.StyledTypography = void 0;
|
|
4
|
+
const styled_1 = require("../../../styled");
|
|
5
|
+
const Typography_1 = require("../../../Typography");
|
|
6
|
+
exports.StyledTypography = (0, styled_1.styled)(Typography_1.Typography) `
|
|
7
|
+
min-height: 22px;
|
|
8
|
+
margin-bottom: ${({ theme }) => theme.microSpacing(1)};
|
|
9
|
+
margin-left: 9px;
|
|
10
|
+
padding-left: 13px;
|
|
11
|
+
|
|
12
|
+
text-align: start;
|
|
13
|
+
|
|
14
|
+
border-left: 2px solid ${({ theme }) => theme.palette.grey[300]};
|
|
15
|
+
|
|
16
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
17
|
+
margin-bottom: 0;
|
|
18
|
+
margin-left: 11px;
|
|
19
|
+
padding-left: 15px;
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Label = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Collapse_1 = require("../../../Collapse");
|
|
6
|
+
const Typography_1 = require("../../../Typography");
|
|
7
|
+
const Fade_1 = require("../../../transitions/Fade");
|
|
8
|
+
const constants_1 = require("../constants");
|
|
9
|
+
const styles_1 = require("./styles");
|
|
10
|
+
const Label = ({ label, isActiveStep }) => {
|
|
11
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(styles_1.DesktopLabel, { className: constants_1.stepClassnames.label, variant: "caption", children: label }), (0, jsx_runtime_1.jsxs)(styles_1.MobileLabelGroup, { className: constants_1.stepClassnames.labelMobile, children: [(0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { in: !isActiveStep, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: !isActiveStep, children: (0, jsx_runtime_1.jsx)(styles_1.MobileCompactLabel, { className: constants_1.stepClassnames.label, component: "span" }) }) }), (0, jsx_runtime_1.jsx)(Collapse_1.Collapse, { in: isActiveStep, orientation: "horizontal", children: (0, jsx_runtime_1.jsx)(Fade_1.Fade, { in: isActiveStep, children: (0, jsx_runtime_1.jsx)(Typography_1.Typography, { className: constants_1.stepClassnames.label, children: label }) }) })] })] }));
|
|
12
|
+
};
|
|
13
|
+
exports.Label = Label;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Label } from './Label';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const MobileLabelGroup: import("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DesktopLabel = exports.MobileCompactLabel = exports.MobileLabelGroup = void 0;
|
|
4
|
+
const styled_1 = require("../../../styled");
|
|
5
|
+
const Typography_1 = require("../../../Typography");
|
|
6
|
+
const constants_1 = require("../../constants");
|
|
7
|
+
exports.MobileLabelGroup = styled_1.styled.div `
|
|
8
|
+
display: none;
|
|
9
|
+
|
|
10
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
11
|
+
display: flex;
|
|
12
|
+
align-items: center;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
exports.MobileCompactLabel = (0, styled_1.styled)(Typography_1.Typography) `
|
|
16
|
+
display: inline-block;
|
|
17
|
+
|
|
18
|
+
&::before {
|
|
19
|
+
content: counter(${constants_1.STEPPER_ORDER_COUNTER_NAME});
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
exports.DesktopLabel = (0, styled_1.styled)(Typography_1.Typography) `
|
|
23
|
+
${({ theme }) => theme.breakpoints.down('sm')} {
|
|
24
|
+
display: none;
|
|
25
|
+
}
|
|
26
|
+
`;
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Step = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const classNames_1 = require("../../utils/classNames");
|
|
6
|
+
const cva_1 = require("../../utils/cva");
|
|
7
|
+
const StepIcon_1 = require("../StepIcon");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
const Description_1 = require("./Description");
|
|
10
|
+
const Label_1 = require("./Label");
|
|
11
|
+
const styles_1 = require("./styles");
|
|
12
|
+
const useLogic_1 = require("./useLogic");
|
|
13
|
+
const step = (0, cva_1.cva)(constants_1.stepClassnames.root, {
|
|
14
|
+
variants: {
|
|
15
|
+
isError: {
|
|
16
|
+
true: constants_1.stepClassnames.error,
|
|
17
|
+
},
|
|
18
|
+
isCompleted: {
|
|
19
|
+
true: constants_1.stepClassnames.completed,
|
|
20
|
+
},
|
|
21
|
+
connector: {
|
|
22
|
+
arrow: constants_1.stepClassnames.connectorArrow,
|
|
23
|
+
line: constants_1.stepClassnames.connectorLine,
|
|
24
|
+
},
|
|
25
|
+
activeStep: {
|
|
26
|
+
true: constants_1.stepClassnames.active,
|
|
27
|
+
},
|
|
28
|
+
alternativeLabel: {
|
|
29
|
+
true: constants_1.stepClassnames.alternativeLabel,
|
|
30
|
+
},
|
|
31
|
+
orientation: {
|
|
32
|
+
horizontal: constants_1.stepClassnames.orientationHorizontal,
|
|
33
|
+
vertical: constants_1.stepClassnames.orientationVertical,
|
|
34
|
+
},
|
|
35
|
+
isDisabled: {
|
|
36
|
+
true: constants_1.stepClassnames.disabled,
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
const connector = (0, cva_1.cva)(constants_1.stepClassnames.connector, {
|
|
41
|
+
variants: {
|
|
42
|
+
connector: {
|
|
43
|
+
arrow: constants_1.stepClassnames.connectorArrow,
|
|
44
|
+
line: constants_1.stepClassnames.connectorLine,
|
|
45
|
+
},
|
|
46
|
+
alternativeLabel: {
|
|
47
|
+
true: constants_1.stepClassnames.alternativeLabel,
|
|
48
|
+
},
|
|
49
|
+
orientation: {
|
|
50
|
+
horizontal: constants_1.stepClassnames.orientationHorizontal,
|
|
51
|
+
vertical: constants_1.stepClassnames.orientationVertical,
|
|
52
|
+
},
|
|
53
|
+
hasDescription: {
|
|
54
|
+
true: constants_1.stepClassnames.hasDescription,
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
});
|
|
58
|
+
const Step = (props) => {
|
|
59
|
+
const { isCompletedStep, isRenderButton, handleClick, connectorVariant, alternativeLabel, orientation, children, isError, isWarning, icon, className, label, isRenderVerticalLineConnector, isRenderHorizontalLineConnector, isDisabled, isActiveStep, } = (0, useLogic_1.useLogic)(props);
|
|
60
|
+
const StepContent = isRenderButton ? styles_1.StyledButton : styles_1.StepContentWrapper;
|
|
61
|
+
return ((0, jsx_runtime_1.jsxs)(styles_1.Wrapper, { "data-active-step": isActiveStep, className: (0, classNames_1.classNames)(step({
|
|
62
|
+
isError,
|
|
63
|
+
isCompleted: isCompletedStep,
|
|
64
|
+
connector: connectorVariant,
|
|
65
|
+
activeStep: isActiveStep,
|
|
66
|
+
alternativeLabel,
|
|
67
|
+
orientation,
|
|
68
|
+
isDisabled,
|
|
69
|
+
}), className), children: [(0, jsx_runtime_1.jsxs)(StepContent, { variant: "text", onClick: handleClick, disabled: isDisabled, className: (0, classNames_1.classNames)(constants_1.stepClassnames.content, {
|
|
70
|
+
[constants_1.stepClassnames.active]: isActiveStep,
|
|
71
|
+
}), children: [(0, jsx_runtime_1.jsxs)(styles_1.LabelWrapper, { className: constants_1.stepClassnames.labelContainer, children: [(0, jsx_runtime_1.jsx)(styles_1.IconWrapper, { className: constants_1.stepClassnames.iconContainer, children: (0, jsx_runtime_1.jsx)(StepIcon_1.StepIcon, { icon: icon, isActive: isActiveStep, isCompleted: isCompletedStep, isError: isError, isWarning: isWarning }) }), (0, jsx_runtime_1.jsx)(Label_1.Label, { label: label, isActiveStep: isActiveStep }), connectorVariant === 'arrow' && ((0, jsx_runtime_1.jsx)(styles_1.ArrowConnector, { className: connector({
|
|
72
|
+
connector: connectorVariant,
|
|
73
|
+
alternativeLabel,
|
|
74
|
+
orientation,
|
|
75
|
+
}) }))] }), children && ((0, jsx_runtime_1.jsx)(Description_1.Description, { className: constants_1.stepClassnames.description, children: children })), isRenderVerticalLineConnector && ((0, jsx_runtime_1.jsx)(styles_1.LineConnector, { className: connector({
|
|
76
|
+
connector: connectorVariant,
|
|
77
|
+
orientation,
|
|
78
|
+
}) }))] }), isRenderHorizontalLineConnector && ((0, jsx_runtime_1.jsx)(styles_1.LineConnector, { className: connector({
|
|
79
|
+
connector: connectorVariant,
|
|
80
|
+
alternativeLabel,
|
|
81
|
+
orientation,
|
|
82
|
+
}) }))] }));
|
|
83
|
+
};
|
|
84
|
+
exports.Step = Step;
|
|
@@ -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,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stepClassnames = exports.stepStateClassnames = void 0;
|
|
4
|
+
const createUIKitClassname_1 = require("../../utils/createUIKitClassname");
|
|
5
|
+
exports.stepStateClassnames = {
|
|
6
|
+
active: (0, createUIKitClassname_1.createUIKitClassname)('step_active'),
|
|
7
|
+
completed: (0, createUIKitClassname_1.createUIKitClassname)('step_completed'),
|
|
8
|
+
error: (0, createUIKitClassname_1.createUIKitClassname)('step_error'),
|
|
9
|
+
warning: (0, createUIKitClassname_1.createUIKitClassname)('step_warning'),
|
|
10
|
+
disabled: (0, createUIKitClassname_1.createUIKitClassname)('step_disabled'),
|
|
11
|
+
};
|
|
12
|
+
exports.stepClassnames = {
|
|
13
|
+
root: (0, createUIKitClassname_1.createUIKitClassname)('step'),
|
|
14
|
+
label: (0, createUIKitClassname_1.createUIKitClassname)('step__label'),
|
|
15
|
+
description: (0, createUIKitClassname_1.createUIKitClassname)('step__description'),
|
|
16
|
+
iconContainer: (0, createUIKitClassname_1.createUIKitClassname)('step__icon-container'),
|
|
17
|
+
connector: (0, createUIKitClassname_1.createUIKitClassname)('step__connector'),
|
|
18
|
+
connectorLine: (0, createUIKitClassname_1.createUIKitClassname)('step_connector-line'),
|
|
19
|
+
connectorArrow: (0, createUIKitClassname_1.createUIKitClassname)('step_connector-arrow'),
|
|
20
|
+
alternativeLabel: (0, createUIKitClassname_1.createUIKitClassname)('step_alternative-label'),
|
|
21
|
+
orientationHorizontal: (0, createUIKitClassname_1.createUIKitClassname)('step_orientation-horizontal'),
|
|
22
|
+
orientationVertical: (0, createUIKitClassname_1.createUIKitClassname)('step_orientation-vertical'),
|
|
23
|
+
labelContainer: (0, createUIKitClassname_1.createUIKitClassname)('step__label-container'),
|
|
24
|
+
labelMobile: (0, createUIKitClassname_1.createUIKitClassname)('step__label-mobile'),
|
|
25
|
+
content: (0, createUIKitClassname_1.createUIKitClassname)('step__content'),
|
|
26
|
+
hasDescription: (0, createUIKitClassname_1.createUIKitClassname)('step_has-description'),
|
|
27
|
+
...exports.stepStateClassnames,
|
|
28
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.stepClassnames = exports.Step = void 0;
|
|
4
|
+
var Step_1 = require("./Step");
|
|
5
|
+
Object.defineProperty(exports, "Step", { enumerable: true, get: function () { return Step_1.Step; } });
|
|
6
|
+
var constants_1 = require("./constants");
|
|
7
|
+
Object.defineProperty(exports, "stepClassnames", { enumerable: true, get: function () { return constants_1.stepClassnames; } });
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const Wrapper: import("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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("@emotion/styled/dist/declarations/src/types").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
|
+
}, {}, {}>;
|