@mailstep/design-system 0.6.60 → 0.6.62-beta.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.60",
3
+ "version": "0.6.62-beta.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -0,0 +1,2 @@
1
+ import { type FC } from 'react';
2
+ export declare const CheckedCircle: FC;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ import Icon from '../../../../Elements/Icon';
3
+ import { CheckedCircleContainer } from './styles';
4
+ export var CheckedCircle = function () {
5
+ return (_jsx(CheckedCircleContainer, { children: _jsx(Icon, { icon: "check", size: "12px" }) }));
6
+ };
@@ -0,0 +1 @@
1
+ export declare const CheckedCircleContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,7 @@
1
+ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cooked, raw) {
2
+ if (Object.defineProperty) { Object.defineProperty(cooked, "raw", { value: raw }); } else { cooked.raw = raw; }
3
+ return cooked;
4
+ };
5
+ import styled, { th } from '@xstyled/styled-components';
6
+ export var CheckedCircleContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 50%;\n border: 8px solid ", ";\n color: ", ";\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n border-radius: 50%;\n border: 8px solid ", ";\n color: ", ";\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n"])), th.color('red1'), th.color('red1'));
7
+ var templateObject_1;
@@ -1,13 +1,13 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import Icon from '../../../../Elements/Icon/Icon';
3
2
  import { Paragraph2, H7 } from '../../../../Elements/Typography/Typography';
3
+ import { CheckedCircle } from '../CheckedCircle';
4
4
  import { Trans } from '@lingui/react';
5
5
  import { x } from '@xstyled/styled-components';
6
6
  import isBoolean from 'lodash/isBoolean';
7
- import { Line, StepItemContainer, StepNumber, ContentWrapper, CompletedStep } from './styles';
7
+ import { Line, StepItemContainer, StepNumber, ContentWrapper } from './styles';
8
8
  export var StepItem = function (_a) {
9
9
  var title = _a.title, index = _a.index, disabled = _a.disabled, activeStep = _a.activeStep, completed = _a.completed, onClick = _a.onClick;
10
10
  var isActiveStep = index === activeStep;
11
11
  var isCompletedStep = isBoolean(completed) ? completed : index < activeStep;
12
- return (_jsxs(StepItemContainer, { onClick: !disabled && isCompletedStep ? onClick : undefined, isActiveStep: isActiveStep, isDisabled: disabled, children: [_jsx(Line, { isActiveStep: isActiveStep, isCompletedStep: isCompletedStep }), _jsxs(ContentWrapper, { children: [isCompletedStep ? (_jsx(CompletedStep, { children: _jsx(Icon, { icon: "check", size: "12px" }) })) : (_jsx(StepNumber, { isActiveStep: isActiveStep, children: index + 1 })), _jsxs("div", { children: [_jsx(x.span, { textTransform: "uppercase", children: _jsxs(H7, { color: "gray1", variant: "semiBold", mt: 0, mb: "4px", children: [_jsx(Trans, { id: "step", message: "Step" }), ": ", index + 1] }) }), _jsx(Paragraph2, { variant: "medium", children: title })] })] })] }));
12
+ return (_jsxs(StepItemContainer, { onClick: !disabled && isCompletedStep ? onClick : undefined, isActiveStep: isActiveStep, isDisabled: disabled, children: [_jsx(Line, { isActiveStep: isActiveStep, isCompletedStep: isCompletedStep }), _jsxs(ContentWrapper, { children: [isCompletedStep ? _jsx(CheckedCircle, {}) : _jsx(StepNumber, { isActiveStep: isActiveStep, children: index + 1 }), _jsxs("div", { children: [_jsx(x.span, { textTransform: "uppercase", children: _jsxs(H7, { color: "gray1", variant: "semiBold", mt: 0, mb: "4px", children: [_jsx(Trans, { id: "step", message: "Step" }), ": ", index + 1] }) }), _jsx(Paragraph2, { variant: "medium", children: title })] })] })] }));
13
13
  };
@@ -10,4 +10,3 @@ export declare const StepNumber: import("styled-components").StyledComponent<"di
10
10
  isActiveStep: boolean;
11
11
  }, never>;
12
12
  export declare const ContentWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
