@mailstep/design-system 0.7.65-beta.2 → 0.7.66-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.7.65-beta.2",
3
+ "version": "0.7.66-beta.0",
4
4
  "license": "ISC",
5
5
  "type": "module",
6
6
  "main": "./ui/index.js",
@@ -1,6 +1,6 @@
1
1
  import { type FC } from 'react';
2
2
  import type { Brand, Variant } from '../../Elements/Logo';
3
- import { LanguageItem } from '../LanguageSwitch';
3
+ import { type LanguageItem } from '../LanguageSwitch';
4
4
  import type { MenuItemType } from '../SideMenu/types';
5
5
  import type { User } from './types';
6
6
  type Props = {
@@ -20,6 +20,7 @@ type Props = {
20
20
  onOpenMobileSideMenu?: () => void;
21
21
  onChangeLanguage?: (language: string) => void;
22
22
  onLogout?: () => void;
23
+ withLanguageSwitch?: boolean;
23
24
  };
24
25
  export declare const Header: FC<Props>;
25
26
  export {};
@@ -9,7 +9,7 @@ import { useChangeLanguage } from './hooks/useChangeLanguage';
9
9
  import { languageItems as defaultLanguageItems } from './utils/languageItems';
10
10
  import { Container, LeftSide, RightSide, LanguageWrapper } from './styles';
11
11
  export var Header = function (_a) {
12
- var isMobileMenuOpen = _a.isMobileMenuOpen, homeLink = _a.homeLink, logo = _a.logo, logoVariant = _a.logoVariant, logoSrc = _a.logoSrc, logoSrcWidth = _a.logoSrcWidth, user = _a.user, currentLanguage = _a.currentLanguage, _b = _a.hasUserMenu, hasUserMenu = _b === void 0 ? false : _b, rightMenuItems = _a.rightMenuItems, showLanguageWithTitle = _a.showLanguageWithTitle, languageFlagWrapBackgroundColor = _a.languageFlagWrapBackgroundColor, _c = _a.languageItems, languageItems = _c === void 0 ? defaultLanguageItems : _c, onOpenMobileSideMenu = _a.onOpenMobileSideMenu, onChangeLanguage = _a.onChangeLanguage, onLogout = _a.onLogout;
12
+ var isMobileMenuOpen = _a.isMobileMenuOpen, homeLink = _a.homeLink, logo = _a.logo, logoVariant = _a.logoVariant, logoSrc = _a.logoSrc, logoSrcWidth = _a.logoSrcWidth, user = _a.user, currentLanguage = _a.currentLanguage, _b = _a.hasUserMenu, hasUserMenu = _b === void 0 ? false : _b, rightMenuItems = _a.rightMenuItems, showLanguageWithTitle = _a.showLanguageWithTitle, languageFlagWrapBackgroundColor = _a.languageFlagWrapBackgroundColor, _c = _a.languageItems, languageItems = _c === void 0 ? defaultLanguageItems : _c, _d = _a.withLanguageSwitch, withLanguageSwitch = _d === void 0 ? true : _d, onOpenMobileSideMenu = _a.onOpenMobileSideMenu, onChangeLanguage = _a.onChangeLanguage, onLogout = _a.onLogout;
13
13
  var handleChangeLanguage = useChangeLanguage({ onChangeLanguage: onChangeLanguage }).handleChangeLanguage;
14
- return (_jsxs(Container, { children: [_jsxs(LeftSide, { children: [onOpenMobileSideMenu && _jsx(HamburgerMenuButton, { isLeftMenuOpen: isMobileMenuOpen, onClick: onOpenMobileSideMenu }), _jsx(Link, { to: homeLink, children: logoSrc ? (_jsx("img", { src: logoSrc, alt: "logo", width: logoSrcWidth })) : (_jsx(Logo, { brand: logo, variant: logoVariant, width: "145px" })) })] }), _jsxs(RightSide, { children: [Array.isArray(rightMenuItems) && (rightMenuItems === null || rightMenuItems === void 0 ? void 0 : rightMenuItems.length) > 0 && _jsx(MenuItems, { items: rightMenuItems }), _jsx(LanguageWrapper, { children: _jsx(LanguageSwitch, { languageItems: languageItems, withTitle: showLanguageWithTitle, onLanguageChange: handleChangeLanguage, activeLanguage: currentLanguage, languageFlagWrapBackgroundColor: languageFlagWrapBackgroundColor }) }), hasUserMenu && _jsx(UserMenu, { user: user, onLogout: onLogout })] })] }));
14
+ return (_jsxs(Container, { children: [_jsxs(LeftSide, { children: [onOpenMobileSideMenu && _jsx(HamburgerMenuButton, { isLeftMenuOpen: isMobileMenuOpen, onClick: onOpenMobileSideMenu }), _jsx(Link, { to: homeLink, children: logoSrc ? (_jsx("img", { src: logoSrc, alt: "logo", width: logoSrcWidth })) : (logo && _jsx(Logo, { brand: logo, variant: logoVariant, width: "145px" })) })] }), _jsxs(RightSide, { children: [Array.isArray(rightMenuItems) && (rightMenuItems === null || rightMenuItems === void 0 ? void 0 : rightMenuItems.length) > 0 && _jsx(MenuItems, { items: rightMenuItems }), withLanguageSwitch && (_jsx(LanguageWrapper, { children: _jsx(LanguageSwitch, { languageItems: languageItems, withTitle: showLanguageWithTitle, onLanguageChange: handleChangeLanguage, activeLanguage: currentLanguage, languageFlagWrapBackgroundColor: languageFlagWrapBackgroundColor }) })), hasUserMenu && _jsx(UserMenu, { user: user, onLogout: onLogout })] })] }));
15
15
  };
@@ -18,6 +18,7 @@ declare const meta: {
18
18
  onOpenMobileSideMenu?: (() => void) | undefined;
19
19
  onChangeLanguage?: ((language: string) => void) | undefined;
20
20
  onLogout?: (() => void) | undefined;
21
+ withLanguageSwitch?: boolean | undefined;
21
22
  }>;
22
23
  tags: string[];
23
24
  argTypes: {};
@@ -49,6 +49,6 @@ var MenuItem = function (_a) {
49
49
  }, [items, link]);
