@itcase/ui 1.0.42 → 1.0.44
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 -39
- 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 +35 -34
- package/dist/css/components/DatePicker/DatePicker.css +39 -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
|
@@ -9,7 +9,7 @@ var direction = require('../constants/componentProps/direction.js');
|
|
|
9
9
|
var shape = require('../constants/componentProps/shape.js');
|
|
10
10
|
var index = require('./Icon.js');
|
|
11
11
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
12
|
-
var useStyles = require('../useStyles
|
|
12
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
13
13
|
require('react-inlinesvg');
|
|
14
14
|
require('../constants/componentProps/iconSize.js');
|
|
15
15
|
require('../constants/componentProps/strokeColor.js');
|
|
@@ -50,7 +50,7 @@ ChevronDown16.defaultProps = {
|
|
|
50
50
|
fill: "none",
|
|
51
51
|
stroke: "none"
|
|
52
52
|
};
|
|
53
|
-
|
|
53
|
+
const icon16 = {
|
|
54
54
|
chevron_down: ChevronDown16
|
|
55
55
|
};
|
|
56
56
|
|
|
@@ -58,39 +58,42 @@ var icon16 = {
|
|
|
58
58
|
|
|
59
59
|
/* Component */
|
|
60
60
|
function AccordionItem(props) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
61
|
+
const {
|
|
62
|
+
children,
|
|
63
|
+
id,
|
|
64
|
+
title,
|
|
65
|
+
icon,
|
|
66
|
+
content,
|
|
67
|
+
beforeContent,
|
|
68
|
+
afterContent,
|
|
69
|
+
className,
|
|
70
|
+
isExpanded,
|
|
71
|
+
onClick
|
|
72
|
+
} = props;
|
|
73
|
+
const onClickTitle = React.useCallback(() => {
|
|
72
74
|
// !isExpanded - is next state of expanded
|
|
73
|
-
|
|
74
|
-
id
|
|
75
|
-
title
|
|
76
|
-
content
|
|
75
|
+
const thisItemData = {
|
|
76
|
+
id,
|
|
77
|
+
title,
|
|
78
|
+
content,
|
|
77
79
|
isExpanded: !isExpanded
|
|
78
80
|
};
|
|
79
81
|
onClick && onClick(thisItemData);
|
|
80
82
|
}, [onClick, id, title, content, isExpanded]);
|
|
81
|
-
|
|
83
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
82
84
|
prefix: 'fill_',
|
|
83
85
|
propsKey: 'fill'
|
|
84
86
|
});
|
|
85
|
-
|
|
87
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
86
88
|
prefix: 'accordion-item_shape_',
|
|
87
89
|
propsKey: 'shape'
|
|
88
90
|
});
|
|
89
|
-
|
|
91
|
+
const iconFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
90
92
|
propsKey: 'iconFill'
|
|
91
93
|
});
|
|
92
|
-
|
|
93
|
-
styles
|
|
94
|
+
const {
|
|
95
|
+
styles
|
|
96
|
+
} = useStyles.useStyles(props);
|
|
94
97
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
95
98
|
className: clsx__default.default('accordion-item', className, fillClass, shapeClass, isExpanded && 'accordion-item_state_open'),
|
|
96
99
|
style: styles
|
|
@@ -149,29 +152,25 @@ AccordionItem.propTypes = {
|
|
|
149
152
|
|
|
150
153
|
/* Component */
|
|
151
154
|
function Accordion(props) {
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
setExpandedItems(
|
|
163
|
-
|
|
164
|
-
return id === targetItem.id;
|
|
165
|
-
});
|
|
155
|
+
const {
|
|
156
|
+
children,
|
|
157
|
+
items,
|
|
158
|
+
className,
|
|
159
|
+
initial,
|
|
160
|
+
isMultiple,
|
|
161
|
+
onClickItem
|
|
162
|
+
} = props;
|
|
163
|
+
const [expandedItems, setExpandedItems] = React.useState(castArray__default.default(initial));
|
|
164
|
+
const onClickAccordionItem = React.useCallback(targetItem => {
|
|
165
|
+
setExpandedItems(prevState => {
|
|
166
|
+
const isExpanded = prevState.find(id => id === targetItem.id);
|
|
166
167
|
if (isMultiple) {
|
|
167
168
|
if (isExpanded) {
|
|
168
169
|
// ... without target id
|
|
169
|
-
return prevState.filter(
|
|
170
|
-
return id !== targetItem.id;
|
|
171
|
-
});
|
|
170
|
+
return prevState.filter(id => id !== targetItem.id);
|
|
172
171
|
} else {
|
|
173
172
|
// ... with target id
|
|
174
|
-
return [
|
|
173
|
+
return [...prevState, targetItem.id];
|
|
175
174
|
}
|
|
176
175
|
} else {
|
|
177
176
|
if (isExpanded) {
|
|
@@ -183,22 +182,20 @@ function Accordion(props) {
|
|
|
183
182
|
});
|
|
184
183
|
onClickItem && onClickItem(targetItem);
|
|
185
184
|
}, [onClickItem]);
|
|
186
|
-
|
|
185
|
+
const accordionItemsList = React.useMemo(() => {
|
|
187
186
|
if (items) {
|
|
188
|
-
return items.map(
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
});
|
|
197
|
-
});
|
|
187
|
+
return items.map((item, i) => /*#__PURE__*/React__default.default.createElement(AccordionItem, {
|
|
188
|
+
content: item.content,
|
|
189
|
+
id: item.id,
|
|
190
|
+
isExpanded: expandedItems.includes(item.id),
|
|
191
|
+
key: `accordionItem_${item.id || i + 1}`,
|
|
192
|
+
title: item.title,
|
|
193
|
+
onClick: onClickAccordionItem
|
|
194
|
+
}));
|
|
198
195
|
}
|
|
199
196
|
if (children) {
|
|
200
|
-
return React__default.default.Children.toArray(children).map(
|
|
201
|
-
|
|
197
|
+
return React__default.default.Children.toArray(children).map(child => {
|
|
198
|
+
const childID = child.props.id || child.key;
|
|
202
199
|
return /*#__PURE__*/React__default.default.cloneElement(child, {
|
|
203
200
|
// this properties are available as a props in child components
|
|
204
201
|
id: childID,
|
|
@@ -209,11 +206,11 @@ function Accordion(props) {
|
|
|
209
206
|
}
|
|
210
207
|
return [];
|
|
211
208
|
}, [children, items, expandedItems, onClickAccordionItem]);
|
|
212
|
-
|
|
209
|
+
const directionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
213
210
|
prefix: 'accordion_direction_',
|
|
214
211
|
propsKey: 'direction'
|
|
215
212
|
});
|
|
216
|
-
|
|
213
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
217
214
|
prefix: 'fill_',
|
|
218
215
|
propsKey: 'fill'
|
|
219
216
|
});
|
|
@@ -223,9 +220,10 @@ function Accordion(props) {
|
|
|
223
220
|
* paddingHorizontal - styles (horizontal will be parsed to left/right)
|
|
224
221
|
* wrapper - target
|
|
225
222
|
*/
|
|
226
|
-
|
|
227
|
-
accordionStyles
|
|
228
|
-
accordionWrapperStyles
|
|
223
|
+
const {
|
|
224
|
+
styles: accordionStyles,
|
|
225
|
+
wrapper: accordionWrapperStyles
|
|
226
|
+
} = useStyles.useStyles(props);
|
|
229
227
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
230
228
|
className: clsx__default.default(className, 'accordion', directionClass, fillClass),
|
|
231
229
|
style: accordionStyles
|
|
@@ -14,7 +14,7 @@ require('../constants/componentProps/resizeMode.js');
|
|
|
14
14
|
require('../constants/componentProps/shape.js');
|
|
15
15
|
require('../constants/componentProps/verticalContentAlign.js');
|
|
16
16
|
require('../constants/componentProps/width.js');
|
|
17
|
-
require('../useStyles
|
|
17
|
+
require('../hooks/useStyles.js');
|
|
18
18
|
require('lodash/camelCase');
|
|
19
19
|
require('lodash/maxBy');
|
|
20
20
|
require('lodash/upperFirst');
|
|
@@ -44,45 +44,47 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
44
44
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
45
45
|
|
|
46
46
|
function Avatar(props) {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
47
|
+
const {
|
|
48
|
+
className,
|
|
49
|
+
icon,
|
|
50
|
+
size,
|
|
51
|
+
after,
|
|
52
|
+
before,
|
|
53
|
+
src,
|
|
54
|
+
type,
|
|
55
|
+
onClick,
|
|
56
|
+
textSize,
|
|
57
|
+
textColor,
|
|
58
|
+
textWeight,
|
|
59
|
+
iconItemFill,
|
|
60
|
+
iconShape,
|
|
61
|
+
iconSize,
|
|
62
|
+
iconStroke,
|
|
63
|
+
iconFill,
|
|
64
|
+
iconFillHover,
|
|
65
|
+
iconFillSize,
|
|
66
|
+
firstName,
|
|
67
|
+
secondName
|
|
68
|
+
} = props;
|
|
69
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
68
70
|
prefix: 'fill_',
|
|
69
71
|
propsKey: 'fill'
|
|
70
72
|
});
|
|
71
|
-
|
|
73
|
+
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
72
74
|
prefix: 'fill_hover_',
|
|
73
75
|
propsKey: 'fillHover'
|
|
74
76
|
});
|
|
75
|
-
|
|
77
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
76
78
|
prefix: 'avatar_shape_',
|
|
77
79
|
propsKey: 'shape'
|
|
78
80
|
});
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
return
|
|
81
|
+
const avatarChars = React.useMemo(() => {
|
|
82
|
+
const firstChar = (firstName?.[0] || '').toUpperCase();
|
|
83
|
+
const secondChar = (secondName?.[0] || '').toUpperCase();
|
|
84
|
+
return `${firstChar}${secondChar}`;
|
|
83
85
|
}, [firstName, secondName]);
|
|
84
86
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
85
|
-
className: clsx__default.default(className, 'avatar', shapeClass, size &&
|
|
87
|
+
className: clsx__default.default(className, 'avatar', shapeClass, size && `avatar_size_${size}`, type && `avatar_type_${type}`, onClick && 'cursor_type_pointer'),
|
|
86
88
|
onClick: onClick
|
|
87
89
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
88
90
|
className: clsx__default.default('avatar__wrapper', fillClass, fillHoverClass)
|
|
@@ -7,7 +7,7 @@ var fill = require('../constants/componentProps/fill.js');
|
|
|
7
7
|
var shape = require('../constants/componentProps/shape.js');
|
|
8
8
|
var width = require('../constants/componentProps/width.js');
|
|
9
9
|
var position = require('../constants/componentProps/position.js');
|
|
10
|
-
var useStyles = require('../useStyles
|
|
10
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
11
11
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
12
12
|
require('lodash/camelCase');
|
|
13
13
|
require('lodash/maxBy');
|
|
@@ -25,38 +25,41 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
25
25
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
26
26
|
|
|
27
27
|
function Background(props) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const {
|
|
29
|
+
src,
|
|
30
|
+
className
|
|
31
|
+
} = props;
|
|
32
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
31
33
|
prefix: 'fill_',
|
|
32
34
|
propsKey: 'fill'
|
|
33
35
|
});
|
|
34
|
-
|
|
36
|
+
const positionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
35
37
|
prefix: 'position_',
|
|
36
38
|
propsKey: 'position'
|
|
37
39
|
});
|
|
38
|
-
|
|
40
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
39
41
|
prefix: 'backdround_shape_',
|
|
40
42
|
propsKey: 'shape'
|
|
41
43
|
});
|
|
42
|
-
|
|
44
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
43
45
|
prefix: 'width_',
|
|
44
46
|
propsKey: 'width'
|
|
45
47
|
});
|
|
46
|
-
|
|
48
|
+
const constraintsClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
47
49
|
prefix: 'constraints_',
|
|
48
50
|
propsKey: 'constraints'
|
|
49
51
|
});
|
|
50
|
-
|
|
52
|
+
const imageWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
51
53
|
prefix: 'width_',
|
|
52
54
|
propsKey: 'imageWidth'
|
|
53
55
|
});
|
|
54
|
-
|
|
56
|
+
const imageHeightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
55
57
|
prefix: 'height_',
|
|
56
58
|
propsKey: 'imageHeight'
|
|
57
59
|
});
|
|
58
|
-
|
|
59
|
-
backgroundStyles
|
|
60
|
+
const {
|
|
61
|
+
styles: backgroundStyles
|
|
62
|
+
} = useStyles.useStyles(props);
|
|
60
63
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
61
64
|
className: clsx__default.default(className, 'background', positionClass, widthClass, fillClass, shapeClass),
|
|
62
65
|
style: backgroundStyles
|
package/dist/components/Badge.js
CHANGED
|
@@ -14,7 +14,7 @@ require('../constants/componentProps/textColorActive.js');
|
|
|
14
14
|
require('../constants/componentProps/textColorHover.js');
|
|
15
15
|
require('../constants/componentProps/textStyle.js');
|
|
16
16
|
require('../constants/componentProps/textWeight.js');
|
|
17
|
-
require('../useStyles
|
|
17
|
+
require('../hooks/useStyles.js');
|
|
18
18
|
require('lodash/camelCase');
|
|
19
19
|
require('lodash/maxBy');
|
|
20
20
|
require('lodash/upperFirst');
|
|
@@ -31,28 +31,30 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
31
31
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
32
32
|
|
|
33
33
|
function Badge(props) {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
34
|
+
const {
|
|
35
|
+
className,
|
|
36
|
+
children,
|
|
37
|
+
textColor,
|
|
38
|
+
textSize,
|
|
39
|
+
value
|
|
40
|
+
} = props;
|
|
41
|
+
const borderClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
40
42
|
prefix: 'border-color_',
|
|
41
43
|
propsKey: 'border'
|
|
42
44
|
});
|
|
43
|
-
|
|
45
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
44
46
|
prefix: 'border_',
|
|
45
47
|
propsKey: 'borderType'
|
|
46
48
|
});
|
|
47
|
-
|
|
49
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
48
50
|
prefix: 'fill_',
|
|
49
51
|
propsKey: 'fill'
|
|
50
52
|
});
|
|
51
|
-
|
|
53
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
52
54
|
prefix: 'badge_size_',
|
|
53
55
|
propsKey: 'size'
|
|
54
56
|
});
|
|
55
|
-
|
|
57
|
+
const typeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
56
58
|
prefix: 'badge_type_',
|
|
57
59
|
propsKey: 'type'
|
|
58
60
|
});
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var useStyles = require('../useStyles-e4accb53.js');
|
|
4
3
|
var React = require('react');
|
|
5
4
|
var PropTypes = require('prop-types');
|
|
6
5
|
var clsx = require('clsx');
|
|
@@ -14,12 +13,7 @@ var index$2 = require('./Icon.js');
|
|
|
14
13
|
var index$1 = require('./Text.js');
|
|
15
14
|
var index = require('./Link.js');
|
|
16
15
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
17
|
-
require('
|
|
18
|
-
require('lodash/upperFirst');
|
|
19
|
-
require('../hooks/styleAttributes.js');
|
|
20
|
-
require('../context/UIContext.js');
|
|
21
|
-
require('../hooks/useMediaQueries.js');
|
|
22
|
-
require('react-responsive');
|
|
16
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
23
17
|
require('react-inlinesvg');
|
|
24
18
|
require('../constants/componentProps/iconSize.js');
|
|
25
19
|
require('../constants/componentProps/strokeColor.js');
|
|
@@ -31,6 +25,12 @@ require('../constants/componentProps/textWeight.js');
|
|
|
31
25
|
require('../constants/componentProps/type.js');
|
|
32
26
|
require('../constants/componentProps/underline.js');
|
|
33
27
|
require('lodash/castArray');
|
|
28
|
+
require('../context/UIContext.js');
|
|
29
|
+
require('../hooks/useMediaQueries.js');
|
|
30
|
+
require('react-responsive');
|
|
31
|
+
require('lodash/maxBy');
|
|
32
|
+
require('lodash/upperFirst');
|
|
33
|
+
require('../hooks/styleAttributes.js');
|
|
34
34
|
require('../constants/componentProps/textColorActive.js');
|
|
35
35
|
require('../constants/componentProps/textColorHover.js');
|
|
36
36
|
|
|
@@ -42,49 +42,52 @@ var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
|
42
42
|
var camelCase__default = /*#__PURE__*/_interopDefault(camelCase);
|
|
43
43
|
|
|
44
44
|
function BreadcrumbsItem(props) {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
45
|
+
const {
|
|
46
|
+
children,
|
|
47
|
+
className,
|
|
48
|
+
set,
|
|
49
|
+
text,
|
|
50
|
+
href,
|
|
51
|
+
iconAfter,
|
|
52
|
+
iconAfterSize,
|
|
53
|
+
iconAfterBgFill,
|
|
54
|
+
iconAfterFill,
|
|
55
|
+
iconAfterStroke,
|
|
56
|
+
underline,
|
|
57
|
+
onClick
|
|
58
|
+
} = props;
|
|
59
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
58
60
|
prefix: 'fill_',
|
|
59
61
|
propsKey: 'fill'
|
|
60
62
|
});
|
|
61
|
-
|
|
63
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
62
64
|
prefix: 'breadcrumbs__item_shape_',
|
|
63
65
|
propsKey: 'shape'
|
|
64
66
|
});
|
|
65
|
-
|
|
67
|
+
const positionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
66
68
|
prefix: 'position_',
|
|
67
69
|
propsKey: 'position'
|
|
68
70
|
});
|
|
69
|
-
|
|
71
|
+
const textSize = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
70
72
|
propsKey: 'textSize'
|
|
71
73
|
});
|
|
72
|
-
|
|
74
|
+
const textColor = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
73
75
|
propsKey: 'textColor'
|
|
74
76
|
});
|
|
75
|
-
|
|
77
|
+
const textColorHover = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
76
78
|
propsKey: 'textColorHover'
|
|
77
79
|
});
|
|
78
|
-
|
|
80
|
+
const underlineClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
79
81
|
prefix: 'text-decoration_',
|
|
80
82
|
propsKey: 'underline'
|
|
81
83
|
});
|
|
82
|
-
|
|
83
|
-
itemStyles
|
|
84
|
+
const {
|
|
85
|
+
styles: itemStyles
|
|
86
|
+
} = useStyles.useStyles(props);
|
|
84
87
|
return /*#__PURE__*/React__default.default.createElement(index.LinkWrapper, {
|
|
85
88
|
href: href,
|
|
86
89
|
DefaultComponent: "div",
|
|
87
|
-
className: clsx__default.default(className, 'breadcrumbs__item', set &&
|
|
90
|
+
className: clsx__default.default(className, 'breadcrumbs__item', set && `breadcrumbs__item_set_${set}`, fillClass, positionClass, shapeClass, underlineClass),
|
|
88
91
|
style: itemStyles,
|
|
89
92
|
onClick: onClick
|
|
90
93
|
}, /*#__PURE__*/React__default.default.createElement(index$1.Text, {
|
|
@@ -128,77 +131,75 @@ BreadcrumbsItem.defaultProps = {
|
|
|
128
131
|
set: 'default'
|
|
129
132
|
};
|
|
130
133
|
|
|
131
|
-
var _excluded = ["breadcrumbsList", "children", "className", "iconAfterSize", "iconAfterBgFill", "iconAfterFill", "iconAfterStroke", "itemUnderline", "itemTextColor", "itemTextColorHover", "set"];
|
|
132
134
|
function Breadcrumbs(props) {
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
135
|
+
const {
|
|
136
|
+
breadcrumbsList,
|
|
137
|
+
children,
|
|
138
|
+
className,
|
|
139
|
+
iconAfterSize,
|
|
140
|
+
iconAfterBgFill,
|
|
141
|
+
iconAfterFill,
|
|
142
|
+
iconAfterStroke,
|
|
143
|
+
itemUnderline,
|
|
144
|
+
itemTextColor,
|
|
145
|
+
itemTextColorHover,
|
|
146
|
+
set,
|
|
147
|
+
...otherProps
|
|
148
|
+
} = props;
|
|
149
|
+
const breadcrumbsItemsList = React.useMemo(() => {
|
|
146
150
|
if (breadcrumbsList) {
|
|
147
|
-
|
|
148
|
-
var key = _ref[0],
|
|
149
|
-
value = _ref[1];
|
|
151
|
+
const itemProps = Object.entries(otherProps).reduce((collectedProps, [key, value]) => {
|
|
150
152
|
if (key.startsWith('item')) {
|
|
151
|
-
|
|
153
|
+
const propKey = camelCase__default.default(key.replace('item', ''));
|
|
152
154
|
collectedProps[propKey] = value;
|
|
153
155
|
}
|
|
154
156
|
return collectedProps;
|
|
155
157
|
}, {});
|
|
156
|
-
return breadcrumbsList.map(
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}, itemProps));
|
|
171
|
-
});
|
|
158
|
+
return breadcrumbsList.map((item, i) => /*#__PURE__*/React__default.default.createElement(BreadcrumbsItem, Object.assign({
|
|
159
|
+
key: `breadcrumbsItem_${item.id || item.text}`,
|
|
160
|
+
set: i + 1 !== breadcrumbsList.length ? 'default' : 'current',
|
|
161
|
+
iconAfter: i + 1 !== breadcrumbsList.length ? itemProps.iconAfter : null,
|
|
162
|
+
iconAfterSize: iconAfterSize,
|
|
163
|
+
iconAfterBgFill: iconAfterBgFill,
|
|
164
|
+
iconAfterFill: iconAfterFill,
|
|
165
|
+
iconAfterStroke: iconAfterStroke,
|
|
166
|
+
text: item.text,
|
|
167
|
+
textColor: itemTextColor,
|
|
168
|
+
textColorHover: itemTextColorHover,
|
|
169
|
+
underline: itemUnderline,
|
|
170
|
+
href: item.href
|
|
171
|
+
}, itemProps)));
|
|
172
172
|
}
|
|
173
173
|
if (children) {
|
|
174
174
|
return children;
|
|
175
175
|
}
|
|
176
176
|
return [];
|
|
177
177
|
}, [children, breadcrumbsList, otherProps]);
|
|
178
|
-
|
|
178
|
+
const directionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
179
179
|
prefix: 'direction_',
|
|
180
180
|
propsKey: 'direction'
|
|
181
181
|
});
|
|
182
|
-
|
|
182
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
183
183
|
prefix: 'fill_',
|
|
184
184
|
propsKey: 'fill'
|
|
185
185
|
});
|
|
186
|
-
|
|
186
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
187
187
|
prefix: 'breadcrumbs_shape_',
|
|
188
188
|
propsKey: 'shape'
|
|
189
189
|
});
|
|
190
|
-
|
|
190
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
191
191
|
prefix: 'width_',
|
|
192
192
|
propsKey: 'width'
|
|
193
193
|
});
|
|
194
|
-
|
|
194
|
+
const positionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
195
195
|
prefix: 'position_',
|
|
196
196
|
propsKey: 'position'
|
|
197
197
|
});
|
|
198
|
-
|
|
199
|
-
breadcrumbsStyles
|
|
198
|
+
const {
|
|
199
|
+
styles: breadcrumbsStyles
|
|
200
|
+
} = useStyles.useStyles(props);
|
|
200
201
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
201
|
-
className: clsx__default.default(className, 'breadcrumbs', widthClass, directionClass, fillClass, positionClass, shapeClass, set &&
|
|
202
|
+
className: clsx__default.default(className, 'breadcrumbs', widthClass, directionClass, fillClass, positionClass, shapeClass, set && `breadcrumbs_set_${set}`),
|
|
202
203
|
style: breadcrumbsStyles
|
|
203
204
|
}, breadcrumbsItemsList);
|
|
204
205
|
}
|