@mailstep/design-system 0.6.57-beta.2 → 0.6.57
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/SideMenu/MenuItem.js +4 -4
- package/ui/Blocks/SideMenu/styles.js +1 -1
- package/ui/Blocks/Stepper/Stepper.js +1 -1
- package/ui/Blocks/Stepper/stories/Stepper.stories.js +8 -8
- package/ui/Blocks/Stepper/types.d.ts +1 -1
- package/ui/index.es.js +7524 -7518
- package/ui/index.umd.js +376 -375
package/package.json
CHANGED
|
@@ -12,12 +12,12 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { memo, useCallback, useMemo, useRef } from 'react';
|
|
14
14
|
import { matchPath } from 'react-router';
|
|
15
|
-
import
|
|
16
|
-
import { Paragraph3, Paragraph5 } from '../../Elements/Typography/Typography';
|
|
15
|
+
import { ItemLinkWrap, ItemIcon, ItemDropdownArrow, SubItemsWrap, OverflowWithEllipsis, MenuItemContainer, ItemLabel, ItemsSeparator } from './styles';
|
|
17
16
|
import SubitemTooltip from './components/SubitemTooltip';
|
|
18
17
|
import { useLeftMenuContext } from './context/useLeftMenuContext';
|
|
18
|
+
import { Paragraph3, Paragraph5 } from '../../Elements/Typography/Typography';
|
|
19
|
+
import Icon from '../../Elements/Icon/Icon';
|
|
19
20
|
import useOutSideHover from './hooks/useOutsideHover';
|
|
20
|
-
import { ItemLinkWrap, ItemIcon, ItemDropdownArrow, SubItemsWrap, OverflowWithEllipsis, MenuItemContainer, ItemLabel, ItemsSeparator } from './styles';
|
|
21
21
|
var removeOptionalEnd = /\?$/;
|
|
22
22
|
var MenuItem = function (_a) {
|
|
23
23
|
var icon = _a.icon, title = _a.title, _b = _a.link, link = _b === void 0 ? '' : _b, items = _a.items, id = _a.id, isSubitem = _a.isSubitem, isCompact = _a.isCompact, _c = _a.lightMode, lightMode = _c === void 0 ? false : _c, _d = _a.separator, separator = _d === void 0 ? false : _d, isLeftMenuOpen = _a.isLeftMenuOpen, onCloseLeftMenu = _a.onCloseLeftMenu;
|
|
@@ -47,7 +47,7 @@ var MenuItem = function (_a) {
|
|
|
47
47
|
var partialMatch = location.pathname.startsWith(link.slice(0, -1)) && location.pathname.includes('/settings/');
|
|
48
48
|
return isActive || childSelected || partialMatch;
|
|
49
49
|
}, [items, link]);
|
|
50
|
-
return (_jsxs(_Fragment, { children: [separator && _jsx(ItemsSeparator, {}), _jsxs(MenuItemContainer, { ref: parentRef, "$isCompact": isCompact, "$lightMode": lightMode, hasChildren: hasChildren, isHovering: isHovering, children: [_jsxs(ItemLinkWrap, __assign({}, linkProps, { onMouseOver: handleMouseOver, activeClassName: hasChildren ? 'selected' : undefined, onClick: toggleChildren, "$isCompact": isCompact, className: itemLinkWrapClassName,
|
|
50
|
+
return (_jsxs(_Fragment, { children: [separator && _jsx(ItemsSeparator, {}), _jsxs(MenuItemContainer, { ref: parentRef, "$isCompact": isCompact, "$lightMode": lightMode, hasChildren: hasChildren, isHovering: isHovering, children: [_jsxs(ItemLinkWrap, __assign({}, linkProps, { onMouseOver: handleMouseOver, exact: true, activeClassName: hasChildren ? 'selected' : undefined, onClick: toggleChildren, "$isCompact": isCompact, className: itemLinkWrapClassName,
|
|
51
51
|
// @ts-ignore
|
|
52
52
|
isActive: isActive, "$lightMode": lightMode, children: [_jsxs(ItemLabel, { "$isCompact": isCompact, isSubitem: isSubitem, children: [!isSubitem && icon && (_jsx(ItemIcon, { className: "mainIcon", "$isCompact": isCompact, children: typeof icon === 'string' ? _jsx(Icon, { icon: icon, fill: "none" }) : icon })), _jsx(Title, { variant: "semiBold", mt: 0, mb: 0, children: _jsx(OverflowWithEllipsis, { children: title }) })] }), !isCompact && hasChildren && _jsx(ItemDropdownArrow, { icon: "goDown", "$lightMode": lightMode })] })), isHovering && isCompact && hasChildren && !listExpandedItems && (_jsx(SubitemTooltip, { items: items, childRef: childRef, parentRef: parentRef, isLeftMenuOpen: isLeftMenuOpen, onCloseLeftMenu: onCloseLeftMenu, lightMode: lightMode }))] }), hasChildren && listExpandedItems && (_jsx(SubItemsWrap, { children: items === null || items === void 0 ? void 0 : items.map(function (item, index) { return (_jsx(MenuItem, __assign({ isCompact: isCompact, lightMode: lightMode }, item, { onCloseLeftMenu: onCloseLeftMenu, isSubitem: true }), "".concat(index))); }) }))] }));
|
|
53
53
|
};
|
|
@@ -139,7 +139,7 @@ export var TooltipWrap = styled.div(templateObject_16 || (templateObject_16 = __
|
|
|
139
139
|
var $lightMode = _a.$lightMode;
|
|
140
140
|
return ($lightMode ? th.color('red20') : th.color('blue2'));
|
|
141
141
|
});
|
|
142
|
-
export var OverflowWithEllipsis = styled.span(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n max-width: 140px;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n max-width: 140px;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
142
|
+
export var OverflowWithEllipsis = styled.span(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n max-width: 140px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n max-width: 140px;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
143
143
|
export var TopLevelWrap = styled.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n border-right: 1px solid ", ";\n height: -webkit-fill-available;\n transition: width 0.5s ease;\n width: ", ";\n\n z-index: 5;\n position: absolute;\n top: ", ";\n height: ", ";\n\n display: flex;\n flex-direction: column;\n\n @media (min-width: 1024px) {\n top: inherit;\n z-index: 2;\n }\n"], ["\n background-color: ", ";\n border-right: 1px solid ", ";\n height: -webkit-fill-available;\n transition: width 0.5s ease;\n width: ", ";\n\n z-index: 5;\n position: absolute;\n top: ", ";\n height: ", ";\n\n display: flex;\n flex-direction: column;\n\n @media (min-width: 1024px) {\n top: inherit;\n z-index: 2;\n }\n"])), function (_a) {
|
|
144
144
|
var lightMode = _a.lightMode;
|
|
145
145
|
return (lightMode ? 'white' : th('colors.blue3'));
|
|
@@ -10,5 +10,5 @@ export var Stepper = function (_a) {
|
|
|
10
10
|
return (_jsxs(Container, { children: [_jsx(ItemsWrapper, { children: items.map(function (_a, index) {
|
|
11
11
|
var title = _a.title, disabled = _a.disabled, completed = _a.completed;
|
|
12
12
|
return (_jsx(StepItem, { onClick: handleChangeStep(index), title: title, index: index, activeStep: activeStep, disabled: disabled, completed: completed }, title));
|
|
13
|
-
}) }), _jsx(Component, {
|
|
13
|
+
}) }), _jsx(Component, { handleGoNext: handleChangeStep(activeStep + 1) })] }));
|
|
14
14
|
};
|
|
@@ -18,29 +18,29 @@ var items = [
|
|
|
18
18
|
{
|
|
19
19
|
title: 'Scan product',
|
|
20
20
|
component: function (_a) {
|
|
21
|
-
var
|
|
22
|
-
return (_jsxs("div", { children: ["Scan product ", _jsx(Button, { onClick:
|
|
21
|
+
var handleGoNext = _a.handleGoNext;
|
|
22
|
+
return (_jsxs("div", { children: ["Scan product ", _jsx(Button, { onClick: handleGoNext, children: "Go next" })] }));
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
title: 'Measurement',
|
|
27
27
|
component: function (_a) {
|
|
28
|
-
var
|
|
29
|
-
return (_jsxs("div", { children: ["Measurement page ", _jsx(Button, { onClick:
|
|
28
|
+
var handleGoNext = _a.handleGoNext;
|
|
29
|
+
return (_jsxs("div", { children: ["Measurement page ", _jsx(Button, { onClick: handleGoNext, children: "Go next" })] }));
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
title: 'Logistic info',
|
|
34
34
|
component: function (_a) {
|
|
35
|
-
var
|
|
36
|
-
return (_jsxs("div", { children: ["Logistic info ", _jsx(Button, { onClick:
|
|
35
|
+
var handleGoNext = _a.handleGoNext;
|
|
36
|
+
return (_jsxs("div", { children: ["Logistic info ", _jsx(Button, { onClick: handleGoNext, children: "Go next" })] }));
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
{
|
|
40
40
|
title: 'Color',
|
|
41
41
|
component: function (_a) {
|
|
42
|
-
var
|
|
43
|
-
return (_jsxs("div", { children: ["Select color ", _jsx(Button, { onClick:
|
|
42
|
+
var handleGoNext = _a.handleGoNext;
|
|
43
|
+
return (_jsxs("div", { children: ["Select color ", _jsx(Button, { onClick: handleGoNext, children: "Finish" })] }));
|
|
44
44
|
}
|
|
45
45
|
}
|
|
46
46
|
];
|