50
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-expect-error
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, textAlign: isCompact ? 'center' : 'left', 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))); }) }))] }));
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, textAlign: "left", 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
  };
54
54
  export default memo(MenuItem);
@@ -29,7 +29,6 @@ export { Inventory2 } from './Inventory2';
29
29
  export { Logout1 } from './Logout1';
30
30
  export { Puzzle1 } from './Puzzle1';
31
31
  export { AddPhoto } from './AddPhoto';
32
- export { Layout } from './Layout';
33
32
  export { Link } from './Link';
34
33
  export { OpenBox } from './OpenBox';
35
34
  export { Box } from './Box';
@@ -29,7 +29,6 @@ export { Inventory2 } from './Inventory2';
29
29
  export { Logout1 } from './Logout1';
30
30
  export { Puzzle1 } from './Puzzle1';
31
31
  export { AddPhoto } from './AddPhoto';
32
- export { Layout } from './Layout';
33
32
  export { Link } from './Link';
34
33
  export { OpenBox } from './OpenBox';
35
34
  export { Box } from './Box';
@@ -29,9 +29,6 @@ declare const defaultTheme: {
29
29
  typoPrimary: string;
30
30
  blue10: string;
31
31
  blue20: string;
32
- blue30: string;
33
- blue40: string;
34
- blue50: string;
35
32
  blue60: string;
36
33
  blue70: string;
37
34
  blue80: string;
@@ -82,13 +79,8 @@ declare const defaultTheme: {
82
79
  purple60: string;
83
80
  purple80: string;
84
81
  purple90: string;
85
- magenta10: string;
86
82
  magenta20: string;
87
- magenta30: string;
88
- magenta40: string;
89
- magenta50: string;
90
83
  magenta60: string;
91
- magenta70: string;
92
84
  magenta80: string;
93
85
  magenta90: string;
94
86
  };
@@ -29,9 +29,6 @@ var defaultTheme = {
29
29
  typoPrimary: '#22394E',
30
30
  blue10: '#F3F9FF',
31
31
  blue20: '#DCEFFF',
32
- blue30: '#BFE0FF',
33
- blue40: '#6FADFF',
34
- blue50: '#2684FF',
35
32
  blue60: '#0065FF',
36
33
  blue70: '#0052CC',
37
34
  blue80: '#0747A6',
@@ -82,15 +79,10 @@ var defaultTheme = {
82
79
  purple60: '#6554C0',
83
80
  purple80: '#403294',
84
81
  purple90: '#03235f',
85
- magenta10: '#FFF7FB',
86
82
  magenta20: '#FCF1F7',
87
- magenta30: '#FFD6E8',
88
- magenta40: '#FFAFD2',
89
- magenta50: '#FF7EB6',
90
83
  magenta60: '#EE5396',
91
- magenta70: '#D12771',
92
84
  magenta80: '#9F1853',
93
- magenta90: '#7B1340',
85
+ magenta90: '#872e8b',
94
86
  },
95
87
  fonts: {
96
88
  primary: 'Inter, sans-serif',
@@ -30,9 +30,6 @@ declare const themes: {
30
30
  typoPrimary: string;
31
31
  blue10: string;
32
32
  blue20: string;
33
- blue30: string;
34
- blue40: string;
35
- blue50: string;
36
33
  blue60: string;
37
34
  blue70: string;
38
35
  blue80: string;
@@ -83,13 +80,8 @@ declare const themes: {
83
80
  purple60: string;
84
81
  purple80: string;
85
82
  purple90: string;
86
- magenta10: string;
87
83
  magenta20: string;
88
- magenta30: string;
89
- magenta40: string;
90
- magenta50: string;
91
84
  magenta60: string;
92
- magenta70: string;
93
85
  magenta80: string;
94
86
  magenta90: string;
95
87
  };