@mailstep/design-system 0.8.1 → 0.8.4-beta.1
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 +8 -14
- package/ui/Blocks/CommonGrid/components/Filters/GridSelect/GridSelect.js +20 -1
- package/ui/Blocks/CornerDialog/stories/CornerDialog.stories.d.ts +1 -1
- package/ui/Blocks/ImageList/stories/ImageList.stories.d.ts +1 -1
- package/ui/Blocks/LanguageSwitch/stories/LanguageSwith.stories.d.ts +1 -1
- package/ui/Blocks/LightBox/stories/LightBox.stories.d.ts +1 -1
- package/ui/Blocks/Modal/stories/Modal.stories.d.ts +1 -1
- package/ui/Blocks/SideMenu/styles.js +2 -2
- package/ui/Blocks/Tabs/stories/Tabs.stories.d.ts +1 -1
- package/ui/Elements/Alert/stories/Alert.stories.d.ts +1 -1
- package/ui/Elements/AsyncSelect/stories/AsyncSelect.stories.d.ts +1 -1
- package/ui/Elements/Avatar/stories/Avatar.stories.d.ts +1 -1
- package/ui/Elements/Badge/stories/Badge.stories.d.ts +1 -1
- package/ui/Elements/BarChartSymbol/stories/BarChartSymbol.stories.d.ts +1 -1
- package/ui/Elements/BorderedBox/stories/BorderedBox.stories.d.ts +1 -1
- package/ui/Elements/Button/stories/Button.stories.d.ts +1 -1
- package/ui/Elements/Card/stories/Card.stories.d.ts +1 -1
- package/ui/Elements/CheckedCircle/storries/CheckedCircle.stories.d.ts +1 -1
- package/ui/Elements/Dropdown/stories/Dropdown.stories.d.ts +1 -1
- package/ui/Elements/ErrorMessage/stories/ErrorMessage.stories.d.ts +1 -1
- package/ui/Elements/Icon/Icon.js +1 -1
- package/ui/Elements/Icon/icons/CircleHalfStroke.d.ts +4 -0
- package/ui/Elements/Icon/icons/CircleHalfStroke.js +13 -0
- package/ui/Elements/Icon/icons/Moon.d.ts +4 -0
- package/ui/Elements/Icon/icons/Moon.js +13 -0
- package/ui/Elements/Icon/icons/ShieldUser.d.ts +4 -0
- package/ui/Elements/Icon/icons/ShieldUser.js +13 -0
- package/ui/Elements/Icon/icons/Sun.d.ts +4 -0
- package/ui/Elements/Icon/icons/Sun.js +13 -0
- package/ui/Elements/Icon/icons/UserCowboy.d.ts +4 -0
- package/ui/Elements/Icon/icons/UserCowboy.js +13 -0
- package/ui/Elements/Icon/icons/index.d.ts +5 -0
- package/ui/Elements/Icon/icons/index.js +5 -0
- package/ui/Elements/Icon/stories/BadgeIcon.stories.d.ts +2 -2
- package/ui/Elements/Icon/stories/Icon.stories.d.ts +1 -1
- package/ui/Elements/Image/stories/Image.stories.d.ts +1 -1
- package/ui/Elements/Label/stories/Label.stories.d.ts +1 -1
- package/ui/Elements/Line/stories/Line.stories.d.ts +1 -1
- package/ui/Elements/Link/stories/Link.stories.d.ts +1 -1
- package/ui/Elements/Logo/stories/Logo.stories.d.ts +1 -1
- package/ui/Elements/Pagination/stories/Pagination.stories.d.ts +1 -1
- package/ui/Elements/ProgressBar/stories/ProgressBar.stories.d.ts +1 -1
- package/ui/Elements/Select/Select.js +3 -3
- package/ui/Elements/Select/components/IconValueContainer.js +3 -2
- package/ui/Elements/Select/types.d.ts +2 -0
- package/ui/Elements/SpaceAround/stories/SpaceAround.stories.d.ts +1 -1
- package/ui/Elements/Spinner/stories/Spinner.stories.d.ts +1 -1
- package/ui/Elements/Tag/stories/Tag.stories.d.ts +1 -1
- package/ui/Elements/Text/stories/Text.stories.d.ts +1 -1
- package/ui/Elements/Toast/stories/Toast.stories.d.ts +1 -1
- package/ui/Elements/Toggle/stories/Toggle.stories.d.ts +1 -1
- package/ui/Elements/Tooltip/stories/Tooltip.stories.d.ts +1 -1
- package/ui/Elements/Typography/stories/Typography.stories.d.ts +1 -1
- package/ui/Forms/Checkbox/stories/Checkbox.stories.d.ts +1 -1
- package/ui/Forms/Checkbox/styles.d.ts +1 -1
- package/ui/Forms/Input/stories/Input.stories.d.ts +1 -1
- package/ui/Forms/RadioButton/stories/RadioButton.stories.d.ts +1 -1
- package/ui/index.es.js +7884 -7866
- package/ui/index.umd.js +390 -390
- package/ui/utils/KeyPress/KeyPress.stories.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mailstep/design-system",
|
|
3
|
-
"version": "0.8.1",
|
|
3
|
+
"version": "0.8.4-beta.1",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./ui/index.js",
|
|
@@ -39,16 +39,9 @@
|
|
|
39
39
|
"@lingui/core": "3.17.2",
|
|
40
40
|
"@lingui/react": "3.17.2",
|
|
41
41
|
"@popperjs/core": "^2.11.8",
|
|
42
|
-
"@storybook/addon-
|
|
43
|
-
"@storybook/addon-
|
|
44
|
-
"@storybook/
|
|
45
|
-
"@storybook/addon-interactions": "^8.4.7",
|
|
46
|
-
"@storybook/addon-links": "^8.4.7",
|
|
47
|
-
"@storybook/blocks": "^8.4.7",
|
|
48
|
-
"@storybook/react": "^8.4.7",
|
|
49
|
-
"@storybook/react-webpack5": "^8.4.7",
|
|
50
|
-
"@storybook/test": "^8.4.7",
|
|
51
|
-
"@storybook/types": "^8.4.7",
|
|
42
|
+
"@storybook/addon-designs": "^11.1.2",
|
|
43
|
+
"@storybook/addon-links": "10.2.8",
|
|
44
|
+
"@storybook/react-webpack5": "10.2.8",
|
|
52
45
|
"@svgr/rollup": "^8.0.1",
|
|
53
46
|
"@trivago/prettier-plugin-sort-imports": "^4.3.0",
|
|
54
47
|
"@types/faker": "^4.1.11",
|
|
@@ -79,7 +72,7 @@
|
|
|
79
72
|
"eslint-plugin-react": "^7.35.0",
|
|
80
73
|
"eslint-plugin-react-hooks": "^4.6.2",
|
|
81
74
|
"eslint-plugin-react-perf": "^3.3.2",
|
|
82
|
-
"eslint-plugin-storybook": "
|
|
75
|
+
"eslint-plugin-storybook": "10.2.8",
|
|
83
76
|
"faker": "^5.1.0",
|
|
84
77
|
"immer": "9.0.7",
|
|
85
78
|
"lodash": "^4.17.21",
|
|
@@ -100,7 +93,7 @@
|
|
|
100
93
|
"react-use-draggable-scroll": "^0.4.7",
|
|
101
94
|
"redux": ">=4.0.5",
|
|
102
95
|
"reselect": "5.0.0-alpha.2",
|
|
103
|
-
"storybook": "
|
|
96
|
+
"storybook": "10.2.8",
|
|
104
97
|
"string-width": "6.1.0",
|
|
105
98
|
"styled-components": "^5.3.10",
|
|
106
99
|
"swiper": "^11.0.3",
|
|
@@ -109,7 +102,8 @@
|
|
|
109
102
|
"vite": "^5.0.10",
|
|
110
103
|
"vite-plugin-dts": "^3.6.4",
|
|
111
104
|
"vite-plugin-static-copy": "^1.0.0",
|
|
112
|
-
"webpack": "^5.82.1"
|
|
105
|
+
"webpack": "^5.82.1",
|
|
106
|
+
"@storybook/addon-docs": "10.2.8"
|
|
113
107
|
},
|
|
114
108
|
"peerDependencies": {
|
|
115
109
|
"@dnd-kit/core": "^6.3.1",
|
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
13
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
14
|
return new (P || (P = Promise))(function (resolve, reject) {
|
|
@@ -58,6 +69,7 @@ var SelectFilter = function (_a) {
|
|
|
58
69
|
onChange === null || onChange === void 0 ? void 0 : onChange(!isArray(options) || !(options === null || options === void 0 ? void 0 : options.length) ? null : options);
|
|
59
70
|
}, [onChange]);
|
|
60
71
|
var isAsync = !!asyncLoadKey;
|
|
72
|
+
var isNotEq = useMemo(function () { return isOptionArray(value) ? value.some(function (option) { return option.isNotEq; }) : false; }, [value]);
|
|
61
73
|
var handleLoadOptions = useCallback(function (fulltext) { return __awaiter(void 0, void 0, void 0, function () {
|
|
62
74
|
var data;
|
|
63
75
|
return __generator(this, function (_a) {
|
|
@@ -75,9 +87,16 @@ var SelectFilter = function (_a) {
|
|
|
75
87
|
}
|
|
76
88
|
});
|
|
77
89
|
}); }, [asyncLoadKey, onAsyncLoadFilterOptions]);
|
|
90
|
+
var handleIconClick = useCallback(function () {
|
|
91
|
+
if (!value || !isOptionArray(value))
|
|
92
|
+
return;
|
|
93
|
+
var newOptions = value === null || value === void 0 ? void 0 : value.map(function (option) { return (__assign(__assign({}, option), { isNotEq: !isNotEq })); });
|
|
94
|
+
onChange(newOptions);
|
|
95
|
+
}, [value, isNotEq, onChange]);
|
|
78
96
|
var defaultOptions = useMemo(function () { return (isMulti && isAsync && isOptionArray(value) ? uniqBy(__spreadArray(__spreadArray([], loadedOptions, true), value, true), 'value') : undefined); }, [isAsync, value, loadedOptions]);
|
|
97
|
+
console.log('value', value);
|
|
79
98
|
if (isMulti) {
|
|
80
|
-
return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true }));
|
|
99
|
+
return (_jsx(Select, { maxMenuHeight: 250, onChange: handleOnMultiChange, value: isOptionArray(value) ? value.map(function (option) { return String(option.value); }) : value, options: defaultOptions || options, showSelectAllButton: checkAllButton, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, defaultOptions: defaultOptions, placeholder: isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined, noOptionsMessage: function () { return null; }, containerVariant: isAsync ? 'search' : undefined, placeholderIcon: isNotEq ? 'notEqual' : 'equals', onIconClick: handleIconClick, optionVariant: "checkbox", multiLabelVariant: "count", isMulti: true }));
|
|
81
100
|
}
|
|
82
101
|
return (_jsx(SingleSelect, { maxMenuHeight: 250, onChange: onChange, value: value, options: options, style: "gridFilter", loadOptions: isAsync ? handleLoadOptions : undefined, placeholder: isAsync ? i18n._({ id: 'dataGrid.filterCell', message: 'Type to filter' }) : undefined, isClearable: isClearable }));
|
|
83
102
|
};
|
|
@@ -140,7 +140,7 @@ export var TooltipWrap = styled.div(templateObject_16 || (templateObject_16 = __
|
|
|
140
140
|
return ($lightMode ? th.color('red20') : th.color('blue2'));
|
|
141
141
|
});
|
|
142
142
|
export var OverflowWithEllipsis = styled.span(templateObject_17 || (templateObject_17 = __makeTemplateObject(["\n max-width: 140px;\n overflow: hidden;\n text-overflow: ellipsis;\n"], ["\n max-width: 140px;\n overflow: hidden;\n text-overflow: ellipsis;\n"])));
|
|
143
|
-
export var TopLevelWrap = styled.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n border-right: 1px solid ", ";\n height: -webkit-fill-available;\n transition: width 0.5s ease;\n width: ", ";\n\n z-index:
|
|
143
|
+
export var TopLevelWrap = styled.div(templateObject_18 || (templateObject_18 = __makeTemplateObject(["\n background-color: ", ";\n border-right: 1px solid ", ";\n height: -webkit-fill-available;\n transition: width 0.5s ease;\n width: ", ";\n\n z-index: 7;\n position: absolute;\n top: ", ";\n height: ", ";\n\n display: flex;\n flex-direction: column;\n\n @media (min-width: 1024px) {\n top: inherit;\n z-index: 2;\n }\n"], ["\n background-color: ", ";\n border-right: 1px solid ", ";\n height: -webkit-fill-available;\n transition: width 0.5s ease;\n width: ", ";\n\n z-index: 7;\n position: absolute;\n top: ", ";\n height: ", ";\n\n display: flex;\n flex-direction: column;\n\n @media (min-width: 1024px) {\n top: inherit;\n z-index: 2;\n }\n"])), function (_a) {
|
|
144
144
|
var lightMode = _a.lightMode;
|
|
145
145
|
return (lightMode ? 'white' : th('colors.blue3'));
|
|
146
146
|
}, th('colors.lightGray6'), function (_a) {
|
|
@@ -158,5 +158,5 @@ export var BodyWrap = styled.div(templateObject_20 || (templateObject_20 = __mak
|
|
|
158
158
|
var isCompact = _a.isCompact;
|
|
159
159
|
return (isCompact ? '24px 9px' : '24px 22px');
|
|
160
160
|
});
|
|
161
|
-
export var Overlay = styled.div(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n z-index:
|
|
161
|
+
export var Overlay = styled.div(templateObject_21 || (templateObject_21 = __makeTemplateObject(["\n position: fixed;\n top: 0;\n z-index: 6;\n height: 100%;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n display: none;\n }\n"], ["\n position: fixed;\n top: 0;\n z-index: 6;\n height: 100%;\n width: 100%;\n background-color: ", ";\n @media (min-width: 1024px) {\n display: none;\n }\n"])), createRgba('blue2', 0.6));
|
|
162
162
|
var templateObject_1, templateObject_2, templateObject_3, templateObject_4, templateObject_5, templateObject_6, templateObject_7, templateObject_8, templateObject_9, templateObject_10, templateObject_11, templateObject_12, templateObject_13, templateObject_14, templateObject_15, templateObject_16, templateObject_17, templateObject_18, templateObject_19, templateObject_20, templateObject_21;
|
package/ui/Elements/Icon/Icon.js
CHANGED
|
@@ -265,7 +265,7 @@ var Icon = function (_a) {
|
|
|
265
265
|
}, [icon, style, namedIcon]);
|
|
266
266
|
var flipProp = (namedIcon && Array.isArray(namedIcon) && namedIcon[1]) || undefined;
|
|
267
267
|
var IconComponent = icons[icon];
|
|
268
|
-
return (_jsx(FaIconSizing, { size: size, className: className !== null && className !== void 0 ? className : '', "$colorSecondary": colorSecondary, "$fixedWidth": fixedWidth, children: IconComponent ? _jsx(IconComponent, { fill: colorFill, stroke: colorStroke }) : (_jsx(FontAwesomeIcon, { color: colorFill, flip: flipProp, icon: iconProp, className: "faIcon ".concat(fixedWidth ? 'fa-fw' : '', " ").concat(spinning ? 'fa-spin' : '') })) }));
|
|
268
|
+
return (_jsx(FaIconSizing, { size: size, className: className !== null && className !== void 0 ? className : '', "$colorSecondary": colorSecondary, "$fixedWidth": fixedWidth, children: IconComponent ? _jsx(IconComponent, { fill: colorFill, stroke: colorStroke, width: size, height: size }) : (_jsx(FontAwesomeIcon, { color: colorFill, flip: flipProp, icon: iconProp, className: "faIcon ".concat(fixedWidth ? 'fa-fw' : '', " ").concat(spinning ? 'fa-spin' : '') })) }));
|
|
269
269
|
};
|
|
270
270
|
export default Icon;
|
|
271
271
|
var templateObject_1;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var CircleHalfStroke = function (props) { return (_jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 512 512", fill: "currentColor" }, props, { children: _jsx("path", { d: "M448 256c0-106-86-192-192-192l0 384c106 0 192-86 192-192zM0 256a256 256 0 1 1 512 0A256 256 0 1 1 0 256z" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var Moon = function (props) { return (_jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 384 512", fill: "currentColor" }, props, { children: _jsx("path", { d: "M223.5 32C100 32 0 132.3 0 256S100 480 223.5 480c60.6 0 115.5-24.2 155.8-63.4c5-4.9 6.3-12.5 3.1-18.7s-10.1-9.7-17-8.5c-9.8 1.7-19.8 2.6-30.1 2.6c-96.9 0-175.5-78.8-175.5-176c0-65.8 36-123.1 89.3-153.3c6.1-3.5 9.2-10.5 7.7-17.3s-7.3-11.9-14.3-12.5c-6.3-.5-12.6-.8-19-.8z" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var ShieldUser = function (props) { return (_jsx("svg", __assign({ viewBox: "0 0 640 640" }, props, { children: _jsx("path", { d: "M320.3 64C322.3 64 324.3 64.2 326.2 64.6C326.4 64.6 326.7 64.7 326.9 64.8C327.7 65 328.5 65.2 329.3 65.4C329.5 65.5 329.8 65.6 330 65.6C330.7 65.8 331.4 66.1 332.1 66.4L332.4 66.5L521.7 146.7L525.7 148.6C544.3 158.1 558.1 176.6 559.8 199L560 203.9C559.5 303.1 518.7 484.6 346.3 567.1C331.7 574.1 315 574.9 299.9 569.7L293.5 567.1C121.3 484.7 80.5 303.2 80 204C79.9 177.8 96.4 156.1 118.3 146.8L307.6 66.5C307.7 66.5 307.8 66.4 307.9 66.4C308.6 66.1 309.3 65.9 310 65.6C310.2 65.5 310.5 65.4 310.7 65.4C311.5 65.1 312.4 65 313.2 64.8C313.4 64.8 313.6 64.7 313.9 64.6C315.8 64.2 317.8 64 319.8 64L320.4 64zM288 336C243.8 336 208 371.8 208 416C208 424.8 215.2 432 224 432L416 432C424.8 432 432 424.8 432 416C432 371.8 396.2 336 352 336L288 336zM320 184C289.1 184 264 209.1 264 240C264 270.9 289.1 296 320 296C350.9 296 376 270.9 376 240C376 209.1 350.9 184 320 184z" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var Sun = function (props) { return (_jsx("svg", __assign({ width: "18", height: "18", viewBox: "0 0 512 512", fill: "currentColor" }, props, { children: _jsx("path", { d: "M361.5 1.2c5 2.1 8.6 6.6 9.6 11.9L391 121l107.9 19.8c5.3 1 9.8 4.6 11.9 9.6s1.5 10.7-1.6 15.2L446.9 256l62.3 90.3c3.1 4.5 3.7 10.2 1.6 15.2s-6.6 8.6-11.9 9.6L391 391 371.1 498.9c-1 5.3-4.6 9.8-9.6 11.9s-10.7 1.5-15.2-1.6L256 446.9l-90.3 62.3c-4.5 3.1-10.2 3.7-15.2 1.6s-8.6-6.6-9.6-11.9L121 391 13.1 371.1c-5.3-1-9.8-4.6-11.9-9.6s-1.5-10.7 1.6-15.2L65.1 256 2.8 165.7c-3.1-4.5-3.7-10.2-1.6-15.2s6.6-8.6 11.9-9.6L121 121 140.9 13.1c1-5.3 4.6-9.8 9.6-11.9s10.7-1.5 15.2 1.6L256 65.1 346.3 2.8c4.5-3.1 10.2-3.7 15.2-1.6zM160 256a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zm224 0a128 128 0 1 0 -256 0 128 128 0 1 0 256 0z" }) }))); };
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
export var UserCowboy = function (props) { return (_jsx("svg", __assign({ viewBox: "0 0 640 640" }, props, { children: _jsx("path", { d: "M516.7 100.7C506.1 111.3 478.1 130.3 433.7 143.9C423.9 90.2 403.8 32 369.7 32C360.8 32 352 35.8 344.2 40C336.5 44.2 326.8 48 320.1 48C313.4 48 303.7 44.2 296 40C288.1 35.7 279.4 32 270.5 32C236.4 32 216.3 90.2 206.5 143.9C162.1 130.3 134.1 111.4 123.5 100.7C118 95.2 109.2 94.4 102.8 99C96.4 103.6 94.3 112.1 97.8 119.1C109.4 142.2 139.8 176.1 192.1 199.1L192.1 208C192.1 278.7 249.4 336 320.1 336C390.8 336 448.1 278.7 448.1 208L448.1 199.1C500.4 176.2 530.9 142.3 542.4 119.1C545.9 112.1 543.8 103.6 537.4 99C531 94.4 522.3 95.1 516.7 100.7zM399.7 215.2C396.1 256 361.8 288 320 288C278.2 288 243.9 256 240.3 215.1C263.8 220.7 290.3 224 320 224C349.7 224 376.2 220.7 399.7 215.1zM276.6 384C185.7 384 112 457.7 112 548.6C112 563.7 124.3 576 139.4 576L500.5 576C515.6 576 527.9 563.7 527.9 548.6C527.9 457.7 454.2 384 363.3 384L276.4 384z" }) }))); };
|
|
@@ -78,3 +78,8 @@ export { MachinePackingForbidden } from './MachinePackingForbidden';
|
|
|
78
78
|
export { Valuable } from './Valuable';
|
|
79
79
|
export { MobilePhone } from './MobilePhone';
|
|
80
80
|
export { Reload } from './Reload';
|
|
81
|
+
export { Sun } from './Sun';
|
|
82
|
+
export { Moon } from './Moon';
|
|
83
|
+
export { CircleHalfStroke } from './CircleHalfStroke';
|
|
84
|
+
export { ShieldUser } from './ShieldUser';
|
|
85
|
+
export { UserCowboy } from './UserCowboy';
|
|
@@ -78,3 +78,8 @@ export { MachinePackingForbidden } from './MachinePackingForbidden';
|
|
|
78
78
|
export { Valuable } from './Valuable';
|
|
79
79
|
export { MobilePhone } from './MobilePhone';
|
|
80
80
|
export { Reload } from './Reload';
|
|
81
|
+
export { Sun } from './Sun';
|
|
82
|
+
export { Moon } from './Moon';
|
|
83
|
+
export { CircleHalfStroke } from './CircleHalfStroke';
|
|
84
|
+
export { ShieldUser } from './ShieldUser';
|
|
85
|
+
export { UserCowboy } from './UserCowboy';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { StoryObj } from '@storybook/react';
|
|
1
|
+
import { StoryObj } from '@storybook/react-webpack5';
|
|
2
2
|
|
|
3
3
|
declare const meta: {
|
|
4
4
|
title: string;
|
|
5
5
|
component: import('react').FC<{
|
|
6
6
|
badge: "warning";
|
|
7
7
|
} & import('..').IconProps>;
|
|
8
|
-
decorators: ((Story: import('
|
|
8
|
+
decorators: ((Story: import('storybook/internal/csf').PartialStoryFn<import('@storybook/react').ReactRenderer, {
|
|
9
9
|
badge: "warning";
|
|
10
10
|
icon: string;
|
|
11
11
|
style?: "normal" | "light" | "solid" | undefined;
|
|
@@ -69,7 +69,7 @@ var emptyOptions = [];
|
|
|
69
69
|
var noOptionsMessage = function () { return i18n._({ id: 'select.noOptions', message: 'no options' }); };
|
|
70
70
|
var loadingMessage = function () { return i18n._({ id: 'components.dropdown.loading', message: 'Loading...' }); };
|
|
71
71
|
var Select = function (_a) {
|
|
72
|
-
var label = _a.label, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.options, options = _c === void 0 ? emptyOptions : _c, defaultOptions = _a.defaultOptions, loadOptions = _a.loadOptions, onChange = _a.onChange, onBlur = _a.onBlur, error = _a.error, isInvalid = _a.isInvalid, isLoading = _a.isLoading, isDarkPlaceholderText = _a.isDarkPlaceholderText, _d = _a.spaceAround, spaceAround = _d === void 0 ? false : _d, disabled = _a.disabled, onInputChange = _a.onInputChange, isSearchable = _a.isSearchable, isMulti = _a.isMulti, className = _a.className, _e = _a.useSimplifiedOptions, useSimplifiedOptions = _e === void 0 ? false : _e, _f = _a.showSelectAllButton, showSelectAllButton = _f === void 0 ? false : _f, _g = _a.showResetGridButton, showResetGridButton = _g === void 0 ? false : _g, _h = _a.shortValues, shortValues = _h === void 0 ? true : _h, style = _a.style, optionVariant = _a.optionVariant, multiLabelVariant = _a.multiLabelVariant, containerVariant = _a.containerVariant, placeholder = _a.placeholder, placeholderIcon = _a.placeholderIcon, innerRef = _a.innerRef, maxMenuHeight = _a.maxMenuHeight, getOptionValue = _a.getOptionValue, resetGrid = _a.resetGrid, passTroughProps = __rest(_a, ["label", "name", "value", "options", "defaultOptions", "loadOptions", "onChange", "onBlur", "error", "isInvalid", "isLoading", "isDarkPlaceholderText", "spaceAround", "disabled", "onInputChange", "isSearchable", "isMulti", "className", "useSimplifiedOptions", "showSelectAllButton", "showResetGridButton", "shortValues", "style", "optionVariant", "multiLabelVariant", "containerVariant", "placeholder", "placeholderIcon", "innerRef", "maxMenuHeight", "getOptionValue", "resetGrid"]);
|
|
72
|
+
var label = _a.label, name = _a.name, _b = _a.value, value = _b === void 0 ? '' : _b, _c = _a.options, options = _c === void 0 ? emptyOptions : _c, defaultOptions = _a.defaultOptions, loadOptions = _a.loadOptions, onChange = _a.onChange, onBlur = _a.onBlur, error = _a.error, isInvalid = _a.isInvalid, isLoading = _a.isLoading, isDarkPlaceholderText = _a.isDarkPlaceholderText, _d = _a.spaceAround, spaceAround = _d === void 0 ? false : _d, disabled = _a.disabled, onInputChange = _a.onInputChange, isSearchable = _a.isSearchable, isMulti = _a.isMulti, className = _a.className, _e = _a.useSimplifiedOptions, useSimplifiedOptions = _e === void 0 ? false : _e, _f = _a.showSelectAllButton, showSelectAllButton = _f === void 0 ? false : _f, _g = _a.showResetGridButton, showResetGridButton = _g === void 0 ? false : _g, _h = _a.shortValues, shortValues = _h === void 0 ? true : _h, style = _a.style, optionVariant = _a.optionVariant, multiLabelVariant = _a.multiLabelVariant, containerVariant = _a.containerVariant, placeholder = _a.placeholder, placeholderIcon = _a.placeholderIcon, innerRef = _a.innerRef, maxMenuHeight = _a.maxMenuHeight, getOptionValue = _a.getOptionValue, resetGrid = _a.resetGrid, onIconClick = _a.onIconClick, passTroughProps = __rest(_a, ["label", "name", "value", "options", "defaultOptions", "loadOptions", "onChange", "onBlur", "error", "isInvalid", "isLoading", "isDarkPlaceholderText", "spaceAround", "disabled", "onInputChange", "isSearchable", "isMulti", "className", "useSimplifiedOptions", "showSelectAllButton", "showResetGridButton", "shortValues", "style", "optionVariant", "multiLabelVariant", "containerVariant", "placeholder", "placeholderIcon", "innerRef", "maxMenuHeight", "getOptionValue", "resetGrid", "onIconClick"]);
|
|
73
73
|
var isAsync = !!loadOptions;
|
|
74
74
|
if (showSelectAllButton && !isMulti) {
|
|
75
75
|
console.error('CheckboxSelect incompatible props');
|
|
@@ -83,7 +83,7 @@ var Select = function (_a) {
|
|
|
83
83
|
onChange === null || onChange === void 0 ? void 0 : onChange(emptyOptions);
|
|
84
84
|
}
|
|
85
85
|
}, [onChange]);
|
|
86
|
-
var icon = containerVariant === 'search' ? 'search' : placeholderIcon || undefined;
|
|
86
|
+
var icon = containerVariant === 'search' && !placeholderIcon ? 'search' : placeholderIcon || undefined;
|
|
87
87
|
var modifiedMaxMenuHeight = showResetGridButton && showSelectAllButton && maxMenuHeight ? maxMenuHeight - 30 : maxMenuHeight;
|
|
88
88
|
var _j = useStylesAndComponents(style, optionVariant, multiLabelVariant, containerVariant, useSimplifiedOptions, showSelectAllButton, showResetGridButton), customComponents = _j[0], customTheme = _j[1], customStyles = _j[2];
|
|
89
89
|
var RenderComponent = isAsync ? StyledAsyncSelect : StyledReactSelect;
|
|
@@ -106,6 +106,6 @@ var Select = function (_a) {
|
|
|
106
106
|
}
|
|
107
107
|
}); }); } : undefined;
|
|
108
108
|
}, [loadOptions]);
|
|
109
|
-
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(Wrapper, { children: [label && _jsx(FieldLabel, { htmlFor: name, children: label }), _jsx(RenderComponent, __assign({ id: name, name: name, options: options, loadOptions: handleLoadOptions, defaultOptions: defaultOptions, value: selectedOption, onChange: onChange, onBlur: onBlur, isDisabled: disabled || isLoading, isLoading: isLoading, isInvalid: isInvalid !== undefined ? isInvalid : !!error, isDarkPlaceholderText: isDarkPlaceholderText, placeholder: placeholder || i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }), styles: customStyles, theme: customTheme, icon: icon, hideSelectedOptions: !!(isMulti && multiLabelVariant != 'count'), onInputChange: onInputChange, isSearchable: isAsync || isSearchable, isMulti: isMulti, classNamePrefix: "react-select", components: customComponents, closeMenuOnSelect: isMulti ? false : undefined, noOptionsMessage: noOptionsMessage }, passTroughProps, { ref: innerRef, tabIndex: null, systemTheme: theme, resetGrid: resetGrid, onCustomSelectAll: setAllOptions, onCustomDeselectAll: unsetAllOptions, selectAllButton: showSelectAllButton, resetGridButton: showResetGridButton, maxMenuHeight: modifiedMaxMenuHeight, getOptionValue: getOptionValue, loadingMessage: loadingMessage, shortValues: shortValues }))] }), error && _jsx(ErrorMessage, { children: error })] }));
|
|
109
|
+
return (_jsxs(SpaceAroundWrap, { spaceAround: spaceAround, className: className, children: [_jsxs(Wrapper, { children: [label && _jsx(FieldLabel, { htmlFor: name, children: label }), _jsx(RenderComponent, __assign({ id: name, name: name, options: options, loadOptions: handleLoadOptions, defaultOptions: defaultOptions, value: selectedOption, onChange: onChange, onBlur: onBlur, isDisabled: disabled || isLoading, isLoading: isLoading, isInvalid: isInvalid !== undefined ? isInvalid : !!error, isDarkPlaceholderText: isDarkPlaceholderText, placeholder: placeholder || i18n._({ id: 'components.dropdown.placeholder', message: 'Select...' }), styles: customStyles, theme: customTheme, icon: icon, onIconClick: onIconClick, hideSelectedOptions: !!(isMulti && multiLabelVariant != 'count'), onInputChange: onInputChange, isSearchable: isAsync || isSearchable, isMulti: isMulti, classNamePrefix: "react-select", components: customComponents, closeMenuOnSelect: isMulti ? false : undefined, noOptionsMessage: noOptionsMessage }, passTroughProps, { ref: innerRef, tabIndex: null, systemTheme: theme, resetGrid: resetGrid, onCustomSelectAll: setAllOptions, onCustomDeselectAll: unsetAllOptions, selectAllButton: showSelectAllButton, resetGridButton: showResetGridButton, maxMenuHeight: modifiedMaxMenuHeight, getOptionValue: getOptionValue, loadingMessage: loadingMessage, shortValues: shortValues }))] }), error && _jsx(ErrorMessage, { children: error })] }));
|
|
110
110
|
};
|
|
111
111
|
export default Select;
|
|
@@ -34,12 +34,13 @@ var IconDiv = styled.div(templateObject_1 || (templateObject_1 = __makeTemplateO
|
|
|
34
34
|
return (hasValue ? 'black' : '#a3b3c1');
|
|
35
35
|
});
|
|
36
36
|
var IconValueContainer = function (props) {
|
|
37
|
-
var _a;
|
|
37
|
+
var _a, _b;
|
|
38
38
|
// eslint-disable-next-line react/prop-types
|
|
39
39
|
var children = props.children, rest = __rest(props, ["children"]);
|
|
40
40
|
var icon = (_a = rest.selectProps) === null || _a === void 0 ? void 0 : _a.icon;
|
|
41
41
|
var hasValue = rest.hasValue;
|
|
42
|
-
|
|
42
|
+
var onIconClick = (_b = rest.selectProps) === null || _b === void 0 ? void 0 : _b.onIconClick;
|
|
43
|
+
return (_jsxs(_Fragment, { children: [icon && (_jsx(IconDiv, { className: "inputIcon", hasValue: hasValue, onClick: onIconClick, children: _jsx(Icon, { icon: icon }) })), _jsx(components.ValueContainer, __assign({}, rest, { children: children }))] }));
|
|
43
44
|
};
|
|
44
45
|
export default IconValueContainer;
|
|
45
46
|
var templateObject_1;
|
|
@@ -7,6 +7,7 @@ export type Option<Value = string | number> = {
|
|
|
7
7
|
label: string | number;
|
|
8
8
|
isDisabled?: boolean;
|
|
9
9
|
isFixed?: boolean;
|
|
10
|
+
isNotEq?: boolean;
|
|
10
11
|
color?: string;
|
|
11
12
|
index?: number;
|
|
12
13
|
inputValue?: string;
|
|
@@ -54,6 +55,7 @@ export type SelectProps = {
|
|
|
54
55
|
getOptionValue?: Function;
|
|
55
56
|
systemTheme?: Theme;
|
|
56
57
|
menuPlacement?: string;
|
|
58
|
+
onIconClick?: Function;
|
|
57
59
|
};
|
|
58
60
|
export type BaseColors = {
|
|
59
61
|
primary: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export declare const FakeInput: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|
|
2
2
|
size: string | number;
|
|
3
3
|
}, never>;
|
|
4
|
-
export declare const CheckIcon: import('styled-components').StyledComponent<import('react').FC<import('
|
|
4
|
+
export declare const CheckIcon: import('styled-components').StyledComponent<import('react').FC<import('../..').IconProps>, import('@xstyled/system').Theme, {
|
|
5
5
|
size: string | number;
|
|
6
6
|
}, never>;
|
|
7
7
|
export declare const CheckboxWrap: import('styled-components').StyledComponent<"div", import('@xstyled/system').Theme, {
|