@mailstep/design-system 0.6.21 → 0.6.23
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 +2 -0
- package/package.json +13 -11
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.js +4 -0
- package/ui/Blocks/LightBox/stories/LightBox.stories.js +2 -1
- package/ui/Elements/Button/stories/Button.stories.d.ts +6 -0
- package/ui/Elements/Button/stories/Button.stories.js +6 -0
- package/ui/Elements/DatePicker/DatePicker.d.ts +2 -1
- package/ui/Elements/DatePicker/DatePicker.js +3 -3
- package/ui/Elements/Dropdown/Dropdown.js +3 -3
- package/ui/Elements/DropdownMenu/components/DefaultItem.js +1 -1
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +1 -1
- package/ui/index.es.js +721 -722
- package/ui/index.umd.js +72 -73
package/README.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.23",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -24,6 +24,7 @@
|
|
|
24
24
|
"@babel/preset-env": "^7.22.4",
|
|
25
25
|
"@babel/preset-react": "^7.22.3",
|
|
26
26
|
"@babel/preset-typescript": "^7.23.3",
|
|
27
|
+
"@chromatic-com/storybook": "^1",
|
|
27
28
|
"@fortawesome/fontawesome-svg-core": "^6.3.0",
|
|
28
29
|
"@fortawesome/free-brands-svg-icons": "^6.1.1",
|
|
29
30
|
"@fortawesome/pro-duotone-svg-icons": "^6.0.0",
|
|
@@ -34,14 +35,15 @@
|
|
|
34
35
|
"@lingui/core": "3.17.2",
|
|
35
36
|
"@lingui/react": "3.17.2",
|
|
36
37
|
"@popperjs/core": "^2.11.8",
|
|
37
|
-
"@storybook/addon-controls": "
|
|
38
|
-
"@storybook/addon-
|
|
39
|
-
"@storybook/addon-
|
|
40
|
-
"@storybook/addon-
|
|
41
|
-
"@storybook/
|
|
42
|
-
"@storybook/
|
|
43
|
-
"@storybook/react
|
|
44
|
-
"@storybook/
|
|
38
|
+
"@storybook/addon-controls": "^8.1.1",
|
|
39
|
+
"@storybook/addon-designs": "^8.0.2",
|
|
40
|
+
"@storybook/addon-essentials": "^8.1.1",
|
|
41
|
+
"@storybook/addon-interactions": "^8.1.1",
|
|
42
|
+
"@storybook/addon-links": "^8.1.1",
|
|
43
|
+
"@storybook/blocks": "^8.1.1",
|
|
44
|
+
"@storybook/react": "^8.1.1",
|
|
45
|
+
"@storybook/react-webpack5": "^8.1.1",
|
|
46
|
+
"@storybook/test": "^8.1.1",
|
|
45
47
|
"@svgr/rollup": "^8.0.1",
|
|
46
48
|
"@types/faker": "^4.1.11",
|
|
47
49
|
"@types/luxon": "^3.4.2",
|
|
@@ -59,7 +61,7 @@
|
|
|
59
61
|
"babel-plugin-macros": "^3.1.0",
|
|
60
62
|
"babel-plugin-named-exports-order": "^0.0.2",
|
|
61
63
|
"chromatic": "^11.3.5",
|
|
62
|
-
"eslint-plugin-storybook": "0.
|
|
64
|
+
"eslint-plugin-storybook": "^0.8.0",
|
|
63
65
|
"faker": "^5.1.0",
|
|
64
66
|
"immer": "9.0.7",
|
|
65
67
|
"lodash": "^4.17.21",
|
|
@@ -81,7 +83,7 @@
|
|
|
81
83
|
"react-use-draggable-scroll": "^0.4.7",
|
|
82
84
|
"redux": ">=4.0.5",
|
|
83
85
|
"reselect": "5.0.0-alpha.2",
|
|
84
|
-
"storybook": "
|
|
86
|
+
"storybook": "^8.1.1",
|
|
85
87
|
"string-width": "6.1.0",
|
|
86
88
|
"styled-components": "^5.3.10",
|
|
87
89
|
"swiper": "^11.0.3",
|
|
@@ -19,6 +19,7 @@ export var InfoCornerDialog = {
|
|
|
19
19
|
statusToTitle: statusToTitle,
|
|
20
20
|
intent: 'info',
|
|
21
21
|
isOpen: true,
|
|
22
|
+
onClose: console.log
|
|
22
23
|
},
|
|
23
24
|
};
|
|
24
25
|
export var SuccessCornerDialog = {
|
|
@@ -28,6 +29,7 @@ export var SuccessCornerDialog = {
|
|
|
28
29
|
statusToTitle: statusToTitle,
|
|
29
30
|
intent: 'success',
|
|
30
31
|
isOpen: true,
|
|
32
|
+
onClose: console.log
|
|
31
33
|
},
|
|
32
34
|
};
|
|
33
35
|
export var ErrorCornerDialog = {
|
|
@@ -37,6 +39,7 @@ export var ErrorCornerDialog = {
|
|
|
37
39
|
statusToTitle: statusToTitle,
|
|
38
40
|
intent: 'error',
|
|
39
41
|
isOpen: true,
|
|
42
|
+
onClose: console.log
|
|
40
43
|
},
|
|
41
44
|
};
|
|
42
45
|
export var WarningCornerDialog = {
|
|
@@ -46,5 +49,6 @@ export var WarningCornerDialog = {
|
|
|
46
49
|
statusToTitle: statusToTitle,
|
|
47
50
|
intent: 'warning',
|
|
48
51
|
isOpen: true,
|
|
52
|
+
onClose: console.log
|
|
49
53
|
},
|
|
50
54
|
};
|
|
@@ -5,6 +5,12 @@ declare const meta: {
|
|
|
5
5
|
component: ({ isLoading, loadingText, icon, iconLeft, iconRight, variant, appearance, disabled, fullWidth, buttonRef, onClick, ...props }: import("../types").Props) => JSX.Element;
|
|
6
6
|
tags: string[];
|
|
7
7
|
argTypes: {};
|
|
8
|
+
parameters: {
|
|
9
|
+
design: {
|
|
10
|
+
type: string;
|
|
11
|
+
url: string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
8
14
|
};
|
|
9
15
|
export default meta;
|
|
10
16
|
type Story = StoryObj<typeof meta>;
|
|
@@ -4,6 +4,12 @@ var meta = {
|
|
|
4
4
|
component: Button,
|
|
5
5
|
tags: ['autodocs'],
|
|
6
6
|
argTypes: {},
|
|
7
|
+
parameters: {
|
|
8
|
+
design: {
|
|
9
|
+
type: 'figma',
|
|
10
|
+
url: 'https://www.figma.com/embed?embed_host=share&url=https%3A%2F%2Fwww.figma.com%2Fdesign%2Fwdpl2dchqnNHAsbuoRDXjb%2FElements%3Fnode-id%3D979%253A2939%26t%3DNHB5soSntRqtsFN0-1',
|
|
11
|
+
},
|
|
12
|
+
},
|
|
7
13
|
};
|
|
8
14
|
export default meta;
|
|
9
15
|
export var DefaultPrimary = {
|
|
@@ -15,6 +15,7 @@ export type DatePickerType = DatetimepickerProps & {
|
|
|
15
15
|
error?: string;
|
|
16
16
|
icon?: boolean;
|
|
17
17
|
onClear?: () => void;
|
|
18
|
+
onInputChange?: () => void;
|
|
18
19
|
};
|
|
19
|
-
declare const _default: React.MemoExoticComponent<({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat, timeFormat, open, secondValue, input, icon, showInputLabel, showCalendarLabel, spaceAround, className, onClear, ...passProps }: DatePickerType) => JSX.Element>;
|
|
20
|
+
declare const _default: React.MemoExoticComponent<({ name, value, initialViewDate, error, label, disabled, isValidDate, onChange, dateFormat, timeFormat, open, secondValue, input, icon, showInputLabel, showCalendarLabel, spaceAround, className, onClear, onInputChange, ...passProps }: DatePickerType) => JSX.Element>;
|
|
20
21
|
export default _default;
|
|
@@ -37,13 +37,13 @@ import Input from '../../Forms/Input';
|
|
|
37
37
|
import { LanguageContext } from '../../ThemeProvider/ThemeProvider';
|
|
38
38
|
var defaultDateFormat = 'DD.MM.YYYY';
|
|
39
39
|
var DatePicker = function (_a) {
|
|
40
|
-
var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear"]);
|
|
40
|
+
var name = _a.name, value = _a.value, initialViewDate = _a.initialViewDate, error = _a.error, label = _a.label, disabled = _a.disabled, isValidDate = _a.isValidDate, onChange = _a.onChange, _b = _a.dateFormat, dateFormat = _b === void 0 ? defaultDateFormat : _b, _c = _a.timeFormat, timeFormat = _c === void 0 ? false : _c, open = _a.open, _d = _a.secondValue, secondValue = _d === void 0 ? null : _d, input = _a.input, _e = _a.icon, icon = _e === void 0 ? true : _e, _f = _a.showInputLabel, showInputLabel = _f === void 0 ? false : _f, _g = _a.showCalendarLabel, showCalendarLabel = _g === void 0 ? true : _g, _h = _a.spaceAround, spaceAround = _h === void 0 ? false : _h, className = _a.className, onClear = _a.onClear, onInputChange = _a.onInputChange, passProps = __rest(_a, ["name", "value", "initialViewDate", "error", "label", "disabled", "isValidDate", "onChange", "dateFormat", "timeFormat", "open", "secondValue", "input", "icon", "showInputLabel", "showCalendarLabel", "spaceAround", "className", "onClear", "onInputChange"]);
|
|
41
41
|
var format = "".concat(dateFormat).concat(timeFormat ? " ".concat(timeFormat) : "");
|
|
42
|
-
var isValid = !!value && moment(value, format).isValid();
|
|
42
|
+
var isValid = !!value && moment(value, format, true).isValid();
|
|
43
43
|
var stringValue = isValid ? moment(value, format).format(format) : value;
|
|
44
44
|
var locale = useContext(LanguageContext);
|
|
45
45
|
var handleRenderInput = useCallback(function (_, openCalendar) {
|
|
46
|
-
return (_jsx(Input, { type: "text", icon: icon ? 'calendar' : undefined, name: name, error: error, disabled: disabled, isInvalid: !!error, label: showInputLabel ? label : undefined, value: stringValue, onFocus: openCalendar, iconOnClick: openCalendar, onClear: onClear }));
|
|
46
|
+
return (_jsx(Input, { type: "text", icon: icon ? 'calendar' : undefined, name: name, error: error, disabled: disabled, isInvalid: !!error, onChange: onInputChange, label: showInputLabel ? label : undefined, value: stringValue, onFocus: openCalendar, iconOnClick: openCalendar, onClear: onClear }));
|
|
47
47
|
}, [name, stringValue, error, label, showInputLabel, isValid, disabled]);
|
|
48
48
|
var handleRenderView = useCallback(function (_, renderCalendar) {
|
|
49
49
|
if (label && !showInputLabel) {
|
|
@@ -12,17 +12,17 @@ var Arrow = styled.div(templateObject_3 || (templateObject_3 = __makeTemplateObj
|
|
|
12
12
|
return (verticalShift ? 'calc(50% + 70px)' : 'calc(50%)');
|
|
13
13
|
}, ArrowInnerA, ArrowInnerB, th.color('white'));
|
|
14
14
|
var StyledDropdownWrap = styled.div(templateObject_4 || (templateObject_4 = __makeTemplateObject(["\n position: absolute;\n\n ", "\n\n width: fit-content;\n height: fit-content;\n display: block;\n z-index: 1;\n\n ", " {\n display: ", ";\n }\n"], ["\n position: absolute;\n\n ", "\n\n width: fit-content;\n height: fit-content;\n display: block;\n z-index: 1;\n\n ", " {\n display: ", ";\n }\n"])), function (_a) {
|
|
15
|
-
var customDropdownPosition = _a.customDropdownPosition
|
|
15
|
+
var customDropdownPosition = _a.customDropdownPosition;
|
|
16
16
|
return customDropdownPosition
|
|
17
17
|
? customDropdownPosition
|
|
18
|
-
: "\n top: 100%;\n
|
|
18
|
+
: "\n top: 100%;\n right: 0;\n ";
|
|
19
19
|
}, Arrow, function (_a) {
|
|
20
20
|
var showArrow = _a.showArrow;
|
|
21
21
|
return (showArrow ? 'block' : 'none');
|
|
22
22
|
});
|
|
23
23
|
var Dropdown = function (_a) {
|
|
24
24
|
var show = _a.show, className = _a.className, wrapRef = _a.wrapRef, children = _a.children, showArrow = _a.showArrow, verticalShift = _a.verticalShift, customDropdownPosition = _a.customDropdownPosition;
|
|
25
|
-
return (_jsx(_Fragment, { children: show && (_jsxs(StyledDropdownWrap, { ref: wrapRef, className: className, showArrow: showArrow,
|
|
25
|
+
return (_jsx(_Fragment, { children: show && (_jsxs(StyledDropdownWrap, { ref: wrapRef, className: className, showArrow: showArrow, customDropdownPosition: customDropdownPosition, children: [_jsx(Arrow, { verticalShift: verticalShift, children: _jsx(ArrowInnerA, { children: _jsx(ArrowInnerB, {}) }) }), children] })) }));
|
|
26
26
|
};
|
|
27
27
|
export default Dropdown;
|
|
28
28
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4;
|
|
@@ -4,7 +4,7 @@ var __makeTemplateObject = (this && this.__makeTemplateObject) || function (cook
|
|
|
4
4
|
};
|
|
5
5
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
6
6
|
import styled, { css } from '@xstyled/styled-components';
|
|
7
|
-
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 10px;\n font-size:
|
|
7
|
+
var StyledListItem = styled.li(templateObject_2 || (templateObject_2 = __makeTemplateObject(["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"], ["\n padding: 8px 10px;\n font-size: 14px;\n color: typoPrimary;\n font-weight: normal;\n\n :hover {\n background-color: bgLightGray1;\n cursor: pointer;\n }\n\n ", ";\n"])), function (props) {
|
|
8
8
|
return props.hasSeparator && css(templateObject_1 || (templateObject_1 = __makeTemplateObject(["\n border-top: slim;\n border-color: lightGray2;\n "], ["\n border-top: slim;\n border-color: lightGray2;\n "])));
|
|
9
9
|
});
|
|
10
10
|
var IconWrap = styled.span(templateObject_3 || (templateObject_3 = __makeTemplateObject(["\n margin-right: 10px;\n"], ["\n margin-right: 10px;\n"])));
|
|
@@ -5,7 +5,7 @@ declare const meta: {
|
|
|
5
5
|
component: ({ badge, ...iconProps }: {
|
|
6
6
|
badge: "warning";
|
|
7
7
|
} & import("..").IconProps) => JSX.Element;
|
|
8
|
-
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-
|
|
8
|
+
decorators: ((Story: import("@storybook/types").PartialStoryFn<import("@storybook/react/dist/types-bf5e6555").R, {
|
|
9
9
|
badge: "warning";
|
|
10
10
|
icon: string;
|
|
11
11
|
style?: "normal" | "light" | "solid" | undefined;
|