@mailstep/design-system 0.8.48 → 0.8.50
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 +7 -7
- package/ui/Blocks/CommonGrid/components/ButtonMore/ButtonMore.d.ts +1 -0
- package/ui/Blocks/HidePrint/stories/HidePrint.stories.d.ts +12 -0
- package/ui/Blocks/Popover/stories/Popover.stories.d.ts +16 -0
- package/ui/Elements/DatePicker/stories/DatePicker.stories.d.ts +11 -0
- package/ui/Elements/DropdownMenu/components/MenuItem.js +29 -16
- package/ui/Elements/DropdownMenu/stories/DropdownMenu.stories.d.ts +10 -0
- package/ui/Elements/DropdownMenu/types.d.ts +2 -0
- package/ui/Elements/DropdownSelect/stories/DropdownSelect.stories.d.ts +22 -0
- package/ui/Elements/HighlightBox/HighlightBox.d.ts +3 -1
- package/ui/Elements/HighlightBox/HighlightBox.js +2 -0
- package/ui/Elements/HighlightBox/stories/HighlightBox.stories.d.ts +31 -0
- package/ui/Elements/Link/stories/Link.stories.d.ts +0 -1
- package/ui/Elements/Portal/stories/Portal.stories.d.ts +11 -0
- package/ui/Elements/SimpleLink/stories/SimpleLink.stories.d.ts +13 -0
- package/ui/Elements/SingleSelect/stories/SingleSelect.stories.d.ts +10 -0
- package/ui/Forms/TextArea/TextArea.d.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.50",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -40,10 +40,10 @@
|
|
|
40
40
|
"@lingui/core": "^5.0.0",
|
|
41
41
|
"@lingui/react": "^5.0.0",
|
|
42
42
|
"@popperjs/core": "^2.11.8",
|
|
43
|
-
"@storybook/addon-designs": "^11.1.
|
|
44
|
-
"@storybook/addon-docs": "10.2
|
|
45
|
-
"@storybook/addon-links": "10.2
|
|
46
|
-
"@storybook/react-webpack5": "10.2
|
|
43
|
+
"@storybook/addon-designs": "^11.1.3",
|
|
44
|
+
"@storybook/addon-docs": "10.4.2",
|
|
45
|
+
"@storybook/addon-links": "10.4.2",
|
|
46
|
+
"@storybook/react-webpack5": "10.4.2",
|
|
47
47
|
"@svgr/rollup": "^8.0.1",
|
|
48
48
|
"@swc/core": "^1.15.30",
|
|
49
49
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"eslint-plugin-react": "^7.35.0",
|
|
74
74
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
75
75
|
"eslint-plugin-react-perf": "^3.3.2",
|
|
76
|
-
"eslint-plugin-storybook": "10.2
|
|
76
|
+
"eslint-plugin-storybook": "10.4.2",
|
|
77
77
|
"faker": "^5.1.0",
|
|
78
78
|
"husky": "^9.1.7",
|
|
79
79
|
"immer": "^9.0.19",
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
"react-use-draggable-scroll": "^0.4.7",
|
|
97
97
|
"redux": ">=4.0.5",
|
|
98
98
|
"reselect": "5.0.0-alpha.2",
|
|
99
|
-
"storybook": "10.2
|
|
99
|
+
"storybook": "10.4.2",
|
|
100
100
|
"string-width": "6.1.0",
|
|
101
101
|
"styled-components": "^5.3.10",
|
|
102
102
|
"swiper": "^11.0.3",
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}>;
|
|
7
|
+
tags: string[];
|
|
8
|
+
argTypes: {};
|
|
9
|
+
};
|
|
10
|
+
export default meta;
|
|
11
|
+
type Story = StoryObj<typeof meta>;
|
|
12
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: FC<{
|
|
5
|
+
parentRef: React.MutableRefObject<HTMLDivElement | null | undefined>;
|
|
6
|
+
onClose?: () => void;
|
|
7
|
+
children: React.ReactNode;
|
|
8
|
+
placement?: import("@popperjs/core").Placement;
|
|
9
|
+
wrapper?: import("styled-components").StyledComponent<any, any>;
|
|
10
|
+
ignoreClickOutsideClosest?: string;
|
|
11
|
+
}>;
|
|
12
|
+
tags: string[];
|
|
13
|
+
argTypes: {};
|
|
14
|
+
};
|
|
15
|
+
export default meta;
|
|
16
|
+
export declare const Default: FC;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").NamedExoticComponent<import("../DatePicker").DatePickerType>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {};
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export declare const Default: FC;
|
|
10
|
+
export declare const WithTime: FC;
|
|
11
|
+
export declare const Disabled: FC;
|
|
@@ -16,6 +16,11 @@ const StyledLink = styled$1(Link)`
|
|
|
16
16
|
background-color: bgLightGray1;
|
|
17
17
|
border-radius: 6px;
|
|
18
18
|
}
|
|
19
|
+
${({ $disabled }) => $disabled && css`
|
|
20
|
+
opacity: 0.5;
|
|
21
|
+
pointer-events: none;
|
|
22
|
+
cursor: not-allowed;
|
|
23
|
+
`}
|
|
19
24
|
${({ $isActive }) => $isActive && css`
|
|
20
25
|
background-color: red1;
|
|
21
26
|
color: white;
|
|
@@ -32,23 +37,31 @@ const StyledLink = styled$1(Link)`
|
|
|
32
37
|
`}
|
|
33
38
|
`;
|
|
34
39
|
const MenuItem = ({ item, ItemComponent, onClose }) => {
|
|
35
|
-
const { onClick, link, hasSeparator, name, autoClose } = item;
|
|
40
|
+
const { onClick, link, hasSeparator, name, autoClose, disabled } = item;
|
|
41
|
+
const isActive = link === useLocation().pathname;
|
|
42
|
+
const onClickCallback = useCallback((e) => {
|
|
43
|
+
if (disabled) {
|
|
44
|
+
e.preventDefault();
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (onClick) {
|
|
48
|
+
e.preventDefault();
|
|
49
|
+
onClick();
|
|
50
|
+
}
|
|
51
|
+
if (autoClose && onClose) setTimeout(() => {
|
|
52
|
+
onClose();
|
|
53
|
+
}, 200);
|
|
54
|
+
}, [
|
|
55
|
+
autoClose,
|
|
56
|
+
disabled,
|
|
57
|
+
onClick,
|
|
58
|
+
onClose
|
|
59
|
+
]);
|
|
36
60
|
return /* @__PURE__ */ jsx(StyledLink, {
|
|
37
|
-
to: link,
|
|
38
|
-
$isActive:
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
e.preventDefault();
|
|
42
|
-
onClick();
|
|
43
|
-
}
|
|
44
|
-
if (autoClose && onClose) setTimeout(() => {
|
|
45
|
-
onClose();
|
|
46
|
-
}, 200);
|
|
47
|
-
}, [
|
|
48
|
-
autoClose,
|
|
49
|
-
onClick,
|
|
50
|
-
onClose
|
|
51
|
-
]),
|
|
61
|
+
to: disabled ? void 0 : link,
|
|
62
|
+
$isActive: isActive,
|
|
63
|
+
$disabled: !!disabled,
|
|
64
|
+
onClick: onClickCallback,
|
|
52
65
|
$hasSeparator: !!hasSeparator,
|
|
53
66
|
"data-cy": name,
|
|
54
67
|
size: "inherit",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: <T extends import("../types").Item>({ items, showMenu, className, ItemComponent, header, footer, ...rest }: import("../types").DropdownMenuProps<T>) => import("react").ReactElement;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {};
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export declare const Default: FC;
|
|
10
|
+
export declare const WithCounts: FC;
|
|
@@ -11,6 +11,7 @@ export type DefaultItem = {
|
|
|
11
11
|
hidden?: boolean;
|
|
12
12
|
count?: number;
|
|
13
13
|
autoClose?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
14
15
|
};
|
|
15
16
|
export type Item = {
|
|
16
17
|
link?: string | Pathname;
|
|
@@ -19,6 +20,7 @@ export type Item = {
|
|
|
19
20
|
name?: string;
|
|
20
21
|
autoClose?: boolean;
|
|
21
22
|
hidden?: boolean;
|
|
23
|
+
disabled?: boolean;
|
|
22
24
|
};
|
|
23
25
|
export type MenuItemProps<ItemType extends Item> = {
|
|
24
26
|
item: ItemType;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<{
|
|
5
|
+
label: string | import("react").ReactNode;
|
|
6
|
+
appearance?: import("../../Button").AppearanceValue;
|
|
7
|
+
variant?: import("../../Button/types").VariantValue;
|
|
8
|
+
options: import("../DropdownSelect").DropdownSelectItem[];
|
|
9
|
+
showChevron?: boolean;
|
|
10
|
+
onSelect?: (value: import("../DropdownSelect").DropdownSelectItem["value"]) => void;
|
|
11
|
+
icon?: import("react").ReactNode;
|
|
12
|
+
disabled?: boolean;
|
|
13
|
+
ButtonComponent?: React.FC;
|
|
14
|
+
}>;
|
|
15
|
+
tags: string[];
|
|
16
|
+
argTypes: {};
|
|
17
|
+
};
|
|
18
|
+
export default meta;
|
|
19
|
+
type Story = StoryObj<typeof meta>;
|
|
20
|
+
export declare const Default: Story;
|
|
21
|
+
export declare const WithoutChevron: Story;
|
|
22
|
+
export declare const Disabled: Story;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export type FlagAppearanceType = 'neutralBold' | 'neutralSubtle' | 'blueBold' | 'blueSubtle' | 'tealBold' | 'tealSubtle' | 'greenBold' | 'greenSubtle' | 'orangeBold' | 'orangeSubtle' | 'yellowBold' | 'yellowSubtle' | 'pinkBold' | 'pinkSubtle' | 'purpleBold' | 'purpleSubtle' | 'redBold' | 'redSubtle';
|
|
2
|
+
export type FlagAppearanceType = 'neutralBold' | 'neutralMedium' | 'neutralSubtle' | 'blueBold' | 'blueSubtle' | 'tealBold' | 'tealSubtle' | 'greenBold' | 'greenSubtle' | 'orangeBold' | 'orangeSubtle' | 'yellowBold' | 'yellowSubtle' | 'pinkBold' | 'pinkSubtle' | 'purpleBold' | 'purpleSubtle' | 'redBold' | 'redSubtle';
|
|
3
3
|
export declare const flagAppearanceToColorMap: {
|
|
4
4
|
neutralBold: string;
|
|
5
|
+
neutralMedium: string;
|
|
5
6
|
neutralSubtle: string;
|
|
6
7
|
blueBold: string;
|
|
7
8
|
blueSubtle: string;
|
|
@@ -22,6 +23,7 @@ export declare const flagAppearanceToColorMap: {
|
|
|
22
23
|
};
|
|
23
24
|
export declare const flagAppearanceToFontColorMap: {
|
|
24
25
|
neutralBold: string;
|
|
26
|
+
neutralMedium: string;
|
|
25
27
|
neutralSubtle: string;
|
|
26
28
|
blueBold: string;
|
|
27
29
|
blueSubtle: string;
|
|
@@ -48,6 +48,7 @@ const OverflowWrap = styled$1.span`
|
|
|
48
48
|
`;
|
|
49
49
|
const flagAppearanceToColorMap = {
|
|
50
50
|
neutralBold: "neutral300",
|
|
51
|
+
neutralMedium: "#D2D8DF",
|
|
51
52
|
neutralSubtle: "bgLightGray2",
|
|
52
53
|
blueBold: "blue70",
|
|
53
54
|
blueSubtle: "blue20",
|
|
@@ -68,6 +69,7 @@ const flagAppearanceToColorMap = {
|
|
|
68
69
|
};
|
|
69
70
|
const flagAppearanceToFontColorMap = {
|
|
70
71
|
neutralBold: "white",
|
|
72
|
+
neutralMedium: "#22394E",
|
|
71
73
|
neutralSubtle: "#22394E",
|
|
72
74
|
blueBold: "#ffffff",
|
|
73
75
|
blueSubtle: "blue80",
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("react").FC<{
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
appearance: import("../HighlightBox").FlagAppearanceType;
|
|
7
|
+
size?: "default" | "small" | "wide" | "fitContent";
|
|
8
|
+
className?: string;
|
|
9
|
+
cursor?: string;
|
|
10
|
+
prefix?: string;
|
|
11
|
+
}>;
|
|
12
|
+
tags: string[];
|
|
13
|
+
argTypes: {
|
|
14
|
+
appearance: {
|
|
15
|
+
control: "select";
|
|
16
|
+
options: string[];
|
|
17
|
+
};
|
|
18
|
+
size: {
|
|
19
|
+
control: "select";
|
|
20
|
+
options: string[];
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
type Story = StoryObj<typeof meta>;
|
|
26
|
+
export declare const Default: Story;
|
|
27
|
+
export declare const Subtle: Story;
|
|
28
|
+
export declare const Small: Story;
|
|
29
|
+
export declare const Wide: Story;
|
|
30
|
+
export declare const FitContent: Story;
|
|
31
|
+
export declare const AllAppearances: Story;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { StoryObj } from '@storybook/react-webpack5';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import("styled-components").StyledComponent<typeof import("react-router-dom").Link, import("@xstyled/styled-components").Theme, import("../SimpleLink").Props, never>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {};
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
type Story = StoryObj<typeof meta>;
|
|
10
|
+
export declare const Default: Story;
|
|
11
|
+
export declare const Decorated: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
export declare const External: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type FC } from 'react';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: FC<import("../SingleSelect").Props>;
|
|
5
|
+
tags: string[];
|
|
6
|
+
argTypes: {};
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export declare const Default: FC;
|
|
10
|
+
export declare const Searchable: FC;
|