@mailstep/design-system 0.6.56 → 0.6.57-beta.1

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.
Files changed (56) hide show
  1. package/package.json +1 -1
  2. package/ui/Blocks/SideMenu/MenuItem.d.ts +12 -0
  3. package/ui/Blocks/SideMenu/MenuItem.js +54 -0
  4. package/ui/Blocks/SideMenu/SideMenu.d.ts +3 -0
  5. package/ui/Blocks/SideMenu/SideMenu.js +24 -0
  6. package/ui/Blocks/SideMenu/components/Footer.d.ts +14 -0
  7. package/ui/Blocks/SideMenu/components/Footer.js +28 -0
  8. package/ui/Blocks/SideMenu/components/HamburgerMenu.d.ts +6 -0
  9. package/ui/Blocks/SideMenu/components/HamburgerMenu.js +24 -0
  10. package/ui/Blocks/SideMenu/components/SubitemTooltip.d.ts +13 -0
  11. package/ui/Blocks/SideMenu/components/SubitemTooltip.js +42 -0
  12. package/ui/Blocks/SideMenu/context/LeftMenuContext.d.ts +12 -0
  13. package/ui/Blocks/SideMenu/context/LeftMenuContext.js +15 -0
  14. package/ui/Blocks/SideMenu/context/useLeftMenuContext.d.ts +4 -0
  15. package/ui/Blocks/SideMenu/context/useLeftMenuContext.js +8 -0
  16. package/ui/Blocks/SideMenu/hooks/useOutsideHover.d.ts +11 -0
  17. package/ui/Blocks/SideMenu/hooks/useOutsideHover.js +23 -0
  18. package/ui/Blocks/SideMenu/index.d.ts +7 -0
  19. package/ui/Blocks/SideMenu/index.js +5 -0
  20. package/ui/Blocks/SideMenu/stories/SideMenu.stories.d.ts +12 -0
  21. package/ui/Blocks/SideMenu/stories/SideMenu.stories.js +23 -0
  22. package/ui/Blocks/SideMenu/stories/menuItems.d.ts +17 -0
  23. package/ui/Blocks/SideMenu/stories/menuItems.js +102 -0
  24. package/ui/Blocks/SideMenu/styles.d.ts +43 -0
  25. package/ui/Blocks/SideMenu/styles.js +162 -0
  26. package/ui/Blocks/SideMenu/types.d.ts +21 -0
  27. package/ui/Blocks/SideMenu/utils/constants.d.ts +2 -0
  28. package/ui/Blocks/SideMenu/utils/constants.js +2 -0
  29. package/ui/Blocks/Stepper/Stepper.d.ts +3 -0
  30. package/ui/Blocks/Stepper/Stepper.js +14 -0
  31. package/ui/Blocks/Stepper/components/StepItem/index.d.ts +11 -0
  32. package/ui/Blocks/Stepper/components/StepItem/index.js +13 -0
  33. package/ui/Blocks/Stepper/components/StepItem/styles.d.ts +13 -0
  34. package/ui/Blocks/Stepper/components/StepItem/styles.js +33 -0
  35. package/ui/Blocks/Stepper/hooks/useStepper.d.ts +6 -0
  36. package/ui/Blocks/Stepper/hooks/useStepper.js +8 -0
  37. package/ui/Blocks/Stepper/index.d.ts +3 -0
  38. package/ui/Blocks/Stepper/index.js +2 -0
  39. package/ui/Blocks/Stepper/stories/Stepper.stories.d.ts +7 -0
  40. package/ui/Blocks/Stepper/stories/Stepper.stories.js +60 -0
  41. package/ui/Blocks/Stepper/styles.d.ts +2 -0
  42. package/ui/Blocks/Stepper/styles.js +8 -0
  43. package/ui/Blocks/Stepper/types.d.ts +15 -0
  44. package/ui/Blocks/Stepper/types.js +1 -0
  45. package/ui/Elements/Text/Text.d.ts +1 -1
  46. package/ui/Elements/Text/Text.js +15 -1
  47. package/ui/Elements/Text/stories/Text.stories.d.ts +1 -1
  48. package/ui/Elements/Text/types.d.ts +4 -2
  49. package/ui/Elements/Typography/Typography.d.ts +13 -116
  50. package/ui/Elements/Typography/Typography.js +31 -26
  51. package/ui/index.d.ts +6 -2
  52. package/ui/index.es.js +17785 -17151
  53. package/ui/index.js +6 -2
  54. package/ui/index.umd.js +952 -564
  55. package/ui/Blocks/CommonGrid/translations.js +0 -6
  56. /package/ui/Blocks/{CommonGrid/translations.d.ts → SideMenu/types.js} +0 -0
