@itcase/ui 1.0.43 → 1.0.45
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/Accordion.js +56 -58
- package/dist/components/Avatar.js +31 -29
- package/dist/components/Background.js +15 -12
- package/dist/components/Badge.js +13 -11
- package/dist/components/Breadcrumbs.js +72 -71
- package/dist/components/Button.js +56 -53
- package/dist/components/Caption.js +11 -8
- package/dist/components/Card.js +22 -20
- package/dist/components/Cell.js +52 -50
- package/dist/components/Checkbox.js +31 -29
- package/dist/components/Chips.js +21 -18
- package/dist/components/Choice.js +43 -49
- package/dist/components/Code.js +260 -105
- package/dist/components/ContextMenu.js +38 -34
- package/dist/components/CookiesWarning.js +26 -27
- package/dist/components/DatePicker.js +64 -67
- package/dist/components/Divider.js +15 -12
- package/dist/components/Dot.js +8 -6
- package/dist/components/Dropdown.js +88 -88
- package/dist/components/Empty.js +21 -19
- package/dist/components/Fader.js +13 -10
- package/dist/components/Flex.js +43 -37
- package/dist/components/FormField.js +77 -66
- package/dist/components/Grid.js +66 -57
- package/dist/components/Group.js +33 -30
- package/dist/components/Icon.js +41 -38
- package/dist/components/Image.js +34 -28
- package/dist/components/Input.js +29 -28
- package/dist/components/InputPassword.js +45 -48
- package/dist/components/Label.js +29 -26
- package/dist/components/LanguageSelector.js +29 -30
- package/dist/components/Link.js +43 -39
- package/dist/components/List.js +35 -29
- package/dist/components/Loader.js +22 -19
- package/dist/components/Logo.js +17 -14
- package/dist/components/Menu.js +20 -19
- package/dist/components/MenuItem.js +55 -52
- package/dist/components/Modal.js +51 -63
- package/dist/components/Notification.js +41 -38
- package/dist/components/Pagination.js +17 -15
- package/dist/components/RadioButton.js +31 -29
- package/dist/components/RangeSlider.js +29 -26
- package/dist/components/Scrollbar.js +6 -4
- package/dist/components/Search.js +66 -61
- package/dist/components/Segmented.js +52 -58
- package/dist/components/Select.js +181 -168
- package/dist/components/SiteMenu.js +34 -28
- package/dist/components/Swiper.js +104 -92
- package/dist/components/Switch.js +11 -9
- package/dist/components/Tab.js +95 -80
- package/dist/components/Text.js +27 -24
- package/dist/components/Textarea.js +23 -21
- package/dist/components/Tile.js +37 -34
- package/dist/components/Title.js +38 -30
- package/dist/components/Tooltip.js +24 -21
- package/dist/components/Video.js +16 -13
- package/dist/components/Wrapper.js +23 -20
- package/dist/constants/componentProps/align.js +1 -1
- package/dist/constants/componentProps/alignDirection.js +1 -1
- package/dist/constants/componentProps/borderColor.js +1 -1
- package/dist/constants/componentProps/borderType.js +1 -1
- package/dist/constants/componentProps/captionPosition.js +1 -1
- package/dist/constants/componentProps/direction.js +1 -1
- package/dist/constants/componentProps/emojiSize.js +1 -1
- package/dist/constants/componentProps/fill.js +1 -1
- package/dist/constants/componentProps/fillGradient.js +1 -1
- package/dist/constants/componentProps/fillType.js +1 -1
- package/dist/constants/componentProps/flexAlign.js +1 -1
- package/dist/constants/componentProps/flexJustifyContent.js +1 -1
- package/dist/constants/componentProps/flexWrap.js +1 -1
- package/dist/constants/componentProps/gridAlign.js +1 -1
- package/dist/constants/componentProps/gridAlignSelf.js +1 -1
- package/dist/constants/componentProps/gridJustifyItems.js +1 -1
- package/dist/constants/componentProps/gridJustifySelf.js +1 -1
- package/dist/constants/componentProps/horizontalContentAlign.js +1 -1
- package/dist/constants/componentProps/horizontalResizeMode.js +1 -1
- package/dist/constants/componentProps/iconSize.js +1 -1
- package/dist/constants/componentProps/position.js +1 -1
- package/dist/constants/componentProps/resizeMode.js +1 -1
- package/dist/constants/componentProps/shape.js +1 -1
- package/dist/constants/componentProps/size.js +1 -1
- package/dist/constants/componentProps/stacking.js +1 -1
- package/dist/constants/componentProps/strokeColor.js +1 -1
- package/dist/constants/componentProps/textAlign.js +1 -1
- package/dist/constants/componentProps/textColor.js +1 -1
- package/dist/constants/componentProps/textColorActive.js +1 -1
- package/dist/constants/componentProps/textColorHover.js +1 -1
- package/dist/constants/componentProps/textGradient.js +1 -1
- package/dist/constants/componentProps/textStyle.js +1 -1
- package/dist/constants/componentProps/textTag.js +1 -1
- package/dist/constants/componentProps/textWeight.js +1 -1
- package/dist/constants/componentProps/titleSize.js +1 -1
- package/dist/constants/componentProps/type.js +1 -1
- package/dist/constants/componentProps/underline.js +1 -1
- package/dist/constants/componentProps/verticalContentAlign.js +1 -1
- package/dist/constants/componentProps/verticalResizeMode.js +1 -1
- package/dist/constants/componentProps/width.js +1 -1
- package/dist/constants/componentProps/wrap.js +1 -1
- package/dist/context/Notifications.js +38 -53
- package/dist/context/UIContext.js +14 -17
- package/dist/css/components/Choice/Choice.css +8 -0
- package/dist/css/components/Code/Code.css +30 -43
- package/dist/css/components/DatePicker/DatePicker.css +39 -0
- package/dist/css/components/Notification/Notification.css +22 -10
- package/dist/css/components/Notification/css/__item/notification__item_set_form.css +15 -0
- package/dist/css/components/Swiper/Swiper.css +6 -3
- package/dist/css/components/Tab/Tab.css +10 -1
- package/dist/css/styles/align/align.css +0 -1
- package/dist/css/styles/align/align_horizontal-reverse.css +6 -6
- package/dist/css/styles/align/align_horizontal.css +9 -9
- package/dist/css/styles/border-color/border-color.css +15 -1
- package/dist/css/styles/column-gap/column-gap.css +3 -1
- package/dist/css/styles/gap/gap.css +3 -1
- package/dist/css/styles/row-gap/row-gap.css +3 -1
- package/dist/hooks/useDeviceTargetClass.js +19 -18
- package/dist/hooks/useMediaQueries.js +7 -10
- package/dist/hooks/useStyles.js +127 -8
- package/package.json +30 -29
- package/dist/useStyles-e4accb53.js +0 -153
package/dist/components/Tab.js
CHANGED
|
@@ -17,7 +17,7 @@ var textStyle = require('../constants/componentProps/textStyle.js');
|
|
|
17
17
|
var textWeight = require('../constants/componentProps/textWeight.js');
|
|
18
18
|
var type = require('../constants/componentProps/type.js');
|
|
19
19
|
var underline = require('../constants/componentProps/underline.js');
|
|
20
|
-
var useStyles = require('../useStyles
|
|
20
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
21
21
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
22
22
|
var size = require('../constants/componentProps/size.js');
|
|
23
23
|
var direction = require('../constants/componentProps/direction.js');
|
|
@@ -40,105 +40,107 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
40
40
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
41
41
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
42
42
|
|
|
43
|
-
|
|
44
|
-
var tabConfig = {
|
|
43
|
+
const tabConfig = {
|
|
45
44
|
appearance: {},
|
|
46
|
-
setAppearance:
|
|
45
|
+
setAppearance: newComponent => {
|
|
47
46
|
tabConfig.appearance = newComponent;
|
|
48
47
|
}
|
|
49
48
|
};
|
|
50
49
|
function Tab(props) {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
50
|
+
const {
|
|
51
|
+
isActive,
|
|
52
|
+
isHover,
|
|
53
|
+
appearance,
|
|
54
|
+
after,
|
|
55
|
+
before,
|
|
56
|
+
children,
|
|
57
|
+
className,
|
|
58
|
+
href,
|
|
59
|
+
link,
|
|
60
|
+
set,
|
|
61
|
+
rel,
|
|
62
|
+
target,
|
|
63
|
+
label,
|
|
64
|
+
labelColor,
|
|
65
|
+
labelTextColorHover,
|
|
66
|
+
labelColorActive,
|
|
67
|
+
labelTextGradient,
|
|
68
|
+
labelTextSize,
|
|
69
|
+
labelTextWrap,
|
|
70
|
+
labelTextStyle,
|
|
71
|
+
labelTextWeight,
|
|
72
|
+
dataTour,
|
|
73
|
+
dividerFill,
|
|
74
|
+
dividerFillHover,
|
|
75
|
+
dividerFillActive,
|
|
76
|
+
dividerFillActiveHover,
|
|
77
|
+
dividerFillDisabled,
|
|
78
|
+
dividerSize,
|
|
79
|
+
dividerDirection,
|
|
80
|
+
onClick,
|
|
81
|
+
onMouseEnter,
|
|
82
|
+
badgeSize,
|
|
83
|
+
badgeFill,
|
|
84
|
+
badgeTextColor,
|
|
85
|
+
badgeTextSize,
|
|
86
|
+
badgeValue
|
|
87
|
+
} = props;
|
|
88
|
+
const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
88
89
|
prefix: 'align_',
|
|
89
90
|
propsKey: 'alignDirection'
|
|
90
91
|
});
|
|
91
|
-
|
|
92
|
+
const alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
92
93
|
prefix: 'align_',
|
|
93
94
|
propsKey: 'align'
|
|
94
95
|
});
|
|
95
|
-
|
|
96
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
96
97
|
prefix: 'fill_',
|
|
97
98
|
propsKey: 'fill'
|
|
98
99
|
});
|
|
99
|
-
|
|
100
|
+
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
100
101
|
prefix: 'fill_hover_',
|
|
101
102
|
propsKey: 'fillHover'
|
|
102
103
|
});
|
|
103
|
-
|
|
104
|
+
const fillActiveClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
104
105
|
prefix: 'fill_active_',
|
|
105
106
|
propsKey: 'fillActive'
|
|
106
107
|
});
|
|
107
|
-
|
|
108
|
+
const fillActiveHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
108
109
|
prefix: 'fill_active_hover_',
|
|
109
110
|
propsKey: 'fillActiveHover'
|
|
110
111
|
});
|
|
111
|
-
|
|
112
|
+
const fillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
112
113
|
prefix: 'fill_disabled_',
|
|
113
114
|
propsKey: 'fillDisabled'
|
|
114
115
|
});
|
|
115
|
-
|
|
116
|
+
const linkFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
116
117
|
propsKey: 'linkFill'
|
|
117
118
|
});
|
|
118
|
-
|
|
119
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
119
120
|
prefix: 'tab_size_',
|
|
120
121
|
propsKey: 'size'
|
|
121
122
|
});
|
|
122
|
-
|
|
123
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
123
124
|
prefix: 'tab_shape_',
|
|
124
125
|
propsKey: 'shape'
|
|
125
126
|
});
|
|
126
|
-
|
|
127
|
+
const justifyContentClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
127
128
|
prefix: 'tab_justify-content_',
|
|
128
129
|
propsKey: 'justifyContent'
|
|
129
130
|
});
|
|
130
|
-
|
|
131
|
+
const typeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
131
132
|
prefix: 'tab_type_',
|
|
132
133
|
propsKey: 'type'
|
|
133
134
|
});
|
|
134
|
-
|
|
135
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
135
136
|
prefix: 'width_',
|
|
136
137
|
propsKey: 'width'
|
|
137
138
|
});
|
|
138
|
-
|
|
139
|
-
tab
|
|
139
|
+
const {
|
|
140
|
+
styles: tab
|
|
141
|
+
} = useStyles.useStyles(props);
|
|
140
142
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
141
|
-
className: clsx__default.default('tab', isActive && 'tab_state_active', isHover && 'tab_state_hover', appearance &&
|
|
143
|
+
className: clsx__default.default('tab', isActive && 'tab_state_active', isHover && 'tab_state_hover', appearance && `fill_${tabConfig.appearance[appearance].fillClass}`.replace(/([A-Z])/g, '-$1').toLowerCase(), appearance && `fill_hover_${tabConfig.appearance[appearance].fillHoverClass}`.replace(/([A-Z])/g, '-$1').toLowerCase(), className, sizeClass, fillClass, fillHoverClass, fillActiveClass, fillActiveHoverClass, fillDisabledClass, shapeClass, typeClass, widthClass, set && `tab_set_${set}`, justifyContentClass),
|
|
142
144
|
style: tab,
|
|
143
145
|
onClick: onClick,
|
|
144
146
|
onMouseEnter: onMouseEnter,
|
|
@@ -178,7 +180,7 @@ function Tab(props) {
|
|
|
178
180
|
direction: dividerDirection
|
|
179
181
|
})), after)));
|
|
180
182
|
}
|
|
181
|
-
Tab.propTypes =
|
|
183
|
+
Tab.propTypes = {
|
|
182
184
|
before: PropTypes__default.default.any,
|
|
183
185
|
after: PropTypes__default.default.any,
|
|
184
186
|
children: PropTypes__default.default.any,
|
|
@@ -212,8 +214,18 @@ Tab.propTypes = (_Tab$propTypes = {
|
|
|
212
214
|
labelColor: PropTypes__default.default.oneOf(textColor.default),
|
|
213
215
|
labelTextColorHover: PropTypes__default.default.oneOf(textColorHover.default),
|
|
214
216
|
labelColorActive: PropTypes__default.default.oneOf(textColorActive.default),
|
|
215
|
-
labelTextGradient: PropTypes__default.default.oneOf(textGradient.default)
|
|
216
|
-
|
|
217
|
+
labelTextGradient: PropTypes__default.default.oneOf(textGradient.default),
|
|
218
|
+
labelTextSize: PropTypes__default.default.oneOf(size.default),
|
|
219
|
+
labelTextWrap: PropTypes__default.default.string,
|
|
220
|
+
labelTextStyle: PropTypes__default.default.oneOf(textStyle.default),
|
|
221
|
+
labelTextWeight: PropTypes__default.default.oneOf(textWeight.default),
|
|
222
|
+
type: PropTypes__default.default.oneOf(type.default),
|
|
223
|
+
typeDesktop: PropTypes__default.default.oneOf(type.default),
|
|
224
|
+
typeMobile: PropTypes__default.default.oneOf(type.default),
|
|
225
|
+
typeTablet: PropTypes__default.default.oneOf(type.default),
|
|
226
|
+
title: PropTypes__default.default.string,
|
|
227
|
+
underline: PropTypes__default.default.oneOf(underline.default)
|
|
228
|
+
};
|
|
217
229
|
Tab.defaultProps = {
|
|
218
230
|
size: 'normal',
|
|
219
231
|
LinkComponent: 'a',
|
|
@@ -221,58 +233,61 @@ Tab.defaultProps = {
|
|
|
221
233
|
};
|
|
222
234
|
|
|
223
235
|
function TabGroup(props) {
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
236
|
+
const {
|
|
237
|
+
id,
|
|
238
|
+
dataTour,
|
|
239
|
+
children,
|
|
240
|
+
className,
|
|
241
|
+
horizontalScroll,
|
|
242
|
+
set,
|
|
243
|
+
style
|
|
244
|
+
} = props;
|
|
245
|
+
const contentAlignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
232
246
|
prefix: 'group_content-align_',
|
|
233
247
|
propsKey: 'contentAlign'
|
|
234
248
|
});
|
|
235
|
-
|
|
249
|
+
const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
236
250
|
prefix: 'align_',
|
|
237
251
|
propsKey: 'alignDirection'
|
|
238
252
|
});
|
|
239
|
-
|
|
253
|
+
const alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
240
254
|
prefix: 'align_',
|
|
241
255
|
propsKey: 'align'
|
|
242
256
|
});
|
|
243
|
-
|
|
257
|
+
const directionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
244
258
|
prefix: 'group_direction_',
|
|
245
259
|
propsKey: 'direction'
|
|
246
260
|
});
|
|
247
|
-
|
|
261
|
+
const wrapClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
248
262
|
prefix: 'group_wrap_',
|
|
249
263
|
propsKey: 'wrap'
|
|
250
264
|
});
|
|
251
|
-
|
|
265
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
252
266
|
prefix: 'fill_',
|
|
253
267
|
propsKey: 'fill'
|
|
254
268
|
});
|
|
255
|
-
|
|
269
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
256
270
|
prefix: 'width_',
|
|
257
271
|
propsKey: 'width'
|
|
258
272
|
});
|
|
259
|
-
|
|
273
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
260
274
|
prefix: 'border-color_',
|
|
261
275
|
propsKey: 'borderColor'
|
|
262
276
|
});
|
|
263
|
-
|
|
277
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
264
278
|
prefix: 'border-width_',
|
|
265
279
|
propsKey: 'borderWidth'
|
|
266
280
|
});
|
|
267
|
-
|
|
281
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
268
282
|
prefix: 'border-type_',
|
|
269
283
|
propsKey: 'borderType'
|
|
270
284
|
});
|
|
271
|
-
|
|
272
|
-
groupStyles
|
|
273
|
-
groupWrapperStyles
|
|
285
|
+
const {
|
|
286
|
+
styles: groupStyles,
|
|
287
|
+
wrapper: groupWrapperStyles
|
|
288
|
+
} = useStyles.useStyles(props);
|
|
274
289
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
275
|
-
className: clsx__default.default(className, 'tab-group', 'group', widthClass, contentAlignClass, alignDirectionClass, directionClass, alignClass, fillClass, set &&
|
|
290
|
+
className: clsx__default.default(className, 'tab-group', 'group', widthClass, contentAlignClass, alignDirectionClass, directionClass, alignClass, fillClass, set && `group_set_${set}`, horizontalScroll && 'group_type_horizontal_scroll', wrapClass, borderColorClass, borderWidthClass, borderTypeClass),
|
|
276
291
|
id: id,
|
|
277
292
|
"data-tour": dataTour,
|
|
278
293
|
style: Object.assign({}, groupStyles, style)
|
package/dist/components/Text.js
CHANGED
|
@@ -9,7 +9,7 @@ var textColorHover = require('../constants/componentProps/textColorHover.js');
|
|
|
9
9
|
var size = require('../constants/componentProps/size.js');
|
|
10
10
|
var textStyle = require('../constants/componentProps/textStyle.js');
|
|
11
11
|
var textWeight = require('../constants/componentProps/textWeight.js');
|
|
12
|
-
var useStyles = require('../useStyles
|
|
12
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
13
13
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
14
14
|
require('lodash/camelCase');
|
|
15
15
|
require('lodash/maxBy');
|
|
@@ -27,60 +27,63 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
27
27
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
28
28
|
|
|
29
29
|
function Text(props) {
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
30
|
+
const {
|
|
31
|
+
after,
|
|
32
|
+
dataTour,
|
|
33
|
+
before,
|
|
34
|
+
children,
|
|
35
|
+
className,
|
|
36
|
+
cursor,
|
|
37
|
+
tag: Tag,
|
|
38
|
+
htmlFor,
|
|
39
|
+
type,
|
|
40
|
+
onClick
|
|
41
|
+
} = props;
|
|
42
|
+
const {
|
|
43
|
+
styles: textStyles
|
|
44
|
+
} = useStyles.useStyles(props);
|
|
45
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
43
46
|
prefix: 'text_size_',
|
|
44
47
|
propsKey: 'size'
|
|
45
48
|
});
|
|
46
|
-
|
|
49
|
+
const weightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
47
50
|
prefix: 'text-weight_',
|
|
48
51
|
propsKey: 'textWeight'
|
|
49
52
|
});
|
|
50
|
-
|
|
53
|
+
const textColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
51
54
|
prefix: 'text-color_',
|
|
52
55
|
propsKey: 'textColor'
|
|
53
56
|
});
|
|
54
|
-
|
|
57
|
+
const textColorActiveClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
55
58
|
prefix: 'text-color-active_',
|
|
56
59
|
propsKey: 'textColorActive'
|
|
57
60
|
});
|
|
58
|
-
|
|
61
|
+
const textColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
59
62
|
prefix: 'text-color_hover_',
|
|
60
63
|
propsKey: 'textColorHover'
|
|
61
64
|
});
|
|
62
|
-
|
|
65
|
+
const textGradientClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
63
66
|
prefix: 'text-gradient_',
|
|
64
67
|
propsKey: 'textColorGradient'
|
|
65
68
|
});
|
|
66
|
-
|
|
69
|
+
const textTruncateClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
67
70
|
prefix: 'text-truncate_',
|
|
68
71
|
propsKey: 'textTruncate'
|
|
69
72
|
});
|
|
70
|
-
|
|
73
|
+
const textStyleClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
71
74
|
prefix: 'text-style_',
|
|
72
75
|
propsKey: 'textStyle'
|
|
73
76
|
});
|
|
74
|
-
|
|
77
|
+
const textWrapClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
75
78
|
prefix: 'word-wrap_',
|
|
76
79
|
propsKey: 'textWrap'
|
|
77
80
|
});
|
|
78
|
-
|
|
81
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
79
82
|
prefix: 'width_',
|
|
80
83
|
propsKey: 'width'
|
|
81
84
|
});
|
|
82
85
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
83
|
-
className: clsx__default.default(className, 'text', sizeClass, weightClass, textColorClass, textColorActiveClass, textColorHoverClass, textGradientClass, textStyleClass, textTruncateClass, textWrapClass, type &&
|
|
86
|
+
className: clsx__default.default(className, 'text', sizeClass, weightClass, textColorClass, textColorActiveClass, textColorHoverClass, textGradientClass, textStyleClass, textTruncateClass, textWrapClass, type && `text_type_${type}`, widthClass, onClick && (cursor || 'cursor_type_pointer')),
|
|
84
87
|
"data-tour": dataTour,
|
|
85
88
|
htmlFor: htmlFor,
|
|
86
89
|
style: textStyles,
|
|
@@ -16,23 +16,25 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
16
16
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
17
17
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
const textareaConfig = {
|
|
20
20
|
state: {},
|
|
21
|
-
setState:
|
|
21
|
+
setState: newComponent => {
|
|
22
22
|
textareaConfig.state = newComponent;
|
|
23
23
|
}
|
|
24
24
|
};
|
|
25
25
|
function Textarea(props) {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
const {
|
|
27
|
+
state,
|
|
28
|
+
id,
|
|
29
|
+
className,
|
|
30
|
+
placeholder,
|
|
31
|
+
disabled,
|
|
32
|
+
value,
|
|
33
|
+
onBlur,
|
|
34
|
+
onChange,
|
|
35
|
+
onKeyDown
|
|
36
|
+
} = props;
|
|
37
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
36
38
|
prefix: 'fill_',
|
|
37
39
|
propsKey: 'fill'
|
|
38
40
|
});
|
|
@@ -40,39 +42,39 @@ function Textarea(props) {
|
|
|
40
42
|
prefix: 'border-color_',
|
|
41
43
|
propsKey: 'borderColor'
|
|
42
44
|
});
|
|
43
|
-
|
|
45
|
+
const borderColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
44
46
|
prefix: 'border-color_hover_',
|
|
45
47
|
propsKey: 'borderHover'
|
|
46
48
|
});
|
|
47
|
-
|
|
49
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
48
50
|
prefix: 'textarea_size_',
|
|
49
51
|
propsKey: 'size'
|
|
50
52
|
});
|
|
51
|
-
|
|
53
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
52
54
|
prefix: 'textarea_shape_',
|
|
53
55
|
propsKey: 'shape'
|
|
54
56
|
});
|
|
55
|
-
|
|
57
|
+
const textSizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
56
58
|
prefix: 'text_size_',
|
|
57
59
|
propsKey: 'size'
|
|
58
60
|
});
|
|
59
|
-
|
|
61
|
+
const textColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
60
62
|
prefix: 'text-color_',
|
|
61
63
|
propsKey: 'textColor'
|
|
62
64
|
});
|
|
63
|
-
|
|
65
|
+
const caretClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
64
66
|
prefix: 'caret-color_',
|
|
65
67
|
propsKey: 'caret'
|
|
66
68
|
});
|
|
67
|
-
|
|
69
|
+
const placeholderClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
68
70
|
prefix: 'placeholder-text-color_',
|
|
69
71
|
propsKey: 'placeholderTextColor'
|
|
70
72
|
});
|
|
71
|
-
|
|
73
|
+
const weightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
72
74
|
prefix: 'text-weight_',
|
|
73
75
|
propsKey: 'textWeight'
|
|
74
76
|
});
|
|
75
|
-
|
|
77
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
76
78
|
prefix: 'width_',
|
|
77
79
|
propsKey: 'width'
|
|
78
80
|
});
|
package/dist/components/Tile.js
CHANGED
|
@@ -14,7 +14,7 @@ var size = require('../constants/componentProps/size.js');
|
|
|
14
14
|
var textAlign = require('../constants/componentProps/textAlign.js');
|
|
15
15
|
var fill = require('../constants/componentProps/fill.js');
|
|
16
16
|
var shape = require('../constants/componentProps/shape.js');
|
|
17
|
-
var useStyles = require('../useStyles
|
|
17
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
18
18
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
19
19
|
require('../constants/componentProps/borderType.js');
|
|
20
20
|
require('../constants/componentProps/textColor.js');
|
|
@@ -47,64 +47,67 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
47
47
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
48
48
|
|
|
49
49
|
function Tile(props) {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
50
|
+
const {
|
|
51
|
+
children,
|
|
52
|
+
className,
|
|
53
|
+
badge,
|
|
54
|
+
badgeSize,
|
|
55
|
+
badgeType,
|
|
56
|
+
direction,
|
|
57
|
+
before,
|
|
58
|
+
after,
|
|
59
|
+
reverse,
|
|
60
|
+
size,
|
|
61
|
+
text,
|
|
62
|
+
textSize,
|
|
63
|
+
textWrap,
|
|
64
|
+
textColor,
|
|
65
|
+
title,
|
|
66
|
+
titleTextSize,
|
|
67
|
+
titleTextWrap,
|
|
68
|
+
titleTextColor,
|
|
69
|
+
titleTextWeight,
|
|
70
|
+
titleTextAlign,
|
|
71
|
+
type,
|
|
72
|
+
onClick
|
|
73
|
+
} = props;
|
|
74
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
73
75
|
prefix: 'fill_',
|
|
74
76
|
propsKey: 'fill'
|
|
75
77
|
});
|
|
76
|
-
|
|
78
|
+
const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
77
79
|
prefix: 'align_',
|
|
78
80
|
propsKey: 'alignDirection'
|
|
79
81
|
});
|
|
80
|
-
|
|
82
|
+
const alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
81
83
|
prefix: 'align_',
|
|
82
84
|
propsKey: 'align'
|
|
83
85
|
});
|
|
84
|
-
|
|
86
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
85
87
|
prefix: 'tile_shape_',
|
|
86
88
|
propsKey: 'shape'
|
|
87
89
|
});
|
|
88
|
-
|
|
90
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
89
91
|
prefix: 'border-color_',
|
|
90
92
|
propsKey: 'borderColor'
|
|
91
93
|
});
|
|
92
|
-
|
|
94
|
+
const borderColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
93
95
|
prefix: 'border-color_hover_',
|
|
94
96
|
propsKey: 'borderHover'
|
|
95
97
|
});
|
|
96
|
-
|
|
98
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
97
99
|
prefix: 'border-width_',
|
|
98
100
|
propsKey: 'borderWidth'
|
|
99
101
|
});
|
|
100
|
-
|
|
102
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
101
103
|
prefix: 'border-type_',
|
|
102
104
|
propsKey: 'borderType'
|
|
103
105
|
});
|
|
104
|
-
|
|
105
|
-
tileStyles
|
|
106
|
+
const {
|
|
107
|
+
styles: tileStyles
|
|
108
|
+
} = useStyles.useStyles(props);
|
|
106
109
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
107
|
-
className: clsx__default.default('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction &&
|
|
110
|
+
className: clsx__default.default('tile', className, fillClass, shapeClass, alignClass, alignDirectionClass, direction && `direction_${direction}`, borderColorClass, borderColorHoverClass, borderWidthClass, borderTypeClass, reverse && 'tile_reverse', size && `tile_size_${size}`, type && `tile_type_${type}`, badge && `tile_state_badge`),
|
|
108
111
|
style: tileStyles,
|
|
109
112
|
onClick: onClick
|
|
110
113
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|