@itcase/ui 1.1.1 → 1.1.2
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 +8 -3
- package/dist/components/Cell.js +30 -14
- package/dist/components/DatePicker.js +2 -1
- package/dist/components/FormField.js +3 -3
- package/dist/components/Grid.js +2 -2
- package/dist/components/Icon.js +125 -16
- package/dist/components/Input.js +1 -1
- package/dist/components/Label.js +2 -2
- package/dist/components/Modal.js +27 -27
- package/dist/components/{Fader.js → Overlay.js} +43 -43
- package/dist/components/ScrollOnDrag.js +290 -0
- package/dist/components/Text.js +1 -1
- package/dist/constants/componentProps/borderWidth.js +3 -1
- package/dist/constants/componentProps/emojiSize.js +3 -1
- package/dist/constants/componentProps/iconFillSize.js +3 -1
- package/dist/constants/componentProps/iconSize.js +3 -1
- package/dist/constants/componentProps/sizePX.js +3 -1
- package/dist/css/components/DatePicker/DatePicker.css +12 -5
- package/dist/css/components/Group/Group.css +0 -8
- package/dist/css/components/Label/Label.css +0 -19
- package/dist/css/components/Modal/Modal.css +3 -3
- package/dist/css/components/{Fader/Fader.css → Overlay/Overlay.css} +10 -10
- package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +6 -0
- package/dist/stories/ModalConfirm.stories.js +1 -1
- package/dist/stories/ModalDefault.stories.js +1 -1
- package/package.json +1 -1
|
@@ -140,7 +140,7 @@ const Button = /*#__PURE__*/React__default.default.forwardRef(function Button(pr
|
|
|
140
140
|
} = useStyles.useStyles(props);
|
|
141
141
|
return /*#__PURE__*/React__default.default.createElement(index.LinkWrapper, {
|
|
142
142
|
className: clsx__default.default(className, 'button', type && `button_type_${type}`, borderWidthClass || buttonConfig.appearance[appearance] && `border-width_${buttonConfig.appearance[appearance].borderWidth}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderColorClass || buttonConfig.appearance[appearance] && `border-color_${buttonConfig.appearance[appearance].borderColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderTypeClass || buttonConfig.appearance[appearance] && `border-type_${buttonConfig.appearance[appearance].borderType}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillClass || buttonConfig.appearance[appearance] && `fill_${buttonConfig.appearance[appearance].fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass || buttonConfig.appearance[appearance] && `fill_hover_${buttonConfig.appearance[appearance].fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass, sizeClass, widthClass, elevationClass, onClick && 'cursor_type_pointer', isDisabled && 'cursor_type_default', Badge && 'button_type_badge', loading && 'button_state_loading', !label && (iconBefore || iconBeforeSrc || iconAfter || iconAfterSrc || icon || iconSrc) && 'button_type_icon', label && (after || before || icon || iconAfter || iconAfterSrc || iconBefore || iconBeforeSrc || iconSrc) && `button_type_with-icon button_type_with-icon_${size}`),
|
|
143
|
-
"data-
|
|
143
|
+
"data-test-id": `${dataTestId}Button`,
|
|
144
144
|
"data-tour": dataTour,
|
|
145
145
|
DefaultComponent: "button",
|
|
146
146
|
disabled: isDisabled,
|
|
@@ -209,7 +209,7 @@ Button.propTypes = {
|
|
|
209
209
|
iconSize: PropTypes__default.default.string,
|
|
210
210
|
iconStroke: PropTypes__default.default.string,
|
|
211
211
|
isDisabled: PropTypes__default.default.bool,
|
|
212
|
-
label: PropTypes__default.default.string,
|
|
212
|
+
label: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
213
213
|
labelTextColor: PropTypes__default.default.string,
|
|
214
214
|
labelTextColorHover: PropTypes__default.default.string,
|
|
215
215
|
labelTextSize: PropTypes__default.default.string,
|
|
@@ -435,7 +435,12 @@ Button.__docgenInfo = {
|
|
|
435
435
|
"label": {
|
|
436
436
|
"description": "",
|
|
437
437
|
"type": {
|
|
438
|
-
"name": "
|
|
438
|
+
"name": "union",
|
|
439
|
+
"value": [{
|
|
440
|
+
"name": "string"
|
|
441
|
+
}, {
|
|
442
|
+
"name": "number"
|
|
443
|
+
}]
|
|
439
444
|
},
|
|
440
445
|
"required": false
|
|
441
446
|
},
|
package/dist/components/Cell.js
CHANGED
|
@@ -6,12 +6,15 @@ var clsx = require('clsx');
|
|
|
6
6
|
var index$1 = require('./Icon.js');
|
|
7
7
|
var index = require('./Text.js');
|
|
8
8
|
var index$2 = require('./Label.js');
|
|
9
|
-
var
|
|
9
|
+
var titleSize = require('../constants/componentProps/titleSize.js');
|
|
10
|
+
var textSize = require('../constants/componentProps/textSize.js');
|
|
11
|
+
var textColor = require('../constants/componentProps/textColor.js');
|
|
12
|
+
var textAlign = require('../constants/componentProps/textAlign.js');
|
|
10
13
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
11
14
|
require('react-inlinesvg');
|
|
12
15
|
require('./Link.js');
|
|
13
16
|
require('../constants/componentProps/fill.js');
|
|
14
|
-
require('../constants/componentProps/
|
|
17
|
+
require('../constants/componentProps/size.js');
|
|
15
18
|
require('../constants/componentProps/textGradient.js');
|
|
16
19
|
require('../constants/componentProps/textStyle.js');
|
|
17
20
|
require('../constants/componentProps/textWeight.js');
|
|
@@ -32,10 +35,7 @@ require('../constants/componentProps/shape.js');
|
|
|
32
35
|
require('../constants/componentProps/strokeColor.js');
|
|
33
36
|
require('./Tooltip.js');
|
|
34
37
|
require('./Title.js');
|
|
35
|
-
require('../constants/componentProps/textAlign.js');
|
|
36
|
-
require('../constants/componentProps/titleSize.js');
|
|
37
38
|
require('../constants/componentProps/wrap.js');
|
|
38
|
-
require('../constants/componentProps/textSize.js');
|
|
39
39
|
require('../constants/componentProps/textColorActive.js');
|
|
40
40
|
require('../constants/componentProps/textColorHover.js');
|
|
41
41
|
require('lodash/castArray');
|
|
@@ -75,6 +75,7 @@ function Cell(props) {
|
|
|
75
75
|
mode,
|
|
76
76
|
size,
|
|
77
77
|
value,
|
|
78
|
+
valueTextAlign,
|
|
78
79
|
valueTextSize,
|
|
79
80
|
valueTextColor,
|
|
80
81
|
valueTextWeight,
|
|
@@ -82,6 +83,7 @@ function Cell(props) {
|
|
|
82
83
|
titleTextSize,
|
|
83
84
|
titleTextColor,
|
|
84
85
|
titleTextWeight,
|
|
86
|
+
titleTextWrap,
|
|
85
87
|
showTitleLabel,
|
|
86
88
|
titleLabelAppearance,
|
|
87
89
|
titleLabel,
|
|
@@ -94,7 +96,6 @@ function Cell(props) {
|
|
|
94
96
|
valueLabelTextSize,
|
|
95
97
|
valueLabelShape,
|
|
96
98
|
valueLabelSize,
|
|
97
|
-
titleTextWrap,
|
|
98
99
|
valueTextWrap,
|
|
99
100
|
zeroPadding,
|
|
100
101
|
zeroGap,
|
|
@@ -189,6 +190,7 @@ function Cell(props) {
|
|
|
189
190
|
className: "cell__value",
|
|
190
191
|
size: valueTextSize,
|
|
191
192
|
tag: valueTag,
|
|
193
|
+
textAlign: valueTextAlign,
|
|
192
194
|
textColor: valueTextColor,
|
|
193
195
|
textWeight: valueTextWeight,
|
|
194
196
|
textWrap: valueTextWrap
|
|
@@ -223,14 +225,15 @@ Cell.propTypes = {
|
|
|
223
225
|
titleIcon: PropTypes__default.default.any,
|
|
224
226
|
titleIconFill: PropTypes__default.default.string,
|
|
225
227
|
titleIconStroke: PropTypes__default.default.string,
|
|
226
|
-
titleTextColor: PropTypes__default.default.
|
|
227
|
-
titleTextSize: PropTypes__default.default.oneOf(
|
|
228
|
+
titleTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
229
|
+
titleTextSize: PropTypes__default.default.oneOf(titleSize.default),
|
|
228
230
|
value: PropTypes__default.default.oneOfType([PropTypes__default.default.element, PropTypes__default.default.string]),
|
|
229
231
|
valueIcon: PropTypes__default.default.any,
|
|
230
232
|
valueIconFill: PropTypes__default.default.string,
|
|
231
233
|
valueIconStroke: PropTypes__default.default.string,
|
|
232
|
-
|
|
233
|
-
|
|
234
|
+
valueTextAlign: PropTypes__default.default.oneOf(textAlign.default),
|
|
235
|
+
valueTextColor: PropTypes__default.default.oneOf(textColor.default),
|
|
236
|
+
valueTextSize: PropTypes__default.default.oneOf(textSize.default),
|
|
234
237
|
onClick: PropTypes__default.default.func,
|
|
235
238
|
onMouseEnter: PropTypes__default.default.func
|
|
236
239
|
};
|
|
@@ -327,7 +330,9 @@ Cell.__docgenInfo = {
|
|
|
327
330
|
"titleTextColor": {
|
|
328
331
|
"description": "",
|
|
329
332
|
"type": {
|
|
330
|
-
"name": "
|
|
333
|
+
"name": "enum",
|
|
334
|
+
"computed": true,
|
|
335
|
+
"value": "textColorProps"
|
|
331
336
|
},
|
|
332
337
|
"required": false
|
|
333
338
|
},
|
|
@@ -336,7 +341,7 @@ Cell.__docgenInfo = {
|
|
|
336
341
|
"type": {
|
|
337
342
|
"name": "enum",
|
|
338
343
|
"computed": true,
|
|
339
|
-
"value": "
|
|
344
|
+
"value": "titleSizeProps"
|
|
340
345
|
},
|
|
341
346
|
"required": false
|
|
342
347
|
},
|
|
@@ -373,10 +378,21 @@ Cell.__docgenInfo = {
|
|
|
373
378
|
},
|
|
374
379
|
"required": false
|
|
375
380
|
},
|
|
381
|
+
"valueTextAlign": {
|
|
382
|
+
"description": "",
|
|
383
|
+
"type": {
|
|
384
|
+
"name": "enum",
|
|
385
|
+
"computed": true,
|
|
386
|
+
"value": "textAlignProps"
|
|
387
|
+
},
|
|
388
|
+
"required": false
|
|
389
|
+
},
|
|
376
390
|
"valueTextColor": {
|
|
377
391
|
"description": "",
|
|
378
392
|
"type": {
|
|
379
|
-
"name": "
|
|
393
|
+
"name": "enum",
|
|
394
|
+
"computed": true,
|
|
395
|
+
"value": "textColorProps"
|
|
380
396
|
},
|
|
381
397
|
"required": false
|
|
382
398
|
},
|
|
@@ -385,7 +401,7 @@ Cell.__docgenInfo = {
|
|
|
385
401
|
"type": {
|
|
386
402
|
"name": "enum",
|
|
387
403
|
"computed": true,
|
|
388
|
-
"value": "
|
|
404
|
+
"value": "textSizeProps"
|
|
389
405
|
},
|
|
390
406
|
"required": false
|
|
391
407
|
},
|
|
@@ -9183,13 +9183,14 @@ function DatePickerClearButton(props, ref) {
|
|
|
9183
9183
|
} = props;
|
|
9184
9184
|
const onClick = React.useCallback(event => {
|
|
9185
9185
|
datepickerRef?.current?.onClearClick(event);
|
|
9186
|
+
datepickerRef?.current?.handleFocus(event);
|
|
9186
9187
|
}, []);
|
|
9187
9188
|
return /*#__PURE__*/React__namespace.default.createElement(React__namespace.default.Fragment, null, clearLabel && /*#__PURE__*/React__namespace.default.createElement(index$3.Label, {
|
|
9188
9189
|
className: clsx__default.default('react-datepicker__clear-label', onClick && 'cursor_type_pointer'),
|
|
9189
9190
|
label: clearLabel,
|
|
9190
|
-
labelTextSize: clearLabelTextSize,
|
|
9191
9191
|
labelTextColor: clearLabelTextColor,
|
|
9192
9192
|
labelTextColorHover: clearLabelTextColorHover,
|
|
9193
|
+
labelTextSize: clearLabelTextSize,
|
|
9193
9194
|
onClick: onClick
|
|
9194
9195
|
}), (clearIcon || clearIconSrc) && /*#__PURE__*/React__namespace.default.createElement(index$4.Icon, {
|
|
9195
9196
|
className: clsx__default.default('react-datepicker__clear-icon', onClick && 'cursor_type_pointer'),
|
|
@@ -115,7 +115,7 @@ function FormField(props) {
|
|
|
115
115
|
} = useStyles.useStyles(props);
|
|
116
116
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
117
117
|
className: clsx__default.default(className, 'form-field', set && `form-field_set_${set}`, sizeClass, fillClass, shapeClass, directionClass),
|
|
118
|
-
"data-
|
|
118
|
+
"data-test-id": dataTestId,
|
|
119
119
|
style: formFieldStyles
|
|
120
120
|
}, label && /*#__PURE__*/React__default.default.createElement("label", {
|
|
121
121
|
htmlFor: id,
|
|
@@ -140,10 +140,10 @@ function FormField(props) {
|
|
|
140
140
|
size: clearIconSize
|
|
141
141
|
}), afterItem), /*#__PURE__*/React__default.default.createElement(index$2.Divider, {
|
|
142
142
|
className: "form-field__item-divider",
|
|
143
|
-
width: dividerWidth,
|
|
144
143
|
direction: dividerDirection,
|
|
144
|
+
fill: dividerFill,
|
|
145
145
|
size: dividerSize,
|
|
146
|
-
|
|
146
|
+
width: dividerWidth
|
|
147
147
|
})), message && /*#__PURE__*/React__default.default.createElement("div", {
|
|
148
148
|
className: "form-field__message"
|
|
149
149
|
}, /*#__PURE__*/React__default.default.createElement(index.Text, {
|
package/dist/components/Grid.js
CHANGED
|
@@ -36,7 +36,7 @@ function Grid(props) {
|
|
|
36
36
|
children,
|
|
37
37
|
className,
|
|
38
38
|
horizontalResizing,
|
|
39
|
-
|
|
39
|
+
horizontalScroll,
|
|
40
40
|
onClick,
|
|
41
41
|
type,
|
|
42
42
|
useGridSystem,
|
|
@@ -102,7 +102,7 @@ function Grid(props) {
|
|
|
102
102
|
gridWrapperInner: gridWrapperInnerStyles
|
|
103
103
|
} = useStyles.useStyles(props);
|
|
104
104
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
105
|
-
className: clsx__default.default(className, 'grid', useGridSystem && `grid_state_system`,
|
|
105
|
+
className: clsx__default.default(className, 'grid', useGridSystem && `grid_state_system`, horizontalScroll && `grid_scroll_horizontal`, type && `grid_type_${type}`, columnsClass, rowsClass, rowGapClass, columnGapClass, alignContentClass, alignItemsClass, justifyContentClass, justifyItemsClass, fillClass, horizontalResizing && `grid_horizontal-resizing_${horizontalResizing}`, verticalResizing && `grid_vertical-resizing_${verticalResizing}`),
|
|
106
106
|
"data-tour": dataTour,
|
|
107
107
|
id: id,
|
|
108
108
|
style: gridStyles,
|
package/dist/components/Icon.js
CHANGED
|
@@ -54,26 +54,26 @@ const iconConfig = {
|
|
|
54
54
|
const Icon = /*#__PURE__*/React__default.default.forwardRef(function Icon(props, ref) {
|
|
55
55
|
const [isTooltipVisible, setIsTooltipVisible] = React.useState(false);
|
|
56
56
|
const {
|
|
57
|
-
before,
|
|
58
|
-
after,
|
|
59
57
|
Badge,
|
|
60
58
|
SvgImage,
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
dataTour,
|
|
59
|
+
after,
|
|
60
|
+
before,
|
|
64
61
|
className,
|
|
62
|
+
dataTour,
|
|
63
|
+
height,
|
|
65
64
|
href,
|
|
65
|
+
id,
|
|
66
|
+
imageSrc,
|
|
66
67
|
link,
|
|
67
|
-
linkTarget,
|
|
68
68
|
linkRel,
|
|
69
|
-
|
|
70
|
-
height,
|
|
69
|
+
linkTarget,
|
|
71
70
|
showTooltip,
|
|
71
|
+
tooltipAppearance,
|
|
72
72
|
tooltipText,
|
|
73
73
|
tooltipTextSize,
|
|
74
74
|
tooltipTitle,
|
|
75
75
|
tooltipTitleSize,
|
|
76
|
-
|
|
76
|
+
width,
|
|
77
77
|
onClick
|
|
78
78
|
} = props;
|
|
79
79
|
const svgSizes = React.useMemo(() => {
|
|
@@ -85,7 +85,7 @@ const Icon = /*#__PURE__*/React__default.default.forwardRef(function Icon(props,
|
|
|
85
85
|
sizes.height = height;
|
|
86
86
|
}
|
|
87
87
|
return sizes;
|
|
88
|
-
}, []);
|
|
88
|
+
}, [height, width]);
|
|
89
89
|
const cursorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
90
90
|
prefix: 'cursor_',
|
|
91
91
|
propsKey: 'cursor'
|
|
@@ -177,7 +177,7 @@ const Icon = /*#__PURE__*/React__default.default.forwardRef(function Icon(props,
|
|
|
177
177
|
});
|
|
178
178
|
}
|
|
179
179
|
return null;
|
|
180
|
-
}, [SvgImage, imageSrc]);
|
|
180
|
+
}, [SvgImage, svgSizes, imageSrc]);
|
|
181
181
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
182
182
|
className: clsx__default.default(className, 'icon', fillClass, fillHoverClass, fillSizeClass, fillDisabledClass, iconFillClass, iconFillHoverClass, iconFillDisabledClass, shapeClass, iconStrokeClass, iconStrokeHoverClass, iconStrokeDisabledClass, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, cursorClass, Badge && 'icon_type_with-badge', (link || href || onClick) && 'cursor_type_pointer'),
|
|
183
183
|
"data-tour": dataTour,
|
|
@@ -194,8 +194,8 @@ const Icon = /*#__PURE__*/React__default.default.forwardRef(function Icon(props,
|
|
|
194
194
|
rel: linkRel,
|
|
195
195
|
target: linkTarget
|
|
196
196
|
}, before, ImageComponent, after, Badge, isTooltipVisible && showTooltip && /*#__PURE__*/React__default.default.createElement(index$1.Tooltip, {
|
|
197
|
-
className: clsx__default.default(className, 'icon__tooltip', alignmentClass),
|
|
198
197
|
appearance: tooltipAppearance,
|
|
198
|
+
className: clsx__default.default(className, 'icon__tooltip', alignmentClass),
|
|
199
199
|
text: tooltipText,
|
|
200
200
|
textSize: tooltipTextSize,
|
|
201
201
|
title: tooltipTitle,
|
|
@@ -203,13 +203,18 @@ const Icon = /*#__PURE__*/React__default.default.forwardRef(function Icon(props,
|
|
|
203
203
|
})));
|
|
204
204
|
});
|
|
205
205
|
Icon.propTypes = {
|
|
206
|
+
after: PropTypes__default.default.any,
|
|
207
|
+
// "bool" type is valid for condition constructions, e.g. "Boolean(some) && <Badge>"
|
|
208
|
+
Badge: PropTypes__default.default.oneOfType([PropTypes__default.default.element, PropTypes__default.default.bool]),
|
|
209
|
+
before: PropTypes__default.default.any,
|
|
206
210
|
borderColor: PropTypes__default.default.oneOf(borderColor.default),
|
|
207
211
|
borderType: PropTypes__default.default.oneOf(borderType.default),
|
|
208
212
|
className: PropTypes__default.default.string,
|
|
213
|
+
dataTour: PropTypes__default.default.string,
|
|
209
214
|
fill: PropTypes__default.default.oneOf(fill.default),
|
|
210
215
|
fillDesktop: PropTypes__default.default.oneOf(fill.default),
|
|
211
216
|
fillMobile: PropTypes__default.default.oneOf(fill.default),
|
|
212
|
-
fillSize: PropTypes__default.default.string,
|
|
217
|
+
fillSize: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
213
218
|
fillSizeDesktop: PropTypes__default.default.string,
|
|
214
219
|
fillSizeMobile: PropTypes__default.default.string,
|
|
215
220
|
fillSizeTablet: PropTypes__default.default.string,
|
|
@@ -220,6 +225,7 @@ Icon.propTypes = {
|
|
|
220
225
|
iconStrokeDesktop: PropTypes__default.default.oneOf(strokeColor.default),
|
|
221
226
|
iconStrokeMobile: PropTypes__default.default.oneOf(strokeColor.default),
|
|
222
227
|
iconStrokeTablet: PropTypes__default.default.oneOf(strokeColor.default),
|
|
228
|
+
id: PropTypes__default.default.string,
|
|
223
229
|
imageSrc: PropTypes__default.default.string,
|
|
224
230
|
link: PropTypes__default.default.string,
|
|
225
231
|
LinkComponent: PropTypes__default.default.any,
|
|
@@ -229,11 +235,17 @@ Icon.propTypes = {
|
|
|
229
235
|
shapeDesktop: PropTypes__default.default.oneOf(shape.default),
|
|
230
236
|
shapeMobile: PropTypes__default.default.oneOf(shape.default),
|
|
231
237
|
shapeTablet: PropTypes__default.default.oneOf(shape.default),
|
|
238
|
+
showTooltip: PropTypes__default.default.bool,
|
|
232
239
|
size: PropTypes__default.default.oneOf(iconSize.default),
|
|
233
240
|
sizeDesktop: PropTypes__default.default.oneOf(iconSize.default),
|
|
234
241
|
sizeMobile: PropTypes__default.default.oneOf(iconSize.default),
|
|
235
242
|
sizeTablet: PropTypes__default.default.oneOf(iconSize.default),
|
|
236
|
-
SvgImage: PropTypes__default.default.oneOfType([PropTypes__default.default.
|
|
243
|
+
SvgImage: PropTypes__default.default.oneOfType([PropTypes__default.default.elementType, PropTypes__default.default.func, PropTypes__default.default.object]),
|
|
244
|
+
tooltipAppearance: PropTypes__default.default.string,
|
|
245
|
+
tooltipText: PropTypes__default.default.string,
|
|
246
|
+
tooltipTextSize: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
247
|
+
tooltipTitle: PropTypes__default.default.string,
|
|
248
|
+
tooltipTitleSize: PropTypes__default.default.oneOfType([PropTypes__default.default.string, PropTypes__default.default.number]),
|
|
237
249
|
width: PropTypes__default.default.string,
|
|
238
250
|
onClick: PropTypes__default.default.func
|
|
239
251
|
};
|
|
@@ -259,6 +271,32 @@ Icon.__docgenInfo = {
|
|
|
259
271
|
},
|
|
260
272
|
"required": false
|
|
261
273
|
},
|
|
274
|
+
"after": {
|
|
275
|
+
"description": "",
|
|
276
|
+
"type": {
|
|
277
|
+
"name": "any"
|
|
278
|
+
},
|
|
279
|
+
"required": false
|
|
280
|
+
},
|
|
281
|
+
"Badge": {
|
|
282
|
+
"description": "",
|
|
283
|
+
"type": {
|
|
284
|
+
"name": "union",
|
|
285
|
+
"value": [{
|
|
286
|
+
"name": "element"
|
|
287
|
+
}, {
|
|
288
|
+
"name": "bool"
|
|
289
|
+
}]
|
|
290
|
+
},
|
|
291
|
+
"required": false
|
|
292
|
+
},
|
|
293
|
+
"before": {
|
|
294
|
+
"description": "",
|
|
295
|
+
"type": {
|
|
296
|
+
"name": "any"
|
|
297
|
+
},
|
|
298
|
+
"required": false
|
|
299
|
+
},
|
|
262
300
|
"borderColor": {
|
|
263
301
|
"description": "",
|
|
264
302
|
"type": {
|
|
@@ -284,6 +322,13 @@ Icon.__docgenInfo = {
|
|
|
284
322
|
},
|
|
285
323
|
"required": false
|
|
286
324
|
},
|
|
325
|
+
"dataTour": {
|
|
326
|
+
"description": "",
|
|
327
|
+
"type": {
|
|
328
|
+
"name": "string"
|
|
329
|
+
},
|
|
330
|
+
"required": false
|
|
331
|
+
},
|
|
287
332
|
"fill": {
|
|
288
333
|
"description": "",
|
|
289
334
|
"type": {
|
|
@@ -314,7 +359,12 @@ Icon.__docgenInfo = {
|
|
|
314
359
|
"fillSize": {
|
|
315
360
|
"description": "",
|
|
316
361
|
"type": {
|
|
317
|
-
"name": "
|
|
362
|
+
"name": "union",
|
|
363
|
+
"value": [{
|
|
364
|
+
"name": "string"
|
|
365
|
+
}, {
|
|
366
|
+
"name": "number"
|
|
367
|
+
}]
|
|
318
368
|
},
|
|
319
369
|
"required": false
|
|
320
370
|
},
|
|
@@ -398,6 +448,13 @@ Icon.__docgenInfo = {
|
|
|
398
448
|
},
|
|
399
449
|
"required": false
|
|
400
450
|
},
|
|
451
|
+
"id": {
|
|
452
|
+
"description": "",
|
|
453
|
+
"type": {
|
|
454
|
+
"name": "string"
|
|
455
|
+
},
|
|
456
|
+
"required": false
|
|
457
|
+
},
|
|
401
458
|
"imageSrc": {
|
|
402
459
|
"description": "",
|
|
403
460
|
"type": {
|
|
@@ -462,6 +519,13 @@ Icon.__docgenInfo = {
|
|
|
462
519
|
},
|
|
463
520
|
"required": false
|
|
464
521
|
},
|
|
522
|
+
"showTooltip": {
|
|
523
|
+
"description": "",
|
|
524
|
+
"type": {
|
|
525
|
+
"name": "bool"
|
|
526
|
+
},
|
|
527
|
+
"required": false
|
|
528
|
+
},
|
|
465
529
|
"size": {
|
|
466
530
|
"description": "",
|
|
467
531
|
"type": {
|
|
@@ -503,7 +567,7 @@ Icon.__docgenInfo = {
|
|
|
503
567
|
"type": {
|
|
504
568
|
"name": "union",
|
|
505
569
|
"value": [{
|
|
506
|
-
"name": "
|
|
570
|
+
"name": "elementType"
|
|
507
571
|
}, {
|
|
508
572
|
"name": "func"
|
|
509
573
|
}, {
|
|
@@ -512,6 +576,51 @@ Icon.__docgenInfo = {
|
|
|
512
576
|
},
|
|
513
577
|
"required": false
|
|
514
578
|
},
|
|
579
|
+
"tooltipAppearance": {
|
|
580
|
+
"description": "",
|
|
581
|
+
"type": {
|
|
582
|
+
"name": "string"
|
|
583
|
+
},
|
|
584
|
+
"required": false
|
|
585
|
+
},
|
|
586
|
+
"tooltipText": {
|
|
587
|
+
"description": "",
|
|
588
|
+
"type": {
|
|
589
|
+
"name": "string"
|
|
590
|
+
},
|
|
591
|
+
"required": false
|
|
592
|
+
},
|
|
593
|
+
"tooltipTextSize": {
|
|
594
|
+
"description": "",
|
|
595
|
+
"type": {
|
|
596
|
+
"name": "union",
|
|
597
|
+
"value": [{
|
|
598
|
+
"name": "string"
|
|
599
|
+
}, {
|
|
600
|
+
"name": "number"
|
|
601
|
+
}]
|
|
602
|
+
},
|
|
603
|
+
"required": false
|
|
604
|
+
},
|
|
605
|
+
"tooltipTitle": {
|
|
606
|
+
"description": "",
|
|
607
|
+
"type": {
|
|
608
|
+
"name": "string"
|
|
609
|
+
},
|
|
610
|
+
"required": false
|
|
611
|
+
},
|
|
612
|
+
"tooltipTitleSize": {
|
|
613
|
+
"description": "",
|
|
614
|
+
"type": {
|
|
615
|
+
"name": "union",
|
|
616
|
+
"value": [{
|
|
617
|
+
"name": "string"
|
|
618
|
+
}, {
|
|
619
|
+
"name": "number"
|
|
620
|
+
}]
|
|
621
|
+
},
|
|
622
|
+
"required": false
|
|
623
|
+
},
|
|
515
624
|
"width": {
|
|
516
625
|
"description": "",
|
|
517
626
|
"type": {
|
package/dist/components/Input.js
CHANGED
|
@@ -123,7 +123,7 @@ const Input = /*#__PURE__*/React__default.default.forwardRef(function Input(prop
|
|
|
123
123
|
ref: ref,
|
|
124
124
|
disabled: isDisabled,
|
|
125
125
|
placeholder: placeholder,
|
|
126
|
-
"data-
|
|
126
|
+
"data-test-id": dataTestId || (name ? `${name}Input` : 'input'),
|
|
127
127
|
value: value,
|
|
128
128
|
onBlur: onBlur,
|
|
129
129
|
onChange: onChange,
|
package/dist/components/Label.js
CHANGED
|
@@ -112,7 +112,7 @@ function Label(props) {
|
|
|
112
112
|
prefix: 'border_type_',
|
|
113
113
|
propsKey: 'borderType'
|
|
114
114
|
});
|
|
115
|
-
|
|
115
|
+
useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
116
116
|
prefix: 'label_text-align_',
|
|
117
117
|
propsKey: 'textAlign'
|
|
118
118
|
});
|
|
@@ -136,7 +136,7 @@ function Label(props) {
|
|
|
136
136
|
// } = labelAppearanceItem
|
|
137
137
|
|
|
138
138
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
139
|
-
className: clsx__default.default(className, 'label', fillClass || labelAppearanceItem.fill && `fill_${labelAppearanceItem.fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass || labelAppearanceItem.fillHover && `fill_hover_${labelAppearanceItem.fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass, borderClass, borderTypeClass, sizeClass, wrapClass, widthClass, alignDirectionClass, alignClass,
|
|
139
|
+
className: clsx__default.default(className, 'label', fillClass || labelAppearanceItem.fill && `fill_${labelAppearanceItem.fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass || labelAppearanceItem.fillHover && `fill_hover_${labelAppearanceItem.fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), shapeClass, borderClass, borderTypeClass, sizeClass, wrapClass, widthClass, alignDirectionClass, alignClass, type && `label_type_${type}`, set && `label_set_${set}`, mode && `label_mode_${mode}`, onClick && (cursor || 'cursor_type_pointer')),
|
|
140
140
|
"data-tour": dataTour,
|
|
141
141
|
style: labelStyles,
|
|
142
142
|
onClick: onClick,
|
package/dist/components/Modal.js
CHANGED
|
@@ -4,7 +4,7 @@ var React = require('react');
|
|
|
4
4
|
var PropTypes = require('prop-types');
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
|
-
var index = require('./
|
|
7
|
+
var index = require('./Overlay.js');
|
|
8
8
|
var useStyles = require('../hooks/useStyles.js');
|
|
9
9
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
10
10
|
var index$1 = require('./Loader.js');
|
|
@@ -59,11 +59,11 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
59
59
|
closeButton,
|
|
60
60
|
contentClassName,
|
|
61
61
|
id,
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
isOverlay,
|
|
63
|
+
overlayClassName,
|
|
64
|
+
overlayFill,
|
|
65
|
+
overlayFillGradient,
|
|
66
|
+
overlayOpacity,
|
|
67
67
|
isOpen: initialIsOpen,
|
|
68
68
|
isScrollOnOpen,
|
|
69
69
|
isSetFocusOnOpen,
|
|
@@ -83,7 +83,7 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
83
83
|
}
|
|
84
84
|
}, []);
|
|
85
85
|
const modalContentRef = React.useRef(null);
|
|
86
|
-
const
|
|
86
|
+
const modalOverlayRef = React.useRef(null);
|
|
87
87
|
const [isOpen, setIsOpen] = React.useState(initialIsOpen);
|
|
88
88
|
const addModalProps = React.useCallback(element => {
|
|
89
89
|
// Change class need in "useEffect"
|
|
@@ -132,10 +132,10 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
132
132
|
if (modalContentElement) {
|
|
133
133
|
modalContentElement.parentNode.appendChild(modalContentElement)
|
|
134
134
|
}
|
|
135
|
-
// Also move
|
|
136
|
-
const
|
|
137
|
-
if (
|
|
138
|
-
|
|
135
|
+
// Also move overlay to end of modal root container after container
|
|
136
|
+
const modalOverlayElement = modalOverlayRef.current
|
|
137
|
+
if (modalOverlayElement) {
|
|
138
|
+
modalOverlayElement.parentNode.appendChild(modalOverlayElement)
|
|
139
139
|
}
|
|
140
140
|
*/
|
|
141
141
|
}, [onOpenModal]);
|
|
@@ -206,13 +206,13 @@ const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(prop
|
|
|
206
206
|
onClick: closeModal
|
|
207
207
|
}, closeButton), /*#__PURE__*/React__default.default.createElement("div", {
|
|
208
208
|
className: "modal-content__wrapper"
|
|
209
|
-
}, children)), /*#__PURE__*/React__default.default.createElement(index.
|
|
210
|
-
className: clsx__default.default('
|
|
211
|
-
fill:
|
|
212
|
-
fillGradient:
|
|
213
|
-
|
|
214
|
-
opacity:
|
|
215
|
-
ref:
|
|
209
|
+
}, children)), /*#__PURE__*/React__default.default.createElement(index.Overlay, {
|
|
210
|
+
className: clsx__default.default('modal__overlay', 'overlay_type_modal', overlayClassName),
|
|
211
|
+
fill: overlayFill,
|
|
212
|
+
fillGradient: overlayFillGradient,
|
|
213
|
+
isOverlay: isOverlay,
|
|
214
|
+
opacity: overlayOpacity,
|
|
215
|
+
ref: modalOverlayRef
|
|
216
216
|
})) : null,
|
|
217
217
|
// A DOM element
|
|
218
218
|
modalElement);
|
|
@@ -224,11 +224,11 @@ Modal.propTypes = {
|
|
|
224
224
|
closeText: PropTypes__default.default.string,
|
|
225
225
|
contentClassName: PropTypes__default.default.string,
|
|
226
226
|
debug: PropTypes__default.default.bool,
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
227
|
+
overlayFill: PropTypes__default.default.string,
|
|
228
|
+
overlayFillGradient: PropTypes__default.default.string,
|
|
229
|
+
overlayOpacity: PropTypes__default.default.string,
|
|
230
230
|
id: PropTypes__default.default.string,
|
|
231
|
-
|
|
231
|
+
isOverlay: PropTypes__default.default.bool,
|
|
232
232
|
isScrollOnOpen: PropTypes__default.default.bool,
|
|
233
233
|
isSetFocusOnOpen: PropTypes__default.default.bool,
|
|
234
234
|
modalQuerySelector: PropTypes__default.default.string,
|
|
@@ -236,7 +236,7 @@ Modal.propTypes = {
|
|
|
236
236
|
onOpenModal: PropTypes__default.default.func
|
|
237
237
|
};
|
|
238
238
|
Modal.defaultProps = {
|
|
239
|
-
|
|
239
|
+
isOverlay: true,
|
|
240
240
|
isOpen: false,
|
|
241
241
|
isScrollOnOpen: true,
|
|
242
242
|
isSetFocusOnOpen: true,
|
|
@@ -247,7 +247,7 @@ Modal.__docgenInfo = {
|
|
|
247
247
|
"methods": [],
|
|
248
248
|
"displayName": "Modal",
|
|
249
249
|
"props": {
|
|
250
|
-
"
|
|
250
|
+
"isOverlay": {
|
|
251
251
|
"defaultValue": {
|
|
252
252
|
"value": "true",
|
|
253
253
|
"computed": false
|
|
@@ -340,21 +340,21 @@ Modal.__docgenInfo = {
|
|
|
340
340
|
},
|
|
341
341
|
"required": false
|
|
342
342
|
},
|
|
343
|
-
"
|
|
343
|
+
"overlayFill": {
|
|
344
344
|
"description": "",
|
|
345
345
|
"type": {
|
|
346
346
|
"name": "string"
|
|
347
347
|
},
|
|
348
348
|
"required": false
|
|
349
349
|
},
|
|
350
|
-
"
|
|
350
|
+
"overlayFillGradient": {
|
|
351
351
|
"description": "",
|
|
352
352
|
"type": {
|
|
353
353
|
"name": "string"
|
|
354
354
|
},
|
|
355
355
|
"required": false
|
|
356
356
|
},
|
|
357
|
-
"
|
|
357
|
+
"overlayOpacity": {
|
|
358
358
|
"description": "",
|
|
359
359
|
"type": {
|
|
360
360
|
"name": "string"
|
|
@@ -22,10 +22,10 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
22
22
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
23
23
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
24
24
|
|
|
25
|
-
function
|
|
25
|
+
function Overlay(props) {
|
|
26
26
|
const {
|
|
27
27
|
className,
|
|
28
|
-
|
|
28
|
+
isOverlay,
|
|
29
29
|
type
|
|
30
30
|
} = props;
|
|
31
31
|
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
@@ -41,19 +41,15 @@ function Fader(props) {
|
|
|
41
41
|
propsKey: 'opacity'
|
|
42
42
|
});
|
|
43
43
|
const {
|
|
44
|
-
styles:
|
|
44
|
+
styles: overlayStyles
|
|
45
45
|
} = useStyles.useStyles(props);
|
|
46
46
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
47
|
-
className: clsx__default.default(className, '
|
|
48
|
-
style:
|
|
47
|
+
className: clsx__default.default(className, 'overlay', opacityClass, isOverlay && 'overlay_state_visible', type && `${className}_type_${type}`, fillClass, fillGradientClass),
|
|
48
|
+
style: overlayStyles
|
|
49
49
|
}, "\xA0");
|
|
50
50
|
}
|
|
51
|
-
|
|
51
|
+
Overlay.propTypes = {
|
|
52
52
|
className: PropTypes__default.default.string,
|
|
53
|
-
opacity: PropTypes__default.default.string,
|
|
54
|
-
opacityDesktop: PropTypes__default.default.string,
|
|
55
|
-
opacityMobile: PropTypes__default.default.string,
|
|
56
|
-
opacityTablet: PropTypes__default.default.string,
|
|
57
53
|
fill: PropTypes__default.default.oneOf(fill.default),
|
|
58
54
|
fillMobile: PropTypes__default.default.oneOf(fill.default),
|
|
59
55
|
fillTablet: PropTypes__default.default.oneOf(fill.default),
|
|
@@ -62,13 +58,17 @@ Fader.propTypes = {
|
|
|
62
58
|
fillGradientMobile: PropTypes__default.default.oneOf(fillGradient.default),
|
|
63
59
|
fillGradientTablet: PropTypes__default.default.oneOf(fillGradient.default),
|
|
64
60
|
fillGradientDesktop: PropTypes__default.default.oneOf(fillGradient.default),
|
|
61
|
+
opacity: PropTypes__default.default.string,
|
|
62
|
+
opacityDesktop: PropTypes__default.default.string,
|
|
63
|
+
opacityMobile: PropTypes__default.default.string,
|
|
64
|
+
opacityTablet: PropTypes__default.default.string,
|
|
65
65
|
type: PropTypes__default.default.string,
|
|
66
|
-
|
|
66
|
+
isOverlay: PropTypes__default.default.any
|
|
67
67
|
};
|
|
68
|
-
|
|
68
|
+
Overlay.__docgenInfo = {
|
|
69
69
|
"description": "",
|
|
70
70
|
"methods": [],
|
|
71
|
-
"displayName": "
|
|
71
|
+
"displayName": "Overlay",
|
|
72
72
|
"props": {
|
|
73
73
|
"className": {
|
|
74
74
|
"description": "",
|
|
@@ -77,34 +77,6 @@ Fader.__docgenInfo = {
|
|
|
77
77
|
},
|
|
78
78
|
"required": false
|
|
79
79
|
},
|
|
80
|
-
"opacity": {
|
|
81
|
-
"description": "",
|
|
82
|
-
"type": {
|
|
83
|
-
"name": "string"
|
|
84
|
-
},
|
|
85
|
-
"required": false
|
|
86
|
-
},
|
|
87
|
-
"opacityDesktop": {
|
|
88
|
-
"description": "",
|
|
89
|
-
"type": {
|
|
90
|
-
"name": "string"
|
|
91
|
-
},
|
|
92
|
-
"required": false
|
|
93
|
-
},
|
|
94
|
-
"opacityMobile": {
|
|
95
|
-
"description": "",
|
|
96
|
-
"type": {
|
|
97
|
-
"name": "string"
|
|
98
|
-
},
|
|
99
|
-
"required": false
|
|
100
|
-
},
|
|
101
|
-
"opacityTablet": {
|
|
102
|
-
"description": "",
|
|
103
|
-
"type": {
|
|
104
|
-
"name": "string"
|
|
105
|
-
},
|
|
106
|
-
"required": false
|
|
107
|
-
},
|
|
108
80
|
"fill": {
|
|
109
81
|
"description": "",
|
|
110
82
|
"type": {
|
|
@@ -177,6 +149,34 @@ Fader.__docgenInfo = {
|
|
|
177
149
|
},
|
|
178
150
|
"required": false
|
|
179
151
|
},
|
|
152
|
+
"opacity": {
|
|
153
|
+
"description": "",
|
|
154
|
+
"type": {
|
|
155
|
+
"name": "string"
|
|
156
|
+
},
|
|
157
|
+
"required": false
|
|
158
|
+
},
|
|
159
|
+
"opacityDesktop": {
|
|
160
|
+
"description": "",
|
|
161
|
+
"type": {
|
|
162
|
+
"name": "string"
|
|
163
|
+
},
|
|
164
|
+
"required": false
|
|
165
|
+
},
|
|
166
|
+
"opacityMobile": {
|
|
167
|
+
"description": "",
|
|
168
|
+
"type": {
|
|
169
|
+
"name": "string"
|
|
170
|
+
},
|
|
171
|
+
"required": false
|
|
172
|
+
},
|
|
173
|
+
"opacityTablet": {
|
|
174
|
+
"description": "",
|
|
175
|
+
"type": {
|
|
176
|
+
"name": "string"
|
|
177
|
+
},
|
|
178
|
+
"required": false
|
|
179
|
+
},
|
|
180
180
|
"type": {
|
|
181
181
|
"description": "",
|
|
182
182
|
"type": {
|
|
@@ -184,7 +184,7 @@ Fader.__docgenInfo = {
|
|
|
184
184
|
},
|
|
185
185
|
"required": false
|
|
186
186
|
},
|
|
187
|
-
"
|
|
187
|
+
"isOverlay": {
|
|
188
188
|
"description": "",
|
|
189
189
|
"type": {
|
|
190
190
|
"name": "any"
|
|
@@ -194,4 +194,4 @@ Fader.__docgenInfo = {
|
|
|
194
194
|
}
|
|
195
195
|
};
|
|
196
196
|
|
|
197
|
-
exports.
|
|
197
|
+
exports.Overlay = Overlay;
|
|
@@ -0,0 +1,290 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var React = require('react');
|
|
4
|
+
var PropTypes = require('prop-types');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var borderColor = require('../constants/componentProps/borderColor.js');
|
|
7
|
+
var borderType = require('../constants/componentProps/borderType.js');
|
|
8
|
+
var borderWidth = require('../constants/componentProps/borderWidth.js');
|
|
9
|
+
var fillHover = require('../constants/componentProps/fillHover.js');
|
|
10
|
+
var fill = require('../constants/componentProps/fill.js');
|
|
11
|
+
var height = require('../constants/componentProps/height.js');
|
|
12
|
+
var width = require('../constants/componentProps/width.js');
|
|
13
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
14
|
+
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
15
|
+
require('lodash/camelCase');
|
|
16
|
+
require('lodash/maxBy');
|
|
17
|
+
require('lodash/upperFirst');
|
|
18
|
+
require('../hooks/styleAttributes.js');
|
|
19
|
+
require('../context/UIContext.js');
|
|
20
|
+
require('../hooks/useMediaQueries.js');
|
|
21
|
+
require('react-responsive');
|
|
22
|
+
require('lodash/castArray');
|
|
23
|
+
|
|
24
|
+
function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
25
|
+
|
|
26
|
+
var React__default = /*#__PURE__*/_interopDefault(React);
|
|
27
|
+
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
28
|
+
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
29
|
+
|
|
30
|
+
var isProduction = process.env.NODE_ENV === 'production';
|
|
31
|
+
var prefix = 'Invariant failed';
|
|
32
|
+
function invariant(condition, message) {
|
|
33
|
+
if (condition) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
if (isProduction) {
|
|
37
|
+
throw new Error(prefix);
|
|
38
|
+
}
|
|
39
|
+
var provided = typeof message === 'function' ? message() : message;
|
|
40
|
+
var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
|
|
41
|
+
throw new Error(value);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const maxHorizontalScroll = dom => dom.scrollWidth - dom.clientWidth;
|
|
45
|
+
const maxVerticalScroll = dom => dom.scrollHeight - dom.clientHeight;
|
|
46
|
+
var useScrollOnDrag = ((domRef, {
|
|
47
|
+
onDragStart = () => {},
|
|
48
|
+
onDragEnd = () => {},
|
|
49
|
+
runScroll = ({
|
|
50
|
+
dx,
|
|
51
|
+
dy
|
|
52
|
+
}) => {
|
|
53
|
+
const offsetX = Math.min(maxHorizontalScroll(domRef.current), domRef.current.scrollLeft + dx);
|
|
54
|
+
domRef.current.scrollLeft = offsetX; // eslint-disable-line no-param-reassign
|
|
55
|
+
|
|
56
|
+
const offsetY = Math.min(maxVerticalScroll(domRef.current), domRef.current.scrollTop + dy);
|
|
57
|
+
domRef.current.scrollTop = offsetY; // eslint-disable-line no-param-reassign
|
|
58
|
+
}
|
|
59
|
+
} = {}) => {
|
|
60
|
+
const internalState = React.useRef({
|
|
61
|
+
lastMouseX: null,
|
|
62
|
+
lastMouseY: null,
|
|
63
|
+
isMouseDown: false,
|
|
64
|
+
isScrolling: false
|
|
65
|
+
});
|
|
66
|
+
const scroll = React.useCallback(({
|
|
67
|
+
dx,
|
|
68
|
+
dy
|
|
69
|
+
}) => {
|
|
70
|
+
!(domRef.current !== null) ? process.env.NODE_ENV !== "production" ? invariant(false, `Trying to scroll to the bottom, but no element was found.
|
|
71
|
+
Did you call this scrollBottom before the component with this hook finished mounting?`) : invariant(false) : void 0;
|
|
72
|
+
runScroll({
|
|
73
|
+
dx,
|
|
74
|
+
dy
|
|
75
|
+
});
|
|
76
|
+
}, [runScroll]);
|
|
77
|
+
const onMouseDown = React.useCallback(e => {
|
|
78
|
+
internalState.current.isMouseDown = true;
|
|
79
|
+
internalState.current.lastMouseX = e.clientX;
|
|
80
|
+
internalState.current.lastMouseY = e.clientY;
|
|
81
|
+
}, []);
|
|
82
|
+
const onMouseUp = () => {
|
|
83
|
+
internalState.current.isMouseDown = false;
|
|
84
|
+
internalState.current.lastMouseX = null;
|
|
85
|
+
internalState.current.lastMouseY = null;
|
|
86
|
+
if (internalState.current.isScrolling) {
|
|
87
|
+
internalState.current.isScrolling = false;
|
|
88
|
+
onDragEnd();
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
const onMouseMove = e => {
|
|
92
|
+
if (!internalState.current.isMouseDown) {
|
|
93
|
+
return;
|
|
94
|
+
}
|
|
95
|
+
if (!internalState.current.isScrolling) {
|
|
96
|
+
internalState.current.isScrolling = true;
|
|
97
|
+
onDragStart();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// diff is negative because we want to scroll in the opposite direction of the movement
|
|
101
|
+
const dx = -(e.clientX - internalState.current.lastMouseX);
|
|
102
|
+
const dy = -(e.clientY - internalState.current.lastMouseY);
|
|
103
|
+
internalState.current.lastMouseX = e.clientX;
|
|
104
|
+
internalState.current.lastMouseY = e.clientY;
|
|
105
|
+
scroll({
|
|
106
|
+
dx,
|
|
107
|
+
dy
|
|
108
|
+
});
|
|
109
|
+
};
|
|
110
|
+
React.useEffect(() => {
|
|
111
|
+
window.addEventListener('mouseup', onMouseUp);
|
|
112
|
+
window.addEventListener('mousemove', onMouseMove);
|
|
113
|
+
return () => {
|
|
114
|
+
window.removeEventListener('mouseup', onMouseUp);
|
|
115
|
+
window.removeEventListener('mousemove', onMouseMove);
|
|
116
|
+
};
|
|
117
|
+
}, []);
|
|
118
|
+
return {
|
|
119
|
+
events: {
|
|
120
|
+
onMouseDown
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
function ScrollOnDrag(props) {
|
|
126
|
+
const {
|
|
127
|
+
children,
|
|
128
|
+
className,
|
|
129
|
+
speed
|
|
130
|
+
} = props;
|
|
131
|
+
const ref = React.useRef(null);
|
|
132
|
+
const fun = ref => ({
|
|
133
|
+
dx
|
|
134
|
+
}) => {
|
|
135
|
+
ref.current.scrollLeft += dx * speed; // eslint-disable-line no-param-reassign
|
|
136
|
+
};
|
|
137
|
+
const {
|
|
138
|
+
events
|
|
139
|
+
} = useScrollOnDrag(ref, {
|
|
140
|
+
runScroll: fun(ref)
|
|
141
|
+
});
|
|
142
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
143
|
+
prefix: 'fill_',
|
|
144
|
+
propsKey: 'fill'
|
|
145
|
+
});
|
|
146
|
+
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
147
|
+
prefix: 'fill_hover_',
|
|
148
|
+
propsKey: 'fillHover'
|
|
149
|
+
});
|
|
150
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
151
|
+
prefix: 'width_',
|
|
152
|
+
propsKey: 'width'
|
|
153
|
+
});
|
|
154
|
+
const heightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
155
|
+
prefix: 'height_',
|
|
156
|
+
propsKey: 'height'
|
|
157
|
+
});
|
|
158
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
159
|
+
prefix: 'border-color_',
|
|
160
|
+
propsKey: 'borderColor'
|
|
161
|
+
});
|
|
162
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
163
|
+
prefix: 'border-width_',
|
|
164
|
+
propsKey: 'borderWidth'
|
|
165
|
+
});
|
|
166
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
167
|
+
prefix: 'border_type_',
|
|
168
|
+
propsKey: 'borderType'
|
|
169
|
+
});
|
|
170
|
+
const elevationClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
171
|
+
prefix: 'elevation_',
|
|
172
|
+
propsKey: 'elevation'
|
|
173
|
+
});
|
|
174
|
+
const {
|
|
175
|
+
styles: groupStyles
|
|
176
|
+
} = useStyles.useStyles(props);
|
|
177
|
+
return /*#__PURE__*/React__default.default.createElement("div", Object.assign({
|
|
178
|
+
className: clsx__default.default(className, 'scrolldrag', borderColorClass, borderTypeClass, borderWidthClass, elevationClass, fillClass, fillHoverClass, heightClass, widthClass)
|
|
179
|
+
}, events, {
|
|
180
|
+
ref: ref,
|
|
181
|
+
style: groupStyles
|
|
182
|
+
}), children);
|
|
183
|
+
}
|
|
184
|
+
ScrollOnDrag.propTypes = {
|
|
185
|
+
borderColor: PropTypes__default.default.oneOf(borderColor.default),
|
|
186
|
+
borderType: PropTypes__default.default.oneOf(borderType.default),
|
|
187
|
+
borderWidth: PropTypes__default.default.oneOf(borderWidth.default),
|
|
188
|
+
children: PropTypes__default.default.any,
|
|
189
|
+
className: PropTypes__default.default.string,
|
|
190
|
+
elevation: PropTypes__default.default.oneOf(),
|
|
191
|
+
fill: PropTypes__default.default.oneOf(fill.default),
|
|
192
|
+
fillHover: PropTypes__default.default.oneOf(fillHover.default),
|
|
193
|
+
height: PropTypes__default.default.oneOf(height.default),
|
|
194
|
+
width: PropTypes__default.default.oneOf(width.default)
|
|
195
|
+
};
|
|
196
|
+
ScrollOnDrag.__docgenInfo = {
|
|
197
|
+
"description": "",
|
|
198
|
+
"methods": [],
|
|
199
|
+
"displayName": "ScrollOnDrag",
|
|
200
|
+
"props": {
|
|
201
|
+
"borderColor": {
|
|
202
|
+
"description": "",
|
|
203
|
+
"type": {
|
|
204
|
+
"name": "enum",
|
|
205
|
+
"computed": true,
|
|
206
|
+
"value": "borderColorProps"
|
|
207
|
+
},
|
|
208
|
+
"required": false
|
|
209
|
+
},
|
|
210
|
+
"borderType": {
|
|
211
|
+
"description": "",
|
|
212
|
+
"type": {
|
|
213
|
+
"name": "enum",
|
|
214
|
+
"computed": true,
|
|
215
|
+
"value": "borderTypeProps"
|
|
216
|
+
},
|
|
217
|
+
"required": false
|
|
218
|
+
},
|
|
219
|
+
"borderWidth": {
|
|
220
|
+
"description": "",
|
|
221
|
+
"type": {
|
|
222
|
+
"name": "enum",
|
|
223
|
+
"computed": true,
|
|
224
|
+
"value": "borderWidthProps"
|
|
225
|
+
},
|
|
226
|
+
"required": false
|
|
227
|
+
},
|
|
228
|
+
"children": {
|
|
229
|
+
"description": "",
|
|
230
|
+
"type": {
|
|
231
|
+
"name": "any"
|
|
232
|
+
},
|
|
233
|
+
"required": false
|
|
234
|
+
},
|
|
235
|
+
"className": {
|
|
236
|
+
"description": "",
|
|
237
|
+
"type": {
|
|
238
|
+
"name": "string"
|
|
239
|
+
},
|
|
240
|
+
"required": false
|
|
241
|
+
},
|
|
242
|
+
"elevation": {
|
|
243
|
+
"description": "",
|
|
244
|
+
"type": {
|
|
245
|
+
"name": "enum",
|
|
246
|
+
"computed": true,
|
|
247
|
+
"value": "PropTypes.oneOf()"
|
|
248
|
+
},
|
|
249
|
+
"required": false
|
|
250
|
+
},
|
|
251
|
+
"fill": {
|
|
252
|
+
"description": "",
|
|
253
|
+
"type": {
|
|
254
|
+
"name": "enum",
|
|
255
|
+
"computed": true,
|
|
256
|
+
"value": "fillProps"
|
|
257
|
+
},
|
|
258
|
+
"required": false
|
|
259
|
+
},
|
|
260
|
+
"fillHover": {
|
|
261
|
+
"description": "",
|
|
262
|
+
"type": {
|
|
263
|
+
"name": "enum",
|
|
264
|
+
"computed": true,
|
|
265
|
+
"value": "fillHoverProps"
|
|
266
|
+
},
|
|
267
|
+
"required": false
|
|
268
|
+
},
|
|
269
|
+
"height": {
|
|
270
|
+
"description": "",
|
|
271
|
+
"type": {
|
|
272
|
+
"name": "enum",
|
|
273
|
+
"computed": true,
|
|
274
|
+
"value": "heightProps"
|
|
275
|
+
},
|
|
276
|
+
"required": false
|
|
277
|
+
},
|
|
278
|
+
"width": {
|
|
279
|
+
"description": "",
|
|
280
|
+
"type": {
|
|
281
|
+
"name": "enum",
|
|
282
|
+
"computed": true,
|
|
283
|
+
"value": "widthProps"
|
|
284
|
+
},
|
|
285
|
+
"required": false
|
|
286
|
+
}
|
|
287
|
+
}
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
exports.ScrollOnDrag = ScrollOnDrag;
|
package/dist/components/Text.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const borderWidthProps = [null,
|
|
3
|
+
const borderWidthProps = [null, /* eslint-disable */
|
|
4
|
+
'1', 1, '2', 2, '3', 3, '4', 4, '5', 5, '6', 6, '7', 7, '8', 8, '9', 9, '10', 10
|
|
5
|
+
/* eslint-enable */];
|
|
4
6
|
|
|
5
7
|
exports.default = borderWidthProps;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const emojiSizeProps = [null,
|
|
3
|
+
const emojiSizeProps = [null, /* eslint-disable */
|
|
4
|
+
'16', 16, '24', 24, '32', 32, '40', 40, '56', 56, '64', 64, '144', 144
|
|
5
|
+
/* eslint-enable */];
|
|
4
6
|
|
|
5
7
|
exports.default = emojiSizeProps;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const iconFillProps = [null,
|
|
3
|
+
const iconFillProps = [null, /* eslint-disable */
|
|
4
|
+
'14', 14, '16', 16, '24', 24, '32', 32, '40', 40, '60', 60, '64', 64, '144', 144
|
|
5
|
+
/* eslint-enable */];
|
|
4
6
|
|
|
5
7
|
exports.default = iconFillProps;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const iconSizeProps = [null,
|
|
3
|
+
const iconSizeProps = [null, /* eslint-disable */
|
|
4
|
+
'14', 14, '16', 16, '24', 24, '32', 32, '40', 40, '60', 60, '64', 64, '144', 144
|
|
5
|
+
/* eslint-enable */];
|
|
4
6
|
|
|
5
7
|
exports.default = iconSizeProps;
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
const sizePXProps = [null,
|
|
3
|
+
const sizePXProps = [null, /* eslint-disable */
|
|
4
|
+
'14', 14, '16', 16, '24', 24, '32', 32, '40', 40, '48', 48, '56', 56, '60', 60, '64', 64, '72', 72, '80', 80, '96', 96, '112', 112, '144', 144, '240', 240
|
|
5
|
+
/* eslint-enable */];
|
|
4
6
|
|
|
5
7
|
exports.default = sizePXProps;
|
|
@@ -829,11 +829,11 @@
|
|
|
829
829
|
}
|
|
830
830
|
}
|
|
831
831
|
&--in-selecting-range:not(
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
832
|
+
.react-datepicker__day--in-range,
|
|
833
|
+
.react-datepicker__month-text--in-range,
|
|
834
|
+
.react-datepicker__quarter-text--in-range,
|
|
835
|
+
.react-datepicker__year-text--in-range
|
|
836
|
+
) {
|
|
837
837
|
background: var(--date-picker-day-selected-background);
|
|
838
838
|
& .button__label {
|
|
839
839
|
color: var(--date-picker-day-selected-text-color);
|
|
@@ -878,6 +878,12 @@
|
|
|
878
878
|
&:hover {
|
|
879
879
|
border-radius: var(--date-picker-day-range-start-end-border-radius) !important;
|
|
880
880
|
}
|
|
881
|
+
&.react-datepicker__day--today {
|
|
882
|
+
border-radius: var(--date-picker-day-today-border-radius) !important;
|
|
883
|
+
&:hover {
|
|
884
|
+
border-radius: var(--date-picker-day-today-border-radius) !important;
|
|
885
|
+
}
|
|
886
|
+
}
|
|
881
887
|
}
|
|
882
888
|
&.react-datepicker__day--selecting-range-start.react-datepicker__day--selecting-range-end {
|
|
883
889
|
border-radius: var(--date-picker-day-range-start-end-border-radius) !important;
|
|
@@ -1165,6 +1171,7 @@
|
|
|
1165
1171
|
--date-picker-day-range-end-border-radius: 0 12px 12px 0;
|
|
1166
1172
|
--date-picker-day-range-start-end-border-radius: 12px;
|
|
1167
1173
|
--date-picker-day-today-background: var(--color-surface-secondary);
|
|
1174
|
+
--date-picker-day-today-border-radius: 12px;
|
|
1168
1175
|
--date-picker-day-today-text-color: var(--color-surface-text-primary);
|
|
1169
1176
|
--date-picker-day-weekend-background: var(--color-surface-primary);
|
|
1170
1177
|
--date-picker-day-weekend-text-color: var(--color-secondary-text-secondary);
|
|
@@ -67,25 +67,6 @@ div.label {
|
|
|
67
67
|
z-index: 12;
|
|
68
68
|
}
|
|
69
69
|
}
|
|
70
|
-
.label {
|
|
71
|
-
&&_text-align {
|
|
72
|
-
&_left {
|
|
73
|
-
^^&__inner {
|
|
74
|
-
text-align: left;
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
&_center {
|
|
78
|
-
^^&__inner {
|
|
79
|
-
text-align: center;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
&_right {
|
|
83
|
-
^^&__inner {
|
|
84
|
-
text-align: right;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
70
|
.label {
|
|
90
71
|
&&_width {
|
|
91
72
|
&_fixed {
|
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
.
|
|
1
|
+
.overlay {
|
|
2
2
|
width: 100%;
|
|
3
3
|
height: 100%;
|
|
4
|
-
background: var(--
|
|
4
|
+
background: var(--overlay-fill);
|
|
5
5
|
position: absolute;
|
|
6
6
|
left: 0;
|
|
7
7
|
top: 0;
|
|
8
8
|
z-index: 1;
|
|
9
|
-
backdrop-filter: blur(var(--
|
|
9
|
+
backdrop-filter: blur(var(--overlay-blur, 10px));
|
|
10
10
|
}
|
|
11
|
-
.
|
|
11
|
+
.overlay {
|
|
12
12
|
&&_state {
|
|
13
13
|
&_visible {
|
|
14
14
|
position: fixed;
|
|
15
15
|
visibility: visible !important;
|
|
16
|
-
animation-name:
|
|
16
|
+
animation-name: overlayFadeIn;
|
|
17
17
|
}
|
|
18
18
|
&_hidden {
|
|
19
|
-
animation-name:
|
|
19
|
+
animation-name: overlayFaderOut;
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
@keyframes
|
|
23
|
+
@keyframes overlayFadeIn {
|
|
24
24
|
from {
|
|
25
25
|
opacity: 0%;
|
|
26
26
|
}
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
opacity: 100%;
|
|
29
29
|
}
|
|
30
30
|
}
|
|
31
|
-
@keyframes
|
|
31
|
+
@keyframes overlayFaderOut {
|
|
32
32
|
from {
|
|
33
33
|
opacity: 100%;
|
|
34
34
|
}
|
|
@@ -36,8 +36,8 @@
|
|
|
36
36
|
opacity: 0%;
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
|
-
.
|
|
39
|
+
.overlay {
|
|
40
40
|
&&_type_click {
|
|
41
|
-
opacity: 0
|
|
41
|
+
opacity: 0%;
|
|
42
42
|
}
|
|
43
43
|
}
|