hrm_ui_lib 1.3.5 → 1.3.6
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/Button-dee36459.js +430 -0
- package/components/Alert/Alert.js +12 -7
- package/components/Alert/index.js +11 -6
- package/components/Avatar/Avatar.js +13 -8
- package/components/Avatar/AvatarGroup.js +8 -4
- package/components/Avatar/index.js +13 -9
- package/components/Button/Button.js +19 -66
- package/components/Button/index.js +13 -8
- package/components/ButtonIcon/ButtonIcon.js +18 -48
- package/components/ButtonIcon/index.js +16 -10
- package/components/CardBody/CardBody.js +11 -6
- package/components/CardBody/index.js +11 -6
- package/components/CardSelect/CardSelect.js +13 -5
- package/components/CardSelect/CardSelectGroup.js +13 -5
- package/components/CardSelect/components/CardInput.js +13 -5
- package/components/CardSelect/components/index.js +13 -5
- package/components/CardSelect/index.js +13 -5
- package/components/Checkbox/Checkbox.js +21 -123
- package/components/Checkbox/index.js +21 -12
- package/components/Copy/Copy.js +15 -10
- package/components/Copy/index.js +13 -8
- package/components/Counter/Counter.js +13 -5
- package/components/Counter/index.js +13 -5
- package/components/DatePicker/CustomHeader/CustomHeader.js +14 -12
- package/components/DatePicker/RangeDatePicker.js +12 -4
- package/components/DatePicker/SimpleDatePicker/SimpleDatePicker.js +12 -16
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerDesktop.js +12 -10
- package/components/DatePicker/SimpleDatePicker/SimpleDatePickerMobile.js +10 -14
- package/components/DatePicker/SimpleDatePicker/index.js +13 -17
- package/components/DatePicker/TimePicker.js +12 -4
- package/components/DatePicker/index.js +13 -17
- package/components/Empty/Empty.js +11 -6
- package/components/Empty/index.js +11 -6
- package/components/FileUpload/FileUpload.js +12 -7
- package/components/FileUpload/UploadItems.js +11 -6
- package/components/FileUpload/index.js +13 -8
- package/components/FormContainer/FormContainer.js +12 -7
- package/components/FormContainer/index.js +12 -7
- package/components/FormField/FormField.js +13 -4
- package/components/FormField/index.js +14 -5
- package/components/Input/Input.js +12 -4
- package/components/Input/index.js +13 -5
- package/components/ItemSelect/ItemSelect.js +15 -6
- package/components/ItemSelect/ItemSelectGroup.js +15 -6
- package/components/ItemSelect/index.js +15 -6
- package/components/Menu/Menu.js +9 -5
- package/components/Menu/NestedMenu.js +7 -5
- package/components/Menu/index.js +10 -8
- package/components/Modal/Modal.js +19 -106
- package/components/Modal/ModalConfirmation.js +8 -6
- package/components/Modal/ModalContent.js +18 -68
- package/components/Modal/index.js +17 -21
- package/components/More/More.js +11 -6
- package/components/More/index.js +11 -6
- package/components/Popover/Popover.d.ts +2 -2
- package/components/Popover/Popover.js +29 -87
- package/components/Popover/PopoverDesktop.d.ts +3 -0
- package/components/Popover/PopoverDesktop.js +70 -0
- package/components/Popover/PopoverMobile.d.ts +3 -0
- package/components/Popover/PopoverMobile.js +35 -0
- package/components/Popover/index.js +27 -10
- package/components/Popover/types.d.ts +9 -0
- package/components/Radio/RadioGroup.js +14 -5
- package/components/Radio/index.js +15 -6
- package/components/Select/ButtonSelect/ButtonSelect.js +19 -17
- package/components/Select/FilterSelect/FilterDropdown.js +12 -8
- package/components/Select/FilterSelect/FilterGroupDropdown.js +13 -9
- package/components/Select/FilterSelect/FilterSelect.js +19 -17
- package/components/Select/MultiSelect/MultiBase/MultiBase.js +10 -8
- package/components/Select/MultiSelect/MultiSelect.js +10 -8
- package/components/Select/MultiSelect/MultiSelectGrouped/MultiSelectGrouped.js +10 -8
- package/components/Select/MultiSelect/MultiSelectWithTabs/MultiSelectWithTabs.js +10 -8
- package/components/Select/MultiSelect/OptionsWrapper.js +12 -10
- package/components/Select/NestedSelect/NestedSelect.js +11 -7
- package/components/Select/Select/Select.js +17 -15
- package/components/Select/SharedComponents/Actions.js +11 -9
- package/components/Select/SharedComponents/ContentTop.js +13 -11
- package/components/Select/SharedComponents/Footer.js +13 -8
- package/components/Select/SharedComponents/InputSelectWrapper/InputSelectWrapper.js +13 -5
- package/components/Select/SharedComponents/index.js +13 -11
- package/components/Select/index.js +11 -9
- package/components/SideSheet/Footer/Footer.js +13 -8
- package/components/SideSheet/SideSheet.js +8 -6
- package/components/SideSheet/index.js +9 -7
- package/components/Snackbar/Snackbar.js +11 -6
- package/components/Snackbar/index.js +11 -6
- package/components/Switcher/Switcher.js +14 -5
- package/components/Switcher/index.js +15 -6
- package/components/Table/Header.js +19 -10
- package/components/Table/IndeterminateCheckbox.js +21 -12
- package/components/Table/Row.js +20 -11
- package/components/Table/Table.js +20 -11
- package/components/Table/index.js +20 -11
- package/components/Table/utils.js +21 -12
- package/components/Textarea/Textarea.js +12 -4
- package/components/Textarea/index.js +13 -5
- package/helperComponents/OptionItem/OptionItem.js +21 -17
- package/helperComponents/OptionItem/index.js +13 -9
- package/helperComponents/index.js +11 -7
- package/index.js +9 -13
- package/package.json +1 -1
- package/stories/Popover.stories.d.ts +2 -2
|
@@ -0,0 +1,430 @@
|
|
|
1
|
+
import { _ as _extends } from './extends-6db97ae3.js';
|
|
2
|
+
import { _ as _defineProperty } from './defineProperty-613bc1ea.js';
|
|
3
|
+
import { _ as _objectWithoutProperties } from './objectWithoutProperties-a9eb619c.js';
|
|
4
|
+
import React, { useState, useId, useEffect, forwardRef, useRef, useMemo } from 'react';
|
|
5
|
+
import classNames from 'classnames';
|
|
6
|
+
import 'dayjs';
|
|
7
|
+
import { Loader } from './helperComponents/Loader/Loader.js';
|
|
8
|
+
import './consts/index.js';
|
|
9
|
+
import './hooks/useScreenSize.js';
|
|
10
|
+
import 'react-hook-form';
|
|
11
|
+
import { _ as _slicedToArray } from './slicedToArray-e10845b5.js';
|
|
12
|
+
import { useIsMobile } from './hooks/useGetIsMobile.js';
|
|
13
|
+
import { motion } from 'framer-motion';
|
|
14
|
+
import { AnimatePresenceWrapper } from './helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
15
|
+
import { useOnOutsideClick } from './hooks/useOnOutsideClick.js';
|
|
16
|
+
import { useHideBodyScroll } from './hooks/useHideBodyScroll.js';
|
|
17
|
+
import 'react-syntax-highlighter';
|
|
18
|
+
import { IconDismiss } from './components/SVGIcons/IconDismiss.js';
|
|
19
|
+
import { Positions } from './components/Tooltip/types.js';
|
|
20
|
+
import { Text } from './components/Text/Text.js';
|
|
21
|
+
import { Tooltip } from './components/Tooltip/Tooltip.js';
|
|
22
|
+
import { noop } from './utils/helpers.js';
|
|
23
|
+
import { Link } from './components/Link/Link.js';
|
|
24
|
+
import { PopoverDesktop } from './components/Popover/PopoverDesktop.js';
|
|
25
|
+
import { IconInfo } from './components/SVGIcons/IconInfo.js';
|
|
26
|
+
import { IconDynamicComponent } from './helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
27
|
+
import { LITE_LOADER_TYPES, ICON_SIZE_MAPPING, ICON_TYPE_MAPPING } from './components/Button/consts.js';
|
|
28
|
+
|
|
29
|
+
var _excluded$3 = ["size", "className", "iconProps", "buttonActionType", "disabled", "isLoading", "formId", "dataId", "onClick", "refHandler"];
|
|
30
|
+
var ButtonIcon = function ButtonIcon(props) {
|
|
31
|
+
var _props$size = props.size,
|
|
32
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
33
|
+
_props$className = props.className,
|
|
34
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
35
|
+
iconProps = props.iconProps,
|
|
36
|
+
_props$buttonActionTy = props.buttonActionType,
|
|
37
|
+
buttonActionType = _props$buttonActionTy === void 0 ? 'button' : _props$buttonActionTy,
|
|
38
|
+
disabled = props.disabled,
|
|
39
|
+
isLoading = props.isLoading,
|
|
40
|
+
formId = props.formId,
|
|
41
|
+
_props$dataId = props.dataId,
|
|
42
|
+
dataId = _props$dataId === void 0 ? '' : _props$dataId,
|
|
43
|
+
onClick = props.onClick,
|
|
44
|
+
_props$refHandler = props.refHandler,
|
|
45
|
+
refHandler = _props$refHandler === void 0 ? null : _props$refHandler,
|
|
46
|
+
rest = _objectWithoutProperties(props, _excluded$3);
|
|
47
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
48
|
+
ref: refHandler,
|
|
49
|
+
"data-id": dataId,
|
|
50
|
+
disabled: disabled,
|
|
51
|
+
type: buttonActionType,
|
|
52
|
+
className: classNames('btn-icon', "btn-icon--".concat(size), className),
|
|
53
|
+
onClick: onClick,
|
|
54
|
+
form: formId
|
|
55
|
+
}, rest), isLoading ? /*#__PURE__*/React.createElement(Loader, {
|
|
56
|
+
size: size,
|
|
57
|
+
type: 'dark'
|
|
58
|
+
}) : /*#__PURE__*/React.createElement(iconProps.Component, {
|
|
59
|
+
size: size,
|
|
60
|
+
type: disabled ? 'disabled' : 'tertiary'
|
|
61
|
+
}));
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
var ModalContent = function ModalContent(_ref) {
|
|
65
|
+
var title = _ref.title,
|
|
66
|
+
subtitle = _ref.subtitle,
|
|
67
|
+
dataIdPrefix = _ref.dataIdPrefix,
|
|
68
|
+
closeIcon = _ref.closeIcon,
|
|
69
|
+
onClose = _ref.onClose,
|
|
70
|
+
children = _ref.children,
|
|
71
|
+
withFooter = _ref.withFooter,
|
|
72
|
+
confirmBtnTooltipText = _ref.confirmBtnTooltipText,
|
|
73
|
+
buttonProps = _ref.buttonProps,
|
|
74
|
+
onSubmit = _ref.onSubmit;
|
|
75
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, title ? /*#__PURE__*/React.createElement("div", {
|
|
76
|
+
className: "modal__header"
|
|
77
|
+
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(Text, {
|
|
78
|
+
lineHeight: "large",
|
|
79
|
+
size: "large",
|
|
80
|
+
weight: 'bolder',
|
|
81
|
+
dataId: dataIdPrefix ? "".concat(dataIdPrefix, "-modal-title") : ''
|
|
82
|
+
}, title), subtitle ? /*#__PURE__*/React.createElement(Text, {
|
|
83
|
+
className: 'mt-12',
|
|
84
|
+
dataId: dataIdPrefix ? "".concat(dataIdPrefix, "-modal-title") : ''
|
|
85
|
+
}, subtitle) : null), closeIcon ? /*#__PURE__*/React.createElement(ButtonIcon, {
|
|
86
|
+
className: 'modal__close ml-16',
|
|
87
|
+
dataId: dataIdPrefix ? "".concat(dataIdPrefix, "-modal-close-button") : '',
|
|
88
|
+
iconProps: {
|
|
89
|
+
Component: IconDismiss
|
|
90
|
+
},
|
|
91
|
+
onClick: onClose
|
|
92
|
+
}) : null) : null, /*#__PURE__*/React.createElement("div", {
|
|
93
|
+
className: "modal__content scrollbar scrollbar--vertical"
|
|
94
|
+
}, children), withFooter && buttonProps ? /*#__PURE__*/React.createElement("div", {
|
|
95
|
+
className: "modal__footer"
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Button, _extends({
|
|
97
|
+
type: "tertiary",
|
|
98
|
+
className: "modal__footer__btn mr-16",
|
|
99
|
+
onClick: onClose,
|
|
100
|
+
dataId: dataIdPrefix ? "".concat(dataIdPrefix, "-modal-cancel-button") : ''
|
|
101
|
+
}, buttonProps.cancel || {})), confirmBtnTooltipText ? /*#__PURE__*/React.createElement(Tooltip, {
|
|
102
|
+
text: confirmBtnTooltipText,
|
|
103
|
+
id: 'confirm-btn-tooltip',
|
|
104
|
+
position: Positions.TOP_CENTER
|
|
105
|
+
}) : null, /*#__PURE__*/React.createElement(Button, _extends({
|
|
106
|
+
id: 'confirm-btn-tooltip',
|
|
107
|
+
className: 'modal__footer__btn',
|
|
108
|
+
type: "primary",
|
|
109
|
+
onClick: onSubmit ? onSubmit : noop,
|
|
110
|
+
dataId: dataIdPrefix ? "".concat(dataIdPrefix, "-modal-confirm-button") : ''
|
|
111
|
+
}, buttonProps.confirm))) : null);
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
var _excluded$2 = ["isOpen", "onClose", "className", "size", "closeOnOutsideClick"];
|
|
115
|
+
var DESKTOP_ANIMATION = {
|
|
116
|
+
initial: {
|
|
117
|
+
opacity: 0.5,
|
|
118
|
+
scale: 0.65
|
|
119
|
+
},
|
|
120
|
+
animate: {
|
|
121
|
+
opacity: 1,
|
|
122
|
+
scale: [0.95, 1]
|
|
123
|
+
},
|
|
124
|
+
exit: {
|
|
125
|
+
opacity: 0,
|
|
126
|
+
scale: 0.7,
|
|
127
|
+
transition: {
|
|
128
|
+
duration: 0.2
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
transition: {
|
|
132
|
+
duration: 0.4,
|
|
133
|
+
type: 'spring',
|
|
134
|
+
damping: 55,
|
|
135
|
+
stiffness: 700
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
var MOBILE_ANIMATION = {
|
|
139
|
+
initial: {
|
|
140
|
+
height: 0,
|
|
141
|
+
bottom: 0
|
|
142
|
+
},
|
|
143
|
+
animate: {
|
|
144
|
+
height: 'auto',
|
|
145
|
+
bottom: 10
|
|
146
|
+
},
|
|
147
|
+
exit: {
|
|
148
|
+
height: 0,
|
|
149
|
+
bottom: 0
|
|
150
|
+
},
|
|
151
|
+
transition: {
|
|
152
|
+
duration: 0.6
|
|
153
|
+
}
|
|
154
|
+
};
|
|
155
|
+
var Modal = function Modal(props) {
|
|
156
|
+
var isOpen = props.isOpen,
|
|
157
|
+
onClose = props.onClose,
|
|
158
|
+
_props$className = props.className,
|
|
159
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
160
|
+
_props$size = props.size,
|
|
161
|
+
size = _props$size === void 0 ? 'medium' : _props$size,
|
|
162
|
+
_props$closeOnOutside = props.closeOnOutsideClick,
|
|
163
|
+
closeOnOutsideClick = _props$closeOnOutside === void 0 ? true : _props$closeOnOutside,
|
|
164
|
+
rest = _objectWithoutProperties(props, _excluded$2);
|
|
165
|
+
var isMobile = useIsMobile();
|
|
166
|
+
var _useState = useState(null),
|
|
167
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
168
|
+
containerRef = _useState2[0],
|
|
169
|
+
setContainerRef = _useState2[1];
|
|
170
|
+
useOnOutsideClick(containerRef, onClose, closeOnOutsideClick && isOpen, useId());
|
|
171
|
+
useHideBodyScroll(isOpen);
|
|
172
|
+
return /*#__PURE__*/React.createElement(AnimatePresenceWrapper, null, isOpen ? /*#__PURE__*/React.createElement(motion.div, {
|
|
173
|
+
className: classNames('modal', "modal--".concat(size), className),
|
|
174
|
+
initial: {
|
|
175
|
+
opacity: 0
|
|
176
|
+
},
|
|
177
|
+
animate: {
|
|
178
|
+
opacity: 1
|
|
179
|
+
},
|
|
180
|
+
exit: {
|
|
181
|
+
opacity: 0
|
|
182
|
+
},
|
|
183
|
+
transition: {
|
|
184
|
+
duration: 0.4
|
|
185
|
+
}
|
|
186
|
+
}, /*#__PURE__*/React.createElement(motion.div, _extends({
|
|
187
|
+
className: classNames('modal__container', {
|
|
188
|
+
modal__container_mobile: isMobile
|
|
189
|
+
}),
|
|
190
|
+
ref: setContainerRef
|
|
191
|
+
}, isMobile ? MOBILE_ANIMATION : DESKTOP_ANIMATION), /*#__PURE__*/React.createElement(ModalContent, _extends({}, rest, {
|
|
192
|
+
onClose: onClose
|
|
193
|
+
})))) : null);
|
|
194
|
+
};
|
|
195
|
+
|
|
196
|
+
var PopoverMobile = function PopoverMobile(props) {
|
|
197
|
+
var dataId = props.dataId,
|
|
198
|
+
text = props.text,
|
|
199
|
+
linkAddons = props.linkAddons,
|
|
200
|
+
mobileTitle = props.mobileTitle,
|
|
201
|
+
hideMessage = props.hideMessage,
|
|
202
|
+
_props$clicked = props.clicked,
|
|
203
|
+
clicked = _props$clicked === void 0 ? false : _props$clicked,
|
|
204
|
+
children = props.children;
|
|
205
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Modal, {
|
|
206
|
+
closeIcon: true,
|
|
207
|
+
title: mobileTitle,
|
|
208
|
+
onClose: hideMessage,
|
|
209
|
+
isOpen: clicked
|
|
210
|
+
}, clicked && /*#__PURE__*/React.createElement(React.Fragment, null, linkAddons ? /*#__PURE__*/React.createElement(Link, {
|
|
211
|
+
dataId: linkAddons.dataId,
|
|
212
|
+
url: linkAddons.url,
|
|
213
|
+
beforeLink: linkAddons.beforeLink,
|
|
214
|
+
afterLink: linkAddons.afterLink,
|
|
215
|
+
target: linkAddons.target,
|
|
216
|
+
className: 'popover__link'
|
|
217
|
+
}, text) : /*#__PURE__*/React.createElement(Text, {
|
|
218
|
+
dataId: "".concat(dataId, "-text"),
|
|
219
|
+
type: "primary",
|
|
220
|
+
weight: "regular",
|
|
221
|
+
lineHeight: "medium",
|
|
222
|
+
size: "small"
|
|
223
|
+
}, text))), children);
|
|
224
|
+
};
|
|
225
|
+
|
|
226
|
+
var _excluded$1 = ["elemRef", "id", "clicked"];
|
|
227
|
+
var Popover = function Popover(props) {
|
|
228
|
+
var elemRef = props.elemRef,
|
|
229
|
+
id = props.id,
|
|
230
|
+
clicked = props.clicked,
|
|
231
|
+
rest = _objectWithoutProperties(props, _excluded$1);
|
|
232
|
+
var isMobile = useIsMobile();
|
|
233
|
+
var _useState = useState(clicked),
|
|
234
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
235
|
+
isClicked = _useState2[0],
|
|
236
|
+
setIsClicked = _useState2[1];
|
|
237
|
+
var _useState3 = useState(elemRef || null),
|
|
238
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
239
|
+
parent = _useState4[0],
|
|
240
|
+
setElement = _useState4[1];
|
|
241
|
+
var showMessage = function showMessage() {
|
|
242
|
+
return setIsClicked(true);
|
|
243
|
+
};
|
|
244
|
+
var hideMessage = function hideMessage() {
|
|
245
|
+
return setIsClicked(false);
|
|
246
|
+
};
|
|
247
|
+
useEffect(function () {
|
|
248
|
+
if (parent) {
|
|
249
|
+
parent.addEventListener('click', showMessage);
|
|
250
|
+
}
|
|
251
|
+
}, [parent]);
|
|
252
|
+
useEffect(function () {
|
|
253
|
+
if (id) {
|
|
254
|
+
var element = document.getElementById(id.toString());
|
|
255
|
+
setElement(element);
|
|
256
|
+
}
|
|
257
|
+
}, [id]);
|
|
258
|
+
return isMobile ? /*#__PURE__*/React.createElement(PopoverMobile, _extends({}, rest, {
|
|
259
|
+
clicked: isClicked,
|
|
260
|
+
hideMessage: hideMessage
|
|
261
|
+
})) : /*#__PURE__*/React.createElement(PopoverDesktop, _extends({}, rest, {
|
|
262
|
+
parent: parent,
|
|
263
|
+
clicked: isClicked,
|
|
264
|
+
showMessage: showMessage,
|
|
265
|
+
hideMessage: hideMessage
|
|
266
|
+
}));
|
|
267
|
+
};
|
|
268
|
+
|
|
269
|
+
var Checkbox = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
270
|
+
var label = props.label,
|
|
271
|
+
disabled = props.disabled,
|
|
272
|
+
_props$required = props.required,
|
|
273
|
+
required = _props$required === void 0 ? false : _props$required,
|
|
274
|
+
link = props.link,
|
|
275
|
+
name = props.name,
|
|
276
|
+
setFieldValue = props.setFieldValue,
|
|
277
|
+
selectedValue = props.selectedValue,
|
|
278
|
+
value = props.value,
|
|
279
|
+
_props$className = props.className,
|
|
280
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
281
|
+
_props$iconProps = props.iconProps,
|
|
282
|
+
iconProps = _props$iconProps === void 0 ? {
|
|
283
|
+
name: 'checkmark'
|
|
284
|
+
} : _props$iconProps,
|
|
285
|
+
_props$dataId = props.dataId,
|
|
286
|
+
dataId = _props$dataId === void 0 ? '' : _props$dataId,
|
|
287
|
+
onClick = props.onClick,
|
|
288
|
+
beforeLink = props.beforeLink,
|
|
289
|
+
afterLink = props.afterLink,
|
|
290
|
+
_props$helperText = props.helperText,
|
|
291
|
+
helperText = _props$helperText === void 0 ? '' : _props$helperText,
|
|
292
|
+
popoverAddons = props.popoverAddons,
|
|
293
|
+
isInvalid = props.isInvalid;
|
|
294
|
+
var localRef = useRef(null);
|
|
295
|
+
var inputRef = ref && Object.keys(ref).length ? ref : localRef;
|
|
296
|
+
var isChecked = !!value || selectedValue;
|
|
297
|
+
var changeHandler = function changeHandler() {
|
|
298
|
+
if (name && setFieldValue) {
|
|
299
|
+
setFieldValue(name, !isChecked, {
|
|
300
|
+
shouldValidate: !isChecked
|
|
301
|
+
});
|
|
302
|
+
}
|
|
303
|
+
if (onClick) {
|
|
304
|
+
onClick(!isChecked);
|
|
305
|
+
}
|
|
306
|
+
};
|
|
307
|
+
var checkboxLabelPopover = popoverAddons ? /*#__PURE__*/React.createElement(Popover, _extends({
|
|
308
|
+
id: "".concat(popoverAddons.id)
|
|
309
|
+
}, popoverAddons), /*#__PURE__*/React.createElement("div", {
|
|
310
|
+
id: "".concat(popoverAddons.id)
|
|
311
|
+
}, /*#__PURE__*/React.createElement(IconInfo, {
|
|
312
|
+
dataId: "".concat(dataId, "-icon"),
|
|
313
|
+
type: "information",
|
|
314
|
+
size: "xsmall",
|
|
315
|
+
className: 'ml-4 pointer',
|
|
316
|
+
onClick: function onClick(e) {
|
|
317
|
+
e.stopPropagation();
|
|
318
|
+
changeHandler();
|
|
319
|
+
}
|
|
320
|
+
}))) : null;
|
|
321
|
+
var checkboxLabel = useMemo(function () {
|
|
322
|
+
if (!label) {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
if (typeof label !== 'string') {
|
|
326
|
+
return label;
|
|
327
|
+
}
|
|
328
|
+
if (!link) {
|
|
329
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
330
|
+
type: disabled ? 'disabled' : 'primary',
|
|
331
|
+
className: "controller__label"
|
|
332
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, label, required && /*#__PURE__*/React.createElement("sup", null, "*")));
|
|
333
|
+
}
|
|
334
|
+
return /*#__PURE__*/React.createElement(Text, {
|
|
335
|
+
type: disabled ? 'disabled' : 'primary',
|
|
336
|
+
className: "controller__label"
|
|
337
|
+
}, /*#__PURE__*/React.createElement(React.Fragment, null, beforeLink && /*#__PURE__*/React.createElement("span", {
|
|
338
|
+
className: "mr-4"
|
|
339
|
+
}, beforeLink), /*#__PURE__*/React.createElement(Link, {
|
|
340
|
+
dataId: dataId,
|
|
341
|
+
url: link,
|
|
342
|
+
target: "_blank"
|
|
343
|
+
}, label), afterLink && /*#__PURE__*/React.createElement("span", {
|
|
344
|
+
className: "ml-4"
|
|
345
|
+
}, afterLink), required && /*#__PURE__*/React.createElement("sup", null, "*")));
|
|
346
|
+
}, [label, link]);
|
|
347
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("label", {
|
|
348
|
+
className: classNames('controller', _defineProperty({
|
|
349
|
+
'controller--checkbox': true,
|
|
350
|
+
'controller--disabled': disabled,
|
|
351
|
+
'controller--error': isInvalid
|
|
352
|
+
}, className, !!className))
|
|
353
|
+
}, /*#__PURE__*/React.createElement("input", {
|
|
354
|
+
"data-id": dataId,
|
|
355
|
+
type: "checkbox",
|
|
356
|
+
ref: inputRef,
|
|
357
|
+
tabIndex: 0,
|
|
358
|
+
onChange: changeHandler,
|
|
359
|
+
checked: Boolean(isChecked),
|
|
360
|
+
disabled: disabled
|
|
361
|
+
}), /*#__PURE__*/React.createElement("span", {
|
|
362
|
+
className: "controller__icon"
|
|
363
|
+
}, /*#__PURE__*/React.createElement(IconDynamicComponent, {
|
|
364
|
+
componentName: iconProps.name,
|
|
365
|
+
size: "xxsmall",
|
|
366
|
+
type: disabled ? 'disabled' : 'inverse',
|
|
367
|
+
className: "controller__mark"
|
|
368
|
+
})), checkboxLabel ? /*#__PURE__*/React.createElement("div", {
|
|
369
|
+
className: "controller__right"
|
|
370
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
371
|
+
className: "flexbox"
|
|
372
|
+
}, checkboxLabel, checkboxLabelPopover), helperText ? /*#__PURE__*/React.createElement(Text, {
|
|
373
|
+
size: "small",
|
|
374
|
+
type: disabled ? 'disabled' : 'secondary'
|
|
375
|
+
}, helperText) : null) : null));
|
|
376
|
+
});
|
|
377
|
+
Checkbox.displayName = 'Checkbox';
|
|
378
|
+
|
|
379
|
+
var _excluded = ["buttonText", "type", "size", "className", "iconProps", "buttonActionType", "disabled", "isLoading", "formId", "dataId", "onClick", "refHandler", "children"];
|
|
380
|
+
var Button = function Button(props) {
|
|
381
|
+
var buttonText = props.buttonText,
|
|
382
|
+
_props$type = props.type,
|
|
383
|
+
type = _props$type === void 0 ? 'primary' : _props$type,
|
|
384
|
+
_props$size = props.size,
|
|
385
|
+
size = _props$size === void 0 ? 'large' : _props$size,
|
|
386
|
+
_props$className = props.className,
|
|
387
|
+
className = _props$className === void 0 ? '' : _props$className,
|
|
388
|
+
iconProps = props.iconProps,
|
|
389
|
+
_props$buttonActionTy = props.buttonActionType,
|
|
390
|
+
buttonActionType = _props$buttonActionTy === void 0 ? 'button' : _props$buttonActionTy,
|
|
391
|
+
disabled = props.disabled,
|
|
392
|
+
isLoading = props.isLoading,
|
|
393
|
+
formId = props.formId,
|
|
394
|
+
_props$dataId = props.dataId,
|
|
395
|
+
dataId = _props$dataId === void 0 ? '' : _props$dataId,
|
|
396
|
+
onClick = props.onClick,
|
|
397
|
+
_props$refHandler = props.refHandler,
|
|
398
|
+
refHandler = _props$refHandler === void 0 ? null : _props$refHandler,
|
|
399
|
+
children = props.children,
|
|
400
|
+
rest = _objectWithoutProperties(props, _excluded);
|
|
401
|
+
var justIcon = !buttonText && !children && iconProps !== undefined;
|
|
402
|
+
var clickHandler = function clickHandler(e) {
|
|
403
|
+
if (disabled || isLoading) {
|
|
404
|
+
return;
|
|
405
|
+
}
|
|
406
|
+
onClick === null || onClick === void 0 || onClick(e);
|
|
407
|
+
};
|
|
408
|
+
return /*#__PURE__*/React.createElement("button", _extends({
|
|
409
|
+
ref: refHandler,
|
|
410
|
+
"data-id": dataId,
|
|
411
|
+
disabled: disabled,
|
|
412
|
+
type: buttonActionType,
|
|
413
|
+
className: classNames('btn', "btn--".concat(type), "btn--".concat(size), _defineProperty({
|
|
414
|
+
'btn--icon': justIcon
|
|
415
|
+
}, "btn--icon-".concat((iconProps === null || iconProps === void 0 ? void 0 : iconProps.alignment) || 'left'), !isLoading && !justIcon && (iconProps === null || iconProps === void 0 ? void 0 : iconProps.Component)), className),
|
|
416
|
+
onClick: clickHandler,
|
|
417
|
+
form: formId
|
|
418
|
+
}, rest), isLoading ? /*#__PURE__*/React.createElement(Loader, {
|
|
419
|
+
size: size,
|
|
420
|
+
type: LITE_LOADER_TYPES.indexOf(type) === -1 ? 'dark' : 'lite'
|
|
421
|
+
}) : /*#__PURE__*/React.createElement(React.Fragment, null, iconProps !== null && iconProps !== void 0 && iconProps.Component ? /*#__PURE__*/React.createElement(iconProps.Component, {
|
|
422
|
+
size: ICON_SIZE_MAPPING[size],
|
|
423
|
+
type: ICON_TYPE_MAPPING[iconProps.type || type],
|
|
424
|
+
className: "btn__icon"
|
|
425
|
+
}) : null, buttonText || children ? /*#__PURE__*/React.createElement("span", {
|
|
426
|
+
className: "btn__text"
|
|
427
|
+
}, buttonText || children) : null));
|
|
428
|
+
};
|
|
429
|
+
|
|
430
|
+
export { Button as B, Checkbox as C, Modal as M, Popover as P, ButtonIcon as a, MOBILE_ANIMATION as b, ModalContent as c, PopoverMobile as d };
|
|
@@ -3,33 +3,38 @@ import React from 'react';
|
|
|
3
3
|
import { ICONS_MAPPING, TYPE_MAPPING } from './consts.js';
|
|
4
4
|
import classNames from 'classnames';
|
|
5
5
|
import { Text } from '../Text/Text.js';
|
|
6
|
-
import { Button } from '
|
|
6
|
+
import { B as Button } from '../../Button-dee36459.js';
|
|
7
7
|
import { IconDismissFilled } from '../SVGIcons/IconDismissFilled.js';
|
|
8
8
|
import { IconDynamicComponent } from '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
9
9
|
import 'dayjs';
|
|
10
10
|
import '../../consts/index.js';
|
|
11
11
|
import '../../hooks/useScreenSize.js';
|
|
12
12
|
import 'react-hook-form';
|
|
13
|
-
import '../Checkbox/Checkbox.js';
|
|
14
13
|
import 'react-syntax-highlighter';
|
|
15
14
|
import '../../utils/helpers.js';
|
|
16
15
|
import '../../defineProperty-613bc1ea.js';
|
|
17
16
|
import '../../typeof-1e1d76cf.js';
|
|
18
17
|
import '../../objectWithoutProperties-a9eb619c.js';
|
|
19
18
|
import '../../helperComponents/Loader/Loader.js';
|
|
20
|
-
import '../Button/consts.js';
|
|
21
|
-
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
22
19
|
import '../../slicedToArray-e10845b5.js';
|
|
23
|
-
import '
|
|
20
|
+
import '../../hooks/useGetIsMobile.js';
|
|
21
|
+
import 'framer-motion';
|
|
22
|
+
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
23
|
+
import '../../hooks/useOnOutsideClick.js';
|
|
24
|
+
import '../../hooks/useHideBodyScroll.js';
|
|
25
|
+
import '../SVGIcons/IconDismiss.js';
|
|
26
|
+
import '../Tooltip/types.js';
|
|
27
|
+
import '../Tooltip/Tooltip.js';
|
|
24
28
|
import '../../hooks/useGetTooltipStyles.js';
|
|
25
29
|
import '../../hooks/useGetElemSizes.js';
|
|
26
30
|
import '../../hooks/useGetElemPositions.js';
|
|
27
31
|
import '../../hooks/useGetTooltipPosition.js';
|
|
28
|
-
import '../Tooltip/types.js';
|
|
29
32
|
import '../../hooks/useHideOnScroll.js';
|
|
30
|
-
import '../../hooks/useOnOutsideClick.js';
|
|
31
33
|
import '../Link/Link.js';
|
|
34
|
+
import '../Popover/PopoverDesktop.js';
|
|
32
35
|
import '../SVGIcons/IconInfo.js';
|
|
36
|
+
import '../Button/consts.js';
|
|
37
|
+
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
33
38
|
|
|
34
39
|
var Alert = function Alert(props) {
|
|
35
40
|
var buttonProps = props.buttonProps,
|
|
@@ -6,7 +6,7 @@ import 'classnames';
|
|
|
6
6
|
import '../Text/Text.js';
|
|
7
7
|
import '../../utils/helpers.js';
|
|
8
8
|
import 'dayjs';
|
|
9
|
-
import '
|
|
9
|
+
import '../../Button-dee36459.js';
|
|
10
10
|
import '../../defineProperty-613bc1ea.js';
|
|
11
11
|
import '../../typeof-1e1d76cf.js';
|
|
12
12
|
import '../../objectWithoutProperties-a9eb619c.js';
|
|
@@ -15,19 +15,24 @@ import '../../consts/index.js';
|
|
|
15
15
|
import '../../hooks/useScreenSize.js';
|
|
16
16
|
import '../../slicedToArray-e10845b5.js';
|
|
17
17
|
import 'react-hook-form';
|
|
18
|
-
import '
|
|
19
|
-
import '
|
|
18
|
+
import '../../hooks/useGetIsMobile.js';
|
|
19
|
+
import 'framer-motion';
|
|
20
|
+
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
21
|
+
import '../../hooks/useOnOutsideClick.js';
|
|
22
|
+
import '../../hooks/useHideBodyScroll.js';
|
|
23
|
+
import 'react-syntax-highlighter';
|
|
24
|
+
import '../SVGIcons/IconDismiss.js';
|
|
25
|
+
import '../Tooltip/types.js';
|
|
26
|
+
import '../Tooltip/Tooltip.js';
|
|
20
27
|
import '../../hooks/useGetTooltipStyles.js';
|
|
21
28
|
import '../../hooks/useGetElemSizes.js';
|
|
22
29
|
import '../../hooks/useGetElemPositions.js';
|
|
23
30
|
import '../../hooks/useGetTooltipPosition.js';
|
|
24
|
-
import '../Tooltip/types.js';
|
|
25
31
|
import '../../hooks/useHideOnScroll.js';
|
|
26
|
-
import '../../hooks/useOnOutsideClick.js';
|
|
27
32
|
import '../Link/Link.js';
|
|
33
|
+
import '../Popover/PopoverDesktop.js';
|
|
28
34
|
import '../SVGIcons/IconInfo.js';
|
|
29
35
|
import '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
30
36
|
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
31
|
-
import 'react-syntax-highlighter';
|
|
32
37
|
import '../Button/consts.js';
|
|
33
38
|
import '../SVGIcons/IconDismissFilled.js';
|
|
@@ -4,7 +4,7 @@ import classNames from 'classnames';
|
|
|
4
4
|
import { FileUpload } from '../FileUpload/FileUpload.js';
|
|
5
5
|
import { FileUploadMode } from '../FileUpload/types.js';
|
|
6
6
|
import '../../toConsumableArray-1fa3cb42.js';
|
|
7
|
-
import '
|
|
7
|
+
import '../../Button-dee36459.js';
|
|
8
8
|
import '../../extends-6db97ae3.js';
|
|
9
9
|
import '../../defineProperty-613bc1ea.js';
|
|
10
10
|
import '../../typeof-1e1d76cf.js';
|
|
@@ -14,22 +14,27 @@ import '../../helperComponents/Loader/Loader.js';
|
|
|
14
14
|
import '../../consts/index.js';
|
|
15
15
|
import '../../hooks/useScreenSize.js';
|
|
16
16
|
import 'react-hook-form';
|
|
17
|
-
import '
|
|
18
|
-
import '
|
|
17
|
+
import '../../hooks/useGetIsMobile.js';
|
|
18
|
+
import 'framer-motion';
|
|
19
|
+
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
20
|
+
import '../../hooks/useOnOutsideClick.js';
|
|
21
|
+
import '../../hooks/useHideBodyScroll.js';
|
|
22
|
+
import 'react-syntax-highlighter';
|
|
23
|
+
import '../SVGIcons/IconDismiss.js';
|
|
24
|
+
import '../Tooltip/types.js';
|
|
25
|
+
import '../Text/Text.js';
|
|
26
|
+
import '../../utils/helpers.js';
|
|
27
|
+
import '../Tooltip/Tooltip.js';
|
|
19
28
|
import '../../hooks/useGetTooltipStyles.js';
|
|
20
29
|
import '../../hooks/useGetElemSizes.js';
|
|
21
30
|
import '../../hooks/useGetElemPositions.js';
|
|
22
31
|
import '../../hooks/useGetTooltipPosition.js';
|
|
23
|
-
import '../Tooltip/types.js';
|
|
24
32
|
import '../../hooks/useHideOnScroll.js';
|
|
25
|
-
import '../../hooks/useOnOutsideClick.js';
|
|
26
|
-
import '../Text/Text.js';
|
|
27
|
-
import '../../utils/helpers.js';
|
|
28
33
|
import '../Link/Link.js';
|
|
34
|
+
import '../Popover/PopoverDesktop.js';
|
|
29
35
|
import '../SVGIcons/IconInfo.js';
|
|
30
36
|
import '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
31
37
|
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
32
|
-
import 'react-syntax-highlighter';
|
|
33
38
|
import '../Button/consts.js';
|
|
34
39
|
import '../../helperComponents/Label/Label.js';
|
|
35
40
|
import '../FileUpload/UploadItems.js';
|
|
@@ -19,20 +19,24 @@ import '../../hooks/useHideOnScroll.js';
|
|
|
19
19
|
import '../FileUpload/FileUpload.js';
|
|
20
20
|
import '../../toConsumableArray-1fa3cb42.js';
|
|
21
21
|
import '../FileUpload/types.js';
|
|
22
|
-
import '
|
|
22
|
+
import '../../Button-dee36459.js';
|
|
23
23
|
import '../../extends-6db97ae3.js';
|
|
24
24
|
import '../../defineProperty-613bc1ea.js';
|
|
25
25
|
import '../../typeof-1e1d76cf.js';
|
|
26
26
|
import '../../objectWithoutProperties-a9eb619c.js';
|
|
27
27
|
import '../../helperComponents/Loader/Loader.js';
|
|
28
|
-
import '
|
|
29
|
-
import '
|
|
28
|
+
import '../../hooks/useGetIsMobile.js';
|
|
29
|
+
import 'framer-motion';
|
|
30
|
+
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
30
31
|
import '../../hooks/useOnOutsideClick.js';
|
|
32
|
+
import '../../hooks/useHideBodyScroll.js';
|
|
33
|
+
import 'react-syntax-highlighter';
|
|
34
|
+
import '../SVGIcons/IconDismiss.js';
|
|
31
35
|
import '../Link/Link.js';
|
|
36
|
+
import '../Popover/PopoverDesktop.js';
|
|
32
37
|
import '../SVGIcons/IconInfo.js';
|
|
33
38
|
import '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
34
39
|
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
35
|
-
import 'react-syntax-highlighter';
|
|
36
40
|
import '../Button/consts.js';
|
|
37
41
|
import '../../helperComponents/Label/Label.js';
|
|
38
42
|
import '../FileUpload/UploadItems.js';
|
|
@@ -6,7 +6,7 @@ import 'classnames';
|
|
|
6
6
|
import '../FileUpload/FileUpload.js';
|
|
7
7
|
import '../../toConsumableArray-1fa3cb42.js';
|
|
8
8
|
import '../FileUpload/types.js';
|
|
9
|
-
import '
|
|
9
|
+
import '../../Button-dee36459.js';
|
|
10
10
|
import '../../extends-6db97ae3.js';
|
|
11
11
|
import '../../defineProperty-613bc1ea.js';
|
|
12
12
|
import '../../typeof-1e1d76cf.js';
|
|
@@ -16,22 +16,27 @@ import '../../helperComponents/Loader/Loader.js';
|
|
|
16
16
|
import '../../consts/index.js';
|
|
17
17
|
import '../../hooks/useScreenSize.js';
|
|
18
18
|
import 'react-hook-form';
|
|
19
|
-
import '
|
|
20
|
-
import '
|
|
19
|
+
import '../../hooks/useGetIsMobile.js';
|
|
20
|
+
import 'framer-motion';
|
|
21
|
+
import '../../helperComponents/AnimatePresenceWrapper/AnimatePresenceWrapper.js';
|
|
22
|
+
import '../../hooks/useOnOutsideClick.js';
|
|
23
|
+
import '../../hooks/useHideBodyScroll.js';
|
|
24
|
+
import 'react-syntax-highlighter';
|
|
25
|
+
import '../SVGIcons/IconDismiss.js';
|
|
26
|
+
import '../Tooltip/types.js';
|
|
27
|
+
import '../Text/Text.js';
|
|
28
|
+
import '../../utils/helpers.js';
|
|
29
|
+
import '../Tooltip/Tooltip.js';
|
|
21
30
|
import '../../hooks/useGetTooltipStyles.js';
|
|
22
31
|
import '../../hooks/useGetElemSizes.js';
|
|
23
32
|
import '../../hooks/useGetElemPositions.js';
|
|
24
33
|
import '../../hooks/useGetTooltipPosition.js';
|
|
25
|
-
import '../Tooltip/types.js';
|
|
26
34
|
import '../../hooks/useHideOnScroll.js';
|
|
27
|
-
import '../../hooks/useOnOutsideClick.js';
|
|
28
|
-
import '../Text/Text.js';
|
|
29
|
-
import '../../utils/helpers.js';
|
|
30
35
|
import '../Link/Link.js';
|
|
36
|
+
import '../Popover/PopoverDesktop.js';
|
|
31
37
|
import '../SVGIcons/IconInfo.js';
|
|
32
38
|
import '../../helperComponents/IconDynamicComponent/IconDynamicComponent.js';
|
|
33
39
|
import '../../helperComponents/IconDynamicComponent/constants.js';
|
|
34
|
-
import 'react-syntax-highlighter';
|
|
35
40
|
import '../Button/consts.js';
|
|
36
41
|
import '../../helperComponents/Label/Label.js';
|
|
37
42
|
import '../FileUpload/UploadItems.js';
|
|
@@ -42,5 +47,4 @@ import '../SVGIcons/IconDelete.js';
|
|
|
42
47
|
import '../SVGIcons/IconEditFilled.js';
|
|
43
48
|
import '../SVGIcons/IconEdit.js';
|
|
44
49
|
import '../SVGIcons/IconAttach.js';
|
|
45
|
-
import '../Tooltip/Tooltip.js';
|
|
46
50
|
import '../SVGIcons/IconAdd.js';
|