@mailstep/design-system 0.6.45 → 0.6.47-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 +1 -1
- package/ui/Blocks/CommonGrid/hooks/useManageColumn.js +1 -1
- package/ui/Blocks/Popover/index.d.ts +1 -1
- package/ui/Elements/Tooltip/Tooltip.d.ts +10 -0
- package/ui/Elements/Tooltip/Tooltip.js +21 -0
- package/ui/Elements/Tooltip/index.d.ts +3 -0
- package/ui/Elements/Tooltip/index.js +3 -0
- package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +11 -0
- package/ui/Elements/Tooltip/stories/Tooltip.stories.js +15 -0
- package/ui/ThemeProvider/themes/default.d.ts +1 -1
- package/ui/ThemeProvider/themes/default.js +1 -1
- package/ui/ThemeProvider/themes/index.d.ts +1 -1
- package/ui/index.es.js +9590 -9685
- package/ui/index.umd.js +344 -344
package/package.json
CHANGED
|
@@ -65,7 +65,7 @@ var useManageColumn = function (_a) {
|
|
|
65
65
|
var j = (orderValues || []).indexOf(col2.name);
|
|
66
66
|
return i > j ? 1 : i < j ? -1 : 0;
|
|
67
67
|
});
|
|
68
|
-
}, [columnConfig, columns]);
|
|
68
|
+
}, [columnConfig, columnsConfigOptions, columns]);
|
|
69
69
|
var displayColumnsDefinitions = useMemo(function () { return getSortedColumns(columnsOrderValue, false); }, [columnsOrderValue, columns]);
|
|
70
70
|
var manageColumnsFormDefinitions = useMemo(function () { return getSortedColumns(updatedColumnsOrder, true); }, [updatedColumnsOrder]);
|
|
71
71
|
var handleDragEnd = useCallback(function (isManageModal) {
|
|
@@ -3,7 +3,7 @@ import { Placement } from '@popperjs/core';
|
|
|
3
3
|
import { StyledComponent } from 'styled-components';
|
|
4
4
|
type DropdownMenuProps = {
|
|
5
5
|
parentRef: React.MutableRefObject<HTMLDivElement | null | undefined>;
|
|
6
|
-
onClose
|
|
6
|
+
onClose?: () => void;
|
|
7
7
|
children: React.ReactChild;
|
|
8
8
|
placement?: Placement;
|
|
9
9
|
wrapper?: StyledComponent<any, any>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Placement } from '@popperjs/core';
|
|
3
|
+
export type Props = {
|
|
4
|
+
children?: React.ReactNode;
|
|
5
|
+
placement?: Placement;
|
|
6
|
+
title?: string | JSX.Element;
|
|
7
|
+
subtitle?: string | JSX.Element;
|
|
8
|
+
};
|
|
9
|
+
declare const Tooltip: ({ children, placement, title, subtitle }: Props) => JSX.Element;
|
|
10
|
+
export default Tooltip;
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
|
+
import styled from '@xstyled/styled-components';
|
|
7
|
+
import { Paragraph4 } from '../Typography';
|
|
8
|
+
import { useRef, useState } from 'react';
|
|
9
|
+
import Popover from '../../Blocks/Popover';
|
|
10
|
+
var Container = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n width: fit-content;\n"], ["\n width: fit-content;\n"])));
|
|
11
|
+
var TooltipWrapper = styled.div(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n display: flex;\n flex-direction: column;\n background-color: white;\n padding: 8px 10px;\n margin-top: 4px;\n border-radius: 8px;\n box-shadow: tooltipShadow;\n gap: 2px;\n"], ["\n display: flex;\n flex-direction: column;\n background-color: white;\n padding: 8px 10px;\n margin-top: 4px;\n border-radius: 8px;\n box-shadow: tooltipShadow;\n gap: 2px;\n"])));
|
|
12
|
+
var Tooltip = function (_a) {
|
|
13
|
+
var children = _a.children, placement = _a.placement, title = _a.title, subtitle = _a.subtitle;
|
|
14
|
+
var _b = useState(false), visible = _b[0], setVisible = _b[1];
|
|
15
|
+
var ref = useRef(null);
|
|
16
|
+
var handleMouseEnter = function () { return setVisible(true); };
|
|
17
|
+
var handleMouseLeave = function () { return setVisible(false); };
|
|
18
|
+
return (_jsxs(Container, { ref: ref, onMouseEnter: handleMouseEnter, onMouseLeave: handleMouseLeave, children: [children, visible && (_jsx(Popover, { parentRef: ref, placement: placement !== null && placement !== void 0 ? placement : 'bottom', children: _jsxs(TooltipWrapper, { children: [title && (_jsx(Paragraph4, { mt: 1, mb: 1, variant: "bold", children: title })), subtitle && (_jsx(Paragraph4, { mt: 1, mb: 1, children: subtitle }))] }) }))] }));
|
|
19
|
+
};
|
|
20
|
+
export default Tooltip;
|
|
21
|
+
var templateObject_1, templateObject_2;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { StoryObj } from '@storybook/react';
|
|
3
|
+
declare const meta: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: ({ children, placement, title, subtitle }: import("../Tooltip").Props) => JSX.Element;
|
|
6
|
+
tags: string[];
|
|
7
|
+
argTypes: {};
|
|
8
|
+
};
|
|
9
|
+
export default meta;
|
|
10
|
+
type Story = StoryObj<typeof meta>;
|
|
11
|
+
export declare const Default: Story;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import Tooltip from '../Tooltip';
|
|
2
|
+
var meta = {
|
|
3
|
+
title: 'Elements/Tooltip',
|
|
4
|
+
component: Tooltip,
|
|
5
|
+
tags: ['autodocs'],
|
|
6
|
+
argTypes: {},
|
|
7
|
+
};
|
|
8
|
+
export default meta;
|
|
9
|
+
export var Default = {
|
|
10
|
+
args: {
|
|
11
|
+
children: '😀',
|
|
12
|
+
title: 'title',
|
|
13
|
+
subtitle: 'subtitle',
|
|
14
|
+
},
|
|
15
|
+
};
|
|
@@ -127,12 +127,12 @@ declare const defaultTheme: {
|
|
|
127
127
|
cardShadow: string;
|
|
128
128
|
smooth: string;
|
|
129
129
|
dialogShadow: string;
|
|
130
|
-
tooltipShadow: string;
|
|
131
130
|
headerShadow: string;
|
|
132
131
|
headerShadowB: string;
|
|
133
132
|
headerShadowNotifications: string;
|
|
134
133
|
cornerDialogShadow: string;
|
|
135
134
|
gridShadow: string;
|
|
135
|
+
tooltipShadow: string;
|
|
136
136
|
};
|
|
137
137
|
space: number[];
|
|
138
138
|
transitions: {
|
|
@@ -129,12 +129,12 @@ var defaultTheme = {
|
|
|
129
129
|
smooth: '0px 4px 25px 0px #0000001a',
|
|
130
130
|
// redesign:
|
|
131
131
|
dialogShadow: '0px 4px 23px 0px rgba(0, 0, 0, 0.08)',
|
|
132
|
-
tooltipShadow: '0px 1px 4px 0 #B1B8C3',
|
|
133
132
|
headerShadow: '1px 2px 3px #00000029',
|
|
134
133
|
headerShadowB: '1px 1px 3px #00000029',
|
|
135
134
|
headerShadowNotifications: '1px 1px 2px #00000029',
|
|
136
135
|
cornerDialogShadow: '1px 1px 3px 1px #00000029',
|
|
137
136
|
gridShadow: '0px 1px 4px 0px rgba(0, 0, 0, 0.12)',
|
|
137
|
+
tooltipShadow: '0px 2px 20px 0px rgba(0, 0, 0, 0.10)',
|
|
138
138
|
},
|
|
139
139
|
space: [0, 4, 8, 16, 24, 48, 96, 144, 192, 240],
|
|
140
140
|
transitions: {
|
|
@@ -128,12 +128,12 @@ declare const themes: {
|
|
|
128
128
|
cardShadow: string;
|
|
129
129
|
smooth: string;
|
|
130
130
|
dialogShadow: string;
|
|
131
|
-
tooltipShadow: string;
|
|
132
131
|
headerShadow: string;
|
|
133
132
|
headerShadowB: string;
|
|
134
133
|
headerShadowNotifications: string;
|
|
135
134
|
cornerDialogShadow: string;
|
|
136
135
|
gridShadow: string;
|
|
136
|
+
tooltipShadow: string;
|
|
137
137
|
};
|
|
138
138
|
space: number[];
|
|
139
139
|
transitions: {
|