@itcase/ui 1.0.43 → 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 -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 +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
|
@@ -15,7 +15,7 @@ var textStyle = require('../constants/componentProps/textStyle.js');
|
|
|
15
15
|
var textWeight = require('../constants/componentProps/textWeight.js');
|
|
16
16
|
var type = require('../constants/componentProps/type.js');
|
|
17
17
|
var underline = require('../constants/componentProps/underline.js');
|
|
18
|
-
var useStyles = require('../useStyles
|
|
18
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
19
19
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
20
20
|
var size = require('../constants/componentProps/size.js');
|
|
21
21
|
require('lodash/camelCase');
|
|
@@ -33,104 +33,107 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
33
33
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
34
34
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
const menuItemConfig = {
|
|
37
37
|
appearance: {},
|
|
38
|
-
setAppearance:
|
|
38
|
+
setAppearance: newComponent => {
|
|
39
39
|
menuItemConfig.appearance = newComponent;
|
|
40
40
|
}
|
|
41
41
|
};
|
|
42
42
|
function MenuItem(props) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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
|
-
|
|
43
|
+
const {
|
|
44
|
+
isActive,
|
|
45
|
+
isHover,
|
|
46
|
+
appearance,
|
|
47
|
+
after,
|
|
48
|
+
before,
|
|
49
|
+
children,
|
|
50
|
+
className,
|
|
51
|
+
href,
|
|
52
|
+
link,
|
|
53
|
+
set,
|
|
54
|
+
rel,
|
|
55
|
+
desc,
|
|
56
|
+
descTextGradient,
|
|
57
|
+
descTextSize,
|
|
58
|
+
descTextWeight,
|
|
59
|
+
descTextColor,
|
|
60
|
+
descTextWrap,
|
|
61
|
+
descTextColorHover,
|
|
62
|
+
descTextStyle,
|
|
63
|
+
label,
|
|
64
|
+
target,
|
|
65
|
+
textColor,
|
|
66
|
+
textColorHover,
|
|
67
|
+
textColorActive,
|
|
68
|
+
textGradient,
|
|
69
|
+
textSize,
|
|
70
|
+
textWrap,
|
|
71
|
+
textStyle,
|
|
72
|
+
textWeight,
|
|
73
|
+
underline,
|
|
74
|
+
onClick,
|
|
75
|
+
onMouseEnter
|
|
76
|
+
} = props;
|
|
77
|
+
const alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
76
78
|
prefix: 'align_',
|
|
77
79
|
propsKey: 'alignDirection'
|
|
78
80
|
});
|
|
79
|
-
|
|
81
|
+
const alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
80
82
|
prefix: 'align_',
|
|
81
83
|
propsKey: 'align'
|
|
82
84
|
});
|
|
83
|
-
|
|
85
|
+
const directionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
84
86
|
prefix: 'menu-item_direction_',
|
|
85
87
|
propsKey: 'direction'
|
|
86
88
|
});
|
|
87
|
-
|
|
89
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
88
90
|
prefix: 'fill_',
|
|
89
91
|
propsKey: 'fill'
|
|
90
92
|
});
|
|
91
|
-
|
|
93
|
+
const fillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
92
94
|
prefix: 'fill_hover_',
|
|
93
95
|
propsKey: 'fillHover'
|
|
94
96
|
});
|
|
95
|
-
|
|
97
|
+
const fillActiveClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
96
98
|
prefix: 'fill_active_',
|
|
97
99
|
propsKey: 'fillActive'
|
|
98
100
|
});
|
|
99
|
-
|
|
101
|
+
const fillActiveHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
100
102
|
prefix: 'fill_active_hover_',
|
|
101
103
|
propsKey: 'fillActiveHover'
|
|
102
104
|
});
|
|
103
|
-
|
|
105
|
+
const fillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
104
106
|
prefix: 'fill_disabled_',
|
|
105
107
|
propsKey: 'fillDisabled'
|
|
106
108
|
});
|
|
107
|
-
|
|
109
|
+
const linkFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
108
110
|
propsKey: 'linkFill'
|
|
109
111
|
});
|
|
110
|
-
|
|
112
|
+
const sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
111
113
|
prefix: 'menu-item_size_',
|
|
112
114
|
propsKey: 'size'
|
|
113
115
|
});
|
|
114
|
-
|
|
116
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
115
117
|
prefix: 'menu-item_shape_',
|
|
116
118
|
propsKey: 'shape'
|
|
117
119
|
});
|
|
118
|
-
|
|
120
|
+
const justifyContentClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
119
121
|
prefix: 'menu-item_justify-content_',
|
|
120
122
|
propsKey: 'justifyContent'
|
|
121
123
|
});
|
|
122
|
-
|
|
124
|
+
const typeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
123
125
|
prefix: 'menu-item_type_',
|
|
124
126
|
propsKey: 'type'
|
|
125
127
|
});
|
|
126
|
-
|
|
128
|
+
const widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
127
129
|
prefix: 'width_',
|
|
128
130
|
propsKey: 'width'
|
|
129
131
|
});
|
|
130
|
-
|
|
131
|
-
menuItem
|
|
132
|
+
const {
|
|
133
|
+
styles: menuItem
|
|
134
|
+
} = useStyles.useStyles(props);
|
|
132
135
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
133
|
-
className: clsx__default.default('menu-item', isActive && 'menu-item_state_active', isHover && 'menu-item_state_hover', directionClass, className, sizeClass, fillClass || appearance &&
|
|
136
|
+
className: clsx__default.default('menu-item', isActive && 'menu-item_state_active', isHover && 'menu-item_state_hover', directionClass, className, sizeClass, fillClass || appearance && `fill_${menuItemConfig.appearance[appearance].fillClass}`.replace(/([A-Z])/g, '-$1').toLowerCase(), fillHoverClass, fillActiveClass, fillActiveHoverClass, fillDisabledClass, shapeClass, typeClass, widthClass, set && `menu-item_set_${set}`, justifyContentClass),
|
|
134
137
|
style: menuItem,
|
|
135
138
|
onClick: onClick,
|
|
136
139
|
onMouseEnter: onMouseEnter
|
package/dist/components/Modal.js
CHANGED
|
@@ -5,7 +5,7 @@ var PropTypes = require('prop-types');
|
|
|
5
5
|
var ReactDOM = require('react-dom');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var index = require('./Fader.js');
|
|
8
|
-
var useStyles = require('../useStyles
|
|
8
|
+
var useStyles = require('../hooks/useStyles.js');
|
|
9
9
|
var useDeviceTargetClass = require('../hooks/useDeviceTargetClass.js');
|
|
10
10
|
var index$1 = require('./Loader.js');
|
|
11
11
|
require('../constants/componentProps/fill.js');
|
|
@@ -33,21 +33,17 @@ var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
|
33
33
|
var ReactDOM__default = /*#__PURE__*/_interopDefault(ReactDOM);
|
|
34
34
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
if (className === void 0) {
|
|
38
|
-
className = '';
|
|
39
|
-
}
|
|
36
|
+
const getOrCreateModalElement = (modalQuerySelector, className = '') => {
|
|
40
37
|
// prettier-ignore
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
const classList = className && typeof className === 'string' ? className.split(' ').filter(Boolean) : [];
|
|
39
|
+
let modalElement = document.querySelector(modalQuerySelector);
|
|
43
40
|
if (!modalElement) {
|
|
44
41
|
// Add modal element into the DOM on mount.
|
|
45
42
|
modalElement = document.createElement('div');
|
|
46
43
|
modalElement.setAttribute('id', 'modal-global');
|
|
47
44
|
modalElement.classList.add('modal');
|
|
48
45
|
if (classList.length) {
|
|
49
|
-
|
|
50
|
-
(_modalElement$classLi = modalElement.classList).add.apply(_modalElement$classLi, classList);
|
|
46
|
+
modalElement.classList.add(...classList);
|
|
51
47
|
}
|
|
52
48
|
document.body.prepend(modalElement);
|
|
53
49
|
}
|
|
@@ -55,41 +51,39 @@ var getOrCreateModalElement = function getOrCreateModalElement(modalQuerySelecto
|
|
|
55
51
|
};
|
|
56
52
|
|
|
57
53
|
// Modal component that is an abstraction around the portal API.
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
54
|
+
const Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(props, ref) {
|
|
55
|
+
const {
|
|
56
|
+
children,
|
|
57
|
+
className,
|
|
58
|
+
closeButton,
|
|
59
|
+
contentClassName,
|
|
60
|
+
id,
|
|
61
|
+
isFader,
|
|
62
|
+
faderFill,
|
|
63
|
+
faderFillGradient,
|
|
64
|
+
faderOpacity,
|
|
65
|
+
isOpen: initialIsOpen,
|
|
66
|
+
isScrollOnOpen,
|
|
67
|
+
isSetFocusOnOpen,
|
|
68
|
+
modalQuerySelector,
|
|
69
|
+
isOutsideClose,
|
|
70
|
+
onCloseModal,
|
|
71
|
+
onOpenModal
|
|
72
|
+
} = props;
|
|
75
73
|
|
|
76
74
|
// Query DOM element
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
React.useLayoutEffect(function () {
|
|
81
|
-
var element = getOrCreateModalElement(modalQuerySelector, className);
|
|
75
|
+
const [modalElement, setModalElement] = React.useState(null);
|
|
76
|
+
React.useLayoutEffect(() => {
|
|
77
|
+
const element = getOrCreateModalElement(modalQuerySelector, className);
|
|
82
78
|
setModalElement(element);
|
|
83
79
|
if (element) {
|
|
84
80
|
addModalProps(element);
|
|
85
81
|
}
|
|
86
82
|
}, []);
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
setIsOpen = _useState2[1];
|
|
92
|
-
var addModalProps = React.useCallback(function (element) {
|
|
83
|
+
const modalContentRef = React.useRef(null);
|
|
84
|
+
const modalFaderRef = React.useRef(null);
|
|
85
|
+
const [isOpen, setIsOpen] = React.useState(initialIsOpen);
|
|
86
|
+
const addModalProps = React.useCallback(element => {
|
|
93
87
|
// Change class need in "useEffect"
|
|
94
88
|
if (isOpen) {
|
|
95
89
|
// Show modal
|
|
@@ -106,16 +100,14 @@ var Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(props,
|
|
|
106
100
|
// "setTimeout" in this implementation is needs for set focus on modal
|
|
107
101
|
// after "onMouseDown" event on button
|
|
108
102
|
if (isSetFocusOnOpen) {
|
|
109
|
-
setTimeout(
|
|
110
|
-
return modalContentRef.current.focus();
|
|
111
|
-
}, 0);
|
|
103
|
+
setTimeout(() => modalContentRef.current.focus(), 0);
|
|
112
104
|
}
|
|
113
105
|
} else if (!element.children.length) {
|
|
114
106
|
// Hide modal if has no children
|
|
115
107
|
element.classList.remove('modal_state_visible');
|
|
116
108
|
}
|
|
117
109
|
}, [isOpen, isSetFocusOnOpen]);
|
|
118
|
-
React.useEffect(
|
|
110
|
+
React.useEffect(() => {
|
|
119
111
|
if (!modalElement) {
|
|
120
112
|
return;
|
|
121
113
|
}
|
|
@@ -123,7 +115,7 @@ var Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(props,
|
|
|
123
115
|
}, [isOpen]); // eslint-disable-line
|
|
124
116
|
|
|
125
117
|
// Show modal with children content
|
|
126
|
-
|
|
118
|
+
const openModal = React.useCallback(() => {
|
|
127
119
|
setIsOpen(true);
|
|
128
120
|
|
|
129
121
|
// Callback
|
|
@@ -147,11 +139,8 @@ var Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(props,
|
|
|
147
139
|
}, [onOpenModal]);
|
|
148
140
|
|
|
149
141
|
// Hide modal and unmount children content
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
event = {};
|
|
153
|
-
}
|
|
154
|
-
var hasRelatedTarget = event.relatedTarget && modalElement.contains(event.relatedTarget);
|
|
142
|
+
const closeModal = React.useCallback((event = {}) => {
|
|
143
|
+
const hasRelatedTarget = event.relatedTarget && modalElement.contains(event.relatedTarget);
|
|
155
144
|
if (hasRelatedTarget) {
|
|
156
145
|
return event;
|
|
157
146
|
}
|
|
@@ -164,40 +153,39 @@ var Modal = /*#__PURE__*/React__default.default.forwardRef(function Modal(props,
|
|
|
164
153
|
}, [modalElement, onCloseModal]);
|
|
165
154
|
|
|
166
155
|
// Save ref things
|
|
167
|
-
React.useImperativeHandle(ref,
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
});
|
|
175
|
-
var contentFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
156
|
+
React.useImperativeHandle(ref, () => ({
|
|
157
|
+
isOpen,
|
|
158
|
+
openModal,
|
|
159
|
+
closeModal,
|
|
160
|
+
modalElement
|
|
161
|
+
}));
|
|
162
|
+
const contentFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
176
163
|
prefix: 'fill_',
|
|
177
164
|
propsKey: 'contentFill'
|
|
178
165
|
});
|
|
179
|
-
|
|
166
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
180
167
|
prefix: 'modal-shape_',
|
|
181
168
|
propsKey: 'shape'
|
|
182
169
|
});
|
|
183
|
-
|
|
170
|
+
const borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
184
171
|
prefix: 'border-color_',
|
|
185
172
|
propsKey: 'borderColor'
|
|
186
173
|
});
|
|
187
|
-
|
|
174
|
+
const borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
188
175
|
prefix: 'border-width_',
|
|
189
176
|
propsKey: 'borderWidth'
|
|
190
177
|
});
|
|
191
|
-
|
|
178
|
+
const borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
192
179
|
prefix: 'border-type_',
|
|
193
180
|
propsKey: 'borderType'
|
|
194
181
|
});
|
|
195
|
-
|
|
182
|
+
const elevationClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
196
183
|
prefix: 'elevation_',
|
|
197
184
|
propsKey: 'elevation'
|
|
198
185
|
});
|
|
199
|
-
|
|
200
|
-
modalStyles
|
|
186
|
+
const {
|
|
187
|
+
styles: modalStyles
|
|
188
|
+
} = useStyles.useStyles(props);
|
|
201
189
|
|
|
202
190
|
// Use a portal to render the children into the element
|
|
203
191
|
return modalElement && /*#__PURE__*/ReactDOM__default.default.createPortal(
|
|
@@ -13,7 +13,7 @@ require('../constants/componentProps/textColorHover.js');
|
|
|
13
13
|
require('../constants/componentProps/size.js');
|
|
14
14
|
require('../constants/componentProps/textStyle.js');
|
|
15
15
|
require('../constants/componentProps/textWeight.js');
|
|
16
|
-
require('../useStyles
|
|
16
|
+
require('../hooks/useStyles.js');
|
|
17
17
|
require('lodash/camelCase');
|
|
18
18
|
require('lodash/maxBy');
|
|
19
19
|
require('lodash/upperFirst');
|
|
@@ -36,33 +36,35 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
36
36
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
37
37
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
const notificationItemConfig = {
|
|
40
40
|
appearance: {},
|
|
41
|
-
setAppearance:
|
|
41
|
+
setAppearance: newComponent => {
|
|
42
42
|
notificationItemConfig.appearance = newComponent;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
function NotificationItem(props) {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
46
|
+
const {
|
|
47
|
+
appearance,
|
|
48
|
+
after,
|
|
49
|
+
before,
|
|
50
|
+
set,
|
|
51
|
+
status,
|
|
52
|
+
size,
|
|
53
|
+
dataTour,
|
|
54
|
+
text,
|
|
55
|
+
textSize,
|
|
56
|
+
textColor,
|
|
57
|
+
title,
|
|
58
|
+
titleTextSize,
|
|
59
|
+
titleTextColor,
|
|
60
|
+
className
|
|
61
|
+
} = props;
|
|
62
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
61
63
|
prefix: 'fill_',
|
|
62
64
|
propsKey: 'fill'
|
|
63
65
|
});
|
|
64
66
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
65
|
-
className: clsx__default.default('notification__item', status &&
|
|
67
|
+
className: clsx__default.default('notification__item', status && `notification__item_status_${status}`, set && `notification__item_set_${set}`, size && `notification__item_set_${size}`, fillClass || notificationItemConfig.appearance[appearance] && `fill_${notificationItemConfig.appearance[appearance].fillClass}`.replace(/([A-Z])/g, '-$1').toLowerCase()),
|
|
66
68
|
"data-tour": dataTour
|
|
67
69
|
}, before, /*#__PURE__*/React__default.default.createElement("div", {
|
|
68
70
|
className: clsx__default.default(className, 'notification__item-wrapper')
|
|
@@ -92,29 +94,30 @@ NotificationItem.defaultProps = {
|
|
|
92
94
|
};
|
|
93
95
|
|
|
94
96
|
function NotificationList(props) {
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
hideNotifications
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
97
|
+
const notifications = Notifications.useNotifications();
|
|
98
|
+
const {
|
|
99
|
+
hideNotifications
|
|
100
|
+
} = Notifications.useNotificationsAPI();
|
|
101
|
+
const {
|
|
102
|
+
className,
|
|
103
|
+
size,
|
|
104
|
+
type,
|
|
105
|
+
set
|
|
106
|
+
} = props;
|
|
102
107
|
return /*#__PURE__*/React__default.default.createElement("div", {
|
|
103
108
|
className: clsx__default.default('notification', className)
|
|
104
109
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
105
110
|
className: "notification__wrapper"
|
|
106
|
-
}, notifications.map(
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
});
|
|
117
|
-
})));
|
|
111
|
+
}, notifications.map((notification, i) => /*#__PURE__*/React__default.default.createElement(NotificationItem, {
|
|
112
|
+
key: i,
|
|
113
|
+
type: notification.type || type,
|
|
114
|
+
set: notification.set || set,
|
|
115
|
+
size: notification.size || size,
|
|
116
|
+
title: notification.title,
|
|
117
|
+
text: notification.text,
|
|
118
|
+
status: notification.status,
|
|
119
|
+
onClick: hideNotifications
|
|
120
|
+
}))));
|
|
118
121
|
}
|
|
119
122
|
NotificationList.propTypes = {
|
|
120
123
|
className: PropTypes__default.default.string,
|
|
@@ -20,24 +20,26 @@ var ceil__default = /*#__PURE__*/_interopDefault(ceil);
|
|
|
20
20
|
var ReactPaginate__default = /*#__PURE__*/_interopDefault(ReactPaginate);
|
|
21
21
|
|
|
22
22
|
function Pagination(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
23
|
+
const {
|
|
24
|
+
pageNumber,
|
|
25
|
+
perPageCount,
|
|
26
|
+
allItemsCount,
|
|
27
|
+
className,
|
|
28
|
+
forcePage,
|
|
29
|
+
pageCount,
|
|
30
|
+
marginPagesDisplayed,
|
|
31
|
+
pageRangeDisplayed,
|
|
32
|
+
previousLabel,
|
|
33
|
+
nextLabel,
|
|
34
|
+
onPageChange
|
|
35
|
+
} = props;
|
|
36
|
+
const justifyContentClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
35
37
|
prefix: 'pagination_justify-content_',
|
|
36
38
|
propsKey: 'justifyContent'
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
// Calculate count of pages for all items
|
|
40
|
-
|
|
42
|
+
const paginationPagesCount = React.useMemo(() => {
|
|
41
43
|
if (allItemsCount && allItemsCount > 0) {
|
|
42
44
|
// Round up. "perPageCount" may be is a query params "limit"
|
|
43
45
|
return ceil__default.default(allItemsCount / perPageCount);
|
|
@@ -46,8 +48,8 @@ function Pagination(props) {
|
|
|
46
48
|
}, [allItemsCount, perPageCount]);
|
|
47
49
|
|
|
48
50
|
// Index for pagination state
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const paginationPageIndex = React.useMemo(() => {
|
|
52
|
+
const intPageNumber = parseInt(pageNumber);
|
|
51
53
|
// For pagination need index of page, not number
|
|
52
54
|
if (!isNaN(intPageNumber) && intPageNumber > 1) {
|
|
53
55
|
return intPageNumber - 1;
|
|
@@ -11,7 +11,7 @@ require('../constants/componentProps/textColorHover.js');
|
|
|
11
11
|
require('../constants/componentProps/size.js');
|
|
12
12
|
require('../constants/componentProps/textStyle.js');
|
|
13
13
|
require('../constants/componentProps/textWeight.js');
|
|
14
|
-
require('../useStyles
|
|
14
|
+
require('../hooks/useStyles.js');
|
|
15
15
|
require('lodash/camelCase');
|
|
16
16
|
require('lodash/maxBy');
|
|
17
17
|
require('lodash/upperFirst');
|
|
@@ -27,71 +27,73 @@ var React__default = /*#__PURE__*/_interopDefault(React);
|
|
|
27
27
|
var PropTypes__default = /*#__PURE__*/_interopDefault(PropTypes);
|
|
28
28
|
var clsx__default = /*#__PURE__*/_interopDefault(clsx);
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
const radioButtonConfig = {
|
|
31
31
|
state: {},
|
|
32
|
-
setState:
|
|
32
|
+
setState: newComponent => {
|
|
33
33
|
radioButtonConfig.state = newComponent;
|
|
34
34
|
}
|
|
35
35
|
};
|
|
36
36
|
function RadioButton(props) {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
const {
|
|
38
|
+
state,
|
|
39
|
+
id,
|
|
40
|
+
className,
|
|
41
|
+
checked,
|
|
42
|
+
onChange,
|
|
43
|
+
disabled,
|
|
44
|
+
descTextSize,
|
|
45
|
+
descTextWidth,
|
|
46
|
+
descTextColor,
|
|
47
|
+
desc,
|
|
48
|
+
label,
|
|
49
|
+
labelTextSize,
|
|
50
|
+
labelTextWidth,
|
|
51
|
+
labelTextColor,
|
|
52
|
+
tag: Tag
|
|
53
|
+
} = props;
|
|
54
|
+
const fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
53
55
|
prefix: 'fill_',
|
|
54
56
|
propsKey: 'fill'
|
|
55
57
|
});
|
|
56
|
-
|
|
58
|
+
const shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
57
59
|
prefix: 'radio-button_shape_',
|
|
58
60
|
propsKey: 'shape'
|
|
59
61
|
});
|
|
60
|
-
|
|
62
|
+
const stateShapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
61
63
|
prefix: 'radio-button__state_shape_',
|
|
62
64
|
propsKey: 'stateShape'
|
|
63
65
|
});
|
|
64
|
-
|
|
66
|
+
const stateFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
65
67
|
prefix: 'fill_',
|
|
66
68
|
propsKey: checked ? 'stateFillChecked' : 'stateFill'
|
|
67
69
|
});
|
|
68
|
-
|
|
70
|
+
const stateFillDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
69
71
|
prefix: 'fill_',
|
|
70
72
|
propsKey: checked ? 'stateFillDisabledChecked' : 'stateFillDisabled'
|
|
71
73
|
});
|
|
72
|
-
|
|
74
|
+
const stateCheckmarkFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
73
75
|
prefix: 'radio-button_checkmark_fill_',
|
|
74
76
|
propsKey: disabled ? 'stateCheckmarkFillDisabled' : 'stateCheckmarkFill'
|
|
75
77
|
});
|
|
76
|
-
|
|
78
|
+
const stateBorderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
77
79
|
prefix: 'border-width_',
|
|
78
80
|
propsKey: 'stateBorderWidth'
|
|
79
81
|
});
|
|
80
|
-
|
|
82
|
+
const stateBorderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
81
83
|
prefix: 'border-color_',
|
|
82
84
|
propsKey: checked ? 'stateBorderColorChecked' : 'stateBorderColor'
|
|
83
85
|
});
|
|
84
|
-
|
|
86
|
+
const stateBorderColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
85
87
|
prefix: 'border-color_hover_',
|
|
86
88
|
propsKey: checked ? 'stateBorderColorHoverChecked' : 'stateBorderColorHover'
|
|
87
89
|
});
|
|
88
|
-
|
|
90
|
+
const stateBorderColorDisabledClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
89
91
|
prefix: 'border-color_',
|
|
90
92
|
propsKey: checked ? 'stateBorderColorDisabledChecked' : 'stateBorderColorDisabled'
|
|
91
93
|
});
|
|
92
94
|
return /*#__PURE__*/React__default.default.createElement(Tag, {
|
|
93
95
|
htmlFor: id,
|
|
94
|
-
|
|
96
|
+
class: clsx__default.default(className, 'radio-button', fillClass, shapeClass)
|
|
95
97
|
}, /*#__PURE__*/React__default.default.createElement("div", {
|
|
96
98
|
className: clsx__default.default('radio-button__item', stateCheckmarkFillClass)
|
|
97
99
|
}, /*#__PURE__*/React__default.default.createElement("input", {
|