@@ -0,0 +1,162 @@
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 { NavLink } from 'react-router-dom';
6
+ import Icon from '../../Elements/Icon/Icon';
7
+ import createRgba from '../../utils/CreateRgba/createRgba';
8
+ import { compactMenuWidth, expandedMenuWidth } from './utils/constants';
9
+ import styled, { css } from '@xstyled/styled-components';
10
+ import { th } from '@xstyled/system';
11
+ var leftMenuAfter = css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n ::after {\n content: '';\n position: absolute;\n width: 60px;\n height: 40px;\n z-index: -1;\n border-radius: 9px 0 0 9px;\n left: 8px;\n top: -1px;\n }\n"], ["\n ::after {\n content: '';\n position: absolute;\n width: 60px;\n height: 40px;\n z-index: -1;\n border-radius: 9px 0 0 9px;\n left: 8px;\n top: -1px;\n }\n"])));
12
+ var compactMenuItem = css(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 40px;\n width: 40px;\n padding: 9px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9px;\n"], ["\n height: 40px;\n width: 40px;\n padding: 9px;\n display: flex;\n align-items: center;\n justify-content: center;\n border-radius: 9px;\n"])));
13
+ export var Container = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n display: ", ";\n\n @media (min-width: 1024px) {\n display: block;\n align-self: stretch;\n height: fit-content;\n\n @media print {\n display: none;\n }\n }\n"], ["\n display: ", ";\n\n @media (min-width: 1024px) {\n display: block;\n align-self: stretch;\n height: fit-content;\n\n @media print {\n display: none;\n }\n }\n"])), function (_a) {
14
+ var isLeftMenuOpen = _a.isLeftMenuOpen;
15
+ return (isLeftMenuOpen ? 'block' : 'none');
16
+ });
17
+ export var SubItemsWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n margin-left: 23px;\n border-left: 1.5px solid;\n border-color: ", ";\n"], ["\n margin-left: 23px;\n border-left: 1.5px solid;\n border-color: ", ";\n"])), th('colors.red1'));
18
+ export var ItemsSeparator = styled.div(templateObject_5 || (templateObject_5 = __makeTemplateObject(["\n height: 1px;\n width: 100%;\n margin: 12px 0;\n background-color: ", ";\n"], ["\n height: 1px;\n width: 100%;\n margin: 12px 0;\n background-color: ", ";\n"])), th('colors.lightGray6'));
19
+ export var ItemLabel = styled.div(templateObject_6 || (templateObject_6 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"], ["\n display: flex;\n justify-content: center;\n align-items: center;\n flex-direction: ", ";\n margin-bottom: ", ";\n margin-left: ", ";\n"])), function (_a) {
20
+ var $isCompact = _a.$isCompact;
21
+ return ($isCompact ? 'column' : 'row');
22
+ }, function (_a) {
23
+ var $isCompact = _a.$isCompact;
24
+ return ($isCompact ? '10px' : '0');
25
+ }, function (_a) {
26
+ var isSubitem = _a.isSubitem;
27
+ return (isSubitem ? '15px' : '0');
28
+ });
29
+ export var ItemDropdownArrow = styled(Icon)(templateObject_7 || (templateObject_7 = __makeTemplateObject(["\n color: ", ";\n svg {\n max-width: 11px;\n }\n"], ["\n color: ", ";\n svg {\n max-width: 11px;\n }\n"])), function (_a) {
30
+ var $lightMode = _a.$lightMode;
31
+ return ($lightMode ? th.color('typoPrimary') : 'white');
32
+ });
33
+ export var TooltipItemLabel = styled.div(templateObject_8 || (templateObject_8 = __makeTemplateObject(["\n line-height: 1.5;\n letter-spacing: 0.4px;\n"], ["\n line-height: 1.5;\n letter-spacing: 0.4px;\n"])));
34
+ export var ItemLinkWrap = styled(NavLink)(templateObject_9 || (templateObject_9 = __makeTemplateObject(["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n cursor: pointer;\n height: ", ";\n border-radius: ", ";\n font-weight: 600;\n letter-spacing: 0.4px;\n position: relative;\n color: ", ";\n transition: moving 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);\n transition-property: transform;\n\n &.toplevel {\n margin: ", ";\n padding: ", ";\n gap: ", ";\n justify-content: ", ";\n &.active {\n color: ", ";\n }\n }\n\n &.nestedlevel {\n padding: 0;\n :hover {\n color: ", ";\n }\n }\n\n &.active > ", " {\n background-color: ", ";\n color: ", ";\n width: 100%;\n border-left: 4px solid ", ";\n :last-child {\n border-bottom-right-radius: 10px;\n }\n :first-child {\n border-top-right-radius: 10px;\n }\n }\n\n ", " {\n color: ", ";\n padding-left: 10px;\n width: -webkit-fill-available;\n height: -webkit-fill-available;\n }\n\n &.active,\n &.selected {\n ", " {\n color: ", ";\n }\n }\n"], ["\n display: flex;\n flex-direction: ", ";\n align-items: center;\n cursor: pointer;\n height: ", ";\n border-radius: ", ";\n font-weight: 600;\n letter-spacing: 0.4px;\n position: relative;\n color: ", ";\n transition: moving 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);\n transition-property: transform;\n\n &.toplevel {\n margin: ", ";\n padding: ", ";\n gap: ", ";\n justify-content: ", ";\n &.active {\n color: ", ";\n }\n }\n\n &.nestedlevel {\n padding: 0;\n :hover {\n color: ", ";\n }\n }\n\n &.active > ", " {\n background-color: ", ";\n color: ", ";\n width: 100%;\n border-left: 4px solid ", ";\n :last-child {\n border-bottom-right-radius: 10px;\n }\n :first-child {\n border-top-right-radius: 10px;\n }\n }\n\n ", " {\n color: ", ";\n padding-left: 10px;\n width: -webkit-fill-available;\n height: -webkit-fill-available;\n }\n\n &.active,\n &.selected {\n ", " {\n color: ", ";\n }\n }\n"])), function (_a) {
35
+ var $isCompact = _a.$isCompact;
36
+ return ($isCompact ? 'column' : 'row');
37
+ }, function (_a) {
38
+ var $isCompact = _a.$isCompact;
39
+ return ($isCompact ? '60px' : '40px');
40
+ }, function (_a) {
41
+ var $lightMode = _a.$lightMode;
42
+ return ($lightMode ? '8px' : '10px');
43
+ }, function (_a) {
44
+ var $lightMode = _a.$lightMode;
45
+ return ($lightMode ? th.color('typoPrimary') : th.color('lightGray5'));
46
+ }, function (_a) {
47
+ var $isCompact = _a.$isCompact;
48
+ return ($isCompact ? '0 0 12px 0' : '16px 0');
49
+ }, function (_a) {
50
+ var $isCompact = _a.$isCompact;
51
+ return ($isCompact ? '10px 14px 6px 13px' : '9px 10px');
52
+ }, function (_a) {
53
+ var $isCompact = _a.$isCompact;
54
+ return ($isCompact ? 'none' : '30px');
55
+ }, function (_a) {
56
+ var $isCompact = _a.$isCompact;
57
+ return ($isCompact ? 'center' : 'space-between');
58
+ }, function (_a) {
59
+ var $lightMode = _a.$lightMode;
60
+ return ($lightMode ? th('colors.red1') : 'white');
61
+ }, function (_a) {
62
+ var $lightMode = _a.$lightMode;
63
+ return ($lightMode ? th('colors.red1') : 'white');
64
+ }, TooltipItemLabel, function (_a) {
65
+ var $lightMode = _a.$lightMode;
66
+ return ($lightMode ? th.color('red20') : th.color('blue2'));
67
+ }, function (_a) {
68
+ var $lightMode = _a.$lightMode;
69
+ return ($lightMode ? th.color('red1') : th.color('white'));
70
+ }, th('colors.red1'), TooltipItemLabel, function (_a) {
71
+ var $lightMode = _a.$lightMode;
72
+ return ($lightMode ? th.color('typoPrimary') : th.color('white'));
73
+ }, ItemDropdownArrow, function (_a) {
74
+ var $lightMode = _a.$lightMode;
75
+ return ($lightMode ? th.color('red1') : th.color('white'));
76
+ });
77
+ export var MenuItemContainer = styled.div(templateObject_14 || (templateObject_14 = __makeTemplateObject(["\n z-index: 1;\n stroke: ", ";\n .selected > ", ", .active > ", " {\n color: ", ";\n stroke: ", ";\n }\n\n .toplevel {\n ", "\n\n ", "\n\n &.active, &.selected {\n ", "\n \n background-color: ", ";\n svg {\n stroke: ", ";\n }\n }\n\n &.expanded > ", " {\n visibility: visible;\n svg {\n transform: rotate(180deg);\n }\n }\n }\n\n &:hover {\n ", ".toplevel {\n background-color: ", ";\n }\n ", ".toplevel.active, ", ".toplevel.selected {\n background-color: ", ";\n }\n ", ".nestedlevel {\n background-color: inherit;\n }\n }\n }\n"], ["\n z-index: 1;\n stroke: ", ";\n .selected > ", ", .active > ", " {\n color: ", ";\n stroke: ", ";\n }\n\n .toplevel {\n ", "\n\n ", "\n\n &.active, &.selected {\n ", "\n \n background-color: ", ";\n svg {\n stroke: ", ";\n }\n }\n\n &.expanded > ", " {\n visibility: visible;\n svg {\n transform: rotate(180deg);\n }\n }\n }\n\n &:hover {\n ", ".toplevel {\n background-color: ", ";\n }\n ", ".toplevel.active, ", ".toplevel.selected {\n background-color: ", ";\n }\n ", ".nestedlevel {\n background-color: inherit;\n }\n }\n }\n"])), function (_a) {
78
+ var $lightMode = _a.$lightMode;
79
+ return ($lightMode ? th.color('blue2') : undefined);
80
+ }, ItemLabel, ItemLabel, function (_a) {
81
+ var $lightMode = _a.$lightMode;
82
+ return ($lightMode ? th.color('red1') : th.color('white'));
83
+ }, function (_a) {
84
+ var $lightMode = _a.$lightMode;
85
+ return ($lightMode ? th.color('red1') : th.color('blue2'));
86
+ }, function (_a) {
87
+ var $isCompact = _a.$isCompact, hasChildren = _a.hasChildren, isHovering = _a.isHovering;
88
+ return $isCompact &&
89
+ hasChildren &&
90
+ isHovering && css(templateObject_10 || (templateObject_10 = __makeTemplateObject(["\n & ", " {\n ", "\n ::after {\n background-color: ", ";\n }\n }\n "], ["\n & ", " {\n ", "\n ::after {\n background-color: ", ";\n }\n }\n "])), ItemIcon, leftMenuAfter, function (_a) {
91
+ var $lightMode = _a.$lightMode;
92
+ return ($lightMode ? th.color('neutral20') : th.color('neutral500'));
93
+ });
94
+ }, function (_a) {
95
+ var $isCompact = _a.$isCompact, $lightMode = _a.$lightMode, hasChildren = _a.hasChildren;
96
+ return $isCompact && css(templateObject_11 || (templateObject_11 = __makeTemplateObject(["\n & ", " {\n ", "\n :hover {\n background-color: ", ";\n }\n }\n "], ["\n & ", " {\n ", "\n :hover {\n background-color: ", ";\n }\n }\n "])), ItemIcon, compactMenuItem, hasChildren ? 'transparent' : $lightMode ? th.color('neutral20') : th.color('neutral500'));
97
+ }, function (_a) {
98
+ var $isCompact = _a.$isCompact, hasChildren = _a.hasChildren, isHovering = _a.isHovering, $lightMode = _a.$lightMode;
99
+ return $isCompact && hasChildren && isHovering
100
+ ? css(templateObject_12 || (templateObject_12 = __makeTemplateObject(["\n & ", " {\n ", "\n ::after {\n background-color: ", ";\n }\n }\n "], ["\n & ", " {\n ", "\n ::after {\n background-color: ", ";\n }\n }\n "])), ItemIcon, leftMenuAfter, $lightMode ? th.color('red20') : th.color('neutral500')) : css(templateObject_13 || (templateObject_13 = __makeTemplateObject(["\n & ", " {\n background-color: ", ";\n :hover {\n background-color: ", ";\n }\n }\n "], ["\n & ", " {\n background-color: ", ";\n :hover {\n background-color: ", ";\n }\n }\n "])), ItemIcon, !$isCompact ? 'transparent' : $lightMode ? th.color('red20') : th.color('red1'), $lightMode ? th.color('red20') : 'none');
101
+ }, function (_a) {
102
+ var $isCompact = _a.$isCompact, $lightMode = _a.$lightMode;
103
+ if ($isCompact)
104
+ return 'none';
105
+ if ($lightMode)
106
+ return th.color('red20');
107
+ return th.color('red1');
108
+ }, function (_a) {
109
+ var $lightMode = _a.$lightMode;
110
+ return ($lightMode ? th.color('red1') : th.color('white'));
111
+ }, ItemDropdownArrow, ItemLinkWrap, function (_a) {
112
+ var $isCompact = _a.$isCompact, $lightMode = _a.$lightMode;
113
+ return $isCompact ? 'none' : $lightMode ? th.color('neutral20') : th.color('blue4');
114
+ }, ItemLinkWrap, ItemLinkWrap, function (_a) {
115
+ var $lightMode = _a.$lightMode, $isCompact = _a.$isCompact;
116
+ if ($isCompact)
117
+ return 'none';
118
+ if ($lightMode)
119
+ return th.color('red20');
120
+ return th.color('red70');
121
+ }, ItemLinkWrap);
122
+ export var ItemIcon = styled.span(templateObject_15 || (templateObject_15 = __makeTemplateObject(["\n display: flex;\n justify-content: center;\n flex-shrink: 0;\n margin-right: ", ";\n margin-bottom: ", ";\n"], ["\n display: flex;\n justify-content: center;\n flex-shrink: 0;\n margin-right: ", ";\n margin-bottom: ", ";\n"])), function (_a) {
123
+ var $isCompact = _a.$isCompact;
124
+ return ($isCompact ? '0' : '11px');
125
+ }, function (_a) {
126
+ var $isCompact = _a.$isCompact;
127
+ return ($isCompact ? '4px' : '0');
128
+ });
129
+ export var TooltipWrap = styled.div(templateObject_16 || (templateObject_16 = __makeTemplateObject(["\n position: absolute;\n background-color: ", ";\n white-space: nowrap;\n transform: translateX(8px);\n width: 248px;\n border-radius: 0 10px 10px 0;\n z-index: 5;\n &::before {\n content: '';\n position: absolute;\n border-radius: 10px;\n width: calc(100% + 80px);\n height: calc(100% + 100px);\n left: -16px;\n top: -50px;\n }\n\n & :not(:last-child) {\n border-radius: 0;\n border-bottom: 0.5px solid ", ";\n }\n\n &:first-child > {\n :hover {\n border-top-right-radius: 10px;\n background-color: ", ";\n }\n }\n\n & :not(:first-child) {\n :hover {\n border-top-right-radius: 0;\n }\n }\n\n & :last-child > {\n :hover {\n border-bottom-right-radius: 10px;\n background-color: ", ";\n }\n }\n"], ["\n position: absolute;\n background-color: ", ";\n white-space: nowrap;\n transform: translateX(8px);\n width: 248px;\n border-radius: 0 10px 10px 0;\n z-index: 5;\n &::before {\n content: '';\n position: absolute;\n border-radius: 10px;\n width: calc(100% + 80px);\n height: calc(100% + 100px);\n left: -16px;\n top: -50px;\n }\n\n & :not(:last-child) {\n border-radius: 0;\n border-bottom: 0.5px solid ", ";\n }\n\n &:first-child > {\n :hover {\n border-top-right-radius: 10px;\n background-color: ", ";\n }\n }\n\n & :not(:first-child) {\n :hover {\n border-top-right-radius: 0;\n }\n }\n\n & :last-child > {\n :hover {\n border-bottom-right-radius: 10px;\n background-color: ", ";\n }\n }\n"])), function (_a) {
130
+ var $lightMode = _a.$lightMode;
131
+ return ($lightMode ? th.color('white') : th.color('neutral500'));
132
+ }, function (_a) {
133
+ var $lightMode = _a.$lightMode;
134
+ return ($lightMode ? th.color('neutral20') : th('colors.textTertiary'));
135
+ }, function (_a) {
136
+ var $lightMode = _a.$lightMode;
137
+ return ($lightMode ? th.color('red20') : th.color('blue2'));
138
+ }, function (_a) {
139
+ var $lightMode = _a.$lightMode;
140
+ return ($lightMode ? th.color('red20') : th.color('blue2'));
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"])));
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
+ var lightMode = _a.lightMode;
145
+ return (lightMode ? 'white' : th('colors.blue3'));
146
+ }, th('colors.lightGray6'), function (_a) {
147
+ var isCompact = _a.isCompact;
148
+ return "".concat(isCompact ? compactMenuWidth : expandedMenuWidth, "px");
149
+ }, function (_a) {
150
+ var isLeftMenuOpen = _a.isLeftMenuOpen;
151
+ return (isLeftMenuOpen ? '0' : undefined);
152
+ }, function (_a) {
153
+ var isLeftMenuOpen = _a.isLeftMenuOpen;
154
+ return (isLeftMenuOpen ? '100%' : 'calc(100% - 52px)');
155
+ });
156
+ export var ScrollWrap = styled.div(templateObject_19 || (templateObject_19 = __makeTemplateObject(["\n overflow-y: auto;\n flex-grow: 1;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"], ["\n overflow-y: auto;\n flex-grow: 1;\n scrollbar-width: none;\n\n &::-webkit-scrollbar {\n display: none;\n }\n"])));
157
+ export var BodyWrap = styled.div(templateObject_20 || (templateObject_20 = __makeTemplateObject(["\n width: 100%;\n text-align: center;\n padding: ", ";\n height: calc(100% - 52px);\n"], ["\n width: 100%;\n text-align: center;\n padding: ", ";\n height: calc(100% - 52px);\n"])), function (_a) {
158
+ var isCompact = _a.isCompact;
159
+ return (isCompact ? '24px 9px' : '24px 22px');
160
+ });
161
+ export var Overlay = styled.div(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n z-index: 4;\n height: 100%;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n display: none;\n }\n"], ["\n position: fixed;\n top: 0;\n z-index: 4;\n height: 100%;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n display: none;\n }\n"])), createRgba('blue2', 0.6));
162
+ var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;
@@ -0,0 +1,21 @@
1
+ import { ReactNode } from 'react';
2
+ export type MenuItemType = {
3
+ icon?: ReactNode;
4
+ title: string;
5
+ link?: string;
6
+ acl?: [string, string];
7
+ items?: MenuItemType[];
8
+ id: string;
9
+ lightMode?: boolean;
10
+ separator?: boolean;
11
+ appearance?: 'gray' | 'default';
12
+ };
13
+ export type SideMenuProps = {
14
+ menuItems: MenuItemType[];
15
+ isCompact: boolean;
16
+ setIsCompact?: (compact: boolean) => void;
17
+ isLeftMenuOpen?: boolean;
18
+ onCloseLeftMenu?: () => void;
19
+ variant?: 'dark' | 'light';
20
+ children?: ReactNode;
21
+ };
@@ -0,0 +1,2 @@
1
+ export declare const compactMenuWidth = 75;
2
+ export declare const expandedMenuWidth = 255;
@@ -0,0 +1,2 @@
1
+ export var compactMenuWidth = 75;
2
+ export var expandedMenuWidth = 255;
@@ -0,0 +1,3 @@
1
+ import { type FC } from 'react';
2
+ import { StepperProps } from './types';
3
+ export declare const Stepper: FC<StepperProps>;
@@ -0,0 +1,14 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useMemo } from 'react';
3
+ import { StepItem } from './components/StepItem';
4
+ import { Container, ItemsWrapper } from './styles';
5
+ export var Stepper = function (_a) {
6
+ var items = _a.items, activeStep = _a.activeStep, handleChangeStep = _a.handleChangeStep;
7
+ if (!(items === null || items === void 0 ? void 0 : items.length))
8
+ return null;
9
+ var Component = useMemo(function () { return items[activeStep].component; }, [items, activeStep]);
10
+ return (_jsxs(Container, { children: [_jsx(ItemsWrapper, { children: items.map(function (_a, index) {
11
+ var title = _a.title, disabled = _a.disabled, completed = _a.completed;
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) })] }));
14
+ };
@@ -0,0 +1,11 @@
1
+ import { type FC } from 'react';
2
+ type StepItemProps = {
3
+ onClick: () => void;
4
+ title: string;
5
+ index: number;
6
+ activeStep: number;
7
+ disabled?: boolean;
8
+ completed?: boolean;
9
+ };
10
+ export declare const StepItem: FC<StepItemProps>;
11
+ export {};
@@ -0,0 +1,13 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import Icon from '../../../../Elements/Icon/Icon';
3
+ import { Paragraph2, H7 } from '../../../../Elements/Typography/Typography';
4
+ import { Trans } from '@lingui/react';
5
+ import { x } from '@xstyled/styled-components';
6
+ import isBoolean from 'lodash/isBoolean';
7
+ import { Line, StepItemContainer, StepNumber, ContentWrapper, CompletedStep } from './styles';
8
+ export var StepItem = function (_a) {
9
+ var title = _a.title, index = _a.index, disabled = _a.disabled, activeStep = _a.activeStep, completed = _a.completed, onClick = _a.onClick;
10
+ var isActiveStep = index === activeStep;
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 })] })] })] }));
13
+ };
@@ -0,0 +1,13 @@
1
+ export declare const StepItemContainer: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
2
+ isActiveStep: boolean;
3
+ isDisabled?: boolean | undefined;
4
+ }, never>;
5
+ export declare const Line: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
6
+ isActiveStep: boolean;
7
+ isCompletedStep: boolean;
8
+ }, never>;
9
+ export declare const StepNumber: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {
10
+ isActiveStep: boolean;
11
+ }, never>;
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>;
@@ -0,0 +1,33 @@
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, { css, th } from '@xstyled/styled-components';
6
+ export var StepItemContainer = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-radius: 10px;\n width: 240px;\n padding: 24px;\n background-color: ", ";\n cursor: ", ";\n"], ["\n border-radius: 10px;\n width: 240px;\n padding: 24px;\n background-color: ", ";\n cursor: ", ";\n"])), function (_a) {
7
+ var isActiveStep = _a.isActiveStep;
8
+ return (isActiveStep ? th.color('bgLightGray1') : 'transparent');
9
+ }, function (_a) {
10
+ var isDisabled = _a.isDisabled;
11
+ return (isDisabled ? 'not-allowed' : 'pointer');
12
+ });
13
+ export var Line = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n height: 4px;\n border-radius: 8px;\n width: 100%;\n background-color: ", ";\n margin-bottom: 16px;\n"], ["\n height: 4px;\n border-radius: 8px;\n width: 100%;\n background-color: ", ";\n margin-bottom: 16px;\n"])), function (_a) {
14
+ var isActiveStep = _a.isActiveStep, isCompletedStep = _a.isCompletedStep;
15
+ if (isActiveStep)
16
+ return th.color('red1');
17
+ if (isCompletedStep)
18
+ return th.color('red20');
19
+ return th.color('lightGray7');
20
+ });
21
+ export var StepNumber = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n font-size: 16px;\n font-weight: 600;\n margin-bottom: 16px;\n color: ", ";\n border: 2px solid ", ";\n border-radius: 50%;\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n\n ", "\n"], ["\n font-size: 16px;\n font-weight: 600;\n margin-bottom: 16px;\n color: ", ";\n border: 2px solid ", ";\n border-radius: 50%;\n height: 36px;\n width: 36px;\n display: flex;\n justify-content: center;\n align-items: center;\n\n ", "\n"])), function (_a) {
22
+ var isActiveStep = _a.isActiveStep;
23
+ return (isActiveStep ? th.color('red1') : th.color('lightGray6'));
24
+ }, function (_a) {
25
+ var isActiveStep = _a.isActiveStep;
26
+ return (isActiveStep ? th.color('red1') : th.color('lightGray6'));
27
+ }, function (_a) {
28
+ var isActiveStep = _a.isActiveStep;
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
+ });
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;
@@ -0,0 +1,6 @@
1
+ type HookType = () => {
2
+ activeStep: number;
3
+ handleChangeStep: (step: number) => () => void;
4
+ };
5
+ export declare const useStepper: HookType;
6
+ export {};
@@ -0,0 +1,8 @@
1
+ import { useCallback, useState } from 'react';
2
+ export var useStepper = function () {
3
+ var _a = useState(0), activeStep = _a[0], setActiveStep = _a[1];
4
+ var handleChangeStep = useCallback(function (step) { return function () {
5
+ setActiveStep(step);
6
+ }; }, []);
7
+ return { activeStep: activeStep, handleChangeStep: handleChangeStep };
8
+ };
@@ -0,0 +1,3 @@
1
+ export { Stepper as default } from './Stepper';
2
+ export { useStepper } from './hooks/useStepper';
3
+ export type { StepperItem, StepperPassedDownProps } from './types';
@@ -0,0 +1,2 @@
1
+ export { Stepper as default } from './Stepper';
2
+ export { useStepper } from './hooks/useStepper';
@@ -0,0 +1,7 @@
1
+ declare const meta: {
2
+ title: string;
3
+ tags: string[];
4
+ };
5
+ export default meta;
6
+ export declare const Default: () => import("react/jsx-runtime").JSX.Element;
7
+ export declare const AllStepsCompleted: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,60 @@
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
+ import Stepper from '../';
14
+ import Button from '../../../Elements/Button/Button';
15
+ import { LinguiContainer } from '../../../utils/LinguiContainer';
16
+ import { useStepper } from '../hooks/useStepper';
17
+ var items = [
18
+ {
19
+ title: 'Scan product',
20
+ component: function (_a) {
21
+ var handleGoToNextStep = _a.handleGoToNextStep;
22
+ return (_jsxs("div", { children: ["Scan product ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
23
+ }
24
+ },
25
+ {
26
+ title: 'Measurement',
27
+ component: function (_a) {
28
+ var handleGoToNextStep = _a.handleGoToNextStep;
29
+ return (_jsxs("div", { children: ["Measurement page ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
30
+ }
31
+ },
32
+ {
33
+ title: 'Logistic info',
34
+ component: function (_a) {
35
+ var handleGoToNextStep = _a.handleGoToNextStep;
36
+ return (_jsxs("div", { children: ["Logistic info ", _jsx(Button, { onClick: handleGoToNextStep, children: "Go next" })] }));
37
+ }
38
+ },
39
+ {
40
+ title: 'Color',
41
+ component: function (_a) {
42
+ var handleGoToNextStep = _a.handleGoToNextStep;
43
+ return (_jsxs("div", { children: ["Select color ", _jsx(Button, { onClick: handleGoToNextStep, children: "Finish" })] }));
44
+ }
45
+ }
46
+ ];
47
+ var completedItems = items.map(function (item) { return (__assign(__assign({}, item), { completed: true })); });
48
+ var meta = {
49
+ title: 'Blocks/Stepper',
50
+ tags: ['autodocs']
51
+ };
52
+ export default meta;
53
+ export var Default = function () {
54
+ var _a = useStepper(), activeStep = _a.activeStep, handleChangeStep = _a.handleChangeStep;
55
+ return (_jsx(LinguiContainer, { children: _jsx(Stepper, { items: items, activeStep: activeStep, handleChangeStep: handleChangeStep }) }));
56
+ };
57
+ export var AllStepsCompleted = function () {
58
+ var _a = useStepper(), activeStep = _a.activeStep, handleChangeStep = _a.handleChangeStep;
59
+ return (_jsx(LinguiContainer, { children: _jsx(Stepper, { items: completedItems, activeStep: activeStep, handleChangeStep: handleChangeStep }) }));
60
+ };
@@ -0,0 +1,2 @@
1
+ export declare const Container: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
2
+ export declare const ItemsWrapper: import("styled-components").StyledComponent<"div", import("@xstyled/system").Theme, {}, never>;
@@ -0,0 +1,8 @@
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 from '@xstyled/styled-components';
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"], ["\n display: flex;\n flex-direction: column;\n height: fit-content;\n justify-content: center;\n align-items: center;\n width: 100%;\n"])));
7
+ export var ItemsWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n margin-bottom: 36px;\n"], ["\n display: flex;\n margin-bottom: 36px;\n"])));
8
+ var templateObject_1, templateObject_2;
@@ -0,0 +1,15 @@
1
+ import { FC } from 'react';
2
+ export type StepperProps = {
3
+ items: StepperItem[];
4
+ activeStep: number;
5
+ handleChangeStep: (step: number) => () => void;
6
+ };
7
+ export type StepperPassedDownProps = {
8
+ handleGoToNextStep: () => void;
9
+ };
10
+ export type StepperItem = {
11
+ title: string;
12
+ completed?: boolean;
13
+ disabled?: boolean;
14
+ component: FC<StepperPassedDownProps>;
15
+ };
@@ -0,0 +1 @@
1
+ export {};
@@ -1,3 +1,3 @@
1
1
  import type { TextProps } from './types';
2
- declare const Text: (props: TextProps) => JSX.Element;
2
+ declare const Text: ({ as, ...props }: TextProps) => JSX.Element;
3
3
  export default Text;
@@ -9,7 +9,21 @@ var __assign = (this && this.__assign) || function () {
9
9
  };
10
10
  return __assign.apply(this, arguments);
11
11
  };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
12
23
  import { jsx as _jsx } from "react/jsx-runtime";
13
24
  import { x } from '@xstyled/styled-components';
14
- var Text = function (props) { return _jsx(x.div, __assign({ as: "span" }, props)); };
25
+ var Text = function (_a) {
26
+ var _b = _a.as, as = _b === void 0 ? 'span' : _b, props = __rest(_a, ["as"]);
27
+ return _jsx(x.div, __assign({ as: as }, props));
28
+ };
15
29
  export default Text;
@@ -2,7 +2,7 @@
2
2
  import type { StoryObj } from '@storybook/react';
3
3
  declare const meta: {
4
4
  title: string;
5
- component: (props: import("..").TextProps) => JSX.Element;
5
+ component: ({ as, ...props }: import("..").TextProps) => JSX.Element;
6
6
  tags: string[];
7
7
  argTypes: {};
8
8
  };
@@ -1,13 +1,15 @@
1
- import { ReactNode } from 'react';
1
+ import { ComponentType, ReactNode } from 'react';
2
2
  export type TextVariant = 'normal' | 'medium' | 'semiBold' | 'bold';
3
3
  export type TextProps = {
4
4
  children?: ReactNode | ReactNode[];
5
- fontSize?: number;
5
+ fontSize?: string | number;
6
6
  fontWeight?: string;
7
+ fontFamily?: string;
7
8
  variant?: TextVariant;
8
9
  mt?: string | number;
9
10
  mr?: string | number;
10
11
  mb?: string | number;
11
12
  ml?: string | number;
12
13
  color?: string;
14
+ as?: string | ComponentType<any>;
13
15
  };
@@ -1,117 +1,14 @@
1
1
  import { TextProps as BaseTextProps } from '../Text';
2
- export declare const Text: {
3
- (props: BaseTextProps): JSX.Element;
4
- defaultProps: {
5
- fontFamily: string;
6
- };
7
- };
8
- export declare const Paragraph1: {
9
- (props: BaseTextProps): JSX.Element;
10
- defaultProps: {
11
- as: string;
12
- fontFamily: string;
13
- fontSize: string;
14
- };
15
- };
16
- export declare const Paragraph2: {
17
- (props: BaseTextProps): JSX.Element;
18
- defaultProps: {
19
- as: string;
20
- fontFamily: string;
21
- fontSize: string;
22
- };
23
- };
24
- export declare const Paragraph3: {
25
- (props: BaseTextProps): JSX.Element;
26
- defaultProps: {
27
- as: string;
28
- fontFamily: string;
29
- fontSize: string;
30
- };
31
- };
32
- export declare const Paragraph4: {
33
- (props: BaseTextProps): JSX.Element;
34
- defaultProps: {
35
- as: string;
36
- fontFamily: string;
37
- fontSize: string;
38
- };
39
- };
40
- export declare const Paragraph5: {
41
- (props: BaseTextProps): JSX.Element;
42
- defaultProps: {
43
- as: string;
44
- fontFamily: string;
45
- fontSize: string;
46
- };
47
- };
48
- export declare const H1: {
49
- (props: BaseTextProps): JSX.Element;
50
- defaultProps: {
51
- as: string;
52
- fontFamily: string;
53
- fontSize: string;
54
- mt: number;
55
- mb: number;
56
- };
57
- };
58
- export declare const H2: {
59
- (props: BaseTextProps): JSX.Element;
60
- defaultProps: {
61
- as: string;
62
- fontFamily: string;
63
- fontSize: string;
64
- mt: number;
65
- mb: number;
66
- };
67
- };
68
- export declare const H3: {
69
- (props: BaseTextProps): JSX.Element;
70
- defaultProps: {
71
- as: string;
72
- fontFamily: string;
73
- fontSize: string;
74
- mt: number;
75
- mb: number;
76
- };
77
- };
78
- export declare const H4: {
79
- (props: BaseTextProps): JSX.Element;
80
- defaultProps: {
81
- as: string;
82
- fontFamily: string;
83
- fontSize: string;
84
- mt: number;
85
- mb: number;
86
- };
87
- };
88
- export declare const H5: {
89
- (props: BaseTextProps): JSX.Element;
90
- defaultProps: {
91
- as: string;
92
- fontFamily: string;
93
- fontSize: string;
94
- mt: number;
95
- mb: number;
96
- };
97
- };
98
- export declare const H6: {
99
- (props: BaseTextProps): JSX.Element;
100
- defaultProps: {
101
- as: string;
102
- fontFamily: string;
103
- fontSize: string;
104
- mt: number;
105
- mb: number;
106
- };
107
- };
108
- export declare const H7: {
109
- (props: BaseTextProps): JSX.Element;
110
- defaultProps: {
111
- as: string;
112
- fontFamily: string;
113
- fontSize: string;
114
- mt: number;
115
- mb: number;
116
- };
117
- };
2
+ export declare const Text: ({ as, fontFamily, fontSize, variant, ...props }: BaseTextProps) => JSX.Element;
3
+ export declare const Paragraph1: (props: BaseTextProps) => JSX.Element;
4
+ export declare const Paragraph2: (props: BaseTextProps) => JSX.Element;
5
+ export declare const Paragraph3: (props: BaseTextProps) => JSX.Element;
6
+ export declare const Paragraph4: (props: BaseTextProps) => JSX.Element;
7
+ export declare const Paragraph5: (props: BaseTextProps) => JSX.Element;
8
+ export declare const H1: (props: BaseTextProps) => JSX.Element;
9
+ export declare const H2: (props: BaseTextProps) => JSX.Element;
10
+ export declare const H3: (props: BaseTextProps) => JSX.Element;
11
+ export declare const H4: (props: BaseTextProps) => JSX.Element;
12
+ export declare const H5: (props: BaseTextProps) => JSX.Element;
13
+ export declare const H6: (props: BaseTextProps) => JSX.Element;
14
+ export declare const H7: (props: BaseTextProps) => JSX.Element;