@mailstep/design-system 0.13.7 → 0.13.8
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/README.md +1 -0
- package/package.json +3 -2
- package/ui/Blocks/Modal/Modal.js +0 -5
- package/ui/Blocks/SideMenu/MenuItem.js +25 -16
- package/ui/Blocks/SideMenu/SideMenu.js +23 -15
- package/ui/Blocks/SideMenu/components/HamburgerMenu.d.ts +3 -1
- package/ui/Blocks/SideMenu/components/HamburgerMenu.js +3 -3
- package/ui/Blocks/SideMenu/components/SubitemTooltip.js +6 -6
- package/ui/Blocks/SideMenu/stories/menuItems.d.ts +19 -0
- package/ui/Blocks/SideMenu/stories/menuItems.js +3 -1
- package/ui/Blocks/SideMenu/styles.d.ts +4 -0
- package/ui/Blocks/SideMenu/styles.js +34 -5
- package/ui/Blocks/SideMenu/types.d.ts +2 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +1 -2
- package/ui/Elements/DropdownSelect/DropdownSelect.js +0 -1
- package/ui/Elements/HighlightBox/HighlightBox.d.ts +0 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +1 -2
- package/ui/Elements/Select/components/ChevronOption.js +1 -2
- package/ui/Elements/Select/components/DropdownIndicator.js +1 -2
- package/ui/Elements/Select/themes/index.js +0 -2
- package/ui/Elements/Toggle/Toggle.js +0 -1
- package/ui/Forms/Checkbox/Checkbox.js +0 -1
- package/ui/Forms/Input/Input.js +0 -1
- package/ui/Modules/CommonGrid/components/ActionHead/ActionHead.js +0 -2
- package/ui/Modules/CommonGrid/components/ButtonMore/ButtonMore.js +0 -1
- package/ui/Modules/CommonGrid/components/ControlButtons/ControlButtons.js +1 -5
- package/ui/Modules/CommonGrid/components/Filters/NumberRange/NumberRange.js +0 -1
- package/ui/Modules/CommonGrid/components/Filters/TextRange/TextRange.js +0 -1
- package/ui/Modules/CommonGrid/components/gridCells/EnumInCell.js +0 -1
- package/ui/Modules/CommonGrid/components/gridCells/IconButtonInCell.js +0 -2
- package/ui/Elements/Select/components/CustomInput.d.ts +0 -2
- package/ui/Elements/Select/components/CustomInput.js +0 -13
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.8",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"deploy:win": "npm run build:win && npm publish ./build",
|
|
21
21
|
"dev": "yarn storybook",
|
|
22
22
|
"test": "echo \"The tests are still waiting to be written, but it seems like they're really good at procrastinating!\"",
|
|
23
|
-
"lint": "eslint ./packages/ui/**/*.{ts,tsx}",
|
|
23
|
+
"lint": "eslint './packages/ui/**/*.{ts,tsx}'",
|
|
24
24
|
"prepare": "husky"
|
|
25
25
|
},
|
|
26
26
|
"lint-staged": {
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"@nivo/legends": "^0.73.0",
|
|
46
46
|
"@nivo/pie": "^0.73.0",
|
|
47
47
|
"@popperjs/core": "^2.11.8",
|
|
48
|
+
"@storybook-community/storybook-dark-mode": "7.1.4",
|
|
48
49
|
"@storybook/addon-designs": "^11.1.4",
|
|
49
50
|
"@storybook/addon-docs": "10.6.0",
|
|
50
51
|
"@storybook/addon-links": "10.6.0",
|
package/ui/Blocks/Modal/Modal.js
CHANGED
|
@@ -41,7 +41,6 @@ const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title,
|
|
|
41
41
|
style: dialogStyle,
|
|
42
42
|
$backgroundColor: background,
|
|
43
43
|
top,
|
|
44
|
-
"data-cy": "dialogWindow",
|
|
45
44
|
onClick: closeEverywhere ? closeDialog : void 0,
|
|
46
45
|
$minWidth: minWidth,
|
|
47
46
|
$minHeight: minHeight,
|
|
@@ -72,7 +71,6 @@ const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title,
|
|
|
72
71
|
}),
|
|
73
72
|
withCloseIcon && /* @__PURE__ */ jsx(CloseButton, {
|
|
74
73
|
onClick: closeDialog,
|
|
75
|
-
"data-cy": "dialogCloseBtn",
|
|
76
74
|
children: /* @__PURE__ */ jsx(Cancel, {
|
|
77
75
|
width: "11px",
|
|
78
76
|
height: "11px"
|
|
@@ -88,7 +86,6 @@ const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title,
|
|
|
88
86
|
type: "button",
|
|
89
87
|
onClick: onExtraAction,
|
|
90
88
|
isLoading,
|
|
91
|
-
"data-cy": "extraActionBtn",
|
|
92
89
|
appearance: "secondary",
|
|
93
90
|
variant: "ghost",
|
|
94
91
|
children: extraActionLabel
|
|
@@ -99,7 +96,6 @@ const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title,
|
|
|
99
96
|
type: "button",
|
|
100
97
|
onClick: onCancel,
|
|
101
98
|
isLoading,
|
|
102
|
-
"data-cy": "cancelBtn",
|
|
103
99
|
appearance: "secondary",
|
|
104
100
|
variant: "default",
|
|
105
101
|
"data-testid": name ? `button-${name}-cancel` : void 0,
|
|
@@ -109,7 +105,6 @@ const Modal = memo(({ children, isShown = true, onExtraAction, onCancel, title,
|
|
|
109
105
|
onClick: onDialogConfirmClick,
|
|
110
106
|
isLoading,
|
|
111
107
|
disabled: isConfirmDisabled,
|
|
112
|
-
"data-cy": "submitBtn",
|
|
113
108
|
appearance: "primary",
|
|
114
109
|
variant: "default",
|
|
115
110
|
"data-testid": name ? `button-${name}-confirm` : void 0,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import Icon from "../../Elements/Icon/Icon.js";
|
|
2
2
|
import { Paragraph3, Paragraph5 } from "../../Elements/Typography/Typography.js";
|
|
3
|
-
import { ItemDropdownArrow, ItemIcon, ItemLabel, ItemLinkWrap, ItemsSeparator, MenuItemContainer, OverflowWithEllipsis, SubItemsWrap } from "./styles.js";
|
|
3
|
+
import { ItemCount, ItemDropdownArrow, ItemIcon, ItemLabel, ItemLinkWrap, ItemsSeparator, MenuItemContainer, OverflowWithEllipsis, SubItemsWrap } from "./styles.js";
|
|
4
4
|
import SubitemTooltip from "./components/SubitemTooltip.js";
|
|
5
5
|
import { useLeftMenuContext } from "./context/useLeftMenuContext.js";
|
|
6
6
|
import useOutSideHover from "./hooks/useOutsideHover.js";
|
|
@@ -9,7 +9,7 @@ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
|
9
9
|
import { matchPath } from "react-router";
|
|
10
10
|
//#region packages/ui/Blocks/SideMenu/MenuItem.tsx
|
|
11
11
|
const removeOptionalEnd = /\?$/;
|
|
12
|
-
const MenuItem = ({ icon, title, link = "", items, id, isSubitem, isCompact, lightMode = false, separator = false, isLeftMenuOpen, onCloseLeftMenu, onClick }) => {
|
|
12
|
+
const MenuItem = ({ icon, title, link = "", items, id, count, isSubitem, isCompact, lightMode = false, separator = false, isLeftMenuOpen, onCloseLeftMenu, onClick }) => {
|
|
13
13
|
const hasChildren = items && items?.length > 0;
|
|
14
14
|
const { expandedItem, expandItem } = useLeftMenuContext();
|
|
15
15
|
const isExpanded = expandedItem === id;
|
|
@@ -61,6 +61,8 @@ const MenuItem = ({ icon, title, link = "", items, id, isSubitem, isCompact, lig
|
|
|
61
61
|
$isCompact: isCompact,
|
|
62
62
|
className: itemLinkWrapClassName,
|
|
63
63
|
$lightMode: lightMode,
|
|
64
|
+
$isHovering: isHovering,
|
|
65
|
+
"data-testid": id ? `menu-item-${id}` : void 0,
|
|
64
66
|
as: link ? void 0 : "a",
|
|
65
67
|
...link ? {
|
|
66
68
|
exact: true,
|
|
@@ -70,20 +72,27 @@ const MenuItem = ({ icon, title, link = "", items, id, isSubitem, isCompact, lig
|
|
|
70
72
|
children: [/* @__PURE__ */ jsxs(ItemLabel, {
|
|
71
73
|
$isCompact: isCompact,
|
|
72
74
|
isSubitem,
|
|
73
|
-
children: [
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
icon,
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
75
|
+
children: [
|
|
76
|
+
!isSubitem && icon && /* @__PURE__ */ jsx(ItemIcon, {
|
|
77
|
+
className: "mainIcon",
|
|
78
|
+
$isCompact: isCompact,
|
|
79
|
+
children: typeof icon === "string" ? /* @__PURE__ */ jsx(Icon, {
|
|
80
|
+
icon,
|
|
81
|
+
fill: "none"
|
|
82
|
+
}) : icon
|
|
83
|
+
}),
|
|
84
|
+
/* @__PURE__ */ jsx(Title, {
|
|
85
|
+
variant: "semiBold",
|
|
86
|
+
mt: 0,
|
|
87
|
+
mb: 0,
|
|
88
|
+
textAlign: isCompact ? "center" : "left",
|
|
89
|
+
children: /* @__PURE__ */ jsx(OverflowWithEllipsis, { children: title })
|
|
90
|
+
}),
|
|
91
|
+
!!count && /* @__PURE__ */ jsx(ItemCount, {
|
|
92
|
+
$isCompact: isCompact,
|
|
93
|
+
children: count
|
|
94
|
+
})
|
|
95
|
+
]
|
|
87
96
|
}), !isCompact && hasChildren && /* @__PURE__ */ jsx(ItemDropdownArrow, {
|
|
88
97
|
icon: "goDown",
|
|
89
98
|
$lightMode: lightMode
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { useClickOutside } from "../Modal/hooks/useClickOutside.js";
|
|
2
|
+
import { HamburgerMenuButton } from "./components/HamburgerMenu.js";
|
|
2
3
|
import MenuFooter from "./components/Footer.js";
|
|
3
4
|
import { LeftMenuProvider } from "./context/LeftMenuContext.js";
|
|
4
5
|
import { BodyWrap, Container, Overlay, ScrollWrap, TopLevelWrap } from "./styles.js";
|
|
@@ -6,7 +7,7 @@ import MenuItem_default from "./MenuItem.js";
|
|
|
6
7
|
import "react";
|
|
7
8
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
9
|
//#region packages/ui/Blocks/SideMenu/SideMenu.tsx
|
|
9
|
-
const SideMenu = ({ menuItems, isCompact, setIsCompact, isLeftMenuOpen, isAlwaysVisible, onCloseLeftMenu, variant = "dark", children }) => {
|
|
10
|
+
const SideMenu = ({ menuItems, isCompact, setIsCompact, isLeftMenuOpen, isAlwaysVisible, onCloseLeftMenu, showHamburgerMenu = false, variant = "dark", children }) => {
|
|
10
11
|
const lightMode = variant === "light";
|
|
11
12
|
return /* @__PURE__ */ jsx(LeftMenuProvider, { children: /* @__PURE__ */ jsxs(Container, {
|
|
12
13
|
isLeftMenuOpen,
|
|
@@ -16,21 +17,28 @@ const SideMenu = ({ menuItems, isCompact, setIsCompact, isLeftMenuOpen, isAlways
|
|
|
16
17
|
isLeftMenuOpen,
|
|
17
18
|
ref: useClickOutside({ onClose: onCloseLeftMenu }),
|
|
18
19
|
lightMode,
|
|
19
|
-
children: [
|
|
20
|
-
|
|
21
|
-
children: [menuItems.map((item, index) => /* @__PURE__ */ jsx(MenuItem_default, {
|
|
22
|
-
isCompact,
|
|
20
|
+
children: [
|
|
21
|
+
showHamburgerMenu && /* @__PURE__ */ jsx(HamburgerMenuButton, {
|
|
23
22
|
isLeftMenuOpen,
|
|
24
|
-
onCloseLeftMenu
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
23
|
+
onClick: onCloseLeftMenu
|
|
24
|
+
}),
|
|
25
|
+
/* @__PURE__ */ jsx(ScrollWrap, { children: /* @__PURE__ */ jsxs(BodyWrap, {
|
|
26
|
+
isCompact,
|
|
27
|
+
children: [menuItems.map((item, index) => /* @__PURE__ */ jsx(MenuItem_default, {
|
|
28
|
+
isCompact,
|
|
29
|
+
isLeftMenuOpen,
|
|
30
|
+
onCloseLeftMenu,
|
|
31
|
+
lightMode,
|
|
32
|
+
separator: !!item.separator,
|
|
33
|
+
...item
|
|
34
|
+
}, `${item.id ?? item.title}-${index}`)), children]
|
|
35
|
+
}) }),
|
|
36
|
+
/* @__PURE__ */ jsx(MenuFooter, {
|
|
37
|
+
isCompact,
|
|
38
|
+
setIsCompact,
|
|
39
|
+
lightMode
|
|
40
|
+
})
|
|
41
|
+
]
|
|
34
42
|
}), /* @__PURE__ */ jsx(Overlay, {})]
|
|
35
43
|
}) });
|
|
36
44
|
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
type Props = {
|
|
2
3
|
isLeftMenuOpen?: boolean;
|
|
3
4
|
onClick?: () => void;
|
|
5
|
+
mr?: string;
|
|
4
6
|
};
|
|
5
|
-
export declare const HamburgerMenuButton: ({ isLeftMenuOpen, onClick }: Props) =>
|
|
7
|
+
export declare const HamburgerMenuButton: ({ isLeftMenuOpen, onClick, mr }: Props) => React.ReactElement;
|
|
6
8
|
export {};
|
|
@@ -35,11 +35,11 @@ const HamburgerMenuWrapper = styled$2(x.div)`
|
|
|
35
35
|
display: none;
|
|
36
36
|
}
|
|
37
37
|
`;
|
|
38
|
-
const HamburgerMenuButton = ({ isLeftMenuOpen, onClick }) => {
|
|
38
|
+
const HamburgerMenuButton = ({ isLeftMenuOpen, onClick, mr = "8px" }) => {
|
|
39
39
|
const theme = useTheme();
|
|
40
|
-
const neutralColor = th$1.color("
|
|
40
|
+
const neutralColor = th$1.color("bgLightGray2")({ theme });
|
|
41
41
|
return /* @__PURE__ */ jsx(HamburgerMenuWrapper, {
|
|
42
|
-
mr
|
|
42
|
+
mr,
|
|
43
43
|
onClick,
|
|
44
44
|
isLeftMenuOpen: !!isLeftMenuOpen,
|
|
45
45
|
children: isLeftMenuOpen ? /* @__PURE__ */ jsx(MobileCancel, { fill: neutralColor }) : /* @__PURE__ */ jsx(HamburgerMenu, {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { H6 } from "../../../Elements/Typography/Typography.js";
|
|
2
2
|
import { Portal } from "../../../Elements/Portal/index.js";
|
|
3
|
-
import { ItemLinkWrap, TooltipItemLabel, TooltipWrap } from "../styles.js";
|
|
3
|
+
import { ItemCount, ItemLinkWrap, TooltipItemLabel, TooltipWrap } from "../styles.js";
|
|
4
4
|
import { useMemo } from "react";
|
|
5
|
-
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import styled from "styled-components";
|
|
7
7
|
import { Popper } from "react-popper";
|
|
8
8
|
//#region packages/ui/Blocks/SideMenu/components/SubitemTooltip.tsx
|
|
9
|
-
const TooltipItem = ({ title, link = "", lightMode }) => {
|
|
9
|
+
const TooltipItem = ({ title, link = "", lightMode, count }) => {
|
|
10
10
|
return /* @__PURE__ */ jsx(ItemLinkWrap, {
|
|
11
11
|
...useMemo(() => {
|
|
12
12
|
return link.startsWith("https://") ? {
|
|
@@ -16,14 +16,14 @@ const TooltipItem = ({ title, link = "", lightMode }) => {
|
|
|
16
16
|
}, [link]),
|
|
17
17
|
exact: true,
|
|
18
18
|
$lightMode: lightMode,
|
|
19
|
-
children: /* @__PURE__ */
|
|
19
|
+
children: /* @__PURE__ */ jsxs(TooltipItemLabel, { children: [/* @__PURE__ */ jsx(H6, {
|
|
20
20
|
variant: "medium",
|
|
21
21
|
children: title
|
|
22
|
-
}) })
|
|
22
|
+
}), !!count && /* @__PURE__ */ jsx(ItemCount, { children: count })] })
|
|
23
23
|
});
|
|
24
24
|
};
|
|
25
25
|
const PopoverWrapper = styled.div`
|
|
26
|
-
z-index:
|
|
26
|
+
z-index: 31;
|
|
27
27
|
display: ${({ isLeftMenuOpen }) => isLeftMenuOpen ? "block" : "none"};
|
|
28
28
|
@media (min-width: 1024px) {
|
|
29
29
|
display: block;
|
|
@@ -4,6 +4,7 @@ export declare const menuItems: ({
|
|
|
4
4
|
link: string;
|
|
5
5
|
id: string;
|
|
6
6
|
items?: undefined;
|
|
7
|
+
count?: undefined;
|
|
7
8
|
} | {
|
|
8
9
|
title: string;
|
|
9
10
|
icon: import("react/jsx-runtime").JSX.Element;
|
|
@@ -14,4 +15,22 @@ export declare const menuItems: ({
|
|
|
14
15
|
link: string;
|
|
15
16
|
id: string;
|
|
16
17
|
}[];
|
|
18
|
+
count?: undefined;
|
|
19
|
+
} | {
|
|
20
|
+
title: string;
|
|
21
|
+
icon: import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
link: string;
|
|
23
|
+
id: string;
|
|
24
|
+
count: number;
|
|
25
|
+
items: ({
|
|
26
|
+
title: string;
|
|
27
|
+
link: string;
|
|
28
|
+
id: string;
|
|
29
|
+
count?: undefined;
|
|
30
|
+
} | {
|
|
31
|
+
title: string;
|
|
32
|
+
link: string;
|
|
33
|
+
id: string;
|
|
34
|
+
count: number;
|
|
35
|
+
})[];
|
|
17
36
|
})[];
|
|
@@ -53,6 +53,7 @@ const menuItems = [
|
|
|
53
53
|
icon: /* @__PURE__ */ jsx(Expeditions, {}),
|
|
54
54
|
link: "/expeditions",
|
|
55
55
|
id: "expeditions",
|
|
56
|
+
count: 3,
|
|
56
57
|
items: [
|
|
57
58
|
{
|
|
58
59
|
title: "Expeditions",
|
|
@@ -62,7 +63,8 @@ const menuItems = [
|
|
|
62
63
|
{
|
|
63
64
|
title: "Outbound receipts",
|
|
64
65
|
link: "/expeditions/outbound-receipts",
|
|
65
|
-
id: "outboundReceipts"
|
|
66
|
+
id: "outboundReceipts",
|
|
67
|
+
count: 3
|
|
66
68
|
},
|
|
67
69
|
{
|
|
68
70
|
title: "Missing goods",
|
|
@@ -16,6 +16,7 @@ export declare const TooltipItemLabel: import("styled-components").StyledCompone
|
|
|
16
16
|
export declare const ItemLinkWrap: import("styled-components").StyledComponent<typeof NavLink, import("@xstyled/styled-components").Theme, {
|
|
17
17
|
$isCompact?: boolean;
|
|
18
18
|
$lightMode?: boolean;
|
|
19
|
+
$isHovering?: boolean;
|
|
19
20
|
appearance?: "gray" | "default";
|
|
20
21
|
}, never>;
|
|
21
22
|
export declare const MenuItemContainer: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {
|
|
@@ -41,3 +42,6 @@ export declare const BodyWrap: import("styled-components").StyledComponent<"div"
|
|
|
41
42
|
isCompact: boolean;
|
|
42
43
|
}, never>;
|
|
43
44
|
export declare const Overlay: import("styled-components").StyledComponent<"div", import("@xstyled/styled-components").Theme, {}, never>;
|
|
45
|
+
export declare const ItemCount: import("styled-components").StyledComponent<"span", import("@xstyled/styled-components").Theme, {
|
|
46
|
+
$isCompact?: boolean;
|
|
47
|
+
}, never>;
|
|
@@ -67,6 +67,8 @@ const ItemDropdownArrow = styled$1(Icon)`
|
|
|
67
67
|
const TooltipItemLabel = styled$1.div`
|
|
68
68
|
line-height: 1.5;
|
|
69
69
|
letter-spacing: 0.4px;
|
|
70
|
+
display: flex;
|
|
71
|
+
align-items: center;
|
|
70
72
|
`;
|
|
71
73
|
const ItemLinkWrap = styled$1(NavLink)`
|
|
72
74
|
display: flex;
|
|
@@ -78,14 +80,17 @@ const ItemLinkWrap = styled$1(NavLink)`
|
|
|
78
80
|
font-weight: 600;
|
|
79
81
|
letter-spacing: 0.4px;
|
|
80
82
|
position: relative;
|
|
81
|
-
color: ${({ $lightMode }) =>
|
|
83
|
+
color: ${({ $lightMode, $isHovering }) => {
|
|
84
|
+
if ($lightMode) return th$1.color("typoPrimary");
|
|
85
|
+
if ($isHovering) return "white";
|
|
86
|
+
return th$1.color("lightGray5");
|
|
87
|
+
}};
|
|
82
88
|
transition: moving 0.2s cubic-bezier(0.25, 0.8, 0.25, 1);
|
|
83
89
|
transition-property: transform;
|
|
84
90
|
|
|
85
91
|
&.toplevel {
|
|
86
92
|
margin: ${({ $isCompact }) => $isCompact ? "0 0 12px 0" : "16px 0"};
|
|
87
93
|
padding: ${({ $isCompact }) => $isCompact ? "10px 14px 6px 13px" : "9px 10px"};
|
|
88
|
-
gap: ${({ $isCompact }) => $isCompact ? "none" : "30px"};
|
|
89
94
|
justify-content: ${({ $isCompact }) => $isCompact ? "center" : "space-between"};
|
|
90
95
|
&.active {
|
|
91
96
|
color: ${({ $lightMode }) => $lightMode ? th$1("colors.red1") : "white"};
|
|
@@ -130,7 +135,7 @@ const MenuItemContainer = styled$1.div`
|
|
|
130
135
|
z-index: 1;
|
|
131
136
|
stroke: ${({ $lightMode }) => $lightMode ? th$1.color("blue2") : void 0};
|
|
132
137
|
.selected > ${ItemLabel}, .active > ${ItemLabel} {
|
|
133
|
-
color: ${({ $lightMode }) => $lightMode ? th$1.color("red1") : th$1.color("
|
|
138
|
+
color: ${({ $lightMode }) => $lightMode ? th$1.color("red1") : th$1.color("sideMenuSelectedText")};
|
|
134
139
|
stroke: ${({ $lightMode }) => $lightMode ? th$1.color("red1") : th$1.color("blue2")};
|
|
135
140
|
}
|
|
136
141
|
|
|
@@ -259,9 +264,10 @@ const OverflowWithEllipsis = styled$1.span`
|
|
|
259
264
|
max-width: 140px;
|
|
260
265
|
overflow: hidden;
|
|
261
266
|
text-overflow: ellipsis;
|
|
267
|
+
white-space: nowrap;
|
|
262
268
|
`;
|
|
263
269
|
const TopLevelWrap = styled$1.div`
|
|
264
|
-
background-color: ${({ lightMode }) => lightMode ? "white" : th$1("colors.
|
|
270
|
+
background-color: ${({ lightMode }) => lightMode ? "white" : th$1("colors.sideMenuBackground")};
|
|
265
271
|
border-right: 1px solid ${th$1("colors.lightGray6")};
|
|
266
272
|
height: -webkit-fill-available;
|
|
267
273
|
transition: width 0.5s ease;
|
|
@@ -306,5 +312,28 @@ const Overlay = styled$1.div`
|
|
|
306
312
|
display: none;
|
|
307
313
|
}
|
|
308
314
|
`;
|
|
315
|
+
const ItemCount = styled$1.span`
|
|
316
|
+
display: flex;
|
|
317
|
+
align-items: center;
|
|
318
|
+
justify-content: center;
|
|
319
|
+
flex-shrink: 0;
|
|
320
|
+
min-width: 20px;
|
|
321
|
+
height: 18px;
|
|
322
|
+
padding: 0 5px;
|
|
323
|
+
border-radius: 9px;
|
|
324
|
+
background-color: #ffffff;
|
|
325
|
+
color: ${th$1.color("red1")};
|
|
326
|
+
font-size: 12px;
|
|
327
|
+
line-height: 18px;
|
|
328
|
+
font-weight: 600;
|
|
329
|
+
margin-left: 8px;
|
|
330
|
+
|
|
331
|
+
${({ $isCompact }) => $isCompact && css`
|
|
332
|
+
position: absolute;
|
|
333
|
+
top: 0;
|
|
334
|
+
right: 2px;
|
|
335
|
+
margin-left: 0;
|
|
336
|
+
`}
|
|
337
|
+
`;
|
|
309
338
|
//#endregion
|
|
310
|
-
export { BodyWrap, Container, ItemDropdownArrow, ItemIcon, ItemLabel, ItemLinkWrap, ItemsSeparator, MenuItemContainer, OverflowWithEllipsis, Overlay, ScrollWrap, SubItemsWrap, TooltipItemLabel, TooltipWrap, TopLevelWrap };
|
|
339
|
+
export { BodyWrap, Container, ItemCount, ItemDropdownArrow, ItemIcon, ItemLabel, ItemLinkWrap, ItemsSeparator, MenuItemContainer, OverflowWithEllipsis, Overlay, ScrollWrap, SubItemsWrap, TooltipItemLabel, TooltipWrap, TopLevelWrap };
|
|
@@ -10,6 +10,7 @@ export type MenuItemType = {
|
|
|
10
10
|
lightMode?: boolean;
|
|
11
11
|
separator?: boolean;
|
|
12
12
|
appearance?: 'gray' | 'default';
|
|
13
|
+
count?: number;
|
|
13
14
|
};
|
|
14
15
|
export type SideMenuProps = {
|
|
15
16
|
menuItems: MenuItemType[];
|
|
@@ -18,6 +19,7 @@ export type SideMenuProps = {
|
|
|
18
19
|
isLeftMenuOpen?: boolean;
|
|
19
20
|
isAlwaysVisible?: boolean;
|
|
20
21
|
onCloseLeftMenu?: () => void;
|
|
22
|
+
showHamburgerMenu?: boolean;
|
|
21
23
|
variant?: 'dark' | 'light';
|
|
22
24
|
children?: ReactNode;
|
|
23
25
|
};
|
|
@@ -37,7 +37,7 @@ const StyledLink = styled$1(Link)`
|
|
|
37
37
|
`}
|
|
38
38
|
`;
|
|
39
39
|
const MenuItem = ({ item, ItemComponent, onClose }) => {
|
|
40
|
-
const { onClick, link, hasSeparator,
|
|
40
|
+
const { onClick, link, hasSeparator, autoClose, disabled } = item;
|
|
41
41
|
const isActive = link === useLocation().pathname;
|
|
42
42
|
const onClickCallback = useCallback((e) => {
|
|
43
43
|
if (disabled) {
|
|
@@ -63,7 +63,6 @@ const MenuItem = ({ item, ItemComponent, onClose }) => {
|
|
|
63
63
|
$disabled: !!disabled,
|
|
64
64
|
onClick: onClickCallback,
|
|
65
65
|
$hasSeparator: !!hasSeparator,
|
|
66
|
-
"data-cy": name,
|
|
67
66
|
size: "inherit",
|
|
68
67
|
children: /* @__PURE__ */ jsx(ItemComponent, { ...item })
|
|
69
68
|
});
|
|
@@ -99,7 +99,6 @@ const DropdownSelect = ({ label, appearance, variant, options, showChevron, onSe
|
|
|
99
99
|
variant: variant || "default",
|
|
100
100
|
onClick: toggleDropdownMenu,
|
|
101
101
|
disabled,
|
|
102
|
-
"data-cy": "createProductDropdownMenuBtn",
|
|
103
102
|
children: /* @__PURE__ */ jsxs(ContentWrapper, { children: [
|
|
104
103
|
icon && /* @__PURE__ */ jsx(CustomIconWrap, { children: icon }),
|
|
105
104
|
/* @__PURE__ */ jsx("span", { children: label }),
|
|
@@ -88,12 +88,11 @@ const flagAppearanceToFontColorMap = {
|
|
|
88
88
|
redBold: "#ffffff",
|
|
89
89
|
redSubtle: "red80"
|
|
90
90
|
};
|
|
91
|
-
const HighlightBox = ({ children, appearance, size = "default", cursor, className
|
|
91
|
+
const HighlightBox = ({ children, appearance, size = "default", cursor, className }) => {
|
|
92
92
|
const theme = useTheme();
|
|
93
93
|
return /* @__PURE__ */ jsx(StyledHighlightBox, {
|
|
94
94
|
$bgcolor: th$1.color(appearance ? flagAppearanceToColorMap[appearance] : "transparent")({ theme }),
|
|
95
95
|
$fontColor: th$1.color(appearance ? flagAppearanceToFontColorMap[appearance] : "typoPrimary")({ theme }),
|
|
96
|
-
"data-cy": prefix ? `${prefix}Label` : "label",
|
|
97
96
|
$cursor: cursor,
|
|
98
97
|
children: /* @__PURE__ */ jsx(OverflowWrap, {
|
|
99
98
|
className: size + " " + (className || ""),
|
|
@@ -5,7 +5,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
5
5
|
import { components } from "react-select";
|
|
6
6
|
//#region packages/ui/Elements/Select/components/ChevronOption.tsx
|
|
7
7
|
const ChevronOption = (props) => {
|
|
8
|
-
const { theme, isSelected, selectOption, children
|
|
8
|
+
const { theme, isSelected, selectOption, children } = props;
|
|
9
9
|
const showCheckbox = !!(theme.optionVariant == "checkbox");
|
|
10
10
|
const showToggle = !!(theme.optionVariant == "toggle");
|
|
11
11
|
return /* @__PURE__ */ jsxs(components.Option, {
|
|
@@ -22,7 +22,6 @@ const ChevronOption = (props) => {
|
|
|
22
22
|
variant: "grid"
|
|
23
23
|
})] }), /* @__PURE__ */ jsx("span", {
|
|
24
24
|
className: "label",
|
|
25
|
-
"data-cy": `dropdownModalOption${data.index}`,
|
|
26
25
|
children
|
|
27
26
|
})]
|
|
28
27
|
});
|
|
@@ -9,13 +9,12 @@ const ChevronDiv = styled$1.div`
|
|
|
9
9
|
display: flex;
|
|
10
10
|
`;
|
|
11
11
|
const DropdownIndicator = (props) => {
|
|
12
|
-
const { menuIsOpen
|
|
12
|
+
const { menuIsOpen } = props.selectProps;
|
|
13
13
|
const iconColor = props.theme.colors.placeholderTextColor;
|
|
14
14
|
return /* @__PURE__ */ jsx(components.DropdownIndicator, {
|
|
15
15
|
...props,
|
|
16
16
|
children: /* @__PURE__ */ jsx(ChevronDiv, {
|
|
17
17
|
className: "chevron",
|
|
18
|
-
"data-cy": `${name || ""}ChevronBtn`,
|
|
19
18
|
children: menuIsOpen ? /* @__PURE__ */ jsx(ArrowUp, {
|
|
20
19
|
width: "16px",
|
|
21
20
|
stroke: iconColor
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ChevronOption } from "../components/ChevronOption.js";
|
|
2
2
|
import ConnectedMenu from "../components/ConnectedMenu.js";
|
|
3
3
|
import CountMultiValue from "../components/CountMultiValue.js";
|
|
4
|
-
import { CustomInput } from "../components/CustomInput.js";
|
|
5
4
|
import { DropdownIndicator } from "../components/DropdownIndicator.js";
|
|
6
5
|
import IconValueContainer from "../components/IconValueContainer.js";
|
|
7
6
|
import SimplifiedOption from "../components/SimplifiedOption.js";
|
|
@@ -17,7 +16,6 @@ const useStylesAndComponents = (style = "form", optionVariant = "default", multi
|
|
|
17
16
|
if (multiLabelVariant === "count") components.MultiValue = CountMultiValue;
|
|
18
17
|
if (containerVariant === "search") components.DropdownIndicator = null;
|
|
19
18
|
if (showSelectAllButton) components.MenuList = ConnectedMenu;
|
|
20
|
-
components.Input = CustomInput;
|
|
21
19
|
const themes = getCustomTheme(systemTheme, optionVariant, style === "gridFilter");
|
|
22
20
|
const styles = CustomStyles;
|
|
23
21
|
components.Option = ChevronOption;
|
|
@@ -108,7 +108,6 @@ const Toggle = ({ onChange, label, name, checked, defaultChecked, spaceAround =
|
|
|
108
108
|
defaultChecked,
|
|
109
109
|
onChange: !disabled ? onChange : void 0,
|
|
110
110
|
disabled,
|
|
111
|
-
"data-cy": name ? `${name}Switch` : void 0,
|
|
112
111
|
"data-testid": name ? `toggle-${name}` : void 0,
|
|
113
112
|
readOnly
|
|
114
113
|
}), /* @__PURE__ */ jsx(StyledToggle, {
|
package/ui/Forms/Input/Input.js
CHANGED
|
@@ -66,7 +66,6 @@ const Input = ({ appearance = "primary", type, name, label, value, icon, variant
|
|
|
66
66
|
className: `${appearance} ${checkIconPlacement}`,
|
|
67
67
|
type,
|
|
68
68
|
name,
|
|
69
|
-
"data-cy": name ? `${name}Inp` : void 0,
|
|
70
69
|
"data-testid": name ? `input-${name}` : void 0,
|
|
71
70
|
value,
|
|
72
71
|
$isInvalid,
|
|
@@ -93,7 +93,6 @@ const ActionHead = ({ gridActions, gridSelectors, actionOptions, onBatchAction,
|
|
|
93
93
|
onClick: checkAll,
|
|
94
94
|
appearance: "secondary",
|
|
95
95
|
variant: "default",
|
|
96
|
-
"data-cy": "checkAllBtn",
|
|
97
96
|
disabled: checked,
|
|
98
97
|
children: /* @__PURE__ */ jsx(Trans, {
|
|
99
98
|
id: "dataGrid.checkAll",
|
|
@@ -105,7 +104,6 @@ const ActionHead = ({ gridActions, gridSelectors, actionOptions, onBatchAction,
|
|
|
105
104
|
onClick: processCheckedValues,
|
|
106
105
|
appearance: "primary",
|
|
107
106
|
variant: "default",
|
|
108
|
-
"data-cy": "exportBtn",
|
|
109
107
|
disabled: !rowsData.length,
|
|
110
108
|
children: processCheckedValuesTitle || /* @__PURE__ */ jsx(Trans, {
|
|
111
109
|
id: "dataGrid.actionOptions.export",
|
|
@@ -67,7 +67,6 @@ const ControlButtons = ({ extraControlButtons, gridActions, gridSelectors, quick
|
|
|
67
67
|
onClick: onClearSettings,
|
|
68
68
|
variant: "default",
|
|
69
69
|
appearance: "secondary",
|
|
70
|
-
"data-cy": "resetFiltersBtn",
|
|
71
70
|
children: /* @__PURE__ */ jsx(Trans, {
|
|
72
71
|
id: "dataGrid.buttonClearSettings",
|
|
73
72
|
message: "Reset"
|
|
@@ -78,7 +77,6 @@ const ControlButtons = ({ extraControlButtons, gridActions, gridSelectors, quick
|
|
|
78
77
|
type: "button",
|
|
79
78
|
appearance: filtersCount ? "primary" : "tertiary",
|
|
80
79
|
onClick: onOpenMobileFilters,
|
|
81
|
-
"data-cy": "mobileFilterBtn",
|
|
82
80
|
children: [/* @__PURE__ */ jsx(Filter, { fill: filtersCount ? "white" : red }), /* @__PURE__ */ jsxs(H6, {
|
|
83
81
|
variant: "semiBold",
|
|
84
82
|
mt: 0,
|
|
@@ -101,7 +99,6 @@ const ControlButtons = ({ extraControlButtons, gridActions, gridSelectors, quick
|
|
|
101
99
|
appearance: sortCount ? "primary" : "tertiary",
|
|
102
100
|
onClick: onOpenMobileSorting,
|
|
103
101
|
disabled: isSortTerminated,
|
|
104
|
-
"data-cy": "mobileSortBtn",
|
|
105
102
|
children: [/* @__PURE__ */ jsx(Sort, { stroke: sortCount ? "white" : red }), /* @__PURE__ */ jsxs(H6, {
|
|
106
103
|
variant: "semiBold",
|
|
107
104
|
mt: 0,
|
|
@@ -158,8 +155,7 @@ const ControlButtons = ({ extraControlButtons, gridActions, gridSelectors, quick
|
|
|
158
155
|
title: i18n._({
|
|
159
156
|
id: "dataGrid.share.title",
|
|
160
157
|
message: "Share"
|
|
161
|
-
})
|
|
162
|
-
"data-cy": "shareGridBtn"
|
|
158
|
+
})
|
|
163
159
|
})] }),
|
|
164
160
|
displayManageColumnButton && !isMobile && /* @__PURE__ */ jsx(StyledColumnButton, {
|
|
165
161
|
type: "button",
|
|
@@ -8,7 +8,6 @@ import { Link } from "react-router-dom";
|
|
|
8
8
|
const IconButtonInCell = ({ icon, isLoading, onClick, linkTo }) => {
|
|
9
9
|
return /* @__PURE__ */ jsx(Fragment, { children: isLoading ? /* @__PURE__ */ jsx(Spinner, { variant: "sm" }) : linkTo ? /* @__PURE__ */ jsx(Link, {
|
|
10
10
|
to: linkTo,
|
|
11
|
-
"data-cy": `${icon ?? ""}IconBtn`,
|
|
12
11
|
children: /* @__PURE__ */ jsx(Icon, {
|
|
13
12
|
icon: icon || "warning",
|
|
14
13
|
size: "16px",
|
|
@@ -16,7 +15,6 @@ const IconButtonInCell = ({ icon, isLoading, onClick, linkTo }) => {
|
|
|
16
15
|
})
|
|
17
16
|
}) : /* @__PURE__ */ jsx(x.span, {
|
|
18
17
|
onClick,
|
|
19
|
-
"data-cy": `${icon ?? ""}IconBtn`,
|
|
20
18
|
cursor: "pointer",
|
|
21
19
|
h: "100%",
|
|
22
20
|
display: "flex",
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { components } from "react-select";
|
|
3
|
-
//#region packages/ui/Elements/Select/components/CustomInput.tsx
|
|
4
|
-
const CustomInput = (props) => {
|
|
5
|
-
const { name } = props.selectProps;
|
|
6
|
-
const value = !!name ? `${name}Inp` : props.id;
|
|
7
|
-
return /* @__PURE__ */ jsx(components.Input, {
|
|
8
|
-
...props,
|
|
9
|
-
"data-cy": value
|
|
10
|
-
});
|
|
11
|
-
};
|
|
12
|
-
//#endregion
|
|
13
|
-
export { CustomInput, CustomInput as default };
|