@itcase/ui 1.0.97 → 1.0.100
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/dist/components/Button.js +3 -3
- package/dist/components/DatePicker.js +53 -35
- package/dist/components/FormField.js +1 -1
- package/dist/components/Grid.js +0 -1
- package/dist/components/Label.js +253 -36
- package/dist/components/Response.js +246 -0
- package/dist/components/Select.js +62 -65
- package/dist/components/Tooltip.js +115 -14
- package/dist/css/components/Avatar/Avatar.css +7 -0
- package/dist/css/components/Cell/Cell.css +1 -0
- package/dist/css/components/Group/Group.css +8 -0
- package/dist/css/components/Label/Label.css +9 -1
- package/dist/css/components/Response/Response.css +21 -0
- package/dist/css/components/Tooltip/Tooltip.css +37 -3
- package/dist/{floating-ui.dom-D_Zct5p2.js → floating-ui.dom-C34fOuI9.js} +20 -39
- package/dist/stories/Avatar.stories.js +179 -0
- package/dist/stories/Cell.stories.js +317 -0
- package/package.json +10 -8
|
@@ -0,0 +1,246 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var PropTypes = require('prop-types');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var SVG = require('react-inlinesvg');
|
|
7
|
+
var borderColor = require('../constants/componentProps/borderColor.js');
|
|
8
|
+
var borderType = require('../constants/componentProps/borderType.js');
|
|
9
|
+
var borderWidth = require('../constants/componentProps/borderWidth.js');
|
|
10
|
+
var fillHover = require('../constants/componentProps/fillHover.js');
|
|
11
|
+
var fill = require('../constants/componentProps/fill.js');
|
|
12
|
+
var shape = require('../constants/componentProps/shape.js');
|
|
13
|
+
var size = require('../constants/componentProps/size.js');
|
|
14
|
+
var textColor = require('../constants/componentProps/textColor.js');
|
|
15
|
+
var textSize = require('../constants/componentProps/textSize.js');
|
|
16
|
+
var textWeight = require('../constants/componentProps/textWeight.js');
|
|
17
|
+
var titleSize = require('../constants/componentProps/titleSize.js');
|
|
18
|
+
var width = require('../constants/componentProps/width.js');
|
|
19
|
+
var index$3 = require('./Button.js');
|
|
20
|
+
var index = require('./Group.js');
|
|
21
|
+
var index$2 = require('./Text.js');
|
|
22
|
+
var index$1 = require('./Title.js');
|
|
23
|
+
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
24
|
+
require('./Icon.js');
|
|
25
|
+
require('./Link.js');
|
|
26
|
+
require('../constants/componentProps/textGradient.js');
|
|
27
|
+
require('../constants/componentProps/textStyle.js');
|
|
28
|
+
require('../constants/componentProps/type.js');
|
|
29
|
+
require('../constants/componentProps/underline.js');
|
|
30
|
+
require('../hooks/useStyles.js');
|
|
31
|
+
require('lodash/camelCase');
|
|
32
|
+
require('lodash/maxBy');
|
|
33
|
+
require('lodash/upperFirst');
|
|
34
|
+
require('../hooks/styleAttributes.js');
|
|
35
|
+
require('../context/UIContext.js');
|
|
36
|
+
require('../hooks/useMediaQueries.js');
|
|
37
|
+
require('react-responsive');
|
|
38
|
+
require('lodash/castArray');
|
|
39
|
+
require('../constants/componentProps/iconSize.js');
|
|
40
|
+
require('../constants/componentProps/strokeColor.js');
|
|
41
|
+
require('./Tooltip.js');
|
|
42
|
+
require('../constants/componentProps/textColorActive.js');
|
|
43
|
+
require('../constants/componentProps/textColorHover.js');
|
|
44
|
+
require('../constants/componentProps/textAlign.js');
|
|
45
|
+
require('../constants/componentProps/wrap.js');
|
|
46
|
+
require('./Loader.js');
|
|
47
|
+
require('../constants/componentProps/direction.js');
|
|
48
|
+
require('../constants/componentProps/stacking.js');
|
|
49
|
+
|
|
50
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
51
|
+
|
|
52
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
53
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
54
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
55
|
+
var SVG__default = /*#__PURE__*/_interopDefault(SVG);
|
|
56
|
+
|
|
57
|
+
const responseConfig = {
|
|
58
|
+
appearance: {},
|
|
59
|
+
setAppearance: newComponent => {
|
|
60
|
+
responseConfig.appearance = newComponent;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
function Response(props) {
|
|
64
|
+
const {
|
|
65
|
+
after,
|
|
66
|
+
before,
|
|
67
|
+
appearance,
|
|
68
|
+
imageSrc,
|
|
69
|
+
className,
|
|
70
|
+
title,
|
|
71
|
+
titleTextSize,
|
|
72
|
+
titleTextWeight,
|
|
73
|
+
titleTextColor,
|
|
74
|
+
message,
|
|
75
|
+
messageTextColor,
|
|
76
|
+
messageTextSize,
|
|
77
|
+
primaryButton,
|
|
78
|
+
primaryButtonAfter,
|
|
79
|
+
primaryButtonAppearance,
|
|
80
|
+
primaryButtonBefore,
|
|
81
|
+
primaryButtonFill,
|
|
82
|
+
primaryButtonFillHover,
|
|
83
|
+
primaryButtonLabel,
|
|
84
|
+
primaryButtonLabelTextColor,
|
|
85
|
+
primaryButtonLabelTextSize,
|
|
86
|
+
primaryButtonShape,
|
|
87
|
+
primaryButtonSize,
|
|
88
|
+
primaryButtonWidth,
|
|
89
|
+
secondaryButton,
|
|
90
|
+
secondaryButtonAfter,
|
|
91
|
+
secondaryButtonAppearance,
|
|
92
|
+
secondaryButtonBefore,
|
|
93
|
+
secondaryButtonFill,
|
|
94
|
+
secondaryButtonFillHover,
|
|
95
|
+
secondaryButtonLabel,
|
|
96
|
+
secondaryButtonLabelTextColor,
|
|
97
|
+
secondaryButtonLabelTextSize,
|
|
98
|
+
secondaryButtonShape,
|
|
99
|
+
secondaryButtonSize,
|
|
100
|
+
secondaryButtonWidth,
|
|
101
|
+
onClickPrimaryButton,
|
|
102
|
+
onClickSecondaryButton
|
|
103
|
+
} = props;
|
|
104
|
+
const ImageComponent = React.useMemo(() => {
|
|
105
|
+
if (imageSrc) {
|
|
106
|
+
// eslint-disable-next-line react/prop-types
|
|
107
|
+
if (imageSrc.endsWith('.svg')) {
|
|
108
|
+
return /*#__PURE__*/React__default.default.createElement(SVG__default.default, {
|
|
109
|
+
src: imageSrc
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
return /*#__PURE__*/React__default.default.createElement("img", {
|
|
113
|
+
src: imageSrc
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
return null;
|
|
117
|
+
}, [imageSrc]);
|
|
118
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
119
|
+
prefix: 'fill_',
|
|
120
|
+
propsKey: 'fill'
|
|
121
|
+
});
|
|
122
|
+
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
123
|
+
prefix: 'fill_hover_',
|
|
124
|
+
propsKey: 'fillHover'
|
|
125
|
+
});
|
|
126
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
127
|
+
prefix: 'response_shape_',
|
|
128
|
+
propsKey: 'shape'
|
|
129
|
+
});
|
|
130
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
131
|
+
prefix: 'border-color_',
|
|
132
|
+
propsKey: 'borderColor'
|
|
133
|
+
});
|
|
134
|
+
const borderColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
135
|
+
prefix: 'border-color_hover_',
|
|
136
|
+
propsKey: 'borderColorHover'
|
|
137
|
+
});
|
|
138
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
139
|
+
prefix: 'border-width_',
|
|
140
|
+
propsKey: 'borderWidth'
|
|
141
|
+
});
|
|
142
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
143
|
+
prefix: 'border_type_',
|
|
144
|
+
propsKey: 'borderType'
|
|
145
|
+
});
|
|
146
|
+
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
147
|
+
className: clsx__default.default(className, 'response', fillClass, fillHoverClass, shapeClass, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass)
|
|
148
|
+
}, before, ImageComponent, /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
149
|
+
className: "response__desc",
|
|
150
|
+
width: "fill"
|
|
151
|
+
}, title && /*#__PURE__*/React__default.default.createElement(index$1.Title, {
|
|
152
|
+
className: "response__title",
|
|
153
|
+
size: titleTextSize || responseConfig.appearance[appearance]?.titleTextSize,
|
|
154
|
+
textColor: titleTextColor || responseConfig.appearance[appearance]?.titleTextColor,
|
|
155
|
+
textWeight: titleTextWeight || responseConfig.appearance[appearance]?.titleTextWeight
|
|
156
|
+
}, title), message && /*#__PURE__*/React__default.default.createElement(index$2.Text, {
|
|
157
|
+
className: "response__message",
|
|
158
|
+
size: messageTextSize || responseConfig.appearance[appearance]?.messageTextSize,
|
|
159
|
+
textColor: messageTextColor || responseConfig.appearance[appearance]?.messageTextColor
|
|
160
|
+
}, message)), (primaryButtonLabel || primaryButton || secondaryButtonLabel || secondaryButton) && /*#__PURE__*/React__default.default.createElement(index.Group, {
|
|
161
|
+
className: "response__button",
|
|
162
|
+
width: "fill"
|
|
163
|
+
}, primaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
164
|
+
after: primaryButtonAfter,
|
|
165
|
+
appearance: primaryButtonAppearance || responseConfig.appearance[appearance]?.primaryButtonAppearance,
|
|
166
|
+
before: primaryButtonBefore,
|
|
167
|
+
className: "response__button-item",
|
|
168
|
+
fill: primaryButtonFill,
|
|
169
|
+
fillHover: primaryButtonFillHover,
|
|
170
|
+
label: primaryButtonLabel,
|
|
171
|
+
labelTextColor: primaryButtonLabelTextColor,
|
|
172
|
+
labelTextSize: primaryButtonLabelTextSize || responseConfig.appearance[appearance]?.primaryButtonLabelTextSize,
|
|
173
|
+
shape: primaryButtonShape || responseConfig.appearance[appearance]?.primaryButtonShape,
|
|
174
|
+
size: primaryButtonSize || responseConfig.appearance[appearance]?.primaryButtonSize,
|
|
175
|
+
width: primaryButtonWidth || responseConfig.appearance[appearance]?.primaryButtonWidth,
|
|
176
|
+
onClick: onClickPrimaryButton
|
|
177
|
+
}) : primaryButton, secondaryButtonLabel ? /*#__PURE__*/React__default.default.createElement(index$3.Button, {
|
|
178
|
+
after: secondaryButtonAfter,
|
|
179
|
+
appearance: secondaryButtonAppearance || responseConfig.appearance[appearance]?.secondaryButtonAppearance,
|
|
180
|
+
before: secondaryButtonBefore,
|
|
181
|
+
className: "response__button-item",
|
|
182
|
+
fill: secondaryButtonFill,
|
|
183
|
+
fillHover: secondaryButtonFillHover,
|
|
184
|
+
label: secondaryButtonLabel,
|
|
185
|
+
labelTextColor: secondaryButtonLabelTextColor,
|
|
186
|
+
labelTextSize: secondaryButtonLabelTextSize || responseConfig.appearance[appearance]?.secondaryButtonLabelTextSize,
|
|
187
|
+
shape: secondaryButtonShape || responseConfig.appearance[appearance]?.secondaryButtonShape,
|
|
188
|
+
size: secondaryButtonSize || responseConfig.appearance[appearance]?.secondaryButtonSize,
|
|
189
|
+
width: secondaryButtonWidth || responseConfig.appearance[appearance]?.secondaryButtonWidth,
|
|
190
|
+
onClick: onClickSecondaryButton
|
|
191
|
+
}) : secondaryButton), after);
|
|
192
|
+
}
|
|
193
|
+
Response.propsTypes = {
|
|
194
|
+
borderColor: PropTypes__default.default.oneOf(borderColor.default),
|
|
195
|
+
borderType: PropTypes__default.default.oneOf(borderType.default),
|
|
196
|
+
borderWidth: PropTypes__default.default.oneOf(borderWidth.default),
|
|
197
|
+
className: PropTypes__default.default.string,
|
|
198
|
+
fill: PropTypes__default.default.oneOf(fill.default),
|
|
199
|
+
fillHover: PropTypes__default.default.oneOf(fillHover.default),
|
|
200
|
+
shape: PropTypes__default.default.oneOf(shape.default),
|
|
201
|
+
after: PropTypes__default.default.any,
|
|
202
|
+
before: PropTypes__default.default.any,
|
|
203
|
+
appearance: PropTypes__default.default.string,
|
|
204
|
+
imageSrc: PropTypes__default.default.string,
|
|
205
|
+
title: PropTypes__default.default.string,
|
|
206
|
+
titleTextSize: PropTypes__default.default.oneOf(titleSize.default),
|
|
207
|
+
titleTextWeight: PropTypes__default.default.oneOf(textWeight.default),
|
|
208
|
+
titleTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
209
|
+
message: PropTypes__default.default.string,
|
|
210
|
+
messageTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
211
|
+
messageTextSize: PropTypes__default.default.oneOf(textSize.default),
|
|
212
|
+
primaryButton: PropTypes__default.default.any,
|
|
213
|
+
primaryButtonAfter: PropTypes__default.default.any,
|
|
214
|
+
primaryButtonAppearance: PropTypes__default.default.string,
|
|
215
|
+
primaryButtonBefore: PropTypes__default.default.any,
|
|
216
|
+
primaryButtonFill: PropTypes__default.default.oneOf(fill.default),
|
|
217
|
+
primaryButtonFillHover: PropTypes__default.default.oneOf(fillHover.default),
|
|
218
|
+
primaryButtonLabel: PropTypes__default.default.string,
|
|
219
|
+
primaryButtonLabelTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
220
|
+
primaryButtonLabelTextSize: PropTypes__default.default.oneOf(textSize.default),
|
|
221
|
+
primaryButtonShape: PropTypes__default.default.oneOf(shape.default),
|
|
222
|
+
primaryButtonSize: PropTypes__default.default.oneOf(size.default),
|
|
223
|
+
primaryButtonWidth: PropTypes__default.default.oneOf(width.default),
|
|
224
|
+
secondaryButton: PropTypes__default.default.any,
|
|
225
|
+
secondaryButtonAfter: PropTypes__default.default.any,
|
|
226
|
+
secondaryButtonAppearance: PropTypes__default.default.string,
|
|
227
|
+
secondaryButtonBefore: PropTypes__default.default.any,
|
|
228
|
+
secondaryButtonFill: PropTypes__default.default.oneOf(fill.default),
|
|
229
|
+
secondaryButtonFillHover: PropTypes__default.default.oneOf(fillHover.default),
|
|
230
|
+
secondaryButtonLabel: PropTypes__default.default.string,
|
|
231
|
+
secondaryButtonLabelTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
232
|
+
secondaryButtonLabelTextSize: PropTypes__default.default.oneOf(textSize.default),
|
|
233
|
+
secondaryButtonShape: PropTypes__default.default.oneOf(shape.default),
|
|
234
|
+
secondaryButtonSize: PropTypes__default.default.oneOf(size.default),
|
|
235
|
+
secondaryButtonWidth: PropTypes__default.default.oneOf(width.default),
|
|
236
|
+
onClickPrimaryButton: PropTypes__default.default.func,
|
|
237
|
+
onClickSecondaryButton: PropTypes__default.default.func
|
|
238
|
+
};
|
|
239
|
+
Response.__docgenInfo = {
|
|
240
|
+
"description": "",
|
|
241
|
+
"methods": [],
|
|
242
|
+
"displayName": "Response"
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
exports.Response = Response;
|
|
246
|
+
exports.responseConfig = responseConfig;
|
|
@@ -6,7 +6,7 @@ var index$1 = require('./Icon.js');
|
|
|
6
6
|
var Select$1 = require('react-select');
|
|
7
7
|
var clsx = require('clsx');
|
|
8
8
|
var ReactDOM = require('react-dom');
|
|
9
|
-
var floatingUi_dom = require('../floating-ui.dom-
|
|
9
|
+
var floatingUi_dom = require('../floating-ui.dom-C34fOuI9.js');
|
|
10
10
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
11
11
|
var index$2 = require('./Badge.js');
|
|
12
12
|
var index$3 = require('./Text.js');
|
|
@@ -135,34 +135,34 @@ function _extends() {
|
|
|
135
135
|
return _extends.apply(this, arguments);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
function _typeof(
|
|
138
|
+
function _typeof(o) {
|
|
139
139
|
"@babel/helpers - typeof";
|
|
140
140
|
|
|
141
|
-
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (
|
|
142
|
-
return typeof
|
|
143
|
-
} : function (
|
|
144
|
-
return
|
|
145
|
-
}, _typeof(
|
|
141
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
|
|
142
|
+
return typeof o;
|
|
143
|
+
} : function (o) {
|
|
144
|
+
return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
|
|
145
|
+
}, _typeof(o);
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
function
|
|
149
|
-
if (
|
|
150
|
-
var
|
|
151
|
-
if (
|
|
152
|
-
var
|
|
153
|
-
if (
|
|
148
|
+
function toPrimitive(t, r) {
|
|
149
|
+
if ("object" != _typeof(t) || !t) return t;
|
|
150
|
+
var e = t[Symbol.toPrimitive];
|
|
151
|
+
if (void 0 !== e) {
|
|
152
|
+
var i = e.call(t, r || "default");
|
|
153
|
+
if ("object" != _typeof(i)) return i;
|
|
154
154
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
155
155
|
}
|
|
156
|
-
return (
|
|
156
|
+
return ("string" === r ? String : Number)(t);
|
|
157
157
|
}
|
|
158
158
|
|
|
159
|
-
function
|
|
160
|
-
var
|
|
161
|
-
return _typeof(
|
|
159
|
+
function toPropertyKey(t) {
|
|
160
|
+
var i = toPrimitive(t, "string");
|
|
161
|
+
return "symbol" == _typeof(i) ? i : String(i);
|
|
162
162
|
}
|
|
163
163
|
|
|
164
164
|
function _defineProperty(obj, key, value) {
|
|
165
|
-
key =
|
|
165
|
+
key = toPropertyKey(key);
|
|
166
166
|
if (key in obj) {
|
|
167
167
|
Object.defineProperty(obj, key, {
|
|
168
168
|
value: value,
|
|
@@ -176,26 +176,26 @@ function _defineProperty(obj, key, value) {
|
|
|
176
176
|
return obj;
|
|
177
177
|
}
|
|
178
178
|
|
|
179
|
-
function ownKeys(
|
|
180
|
-
var
|
|
179
|
+
function ownKeys(e, r) {
|
|
180
|
+
var t = Object.keys(e);
|
|
181
181
|
if (Object.getOwnPropertySymbols) {
|
|
182
|
-
var
|
|
183
|
-
|
|
184
|
-
return Object.getOwnPropertyDescriptor(
|
|
185
|
-
})),
|
|
182
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
183
|
+
r && (o = o.filter(function (r) {
|
|
184
|
+
return Object.getOwnPropertyDescriptor(e, r).enumerable;
|
|
185
|
+
})), t.push.apply(t, o);
|
|
186
186
|
}
|
|
187
|
-
return
|
|
188
|
-
}
|
|
189
|
-
function _objectSpread2(
|
|
190
|
-
for (var
|
|
191
|
-
var
|
|
192
|
-
|
|
193
|
-
_defineProperty(
|
|
194
|
-
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(
|
|
195
|
-
Object.defineProperty(
|
|
187
|
+
return t;
|
|
188
|
+
}
|
|
189
|
+
function _objectSpread2(e) {
|
|
190
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
191
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
192
|
+
r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {
|
|
193
|
+
_defineProperty(e, r, t[r]);
|
|
194
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {
|
|
195
|
+
Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
|
|
196
196
|
});
|
|
197
197
|
}
|
|
198
|
-
return
|
|
198
|
+
return e;
|
|
199
199
|
}
|
|
200
200
|
|
|
201
201
|
function _classCallCheck(instance, Constructor) {
|
|
@@ -210,7 +210,7 @@ function _defineProperties(target, props) {
|
|
|
210
210
|
descriptor.enumerable = descriptor.enumerable || false;
|
|
211
211
|
descriptor.configurable = true;
|
|
212
212
|
if ("value" in descriptor) descriptor.writable = true;
|
|
213
|
-
Object.defineProperty(target,
|
|
213
|
+
Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);
|
|
214
214
|
}
|
|
215
215
|
}
|
|
216
216
|
function _createClass(Constructor, protoProps, staticProps) {
|
|
@@ -255,15 +255,12 @@ function _getPrototypeOf(o) {
|
|
|
255
255
|
}
|
|
256
256
|
|
|
257
257
|
function _isNativeReflectConstruct() {
|
|
258
|
-
if (typeof Reflect === "undefined" || !Reflect.construct) return false;
|
|
259
|
-
if (Reflect.construct.sham) return false;
|
|
260
|
-
if (typeof Proxy === "function") return true;
|
|
261
258
|
try {
|
|
262
|
-
Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
return
|
|
266
|
-
}
|
|
259
|
+
var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));
|
|
260
|
+
} catch (t) {}
|
|
261
|
+
return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {
|
|
262
|
+
return !!t;
|
|
263
|
+
})();
|
|
267
264
|
}
|
|
268
265
|
|
|
269
266
|
function _assertThisInitialized(self) {
|
|
@@ -2676,7 +2673,7 @@ var Emotion$1 = Emotion;
|
|
|
2676
2673
|
|
|
2677
2674
|
var pkg = {
|
|
2678
2675
|
name: "@emotion/react",
|
|
2679
|
-
version: "11.11.
|
|
2676
|
+
version: "11.11.3",
|
|
2680
2677
|
main: "dist/emotion-react.cjs.js",
|
|
2681
2678
|
module: "dist/emotion-react.esm.js",
|
|
2682
2679
|
browser: {
|
|
@@ -2749,7 +2746,7 @@ var pkg = {
|
|
|
2749
2746
|
"@babel/runtime": "^7.18.3",
|
|
2750
2747
|
"@emotion/babel-plugin": "^11.11.0",
|
|
2751
2748
|
"@emotion/cache": "^11.11.0",
|
|
2752
|
-
"@emotion/serialize": "^1.1.
|
|
2749
|
+
"@emotion/serialize": "^1.1.3",
|
|
2753
2750
|
"@emotion/use-insertion-effect-with-fallbacks": "^1.0.1",
|
|
2754
2751
|
"@emotion/utils": "^1.2.1",
|
|
2755
2752
|
"@emotion/weak-memoize": "^0.3.1",
|
|
@@ -2765,7 +2762,7 @@ var pkg = {
|
|
|
2765
2762
|
},
|
|
2766
2763
|
devDependencies: {
|
|
2767
2764
|
"@definitelytyped/dtslint": "0.0.112",
|
|
2768
|
-
"@emotion/css": "11.11.
|
|
2765
|
+
"@emotion/css": "11.11.2",
|
|
2769
2766
|
"@emotion/css-prettifier": "1.1.3",
|
|
2770
2767
|
"@emotion/server": "11.11.0",
|
|
2771
2768
|
"@emotion/styled": "11.11.0",
|
|
@@ -3126,31 +3123,31 @@ function _arrayWithHoles(arr) {
|
|
|
3126
3123
|
if (Array.isArray(arr)) return arr;
|
|
3127
3124
|
}
|
|
3128
3125
|
|
|
3129
|
-
function _iterableToArrayLimit(
|
|
3130
|
-
var
|
|
3131
|
-
if (null !=
|
|
3132
|
-
var
|
|
3133
|
-
|
|
3134
|
-
|
|
3135
|
-
|
|
3136
|
-
|
|
3137
|
-
|
|
3138
|
-
|
|
3126
|
+
function _iterableToArrayLimit(r, l) {
|
|
3127
|
+
var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"];
|
|
3128
|
+
if (null != t) {
|
|
3129
|
+
var e,
|
|
3130
|
+
n,
|
|
3131
|
+
i,
|
|
3132
|
+
u,
|
|
3133
|
+
a = [],
|
|
3134
|
+
f = !0,
|
|
3135
|
+
o = !1;
|
|
3139
3136
|
try {
|
|
3140
|
-
if (
|
|
3141
|
-
if (Object(
|
|
3142
|
-
|
|
3143
|
-
} else for (; !(
|
|
3144
|
-
} catch (
|
|
3145
|
-
|
|
3137
|
+
if (i = (t = t.call(r)).next, 0 === l) {
|
|
3138
|
+
if (Object(t) !== t) return;
|
|
3139
|
+
f = !1;
|
|
3140
|
+
} else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);
|
|
3141
|
+
} catch (r) {
|
|
3142
|
+
o = !0, n = r;
|
|
3146
3143
|
} finally {
|
|
3147
3144
|
try {
|
|
3148
|
-
if (!
|
|
3145
|
+
if (!f && null != t["return"] && (u = t["return"](), Object(u) !== u)) return;
|
|
3149
3146
|
} finally {
|
|
3150
|
-
if (
|
|
3147
|
+
if (o) throw n;
|
|
3151
3148
|
}
|
|
3152
3149
|
}
|
|
3153
|
-
return
|
|
3150
|
+
return a;
|
|
3154
3151
|
}
|
|
3155
3152
|
}
|
|
3156
3153
|
|
|
@@ -41,11 +41,12 @@ const tooltipConfig = {
|
|
|
41
41
|
tooltipConfig.appearance = newComponent;
|
|
42
42
|
}
|
|
43
43
|
};
|
|
44
|
-
function Tooltip(props) {
|
|
44
|
+
const Tooltip = /*#__PURE__*/React__default.default.forwardRef(function Tooltip(props, ref) {
|
|
45
45
|
const {
|
|
46
46
|
before,
|
|
47
47
|
after,
|
|
48
48
|
appearance,
|
|
49
|
+
children,
|
|
49
50
|
className,
|
|
50
51
|
text,
|
|
51
52
|
title,
|
|
@@ -57,6 +58,37 @@ function Tooltip(props) {
|
|
|
57
58
|
textColor,
|
|
58
59
|
textSize
|
|
59
60
|
} = props;
|
|
61
|
+
const tooltipTimeoutHideRef = React.useRef(null);
|
|
62
|
+
const isTooltipCloseAnimationInProgressRef = React.useRef(false);
|
|
63
|
+
const [isTooltipVisible, setIsTooltipVisible] = React.useState(null);
|
|
64
|
+
const openTooltip = React.useCallback(() => {
|
|
65
|
+
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
66
|
+
clearTimeout(tooltipTimeoutHideRef.current);
|
|
67
|
+
setIsTooltipVisible(true);
|
|
68
|
+
}
|
|
69
|
+
}, []);
|
|
70
|
+
const closeTooltip = React.useCallback(() => {
|
|
71
|
+
// Make a small delay to be able to move cursor on the tooltip without
|
|
72
|
+
// triggering a close, because the label and the tooltip have space between
|
|
73
|
+
tooltipTimeoutHideRef.current = setTimeout(() => {
|
|
74
|
+
setIsTooltipVisible(prevState => {
|
|
75
|
+
const newState = false;
|
|
76
|
+
if (prevState === true) {
|
|
77
|
+
isTooltipCloseAnimationInProgressRef.current = true;
|
|
78
|
+
}
|
|
79
|
+
return newState;
|
|
80
|
+
});
|
|
81
|
+
}, 250);
|
|
82
|
+
}, []);
|
|
83
|
+
const onAnimationEnd = React.useCallback(() => {
|
|
84
|
+
isTooltipCloseAnimationInProgressRef.current = false;
|
|
85
|
+
}, []);
|
|
86
|
+
React.useImperativeHandle(ref, () => ({
|
|
87
|
+
openTooltip,
|
|
88
|
+
closeTooltip
|
|
89
|
+
}), [openTooltip, closeTooltip]);
|
|
90
|
+
|
|
91
|
+
/* STYLES */
|
|
60
92
|
const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
61
93
|
prefix: 'align_',
|
|
62
94
|
propsKey: 'alignDirection'
|
|
@@ -89,31 +121,50 @@ function Tooltip(props) {
|
|
|
89
121
|
prefix: 'border_type_',
|
|
90
122
|
propsKey: 'borderType'
|
|
91
123
|
});
|
|
124
|
+
const elevationClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
125
|
+
prefix: 'elevation_',
|
|
126
|
+
propsKey: 'elevation'
|
|
127
|
+
});
|
|
128
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
129
|
+
prefix: 'width_',
|
|
130
|
+
propsKey: 'width'
|
|
131
|
+
});
|
|
132
|
+
const alignmentClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
133
|
+
prefix: 'alignment_',
|
|
134
|
+
propsKey: 'alignment'
|
|
135
|
+
});
|
|
92
136
|
const {
|
|
93
137
|
styles: tooltipStyles
|
|
94
138
|
} = useStyles.useStyles(props);
|
|
139
|
+
const tooltipAppearanceItem = tooltipConfig.appearance[appearance] || {};
|
|
95
140
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
96
|
-
className: clsx__default.default(className, 'tooltip', fillClass ||
|
|
97
|
-
style: tooltipStyles
|
|
141
|
+
className: clsx__default.default(className, 'tooltip', isTooltipVisible === true && 'tooltip_state_open', isTooltipVisible === false && 'tooltip_state_close', fillClass || tooltipAppearanceItem.fillClass && `fill_${tooltipAppearanceItem.fillClass}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass, alignDirectionClass, alignClass, alignmentClass, borderWidthClass, borderColorClass, borderTypeClass, elevationClass, sizeClass, arrowPosition && `tooltip_type_arrow tooltip_arrow_position_${arrowPosition}`, type && `tooltip_type_${type}`, set && `tooltip_set_${set}`, widthClass),
|
|
142
|
+
style: tooltipStyles,
|
|
143
|
+
onAnimationEnd: onAnimationEnd
|
|
98
144
|
}, before, /*#__PURE__*/React__default.default.createElement("div", {
|
|
99
145
|
className: "tooltip__inner"
|
|
100
146
|
}, title && /*#__PURE__*/React__default.default.createElement(index.Title, {
|
|
101
147
|
className: "tooltip__title",
|
|
102
148
|
size: titleSize,
|
|
103
|
-
textColor: titleTextColor ||
|
|
149
|
+
textColor: titleTextColor || tooltipAppearanceItem.titleTextColor
|
|
104
150
|
}, title), text && /*#__PURE__*/React__default.default.createElement(index$1.Text, {
|
|
105
151
|
className: "tooltip__text",
|
|
106
152
|
size: textSize,
|
|
107
|
-
textColor: textColor ||
|
|
108
|
-
}, text)), after);
|
|
109
|
-
}
|
|
153
|
+
textColor: textColor || tooltipAppearanceItem.textColor
|
|
154
|
+
}, text), children), after);
|
|
155
|
+
});
|
|
110
156
|
Tooltip.propTypes = {
|
|
157
|
+
after: PropTypes__default.default.string,
|
|
158
|
+
appearance: PropTypes__default.default.string,
|
|
159
|
+
arrowPosition: PropTypes__default.default.string,
|
|
160
|
+
before: PropTypes__default.default.string,
|
|
111
161
|
children: PropTypes__default.default.any,
|
|
112
162
|
className: PropTypes__default.default.string,
|
|
113
163
|
fill: PropTypes__default.default.oneOf(fill.default),
|
|
114
164
|
fillDesktop: PropTypes__default.default.oneOf(fill.default),
|
|
115
165
|
fillMobile: PropTypes__default.default.oneOf(fill.default),
|
|
116
166
|
fillTablet: PropTypes__default.default.oneOf(fill.default),
|
|
167
|
+
set: PropTypes__default.default.string,
|
|
117
168
|
shape: PropTypes__default.default.oneOf(shape.default),
|
|
118
169
|
shapeDesktop: PropTypes__default.default.oneOf(shape.default),
|
|
119
170
|
shapeMobile: PropTypes__default.default.oneOf(shape.default),
|
|
@@ -128,20 +179,42 @@ Tooltip.propTypes = {
|
|
|
128
179
|
textSizeDesktop: PropTypes__default.default.oneOf(size.default),
|
|
129
180
|
textSizeMobile: PropTypes__default.default.oneOf(size.default),
|
|
130
181
|
textSizeTablet: PropTypes__default.default.oneOf(size.default),
|
|
182
|
+
title: PropTypes__default.default.string,
|
|
183
|
+
titleSize: PropTypes__default.default.string,
|
|
184
|
+
titleTextColor: PropTypes__default.default.string,
|
|
131
185
|
type: PropTypes__default.default.string
|
|
132
186
|
};
|
|
133
|
-
Tooltip.defaultProps = {
|
|
134
|
-
label: 'Label'
|
|
135
|
-
};
|
|
187
|
+
Tooltip.defaultProps = {};
|
|
136
188
|
Tooltip.__docgenInfo = {
|
|
137
189
|
"description": "",
|
|
138
190
|
"methods": [],
|
|
139
191
|
"displayName": "Tooltip",
|
|
140
192
|
"props": {
|
|
141
|
-
"
|
|
142
|
-
"
|
|
143
|
-
|
|
144
|
-
"
|
|
193
|
+
"after": {
|
|
194
|
+
"description": "",
|
|
195
|
+
"type": {
|
|
196
|
+
"name": "string"
|
|
197
|
+
},
|
|
198
|
+
"required": false
|
|
199
|
+
},
|
|
200
|
+
"appearance": {
|
|
201
|
+
"description": "",
|
|
202
|
+
"type": {
|
|
203
|
+
"name": "string"
|
|
204
|
+
},
|
|
205
|
+
"required": false
|
|
206
|
+
},
|
|
207
|
+
"arrowPosition": {
|
|
208
|
+
"description": "",
|
|
209
|
+
"type": {
|
|
210
|
+
"name": "string"
|
|
211
|
+
},
|
|
212
|
+
"required": false
|
|
213
|
+
},
|
|
214
|
+
"before": {
|
|
215
|
+
"description": "",
|
|
216
|
+
"type": {
|
|
217
|
+
"name": "string"
|
|
145
218
|
},
|
|
146
219
|
"required": false
|
|
147
220
|
},
|
|
@@ -195,6 +268,13 @@ Tooltip.__docgenInfo = {
|
|
|
195
268
|
},
|
|
196
269
|
"required": false
|
|
197
270
|
},
|
|
271
|
+
"set": {
|
|
272
|
+
"description": "",
|
|
273
|
+
"type": {
|
|
274
|
+
"name": "string"
|
|
275
|
+
},
|
|
276
|
+
"required": false
|
|
277
|
+
},
|
|
198
278
|
"shape": {
|
|
199
279
|
"description": "",
|
|
200
280
|
"type": {
|
|
@@ -319,6 +399,27 @@ Tooltip.__docgenInfo = {
|
|
|
319
399
|
},
|
|
320
400
|
"required": false
|
|
321
401
|
},
|
|
402
|
+
"title": {
|
|
403
|
+
"description": "",
|
|
404
|
+
"type": {
|
|
405
|
+
"name": "string"
|
|
406
|
+
},
|
|
407
|
+
"required": false
|
|
408
|
+
},
|
|
409
|
+
"titleSize": {
|
|
410
|
+
"description": "",
|
|
411
|
+
"type": {
|
|
412
|
+
"name": "string"
|
|
413
|
+
},
|
|
414
|
+
"required": false
|
|
415
|
+
},
|
|
416
|
+
"titleTextColor": {
|
|
417
|
+
"description": "",
|
|
418
|
+
"type": {
|
|
419
|
+
"name": "string"
|
|
420
|
+
},
|
|
421
|
+
"required": false
|
|
422
|
+
},
|
|
322
423
|
"type": {
|
|
323
424
|
"description": "",
|
|
324
425
|
"type": {
|