@itcase/ui 1.1.1 → 1.1.3
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 +32 -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 -8
- package/dist/components/InputMask.js +233 -0
- package/dist/components/InputPassword.js +6 -6
- package/dist/components/Label.js +4 -4
- package/dist/components/Modal.js +27 -27
- package/dist/components/{Fader.js → Overlay.js} +43 -43
- package/dist/components/Response.js +10 -9
- package/dist/components/ScrollOnDrag.js +290 -0
- package/dist/components/Search.js +19 -3
- package/dist/components/Tab.js +8 -8
- package/dist/components/Text.js +4 -4
- 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/InputMask/Input.css +77 -0
- package/dist/css/components/Label/Label.css +0 -19
- package/dist/css/components/Loader/Loader.css +1 -1
- 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/Response/Response.css +8 -0
- package/dist/css/components/ScrollOnDrag/ScrollOnDrag.css +6 -0
- package/dist/css/styles/align/align_vertical-reverse.css +6 -6
- package/dist/css/styles/align/align_vertical.css +8 -8
- package/dist/css/styles/border-color/border-color.css +1 -1
- package/dist/css/styles/border-color/border-color_focus.css +2 -2
- package/dist/css/styles/border-color/border-color_hover.css +1 -1
- package/dist/css/styles/caret-color/caret-color.css +1 -1
- package/dist/css/styles/fill/fill.css +2 -2
- package/dist/css/styles/fill/fill_active.css +2 -2
- package/dist/css/styles/fill/fill_active_hover.css +2 -2
- package/dist/css/styles/fill/fill_disabled.css +2 -2
- package/dist/css/styles/fill/fill_hover.css +2 -2
- package/dist/stories/ModalConfirm.stories.js +1 -1
- package/dist/stories/ModalDefault.stories.js +1 -1
- package/dist/stories/NotFound.stories.js +3 -4
- package/package.json +1 -1
- package/dist/components/Empty.js +0 -229
- package/dist/css/components/Empty/Empty.css +0 -21
- package/dist/stories/Empty.stories.js +0 -115
|
@@ -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;
|
|
@@ -47,9 +47,16 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
47
47
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
48
48
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
49
49
|
|
|
50
|
+
const searchInputConfig = {
|
|
51
|
+
appearance: {},
|
|
52
|
+
setAppearance: newComponent => {
|
|
53
|
+
searchInputConfig.appearance = newComponent;
|
|
54
|
+
}
|
|
55
|
+
};
|
|
50
56
|
const SearchInput = /*#__PURE__*/React__default.default.forwardRef(function SearchInput(props, ref) {
|
|
51
57
|
const {
|
|
52
58
|
after,
|
|
59
|
+
appearance,
|
|
53
60
|
before,
|
|
54
61
|
className,
|
|
55
62
|
size,
|
|
@@ -146,7 +153,7 @@ const SearchInput = /*#__PURE__*/React__default.default.forwardRef(function Sear
|
|
|
146
153
|
styles: searchInputStyles
|
|
147
154
|
} = useStyles.useStyles(props);
|
|
148
155
|
return /*#__PURE__*/React__default.default.createElement("label", {
|
|
149
|
-
className: clsx__default.default(className, 'search-input', shapeClass, fillClass, widthClass, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, size && `search-input_size_${size}`, type && `search-input_type_${type}`),
|
|
156
|
+
className: clsx__default.default(className, 'search-input', shapeClass || searchInputConfig.appearance[appearance] && `search_shape_${searchInputConfig.appearance[appearance].shape}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillClass || searchInputConfig.appearance[appearance] && `fill_${searchInputConfig.appearance[appearance].fill}`.replace(/([A-Z])/g, '-$1').toLowerCase(), widthClass, borderColorClass || searchInputConfig.appearance[appearance] && `border-color_${searchInputConfig.appearance[appearance].borderColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderColorHoverClass || searchInputConfig.appearance[appearance] && `border-color_hover_${searchInputConfig.appearance[appearance].borderHover}`.replace(/([A-Z])/g, '-$1').toLowerCase(), borderWidthClass, borderTypeClass, size && `search-input_size_${size}`, type && `search-input_type_${type}`),
|
|
150
157
|
"data-tour": dataTour,
|
|
151
158
|
style: searchInputStyles
|
|
152
159
|
}, before, (iconBefore || iconBeforeSrc) && /*#__PURE__*/React__default.default.createElement(index.Icon, {
|
|
@@ -172,7 +179,7 @@ const SearchInput = /*#__PURE__*/React__default.default.forwardRef(function Sear
|
|
|
172
179
|
}, /*#__PURE__*/React__default.default.createElement(index$1.Text, {
|
|
173
180
|
className: clsx__default.default('search-input__placeholder-value'),
|
|
174
181
|
size: placeholderTextSize,
|
|
175
|
-
textColor: placeholderTextColor,
|
|
182
|
+
textColor: placeholderTextColor || searchInputConfig.appearance[appearance].placeholderTextColor,
|
|
176
183
|
textStyle: placeholderTextStyle,
|
|
177
184
|
textWeight: placeholderTextWeight
|
|
178
185
|
}, placeholder || 'Search')), value && /*#__PURE__*/React__default.default.createElement(index.Icon, {
|
|
@@ -229,7 +236,8 @@ SearchInput.propTypes = {
|
|
|
229
236
|
};
|
|
230
237
|
SearchInput.defaultProps = {
|
|
231
238
|
placeholderTextSize: 'm',
|
|
232
|
-
inputTextSize: 'm'
|
|
239
|
+
inputTextSize: 'm',
|
|
240
|
+
size: 'normal'
|
|
233
241
|
};
|
|
234
242
|
SearchInput.__docgenInfo = {
|
|
235
243
|
"description": "",
|
|
@@ -258,6 +266,13 @@ SearchInput.__docgenInfo = {
|
|
|
258
266
|
},
|
|
259
267
|
"required": false
|
|
260
268
|
},
|
|
269
|
+
"size": {
|
|
270
|
+
"defaultValue": {
|
|
271
|
+
"value": "'normal'",
|
|
272
|
+
"computed": false
|
|
273
|
+
},
|
|
274
|
+
"required": false
|
|
275
|
+
},
|
|
261
276
|
"after": {
|
|
262
277
|
"description": "",
|
|
263
278
|
"type": {
|
|
@@ -553,3 +568,4 @@ SearchResult.__docgenInfo = {
|
|
|
553
568
|
|
|
554
569
|
exports.SearchInput = SearchInput;
|
|
555
570
|
exports.SearchResult = SearchResult;
|
|
571
|
+
exports.searchInputConfig = searchInputConfig;
|
package/dist/components/Tab.js
CHANGED
|
@@ -141,7 +141,7 @@ function Tab(props) {
|
|
|
141
141
|
styles: tab
|
|
142
142
|
} = useStyles.useStyles(props);
|
|
143
143
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
144
|
-
className: clsx__default.default('tab', isActive && 'tab_state_active', isDisabled && 'tab_state_disabled', isHover && 'tab_state_hover', fillClass || (isDisabled ? fillDisabledClass || tabConfig.appearance[appearance] && `fill_${tabConfig.appearance[appearance].fillDisabled}`.replace(/([A-Z])/g, '-$1').toLowerCase() : fillClass || tabConfig.appearance[appearance] && `fill_${tabConfig.appearance[appearance].fill}`.replace(/([A-Z])/g, '-$1').toLowerCase()), fillHoverClass || (isDisabled ? null : tabConfig.appearance[appearance] && `fill_hover_${tabConfig.appearance[appearance].fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase()), className, sizeClass, fillActiveClass, fillActiveHoverClass, shapeClass, typeClass, widthClass, reset && 'tab-reset', set && `tab_set_${set}`, justifyContentClass, onClick && 'cursor_type_pointer'),
|
|
144
|
+
className: clsx__default.default('tab', isActive && 'tab_state_active', isDisabled && 'tab_state_disabled', isHover && 'tab_state_hover', fillClass || (isDisabled ? fillDisabledClass || tabConfig.appearance[appearance] && `fill_${tabConfig.appearance[appearance].fillDisabled}`.replace(/([A-Z])/g, '-$1').toLowerCase() : fillClass || tabConfig.appearance[appearance] && `fill_${tabConfig.appearance[appearance].fill}`.replace(/([A-Z])/g, '-$1').toLowerCase()), fillHoverClass || (isDisabled ? null : tabConfig.appearance[appearance] && `fill_hover_${tabConfig.appearance[appearance].fillHover}`.replace(/([A-Z])/g, '-$1').toLowerCase()), className, sizeClass || tabConfig.appearance[appearance] && `tab_size_${tabConfig.appearance[appearance]?.size}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillActiveClass, fillActiveHoverClass, shapeClass, typeClass || tabConfig.appearance[appearance] && `tab_type_${tabConfig.appearance[appearance].type}`.replace(/([A-Z])/g, '-$1').toLowerCase(), widthClass, reset && 'tab-reset', set && `tab_set_${set}`, justifyContentClass, onClick && 'cursor_type_pointer'),
|
|
145
145
|
"data-tour": dataTour,
|
|
146
146
|
style: tab,
|
|
147
147
|
onClick: onClick,
|
|
@@ -154,9 +154,9 @@ function Tab(props) {
|
|
|
154
154
|
target: target
|
|
155
155
|
}, /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, before, children || /*#__PURE__*/React__default.default.createElement(React__default.default.Fragment, null, /*#__PURE__*/React__default.default.createElement("div", {
|
|
156
156
|
className: "tab__wrapper"
|
|
157
|
-
}, label && /*#__PURE__*/React__default.default.createElement(index$1.Text, {
|
|
157
|
+
}, (label || tabConfig.appearance[appearance].label) && /*#__PURE__*/React__default.default.createElement(index$1.Text, {
|
|
158
158
|
className: "tab__label",
|
|
159
|
-
size: labelTextSize,
|
|
159
|
+
size: labelTextSize || tabConfig.appearance[appearance].labelTextSize,
|
|
160
160
|
textColor: isDisabled ? labelColorDisabled || tabConfig.appearance[appearance].labelColorDisabled : labelColor || tabConfig.appearance[appearance].labelColor,
|
|
161
161
|
textColorActive: isActive && (labelColorActive || tabConfig.appearance[appearance].labelColorActive),
|
|
162
162
|
textColorGradient: labelTextGradient,
|
|
@@ -164,11 +164,11 @@ function Tab(props) {
|
|
|
164
164
|
textStyle: labelTextStyle,
|
|
165
165
|
textWeight: labelTextWeight,
|
|
166
166
|
textWrap: labelTextWrap
|
|
167
|
-
}, dividerFillActive, " ", label), badgeValue && /*#__PURE__*/React__default.default.createElement(index$2.Badge, {
|
|
168
|
-
appearance: badgeAppearance,
|
|
169
|
-
size: badgeSize,
|
|
170
|
-
textSize: badgeTextSize,
|
|
171
|
-
value: badgeValue
|
|
167
|
+
}, dividerFillActive, " ", label || tabConfig.appearance[appearance].label), (badgeValue || tabConfig.appearance[appearance].badgeValue) && /*#__PURE__*/React__default.default.createElement(index$2.Badge, {
|
|
168
|
+
appearance: badgeAppearance || tabConfig.appearance[appearance].badgeAppearance,
|
|
169
|
+
size: badgeSize || tabConfig.appearance[appearance].badgeSize,
|
|
170
|
+
textSize: badgeTextSize || tabConfig.appearance[appearance].badgeTextSize,
|
|
171
|
+
value: badgeValue || tabConfig.appearance[appearance].badgeValue
|
|
172
172
|
})), /*#__PURE__*/React__default.default.createElement(index$3.Divider, {
|
|
173
173
|
direction: dividerDirection,
|
|
174
174
|
fill: isDisabled ? dividerFillDisabled || tabConfig.appearance[appearance].dividerFillDisabled : dividerFill || tabConfig.appearance[appearance].dividerFill,
|
package/dist/components/Text.js
CHANGED
|
@@ -49,9 +49,6 @@ function Text(props) {
|
|
|
49
49
|
type,
|
|
50
50
|
onClick
|
|
51
51
|
} = props;
|
|
52
|
-
const {
|
|
53
|
-
styles: textStyles
|
|
54
|
-
} = useStyles.useStyles(props);
|
|
55
52
|
const cursorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
56
53
|
prefix: 'cursor_',
|
|
57
54
|
propsKey: 'cursor'
|
|
@@ -100,13 +97,16 @@ function Text(props) {
|
|
|
100
97
|
prefix: 'width_',
|
|
101
98
|
propsKey: 'width'
|
|
102
99
|
});
|
|
100
|
+
const {
|
|
101
|
+
styles: textStyles
|
|
102
|
+
} = useStyles.useStyles(props);
|
|
103
103
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
104
104
|
className: clsx__default.default(className, 'text', sizeClass || textConfig.appearance[appearance] && `text_size_${textConfig.appearance[appearance].size}`.replace(/([A-Z])/g, '-$1').toLowerCase(), weightClass, textAlignClass, textColorClass || textConfig.appearance[appearance] && `text-color_${textConfig.appearance[appearance].textColor}`.replace(/([A-Z])/g, '-$1').toLowerCase(), textColorActiveClass, textColorHoverClass, textGradientClass, textStyleClass, textTruncateClass, textWrapClass, type && `text_type_${type}`, mode && `text_mode_${mode}`, widthClass, cursorClass, onClick && (cursor || 'cursor_type_pointer')),
|
|
105
105
|
"data-tour": dataTour,
|
|
106
106
|
htmlFor: htmlFor,
|
|
107
107
|
style: textStyles,
|
|
108
108
|
onClick: onClick,
|
|
109
|
-
"data-
|
|
109
|
+
"data-test-id": dataTestId
|
|
110
110
|
}, before, children, after);
|
|
111
111
|
}
|
|
112
112
|
Text.propTypes = {
|
|
@@ -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);
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
.input {
|
|
2
|
+
min-width: unset;
|
|
3
|
+
padding: 0;
|
|
4
|
+
margin: 0;
|
|
5
|
+
border: none;
|
|
6
|
+
position: relative;
|
|
7
|
+
box-shadow: none;
|
|
8
|
+
appearance: none;
|
|
9
|
+
outline: 0;
|
|
10
|
+
caret-color: var(--input-caret-color);
|
|
11
|
+
&:disabled {
|
|
12
|
+
background: var(--input-state-disabled-background, #ECECEC);
|
|
13
|
+
border: solid 1px var(--input-state-disabled-border, #747474);
|
|
14
|
+
&:hover {
|
|
15
|
+
background: var(--input-state-disabled-background, #ECECEC);
|
|
16
|
+
border: solid 1px var(--input-state-disabled-border, #747474);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
&:focus {
|
|
20
|
+
outline: none;
|
|
21
|
+
}
|
|
22
|
+
&:hover {
|
|
23
|
+
background: var(--input-state-hover-background);
|
|
24
|
+
border: solid 1px var(--input-state-hover-border);
|
|
25
|
+
}
|
|
26
|
+
&&_state {
|
|
27
|
+
&_success {
|
|
28
|
+
background: var(--input-state-success-background);
|
|
29
|
+
border: solid 1px var(--input-state-success-border);
|
|
30
|
+
}
|
|
31
|
+
&_error {
|
|
32
|
+
background: var(--input-state-error-background);
|
|
33
|
+
border: solid 1px var(--input-state-error-border);
|
|
34
|
+
}
|
|
35
|
+
&_focus {
|
|
36
|
+
background: var(--input-state-focus-background);
|
|
37
|
+
border: solid 1px var(--input-state-focus-border);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
.input {
|
|
42
|
+
&_shape {
|
|
43
|
+
&_rounded {
|
|
44
|
+
border-radius: var(--input-shape-rounded, 4px);
|
|
45
|
+
position: relative;
|
|
46
|
+
}
|
|
47
|
+
&_underline {
|
|
48
|
+
border-left: none !important;
|
|
49
|
+
border-top: none !important;
|
|
50
|
+
border-right: none !important;
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
.input {
|
|
56
|
+
&&_size {
|
|
57
|
+
@each $size in xs, s, m, l, xl, xxl, normal, tiny, compact, large {
|
|
58
|
+
&_$(size) {
|
|
59
|
+
padding: var(--input-size-$(size)-padding);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
.input {
|
|
65
|
+
&_type {
|
|
66
|
+
&_number {
|
|
67
|
+
appearance: none;
|
|
68
|
+
&[type='number'] {
|
|
69
|
+
appearance: textfield;
|
|
70
|
+
}
|
|
71
|
+
&::-webkit-outer-spin-button,
|
|
72
|
+
&::-webkit-inner-spin-button {
|
|
73
|
+
appearance: none;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
}
|
|
@@ -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 {
|