@prom-ui/core 1.3.1 → 1.4.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/Avatar/cjs/index.development.js +99 -67
- package/Avatar/cjs/index.development.v2.js +99 -67
- package/Avatar/cjs/index.production.js +1 -1
- package/Avatar/cjs/index.production.v2.js +1 -1
- package/Avatar/index.d.ts +14 -14
- package/Avatar/package.json +1 -1
- package/Avatar/utils.d.ts +2 -2
- package/Backdrop/cjs/index.development.js +131 -77
- package/Backdrop/cjs/index.development.v2.js +131 -77
- package/Backdrop/cjs/index.production.js +1 -1
- package/Backdrop/cjs/index.production.v2.js +1 -1
- package/Backdrop/index.d.ts +25 -25
- package/Backdrop/package.json +1 -1
- package/Body/cjs/index.development.js +2 -0
- package/Body/cjs/index.development.v2.js +2 -0
- package/Body/index.d.ts +36 -36
- package/Body/package.json +1 -1
- package/BodyContext/cjs/index.development.js +6 -7
- package/BodyContext/cjs/index.development.v2.js +6 -7
- package/BodyContext/cjs/index.production.js +1 -1
- package/BodyContext/cjs/index.production.v2.js +1 -1
- package/BodyContext/index.d.ts +12 -12
- package/BodyContext/package.json +1 -1
- package/BodyProvider/cjs/index.development.js +7 -6
- package/BodyProvider/cjs/index.development.v2.js +7 -6
- package/BodyProvider/index.d.ts +10 -10
- package/BodyProvider/package.json +1 -1
- package/Box/cjs/index.development.js +4 -4
- package/Box/cjs/index.development.v2.js +4 -4
- package/Box/index.d.ts +106 -106
- package/Box/package.json +1 -1
- package/Button/cjs/index.development.js +67 -62
- package/Button/cjs/index.development.v2.js +67 -62
- package/Button/cjs/index.production.js +1 -1
- package/Button/cjs/index.production.v2.js +1 -1
- package/Button/index.d.ts +45 -45
- package/Button/package.json +1 -1
- package/ButtonPageUp/cjs/index.development.js +195 -85
- package/ButtonPageUp/cjs/index.development.v2.js +195 -85
- package/ButtonPageUp/cjs/index.production.js +1 -1
- package/ButtonPageUp/cjs/index.production.v2.js +1 -1
- package/ButtonPageUp/index.d.ts +18 -18
- package/ButtonPageUp/package.json +1 -1
- package/Checkbox/cjs/index.development.js +99 -67
- package/Checkbox/cjs/index.development.v2.js +99 -67
- package/Checkbox/cjs/index.production.js +1 -1
- package/Checkbox/cjs/index.production.v2.js +1 -1
- package/Checkbox/index.d.ts +8 -8
- package/Checkbox/package.json +1 -1
- package/Flex/index.d.ts +34 -34
- package/Flex/package.json +1 -1
- package/Grid/index.d.ts +46 -46
- package/Grid/package.json +1 -1
- package/Icon/index.d.ts +9 -9
- package/Icon/package.json +1 -1
- package/Image/index.d.ts +42 -42
- package/Image/package.json +1 -1
- package/ImageEmoji/cjs/index.development.js +70 -63
- package/ImageEmoji/cjs/index.development.v2.js +70 -63
- package/ImageEmoji/cjs/index.production.js +1 -1
- package/ImageEmoji/cjs/index.production.v2.js +1 -1
- package/ImageEmoji/index.d.ts +9 -9
- package/ImageEmoji/package.json +1 -1
- package/Input/index.d.ts +18 -18
- package/Input/package.json +1 -1
- package/InputField/addons/AfterClearValue.d.ts +3 -3
- package/InputField/addons/AfterCorrectValue.d.ts +2 -2
- package/InputField/addons/AfterLoading.d.ts +2 -2
- package/InputField/addons/AfterTogglePassword.d.ts +6 -6
- package/InputField/addons/ErrorText.d.ts +6 -6
- package/InputField/cjs/index.development.js +237 -173
- package/InputField/cjs/index.development.v2.js +237 -173
- package/InputField/cjs/index.production.js +1 -1
- package/InputField/cjs/index.production.v2.js +1 -1
- package/InputField/index.d.ts +18 -18
- package/InputField/package.json +1 -1
- package/InputField/utils.d.ts +10 -10
- package/KeyPress/cjs/index.development.js +13 -13
- package/KeyPress/cjs/index.development.v2.js +13 -13
- package/KeyPress/index.d.ts +14 -14
- package/KeyPress/package.json +1 -1
- package/Line/index.d.ts +13 -13
- package/Line/package.json +1 -1
- package/Link/cjs/index.development.js +5 -5
- package/Link/cjs/index.development.v2.js +5 -5
- package/Link/index.d.ts +28 -28
- package/Link/package.json +1 -1
- package/List/index.d.ts +23 -23
- package/List/package.json +1 -1
- package/Media/MediaProvider.d.ts +8 -8
- package/Media/cjs/index.development.js +70 -19
- package/Media/cjs/index.development.v2.js +70 -19
- package/Media/cjs/index.production.js +1 -1
- package/Media/cjs/index.production.v2.js +1 -1
- package/Media/index.d.ts +20 -20
- package/Media/package.json +1 -1
- package/OutsideClick/cjs/index.development.js +117 -61
- package/OutsideClick/cjs/index.development.v2.js +117 -61
- package/OutsideClick/cjs/index.production.js +1 -1
- package/OutsideClick/cjs/index.production.v2.js +1 -1
- package/OutsideClick/index.d.ts +12 -12
- package/OutsideClick/package.json +1 -1
- package/Overlay/cjs/index.development.js +197 -183
- package/Overlay/cjs/index.development.v2.js +197 -183
- package/Overlay/cjs/index.production.js +1 -1
- package/Overlay/cjs/index.production.v2.js +1 -1
- package/Overlay/components/OverlayHeader.d.ts +11 -11
- package/Overlay/components/SwipeClose.d.ts +11 -11
- package/Overlay/components/TouchScrollable.d.ts +8 -8
- package/Overlay/index.d.ts +76 -76
- package/Overlay/package.json +1 -1
- package/Overlay/utils.d.ts +10 -10
- package/Picture/index.d.ts +70 -70
- package/Picture/package.json +1 -1
- package/Portal/cjs/index.development.js +11 -11
- package/Portal/cjs/index.development.v2.js +11 -11
- package/Portal/index.d.ts +10 -10
- package/Portal/package.json +1 -1
- package/QRCode/cjs/index.development.js +11 -11
- package/QRCode/cjs/index.development.v2.js +11 -11
- package/QRCode/index.d.ts +17 -17
- package/QRCode/package.json +1 -1
- package/Rating/cjs/index.development.js +75 -69
- package/Rating/cjs/index.development.v2.js +75 -69
- package/Rating/cjs/index.production.js +1 -1
- package/Rating/cjs/index.production.v2.js +1 -1
- package/Rating/index.d.ts +17 -17
- package/Rating/package.json +1 -1
- package/RatingSelect/cjs/index.development.js +148 -68
- package/RatingSelect/cjs/index.development.v2.js +148 -68
- package/RatingSelect/cjs/index.production.js +1 -1
- package/RatingSelect/cjs/index.production.v2.js +1 -1
- package/RatingSelect/index.d.ts +22 -18
- package/RatingSelect/package.json +1 -1
- package/SafeQuery/cjs/index.development.js +158 -110
- package/SafeQuery/cjs/index.development.v2.js +158 -110
- package/SafeQuery/cjs/index.production.js +1 -1
- package/SafeQuery/cjs/index.production.v2.js +1 -1
- package/SafeQuery/components/Error.d.ts +7 -7
- package/SafeQuery/index.d.ts +10 -10
- package/SafeQuery/package.json +1 -1
- package/Scroll/index.d.ts +25 -25
- package/Scroll/package.json +1 -1
- package/ScrollControls/ScrollControlsButton.d.ts +11 -11
- package/ScrollControls/cjs/index.development.js +201 -113
- package/ScrollControls/cjs/index.development.v2.js +201 -113
- package/ScrollControls/cjs/index.production.js +1 -1
- package/ScrollControls/cjs/index.production.v2.js +1 -1
- package/ScrollControls/index.d.ts +16 -16
- package/ScrollControls/package.json +1 -1
- package/SimpleSlider/cjs/index.development.js +270 -158
- package/SimpleSlider/cjs/index.development.v2.js +270 -158
- package/SimpleSlider/cjs/index.production.js +1 -1
- package/SimpleSlider/cjs/index.production.v2.js +1 -1
- package/SimpleSlider/index.d.ts +41 -41
- package/SimpleSlider/package.json +1 -1
- package/SimpleSlider/useAutoPlay.d.ts +3 -3
- package/SimpleSlider/utils.d.ts +19 -19
- package/Skeleton/cjs/index.development.js +118 -64
- package/Skeleton/cjs/index.development.v2.js +118 -64
- package/Skeleton/cjs/index.production.js +1 -1
- package/Skeleton/cjs/index.production.v2.js +1 -1
- package/Skeleton/index.d.ts +37 -37
- package/Skeleton/package.json +1 -1
- package/Spinner/cjs/index.development.js +66 -61
- package/Spinner/cjs/index.development.v2.js +66 -61
- package/Spinner/cjs/index.production.js +1 -1
- package/Spinner/cjs/index.production.v2.js +1 -1
- package/Spinner/index.d.ts +29 -29
- package/Spinner/package.json +1 -1
- package/Text/index.d.ts +25 -25
- package/Text/package.json +1 -1
- package/TextEmoji/cjs/index.development.js +65 -60
- package/TextEmoji/cjs/index.development.v2.js +65 -60
- package/TextEmoji/cjs/index.production.js +1 -1
- package/TextEmoji/cjs/index.production.v2.js +1 -1
- package/TextEmoji/index.d.ts +9 -9
- package/TextEmoji/package.json +1 -1
- package/Tooltip/cjs/index.development.js +80 -91
- package/Tooltip/cjs/index.development.v2.js +80 -91
- package/Tooltip/cjs/index.production.js +1 -1
- package/Tooltip/cjs/index.production.v2.js +1 -1
- package/Tooltip/index.d.ts +87 -87
- package/Tooltip/package.json +1 -1
- package/Tumbler/cjs/index.development.js +98 -66
- package/Tumbler/cjs/index.development.v2.js +98 -66
- package/Tumbler/cjs/index.production.js +1 -1
- package/Tumbler/cjs/index.production.v2.js +1 -1
- package/Tumbler/index.d.ts +8 -8
- package/Tumbler/package.json +1 -1
- package/package.json +7 -5
- package/useBodyTTag/cjs/index.development.js +1 -1
- package/useBodyTTag/cjs/index.development.v2.js +1 -1
- package/useBodyTTag/index.d.ts +2 -2
- package/useBodyTTag/package.json +1 -1
- package/useDebounce/cjs/index.development.js +58 -6
- package/useDebounce/cjs/index.development.v2.js +58 -6
- package/useDebounce/cjs/index.production.js +1 -1
- package/useDebounce/cjs/index.production.v2.js +1 -1
- package/useDebounce/index.d.ts +4 -4
- package/useDebounce/package.json +1 -1
- package/useId/cjs/index.development.js +6 -7
- package/useId/cjs/index.development.v2.js +6 -7
- package/useId/cjs/index.production.js +1 -1
- package/useId/cjs/index.production.v2.js +1 -1
- package/useId/index.d.ts +4 -4
- package/useId/package.json +1 -1
- package/useIsMounted/cjs/index.development.js +3 -3
- package/useIsMounted/cjs/index.development.v2.js +3 -3
- package/useIsMounted/index.d.ts +4 -4
- package/useIsMounted/package.json +1 -1
- package/useKeyPress/cjs/index.development.js +76 -22
- package/useKeyPress/cjs/index.development.v2.js +76 -22
- package/useKeyPress/cjs/index.production.js +1 -1
- package/useKeyPress/cjs/index.production.v2.js +1 -1
- package/useKeyPress/index.d.ts +6 -6
- package/useKeyPress/package.json +1 -1
- package/useMedia/cjs/index.development.js +5 -5
- package/useMedia/cjs/index.development.v2.js +5 -5
- package/useMedia/index.d.ts +21 -21
- package/useMedia/package.json +1 -1
- package/useOutsideClick/cjs/index.development.js +2 -2
- package/useOutsideClick/cjs/index.development.v2.js +2 -2
- package/useOutsideClick/index.d.ts +5 -5
- package/useOutsideClick/package.json +1 -1
- package/usePortal/cjs/index.development.js +32 -27
- package/usePortal/cjs/index.development.v2.js +32 -27
- package/usePortal/index.d.ts +12 -12
- package/usePortal/package.json +1 -1
- package/useScrollPosition/cjs/index.development.js +2 -2
- package/useScrollPosition/cjs/index.development.v2.js +2 -2
- package/useScrollPosition/index.d.ts +5 -5
- package/useScrollPosition/package.json +1 -1
|
@@ -10,62 +10,94 @@ var User = require('@prom-ui/icons/User');
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
function _interopNamespaceCompat(e) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
}
|
|
13
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
24
22
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
31
31
|
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
33
|
+
function _defineProperty(obj, key, value) {
|
|
34
|
+
key = _toPropertyKey(key);
|
|
35
|
+
if (key in obj) {
|
|
36
|
+
Object.defineProperty(obj, key, {
|
|
37
|
+
value: value,
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
obj[key] = value;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
function _extends() {
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i];
|
|
51
|
+
for (var key in source) {
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
53
|
+
target[key] = source[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
};
|
|
59
|
+
return _extends.apply(this, arguments);
|
|
60
|
+
}
|
|
61
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
62
|
+
if (source == null) return {};
|
|
63
|
+
var target = {};
|
|
64
|
+
var sourceKeys = Object.keys(source);
|
|
65
|
+
var key, i;
|
|
66
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
67
|
+
key = sourceKeys[i];
|
|
68
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69
|
+
target[key] = source[key];
|
|
70
|
+
}
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
|
+
function _objectWithoutProperties(source, excluded) {
|
|
74
|
+
if (source == null) return {};
|
|
75
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
+
var key, i;
|
|
77
|
+
if (Object.getOwnPropertySymbols) {
|
|
78
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
79
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
80
|
+
key = sourceSymbolKeys[i];
|
|
81
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
82
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return target;
|
|
87
|
+
}
|
|
88
|
+
function _toPrimitive(input, hint) {
|
|
89
|
+
if (typeof input !== "object" || input === null) return input;
|
|
90
|
+
var prim = input[Symbol.toPrimitive];
|
|
91
|
+
if (prim !== undefined) {
|
|
92
|
+
var res = prim.call(input, hint || "default");
|
|
93
|
+
if (typeof res !== "object") return res;
|
|
94
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
95
|
+
}
|
|
96
|
+
return (hint === "string" ? String : Number)(input);
|
|
97
|
+
}
|
|
98
|
+
function _toPropertyKey(arg) {
|
|
99
|
+
var key = _toPrimitive(arg, "string");
|
|
100
|
+
return typeof key === "symbol" ? key : String(key);
|
|
69
101
|
}
|
|
70
102
|
|
|
71
103
|
function stringToColor(string) {
|
|
@@ -90,18 +122,18 @@ function stringAvatar(name) {
|
|
|
90
122
|
|
|
91
123
|
var css = {"root":"Avatar__root___ap8QD","image":"Avatar__image___52SeG","text":"Avatar__text___-Fg0p","icon":"Avatar__icon___-JCN2","theme_white":"Avatar__theme_white___VDWp7","theme_black-100":"Avatar__theme_black-100___AQ1tT","theme_violet-300":"Avatar__theme_violet-300___yK-3d","theme_yellow-500":"Avatar__theme_yellow-500___O2My9","theme_multicolor":"Avatar__theme_multicolor___xV5U3"};
|
|
92
124
|
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
var image =
|
|
96
|
-
name =
|
|
97
|
-
|
|
98
|
-
size =
|
|
99
|
-
|
|
100
|
-
loading =
|
|
101
|
-
|
|
102
|
-
theme =
|
|
103
|
-
className =
|
|
104
|
-
props =
|
|
125
|
+
var _excluded = ["image", "name", "size", "loading", "theme", "className"];
|
|
126
|
+
var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
127
|
+
var image = _ref.image,
|
|
128
|
+
name = _ref.name,
|
|
129
|
+
_ref$size = _ref.size,
|
|
130
|
+
size = _ref$size === void 0 ? 40 : _ref$size,
|
|
131
|
+
_ref$loading = _ref.loading,
|
|
132
|
+
loading = _ref$loading === void 0 ? 'eager' : _ref$loading,
|
|
133
|
+
_ref$theme = _ref.theme,
|
|
134
|
+
theme = _ref$theme === void 0 ? 'violet-300' : _ref$theme,
|
|
135
|
+
className = _ref.className,
|
|
136
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
105
137
|
var isImage = !!image;
|
|
106
138
|
var bgColor = undefined;
|
|
107
139
|
var shortName = null;
|
|
@@ -112,8 +144,8 @@ var Avatar = React__namespace.forwardRef(function (_a, ref) {
|
|
|
112
144
|
}
|
|
113
145
|
shortName = stringAvatar(trimName);
|
|
114
146
|
}
|
|
115
|
-
return React__namespace.createElement("div",
|
|
116
|
-
className: classNames__default.default(css.root, className, (
|
|
147
|
+
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
148
|
+
className: classNames__default.default(css.root, className, _defineProperty({}, css["theme_".concat(theme)], !isImage))
|
|
117
149
|
}, props, {
|
|
118
150
|
style: {
|
|
119
151
|
background: bgColor,
|
|
@@ -122,16 +154,16 @@ var Avatar = React__namespace.forwardRef(function (_a, ref) {
|
|
|
122
154
|
fontSize: size / 2.2
|
|
123
155
|
},
|
|
124
156
|
ref: ref
|
|
125
|
-
}), isImage ? React__namespace.createElement("img", {
|
|
157
|
+
}), isImage ? /*#__PURE__*/React__namespace.createElement("img", {
|
|
126
158
|
className: css.image,
|
|
127
159
|
src: image,
|
|
128
160
|
alt: name,
|
|
129
161
|
width: size,
|
|
130
162
|
height: size,
|
|
131
163
|
loading: loading
|
|
132
|
-
}) : React__namespace.createElement(React__namespace.Fragment, null, !!shortName ? React__namespace.createElement("span", {
|
|
164
|
+
}) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, !!shortName ? /*#__PURE__*/React__namespace.createElement("span", {
|
|
133
165
|
className: css.text
|
|
134
|
-
}, shortName) : React__namespace.createElement(Icon.Icon, {
|
|
166
|
+
}, shortName) : /*#__PURE__*/React__namespace.createElement(Icon.Icon, {
|
|
135
167
|
className: css.icon,
|
|
136
168
|
"icon-as": User.SvgUser
|
|
137
169
|
})));
|
|
@@ -10,62 +10,94 @@ var User = require('@prom-ui/icons/User');
|
|
|
10
10
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
11
|
|
|
12
12
|
function _interopNamespaceCompat(e) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
});
|
|
23
|
-
}
|
|
13
|
+
if (e && typeof e === 'object' && 'default' in e) return e;
|
|
14
|
+
var n = Object.create(null);
|
|
15
|
+
if (e) {
|
|
16
|
+
Object.keys(e).forEach(function (k) {
|
|
17
|
+
if (k !== 'default') {
|
|
18
|
+
var d = Object.getOwnPropertyDescriptor(e, k);
|
|
19
|
+
Object.defineProperty(n, k, d.get ? d : {
|
|
20
|
+
enumerable: true,
|
|
21
|
+
get: function () { return e[k]; }
|
|
24
22
|
});
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
n.default = e;
|
|
27
|
+
return Object.freeze(n);
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
var React__namespace = /*#__PURE__*/_interopNamespaceCompat(React);
|
|
31
31
|
var classNames__default = /*#__PURE__*/_interopDefaultCompat(classNames);
|
|
32
32
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
33
|
+
function _defineProperty(obj, key, value) {
|
|
34
|
+
key = _toPropertyKey(key);
|
|
35
|
+
if (key in obj) {
|
|
36
|
+
Object.defineProperty(obj, key, {
|
|
37
|
+
value: value,
|
|
38
|
+
enumerable: true,
|
|
39
|
+
configurable: true,
|
|
40
|
+
writable: true
|
|
41
|
+
});
|
|
42
|
+
} else {
|
|
43
|
+
obj[key] = value;
|
|
44
|
+
}
|
|
45
|
+
return obj;
|
|
46
|
+
}
|
|
47
|
+
function _extends() {
|
|
48
|
+
_extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
49
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
50
|
+
var source = arguments[i];
|
|
51
|
+
for (var key in source) {
|
|
52
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
53
|
+
target[key] = source[key];
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
return target;
|
|
58
|
+
};
|
|
59
|
+
return _extends.apply(this, arguments);
|
|
60
|
+
}
|
|
61
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
62
|
+
if (source == null) return {};
|
|
63
|
+
var target = {};
|
|
64
|
+
var sourceKeys = Object.keys(source);
|
|
65
|
+
var key, i;
|
|
66
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
67
|
+
key = sourceKeys[i];
|
|
68
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
69
|
+
target[key] = source[key];
|
|
70
|
+
}
|
|
71
|
+
return target;
|
|
72
|
+
}
|
|
73
|
+
function _objectWithoutProperties(source, excluded) {
|
|
74
|
+
if (source == null) return {};
|
|
75
|
+
var target = _objectWithoutPropertiesLoose(source, excluded);
|
|
76
|
+
var key, i;
|
|
77
|
+
if (Object.getOwnPropertySymbols) {
|
|
78
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
79
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
80
|
+
key = sourceSymbolKeys[i];
|
|
81
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
82
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
83
|
+
target[key] = source[key];
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return target;
|
|
87
|
+
}
|
|
88
|
+
function _toPrimitive(input, hint) {
|
|
89
|
+
if (typeof input !== "object" || input === null) return input;
|
|
90
|
+
var prim = input[Symbol.toPrimitive];
|
|
91
|
+
if (prim !== undefined) {
|
|
92
|
+
var res = prim.call(input, hint || "default");
|
|
93
|
+
if (typeof res !== "object") return res;
|
|
94
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
95
|
+
}
|
|
96
|
+
return (hint === "string" ? String : Number)(input);
|
|
97
|
+
}
|
|
98
|
+
function _toPropertyKey(arg) {
|
|
99
|
+
var key = _toPrimitive(arg, "string");
|
|
100
|
+
return typeof key === "symbol" ? key : String(key);
|
|
69
101
|
}
|
|
70
102
|
|
|
71
103
|
function stringToColor(string) {
|
|
@@ -90,18 +122,18 @@ function stringAvatar(name) {
|
|
|
90
122
|
|
|
91
123
|
var css = {"root":"Avatar__root___G2c2y","image":"Avatar__image___A7F5c","text":"Avatar__text___ZWoLT","icon":"Avatar__icon___sQ5M9","theme_white":"Avatar__theme_white___alKXP","theme_black-100":"Avatar__theme_black-100___mN0Ch","theme_violet-300":"Avatar__theme_violet-300___MEUSj","theme_yellow-500":"Avatar__theme_yellow-500___lfsbh","theme_multicolor":"Avatar__theme_multicolor___zMJTY"};
|
|
92
124
|
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
var image =
|
|
96
|
-
name =
|
|
97
|
-
|
|
98
|
-
size =
|
|
99
|
-
|
|
100
|
-
loading =
|
|
101
|
-
|
|
102
|
-
theme =
|
|
103
|
-
className =
|
|
104
|
-
props =
|
|
125
|
+
var _excluded = ["image", "name", "size", "loading", "theme", "className"];
|
|
126
|
+
var Avatar = /*#__PURE__*/React__namespace.forwardRef(function (_ref, ref) {
|
|
127
|
+
var image = _ref.image,
|
|
128
|
+
name = _ref.name,
|
|
129
|
+
_ref$size = _ref.size,
|
|
130
|
+
size = _ref$size === void 0 ? 40 : _ref$size,
|
|
131
|
+
_ref$loading = _ref.loading,
|
|
132
|
+
loading = _ref$loading === void 0 ? 'eager' : _ref$loading,
|
|
133
|
+
_ref$theme = _ref.theme,
|
|
134
|
+
theme = _ref$theme === void 0 ? 'violet-300' : _ref$theme,
|
|
135
|
+
className = _ref.className,
|
|
136
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
105
137
|
var isImage = !!image;
|
|
106
138
|
var bgColor = undefined;
|
|
107
139
|
var shortName = null;
|
|
@@ -112,8 +144,8 @@ var Avatar = React__namespace.forwardRef(function (_a, ref) {
|
|
|
112
144
|
}
|
|
113
145
|
shortName = stringAvatar(trimName);
|
|
114
146
|
}
|
|
115
|
-
return React__namespace.createElement("div",
|
|
116
|
-
className: classNames__default.default(css.root, className, (
|
|
147
|
+
return /*#__PURE__*/React__namespace.createElement("div", _extends({
|
|
148
|
+
className: classNames__default.default(css.root, className, _defineProperty({}, css["theme_".concat(theme)], !isImage))
|
|
117
149
|
}, props, {
|
|
118
150
|
style: {
|
|
119
151
|
background: bgColor,
|
|
@@ -122,16 +154,16 @@ var Avatar = React__namespace.forwardRef(function (_a, ref) {
|
|
|
122
154
|
fontSize: size / 2.2
|
|
123
155
|
},
|
|
124
156
|
ref: ref
|
|
125
|
-
}), isImage ? React__namespace.createElement("img", {
|
|
157
|
+
}), isImage ? /*#__PURE__*/React__namespace.createElement("img", {
|
|
126
158
|
className: css.image,
|
|
127
159
|
src: image,
|
|
128
160
|
alt: name,
|
|
129
161
|
width: size,
|
|
130
162
|
height: size,
|
|
131
163
|
loading: loading
|
|
132
|
-
}) : React__namespace.createElement(React__namespace.Fragment, null, !!shortName ? React__namespace.createElement("span", {
|
|
164
|
+
}) : /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, !!shortName ? /*#__PURE__*/React__namespace.createElement("span", {
|
|
133
165
|
className: css.text
|
|
134
|
-
}, shortName) : React__namespace.createElement(Icon.Icon, {
|
|
166
|
+
}, shortName) : /*#__PURE__*/React__namespace.createElement(Icon.Icon, {
|
|
135
167
|
className: css.icon,
|
|
136
168
|
"icon-as": User.SvgUser
|
|
137
169
|
})));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/Icon"),n=require("@prom-ui/icons/User");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/Icon"),n=require("@prom-ui/icons/User");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s={root:"ap8QD",image:"_52SeG",text:"-Fg0p",icon:"-JCN2",theme_white:"VDWp7","theme_black-100":"AQ1tT","theme_violet-300":"yK-3d","theme_yellow-500":"O2My9",theme_multicolor:"xV5U3"},m=["image","name","size","loading","theme","className"],p=a.forwardRef((function(e,t){var i=e.image,o=e.name,p=e.size,v=void 0===p?40:p,g=e.loading,b=void 0===g?"eager":g,d=e.theme,y=void 0===d?"violet-300":d,h=e.className,O=f(e,m),j=!!i,w=void 0,N=null;if(!j){var P=o?o.trim():"";"multicolor"===y&&(w=function(e){var t,r=0;for(t=0;t<e.length;t+=1)r=e.charCodeAt(t)+((r<<5)-r);var n="#";for(t=0;t<3;t+=1)n+="00".concat((r>>8*t&255).toString(16)).slice(-2);return n}(P)),N=function(e){return e.split(" ").slice(0,2).map((function(e){return e[0]})).join("")}(P)}return a.createElement("div",u({className:c.default(s.root,h,l({},s["theme_".concat(y)],!j))},O,{style:{background:w,width:v,height:v,fontSize:v/2.2},ref:t}),j?a.createElement("img",{className:s.image,src:i,alt:o,width:v,height:v,loading:b}):a.createElement(a.Fragment,null,N?a.createElement("span",{className:s.text},N):a.createElement(r.Icon,{className:s.icon,"icon-as":n.SvgUser})))}));p.displayName="Avatar",exports.Avatar=p,require("./style.production.css");
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/Icon"),n=require("@prom-ui/icons/User");function
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("classnames"),r=require("@prom-ui/core/Icon"),n=require("@prom-ui/icons/User");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&"object"==typeof e&&"default"in e)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var a=o(e),c=i(t);function l(e,t,r){return(t=function(e){var t=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:String(t)}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function u(){return u=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},u.apply(this,arguments)}function f(e,t){if(null==e)return{};var r,n,i=function(e,t){if(null==e)return{};var r,n,i={},o=Object.keys(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||(i[r]=e[r]);return i}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(n=0;n<o.length;n++)r=o[n],t.indexOf(r)>=0||Object.prototype.propertyIsEnumerable.call(e,r)&&(i[r]=e[r])}return i}var s={root:"G2c2y",image:"A7F5c",text:"ZWoLT",icon:"sQ5M9",theme_white:"alKXP","theme_black-100":"mN0Ch","theme_violet-300":"MEUSj","theme_yellow-500":"lfsbh",theme_multicolor:"zMJTY"},m=["image","name","size","loading","theme","className"],v=a.forwardRef((function(e,t){var i=e.image,o=e.name,v=e.size,b=void 0===v?40:v,p=e.loading,g=void 0===p?"eager":p,d=e.theme,y=void 0===d?"violet-300":d,h=e.className,j=f(e,m),O=!!i,w=void 0,P=null;if(!O){var E=o?o.trim():"";"multicolor"===y&&(w=function(e){var t,r=0;for(t=0;t<e.length;t+=1)r=e.charCodeAt(t)+((r<<5)-r);var n="#";for(t=0;t<3;t+=1)n+="00".concat((r>>8*t&255).toString(16)).slice(-2);return n}(E)),P=function(e){return e.split(" ").slice(0,2).map((function(e){return e[0]})).join("")}(E)}return a.createElement("div",u({className:c.default(s.root,h,l({},s["theme_".concat(y)],!O))},j,{style:{background:w,width:b,height:b,fontSize:b/2.2},ref:t}),O?a.createElement("img",{className:s.image,src:i,alt:o,width:b,height:b,loading:g}):a.createElement(a.Fragment,null,P?a.createElement("span",{className:s.text},P):a.createElement(r.Icon,{className:s.icon,"icon-as":n.SvgUser})))}));v.displayName="Avatar",exports.Avatar=v,require("./style.production.v2.css");
|
package/Avatar/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
export type AvatarProps = React.ComponentPropsWithRef<'div'> & {
|
|
3
|
-
/** Фото пользователя */
|
|
4
|
-
image?: string;
|
|
5
|
-
/** Имя пользователя */
|
|
6
|
-
name?: string;
|
|
7
|
-
/** Размер в px */
|
|
8
|
-
size?: number;
|
|
9
|
-
/** Тема */
|
|
10
|
-
theme?: 'white' | 'black-100' | 'violet-300' | 'yellow-500' | 'multicolor';
|
|
11
|
-
/** Отложенная загрузка изображения */
|
|
12
|
-
loading?: 'lazy' | 'eager';
|
|
13
|
-
};
|
|
14
|
-
export declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
export type AvatarProps = React.ComponentPropsWithRef<'div'> & {
|
|
3
|
+
/** Фото пользователя */
|
|
4
|
+
image?: string;
|
|
5
|
+
/** Имя пользователя */
|
|
6
|
+
name?: string;
|
|
7
|
+
/** Размер в px */
|
|
8
|
+
size?: number;
|
|
9
|
+
/** Тема */
|
|
10
|
+
theme?: 'white' | 'black-100' | 'violet-300' | 'yellow-500' | 'multicolor';
|
|
11
|
+
/** Отложенная загрузка изображения */
|
|
12
|
+
loading?: 'lazy' | 'eager';
|
|
13
|
+
};
|
|
14
|
+
export declare const Avatar: React.ForwardRefExoticComponent<Omit<AvatarProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
package/Avatar/package.json
CHANGED
package/Avatar/utils.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare function stringToColor(string: string): string;
|
|
2
|
-
export declare function stringAvatar(name: string): string;
|
|
1
|
+
export declare function stringToColor(string: string): string;
|
|
2
|
+
export declare function stringAvatar(name: string): string;
|