13
- export declare const CompletedStep: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -29,5 +29,4 @@ export var StepNumber = styled.div(templateObject_4 || (templateObject_4 = __mak
29
29
  return isActiveStep && css(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n box-shadow: 0 0 0 4px ", ";\n "], ["\n box-shadow: 0 0 0 4px ", ";\n "])), th.color('red20'));
30
30
  });
31
31
  export var ContentWrapper = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n display: flex;\n column-gap: 16px;\n"], ["\n display: flex;\n column-gap: 16px;\n"])));
32
- export var CompletedStep = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n border-radius: 50%;\n border: 8px solid ", ";\n color: ", ";\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n"], ["\n border-radius: 50%;\n border: 8px solid ", ";\n color: ", ";\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n"])), th.color('red1'), th.color('red1'));
33
- var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6;
32
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5;
@@ -6,6 +6,7 @@ type HookType = (props: Props) => {
6
6
  handleChangeStep: (step: number) => () => void;
7
7
  handleGoToNextStep: () => void;
8
8
  isSuccess: boolean;
9
+ handleReset: () => void;
9
10
  };
10
11
  export declare const useStepper: HookType;
11
12
  export {};
@@ -3,15 +3,20 @@ export var useStepper = function (_a) {
3
3
  var totalSteps = _a.totalSteps;
4
4
  var _b = useState(0), activeStep = _b[0], setActiveStep = _b[1];
5
5
  var _c = useState(false), isSuccess = _c[0], setSuccess = _c[1];
6
+ var handleReset = useCallback(function () {
7
+ setActiveStep(0);
8
+ setSuccess(false);
9
+ }, []);
6
10
  var handleGoToNextStep = useCallback(function () {
7
11
  if (activeStep + 1 === totalSteps) {
12
+ handleReset();
8
13
  setSuccess(true);
9
14
  return;
10
15
  }
11
16
  setActiveStep(activeStep + 1);
12
- }, [activeStep, totalSteps]);
17
+ }, [activeStep, totalSteps, handleReset]);
13
18
  var handleChangeStep = useCallback(function (step) { return function () {
14
19
  setActiveStep(step);
15
20
  }; }, []);
16
- return { activeStep: activeStep, handleChangeStep: handleChangeStep, handleGoToNextStep: handleGoToNextStep, isSuccess: isSuccess };
21
+ return { activeStep: activeStep, handleChangeStep: handleChangeStep, handleGoToNextStep: handleGoToNextStep, isSuccess: isSuccess, handleReset: handleReset };
17
22
  };
@@ -1,3 +1,4 @@
1
1
  export { Stepper as default } from './Stepper';
2
2
  export { useStepper } from './hooks/useStepper';
3
+ export { CheckedCircle } from './components/CheckedCircle';
3
4
  export type { StepperItem, StepperPassedDownProps } from './types';
@@ -1,2 +1,3 @@
1
1
  export { Stepper as default } from './Stepper';
2
2
  export { useStepper } from './hooks/useStepper';
3
+ export { CheckedCircle } from './components/CheckedCircle';
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import { SvgProps } from '../types';
3
+ export declare const Fragile: FC<SvgProps>;
@@ -0,0 +1,13 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
13
+ export var Fragile = function (props) { return (_jsxs("svg", __assign({ width: "45", height: "70", viewBox: "0 0 45 70", fill: "none", stroke: "black", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [_jsx("path", { d: "M22.5417 45.2083V68.5417", stroke: "black", strokeWidth: "2.91667", strokeMiterlimit: "10", strokeLinejoin: "round" }), _jsx("path", { d: "M10.875 68.5417H34.2083", strokeWidth: "2.91667", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M5.04167 1.45834H40.0417L42.9583 24.7917C42.9583 36.0704 33.8175 45.2083 22.5417 45.2083C11.2658 45.2083 2.125 36.0704 2.125 24.7917L5.04167 1.45834Z", strokeWidth: "2.91667", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" }), _jsx("path", { d: "M28.3751 1.45834L13.7917 16.0417H28.3751L13.7917 30.625", strokeWidth: "2.91667", strokeMiterlimit: "10", strokeLinecap: "round", strokeLinejoin: "round" })] }))); };
@@ -61,3 +61,4 @@ export { ToastSuccess } from './ToastSuccess';
61
61
  export { ToastError } from './ToastError';
62
62
  export { ArrowForward } from './ArrowForward';
63
63
  export { Add } from './Add';
64
+ export { Fragile } from './Fragile';
@@ -61,3 +61,4 @@ export { ToastSuccess } from './ToastSuccess';
61
61
  export { ToastError } from './ToastError';
62
62
  export { ArrowForward } from './ArrowForward';
63
63
  export { Add } from './Add';
64
+ export { Fragile } from './Fragile';