@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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mailstep/design-system",
3
- "version": "0.6.57-beta.2",
3
+ "version": "0.6.57",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -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 Icon from '../../Elements/Icon/Icon';
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, { handleGoToNextStep: handleChangeStep(activeStep + 1) })] }));
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 handleGoToNextStep = _a.handleGoToNextStep;
22
- return (_jsxs("div", { children: ["Scan product ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
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 handleGoToNextStep = _a.handleGoToNextStep;
29
- return (_jsxs("div", { children: ["Measurement page ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
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 handleGoToNextStep = _a.handleGoToNextStep;
36
- return (_jsxs("div", { children: ["Logistic info ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
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 handleGoToNextStep = _a.handleGoToNextStep;
43
- return (_jsxs("div", { children: ["Select color ", _jsx(Button, { onClick: handleGoToNextStep, children: "Finish" })] }));
42
+ var handleGoNext = _a.handleGoNext;
43
+ return (_jsxs("div", { children: ["Select color ", _jsx(Button, { onClick: handleGoNext, children: "Finish" })] }));
44
44
  }
45
45
  }
46
46
  ];
@@ -5,7 +5,7 @@ export type StepperProps = {
5
5
  handleChangeStep: (step: number) => () => void;
6
6
  };
7
7
  export type StepperPassedDownProps = {
8
- handleGoToNextStep: () => void;
8
+ handleGoNext: () => void;
9
9
  };
10
10
  export type StepperItem = {
11
11
  title: string;