@mailstep/design-system 0.6.69-beta.1 → 0.6.69-beta.4
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 +1 -1
- package/ui/Blocks/Stepper/Stepper.js +1 -1
- package/ui/Blocks/Stepper/styles.d.ts +1 -0
- package/ui/Blocks/Stepper/styles.js +4 -1
- package/ui/Elements/CheckedCircle/index.d.ts +2 -0
- package/ui/Elements/CheckedCircle/index.js +6 -0
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +11 -0
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.js +11 -0
- package/ui/Elements/CheckedCircle/styles.d.ts +1 -0
- package/ui/Elements/CheckedCircle/styles.js +7 -0
- package/ui/index.es.js +4 -2
- package/ui/index.umd.js +2 -2
package/package.json
CHANGED
|
@@ -13,7 +13,7 @@ export var Stepper = function (_a) {
|
|
|
13
13
|
}, [items]);
|
|
14
14
|
if (!(items === null || items === void 0 ? void 0 : items.length))
|
|
15
15
|
return null;
|
|
16
|
-
return (_jsxs(Container, { children: [_jsx(ItemsWrapper, { total: items.length, children: items.map(function (_a, index) {
|
|
16
|
+
return (_jsxs(Container, { children: [_jsx(ItemsWrapper, { total: items.length, hasComponent: !!Component, children: items.map(function (_a, index) {
|
|
17
17
|
var title = _a.title, disabled = _a.disabled, completed = _a.completed, icon = _a.icon;
|
|
18
18
|
return (_jsx(StepItem, { onClick: handleChangeStep === null || handleChangeStep === void 0 ? void 0 : handleChangeStep(index), title: title, index: index, total: items.length, activeStep: activeStep, disabled: disabled, completed: completed, hasStepNumbering: hasStepNumbering, icon: icon }, title));
|
|
19
19
|
}) }), Component && _jsx(Component, { handleGoToNextStep: handleGoToNextStep, isLoading: isLoading })] }));
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
|
|
2
2
|
export declare const ItemsWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
|
|
3
3
|
total: number;
|
|
4
|
+
hasComponent: boolean;
|
|
4
5
|
}, never>;
|
|
@@ -4,7 +4,10 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import styled from '@xstyled/styled-components';
|
|
6
6
|
export var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n height: fit-content;\n justify-content: center;\n align-items: center;\n width: 100%;\n flex-direction: column;\n"], ["\n display: flex;\n flex-direction: column;\n height: fit-content;\n justify-content: center;\n align-items: center;\n width: 100%;\n flex-direction: column;\n"])));
|
|
7
|
-
export var ItemsWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin-bottom:
|
|
7
|
+
export var ItemsWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin-bottom: ", ";\n flex-direction: column;\n width: 100%;\n\n @media (min-width: ", "px) {\n flex-direction: row;\n width: auto;\n }\n"], ["\n display: flex;\n margin-bottom: ", ";\n flex-direction: column;\n width: 100%;\n\n @media (min-width: ", "px) {\n flex-direction: row;\n width: auto;\n }\n"])), function (_a) {
|
|
8
|
+
var hasComponent = _a.hasComponent;
|
|
9
|
+
return (hasComponent ? '36px' : '0');
|
|
10
|
+
}, function (_a) {
|
|
8
11
|
var total = _a.total;
|
|
9
12
|
return total * 150;
|
|
10
13
|
});
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import Icon from '../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,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: import("react").FC;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
@@ -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 background-color: white;\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 background-color: white;\n"])), th.color('red1'), th.color('red1'));
|
|
7
|
+
var templateObject_1;
|
package/ui/index.es.js
CHANGED
|
@@ -51632,7 +51632,9 @@ const Cke = /* @__PURE__ */ Da(wke), xke = ot`
|
|
|
51632
51632
|
flex-direction: column;
|
|
51633
51633
|
`, Pke = q.div`
|
|
51634
51634
|
display: flex;
|
|
51635
|
-
margin-bottom:
|
|
51635
|
+
margin-bottom: ${({
|
|
51636
|
+
hasComponent: e
|
|
51637
|
+
}) => e ? "36px" : "0"};
|
|
51636
51638
|
flex-direction: column;
|
|
51637
51639
|
width: 100%;
|
|
51638
51640
|
|
|
@@ -51655,7 +51657,7 @@ const Cke = /* @__PURE__ */ Da(wke), xke = ot`
|
|
|
51655
51657
|
var c;
|
|
51656
51658
|
t && !((c = e[t - 1]) != null && c.completed) && (n == null || n(0)());
|
|
51657
51659
|
}, [e]), e != null && e.length ? /* @__PURE__ */ g.jsxs(Oke, { children: [
|
|
51658
|
-
/* @__PURE__ */ g.jsx(Pke, { total: e.length, children: e.map(({
|
|
51660
|
+
/* @__PURE__ */ g.jsx(Pke, { total: e.length, hasComponent: !!l, children: e.map(({
|
|
51659
51661
|
title: c,
|
|
51660
51662
|
disabled: u,
|
|
51661
51663
|
completed: f,
|
package/ui/index.umd.js
CHANGED
|
@@ -3975,7 +3975,7 @@ ${ee.current.stack}
|
|
|
3975
3975
|
flex-direction: column;
|
|
3976
3976
|
`,SOe=$.div`
|
|
3977
3977
|
display: flex;
|
|
3978
|
-
margin-bottom: 36px;
|
|
3978
|
+
margin-bottom: ${({hasComponent:e})=>e?"36px":"0"};
|
|
3979
3979
|
flex-direction: column;
|
|
3980
3980
|
width: 100%;
|
|
3981
3981
|
|
|
@@ -3983,7 +3983,7 @@ ${ee.current.stack}
|
|
|
3983
3983
|
flex-direction: row;
|
|
3984
3984
|
width: auto;
|
|
3985
3985
|
}
|
|
3986
|
-
`,EOe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>e[t].component,[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(xOe,{children:[g.jsx(SOe,{total:e.length,children:e.map(({title:u,disabled:c,completed:f,icon:A},p)=>g.jsx(COe,{onClick:n==null?void 0:n(p),title:u,index:p,total:e.length,activeStep:t,disabled:c,completed:f,hasStepNumbering:r,icon:A},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},IOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{r(0),i(!1)},[]),l=I.useCallback(()=>{if(t+1===e){o(),i(!0);return}r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},kOe=$($e.div)`
|
|
3986
|
+
`,EOe=({items:e,activeStep:t,hasStepNumbering:r,handleChangeStep:n,handleGoToNextStep:i,isLoading:o})=>{const l=I.useMemo(()=>e[t].component,[e,t]);return I.useEffect(()=>{var u;t&&!((u=e[t-1])!=null&&u.completed)&&(n==null||n(0)())},[e]),e!=null&&e.length?g.jsxs(xOe,{children:[g.jsx(SOe,{total:e.length,hasComponent:!!l,children:e.map(({title:u,disabled:c,completed:f,icon:A},p)=>g.jsx(COe,{onClick:n==null?void 0:n(p),title:u,index:p,total:e.length,activeStep:t,disabled:c,completed:f,hasStepNumbering:r,icon:A},u))}),l&&g.jsx(l,{handleGoToNextStep:i,isLoading:o})]}):null},IOe=({totalSteps:e})=>{const[t,r]=I.useState(0),[n,i]=I.useState(!1),o=I.useCallback(()=>{r(0),i(!1)},[]),l=I.useCallback(()=>{if(t+1===e){o(),i(!0);return}r(t+1)},[t,e,o]),u=I.useCallback(c=>()=>{r(c)},[]);return{activeStep:t,handleChangeStep:u,handleGoToNextStep:l,isSuccess:n,handleReset:o}},kOe=$($e.div)`
|
|
3987
3987
|
margin-right: 1em;
|
|
3988
3988
|
`,OOe=$.div`
|
|
3989
3989
|
display: flex;
|