@itcase/ui 1.8.122 → 1.8.124
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/Avatar_cjs_mojzcWRL.js +161 -0
- package/dist/Avatar_es_BFom0nAS.js +157 -0
- package/dist/{Button_cjs_i0Dn1pkl.js → Button_cjs_CZz8OjWi.js} +42 -30
- package/dist/{Button_es_CtH5EKJd.js → Button_es_Cn3wtv3M.js} +42 -30
- package/dist/ChipsGroup_cjs_Dgskkc1e.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_BVQ7_n0k.js} +48 -35
- package/dist/DatePicker_cjs_Lzrr9Amf.js +182 -0
- package/dist/DatePicker_es_D1LvY5RT.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_rKLdFxSj.js +211 -0
- package/dist/DropdownItem_es_B-1qtEa7.js +206 -0
- package/dist/Group_cjs_DmfeUcFI.js +59 -0
- package/dist/Group_es_BU5k8f5S.js +55 -0
- package/dist/{Icon_cjs_Cz6IyOkb.js → Icon_cjs_DpFxIFv5.js} +170 -121
- package/dist/{Icon_es_BrwLifge.js → Icon_es_D5eiycFI.js} +170 -121
- package/dist/Image_cjs_CBDMUzv_.js +29 -0
- package/dist/Image_es_BHec4iVN.js +27 -0
- package/dist/{Input_cjs_Du73R-wm.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_CiDHjDqJ.js → Input_es_BnCXATnh.js} +27 -19
- package/dist/{Label_cjs_DMoaOoHi.js → Label_cjs_C-x9blCL.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_DCqpSw_F.js} +45 -33
- package/dist/{Link_cjs_C5UsZUiF.js → Link_cjs_qKXVfU8e.js} +43 -30
- package/dist/{Link_es_XiqbdwLp.js → Link_es_P2b6ya7P.js} +43 -30
- package/dist/Loader_cjs_DIDsIq3J.js +143 -0
- package/dist/Loader_es_CmSggwbR.js +139 -0
- package/dist/Overlay_cjs_tGA2fU43.js +42 -0
- package/dist/Overlay_es_BS7OTFoy.js +38 -0
- package/dist/{Scrollbar_cjs_DcKOfcNp.js → Scrollbar_cjs_Cp-7v2Mt.js} +1 -1
- package/dist/{Scrollbar_es_CThJeCLF.js → Scrollbar_es_CcMgNvGi.js} +1 -1
- package/dist/Text_cjs_BDTjOTVB.js +69 -0
- package/dist/Text_es_CnymlElo.js +65 -0
- package/dist/cjs/components/Accordion.js +37 -34
- package/dist/cjs/components/Avatar.js +5 -6
- package/dist/cjs/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/cjs/components/AvatarStack.js +17 -16
- package/dist/cjs/components/Badge.js +3 -4
- package/dist/cjs/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/cjs/components/Breadcrumbs.js +27 -23
- package/dist/cjs/components/Button.js +5 -6
- package/dist/cjs/components/Cell/stories/__mock__.js +1 -1
- package/dist/cjs/components/Cell.js +28 -25
- package/dist/cjs/components/Checkbox.js +33 -26
- package/dist/cjs/components/Checkmark.js +28 -23
- package/dist/cjs/components/Chips/stories/__mock__.js +1 -1
- package/dist/cjs/components/Chips.js +4 -5
- package/dist/cjs/components/Choice/stories/__mock__.js +2 -2
- package/dist/cjs/components/Choice.js +46 -40
- package/dist/cjs/components/Code.js +34 -26
- package/dist/cjs/components/CookiesWarning.js +23 -23
- package/dist/cjs/components/Dadata.js +14 -9
- package/dist/cjs/components/DatePeriod.js +32 -30
- package/dist/cjs/components/DatePicker.js +8 -9
- package/dist/cjs/components/Divider.js +1 -2
- package/dist/cjs/components/Dot.js +5 -6
- package/dist/cjs/components/Drawer.js +23 -21
- package/dist/cjs/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/cjs/components/Dropdown.js +5 -6
- package/dist/cjs/components/Flex.js +11 -12
- package/dist/cjs/components/Grid.js +15 -16
- package/dist/cjs/components/Group.js +1 -2
- package/dist/cjs/components/HTMLContent.js +5 -6
- package/dist/cjs/components/HeroTitle.js +17 -16
- package/dist/cjs/components/Icon.js +3 -4
- package/dist/cjs/components/Image.js +1 -2
- package/dist/cjs/components/Input.js +1 -2
- package/dist/cjs/components/InputPassword.js +114 -84
- package/dist/cjs/components/Label.js +4 -5
- package/dist/cjs/components/Link.js +1 -2
- package/dist/cjs/components/List.js +39 -28
- package/dist/cjs/components/Loader.js +2 -3
- package/dist/cjs/components/Logo.js +10 -11
- package/dist/cjs/components/MenuItem.js +36 -33
- package/dist/cjs/components/Modal.js +40 -38
- package/dist/cjs/components/ModalSheetBottom.js +17 -18
- package/dist/cjs/components/Notification/stories/__mock__.js +1 -1
- package/dist/cjs/components/Notification.js +31 -24
- package/dist/cjs/components/Overlay.js +1 -2
- package/dist/cjs/components/Pagination.js +43 -41
- package/dist/cjs/components/Radio.js +34 -26
- package/dist/cjs/components/RangeSlider.js +8 -9
- package/dist/cjs/components/Response/img.js +1 -1
- package/dist/cjs/components/Response.js +102 -84
- package/dist/cjs/components/SVGContent.js +6 -7
- package/dist/cjs/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/cjs/components/ScrollOnDrag.js +7 -8
- package/dist/cjs/components/ScrollToView.js +8 -9
- package/dist/cjs/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/cjs/components/Scrollbar.js +1 -1
- package/dist/cjs/components/Search.js +39 -31
- package/dist/cjs/components/Segmented/stories/__mock__.js +23 -10
- package/dist/cjs/components/Segmented.js +47 -42
- package/dist/cjs/components/Select.js +118 -113
- package/dist/cjs/components/Swiper/stories/__mock__.js +3 -3
- package/dist/cjs/components/Swiper.js +27 -29
- package/dist/cjs/components/Switch.js +33 -26
- package/dist/cjs/components/Tab/stories/__mock__.js +1 -1
- package/dist/cjs/components/Tab.js +59 -69
- package/dist/cjs/components/Text.js +1 -2
- package/dist/cjs/components/Textarea.js +26 -18
- package/dist/cjs/components/Tile.js +21 -17
- package/dist/cjs/components/Title.js +3 -4
- package/dist/cjs/components/Tooltip.js +3 -4
- package/dist/cjs/components/Video/stories/__mocks__.js +1 -1
- package/dist/cjs/components/Video.js +3 -4
- package/dist/cjs/components/Warning.js +26 -20
- package/dist/cjs/context/Notifications.js +38 -42
- package/dist/cjs/context/UIContext.js +19 -17
- package/dist/cjs/context/UrlAssetPrefix.js +3 -3
- package/dist/cjs/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/cjs/hooks/useAppearanceConfig.js +0 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/cjs/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/cjs/hooks/useDeviceTargetClass.js +0 -1
- package/dist/cjs/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +0 -1
- package/dist/cjs/hooks/useStyles.js +0 -1
- package/dist/cjs/hooks/useViewportFix.js +5 -5
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/utils/setViewportProperty.js +3 -3
- package/dist/components/Accordion.js +37 -34
- package/dist/components/Avatar.js +5 -6
- package/dist/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/components/AvatarStack.js +17 -16
- package/dist/components/Badge.js +3 -4
- package/dist/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/components/Breadcrumbs.js +27 -23
- package/dist/components/Button.js +5 -6
- package/dist/components/Cell/stories/__mock__.js +1 -1
- package/dist/components/Cell.js +28 -25
- package/dist/components/Checkbox.js +33 -26
- package/dist/components/Checkmark.js +28 -23
- package/dist/components/Chips/stories/__mock__.js +1 -1
- package/dist/components/Chips.js +4 -5
- package/dist/components/Choice/stories/__mock__.js +2 -2
- package/dist/components/Choice.js +46 -40
- package/dist/components/Code.js +34 -26
- package/dist/components/CookiesWarning.js +23 -23
- package/dist/components/Dadata.js +14 -9
- package/dist/components/DatePeriod.js +32 -30
- package/dist/components/DatePicker.js +8 -9
- package/dist/components/Divider.js +1 -2
- package/dist/components/Dot.js +5 -6
- package/dist/components/Drawer.js +23 -21
- package/dist/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/components/Dropdown.js +5 -6
- package/dist/components/Flex.js +11 -12
- package/dist/components/Grid.js +15 -16
- package/dist/components/Group.js +1 -2
- package/dist/components/HTMLContent.js +5 -6
- package/dist/components/HeroTitle.js +17 -16
- package/dist/components/Icon.js +3 -4
- package/dist/components/Image.js +1 -2
- package/dist/components/Input.js +1 -2
- package/dist/components/InputPassword.js +114 -84
- package/dist/components/Label.js +4 -5
- package/dist/components/Link.js +1 -2
- package/dist/components/List.js +39 -28
- package/dist/components/Loader.js +2 -3
- package/dist/components/Logo.js +10 -11
- package/dist/components/MenuItem.js +36 -33
- package/dist/components/Modal.js +40 -38
- package/dist/components/ModalSheetBottom.js +17 -18
- package/dist/components/Notification/stories/__mock__.js +1 -1
- package/dist/components/Notification.js +31 -24
- package/dist/components/Overlay.js +1 -2
- package/dist/components/Pagination.js +43 -41
- package/dist/components/Radio.js +34 -26
- package/dist/components/RangeSlider.js +8 -9
- package/dist/components/Response/img.js +1 -1
- package/dist/components/Response.js +102 -84
- package/dist/components/SVGContent.js +6 -7
- package/dist/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/components/ScrollOnDrag.js +7 -8
- package/dist/components/ScrollToView.js +8 -9
- package/dist/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/components/Scrollbar.js +1 -1
- package/dist/components/Search.js +39 -31
- package/dist/components/Segmented/stories/__mock__.js +23 -10
- package/dist/components/Segmented.js +47 -42
- package/dist/components/Select.js +118 -113
- package/dist/components/Swiper/stories/__mock__.js +3 -3
- package/dist/components/Swiper.js +27 -29
- package/dist/components/Switch.js +33 -26
- package/dist/components/Tab/stories/__mock__.js +1 -1
- package/dist/components/Tab.js +59 -69
- package/dist/components/Text.js +1 -2
- package/dist/components/Textarea.js +26 -18
- package/dist/components/Tile.js +21 -17
- package/dist/components/Title.js +3 -4
- package/dist/components/Tooltip.js +3 -4
- package/dist/components/Video/stories/__mocks__.js +1 -1
- package/dist/components/Video.js +3 -4
- package/dist/components/Warning.js +26 -20
- package/dist/context/Notifications.js +38 -42
- package/dist/context/UIContext.js +19 -17
- package/dist/context/UrlAssetPrefix.js +3 -3
- package/dist/css/components/Checkmark/Checkmark.css +2 -0
- package/dist/css/components/DatePeriod/DatePeriod.css +3 -0
- package/dist/css/components/Input/Input.css +0 -8
- package/dist/css/components/InputPassword/InputPassword.css +34 -43
- package/dist/css/components/Tile/Tile.css +3 -3
- package/dist/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/hooks/useAppearanceConfig.js +0 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/hooks/useDeviceTargetClass.js +0 -1
- package/dist/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/hooks/useStyles/useStyles.js +0 -1
- package/dist/hooks/useStyles.js +0 -1
- package/dist/hooks/useViewportFix.js +5 -5
- package/dist/hooks.js +1 -1
- package/dist/types/components/InputPassword/InputPassword.appearance.d.ts +179 -2
- package/dist/types/components/InputPassword/appearance/inputPasswordDefault.d.ts +7 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordDisabled.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordError.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordRequire.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordShape.d.ts +25 -0
- package/dist/types/components/InputPassword/appearance/inputPasswordSize.d.ts +14 -28
- package/dist/types/components/InputPassword/appearance/inputPasswordStyle.d.ts +5 -5
- package/dist/types/components/InputPassword/appearance/inputPasswordSuccess.d.ts +6 -4
- package/dist/types/components/Response/Response.constant.d.ts +32 -35
- package/dist/types/components/Response/appearance/responseConfirm.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseDanger.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseEmpty.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseError.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseFail.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseNothingFound.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseRefresh.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseSuccess.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseUnableLoadData.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseWarning.d.ts +1 -0
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Tab/appearance/tabSize.d.ts +0 -14
- package/dist/types/components/Tab/appearance/tabSurface.d.ts +7 -7
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +14 -14
- package/dist/Avatar_cjs_kuE0Rueg.js +0 -157
- package/dist/Avatar_es_lx7s4Vla.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_DsIAoi01.js +0 -183
- package/dist/DatePicker_es_BP5BrEr-.js +0 -179
- package/dist/Divider_cjs_DUYtmwn2.js +0 -97
- package/dist/Divider_es_CCLBFIx6.js +0 -93
- package/dist/DropdownItem_cjs_Bhss6lyM.js +0 -207
- package/dist/DropdownItem_es_BXl6lPJx.js +0 -202
- package/dist/Group_cjs_CsJ6ICKK.js +0 -59
- package/dist/Group_es_DRqIIM9m.js +0 -55
- package/dist/Image_cjs_B6YlGx8G.js +0 -28
- package/dist/Image_es_BvYo_cHH.js +0 -26
- package/dist/Loader_cjs_D3lnxPlI.js +0 -132
- package/dist/Loader_es_BUSqFrCd.js +0 -128
- package/dist/Overlay_cjs_CcfJYN5o.js +0 -41
- package/dist/Overlay_es_DF3DAdxS.js +0 -37
- package/dist/Text_cjs_0EINiUq4.js +0 -68
- package/dist/Text_es_CwV9rjFD.js +0 -64
- package/dist/tslib.es6_cjs_CCZ3TN_7.js +0 -59
- package/dist/tslib.es6_es_Bwu1Cn-t.js +0 -56
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
2
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
2
|
import React, { useState, useCallback, useImperativeHandle } from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
@@ -6,7 +5,7 @@ import { Sheet } from 'react-modal-sheet';
|
|
|
6
5
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
6
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
7
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { b as Title } from '../
|
|
8
|
+
import { b as Title } from '../Icon_es_D5eiycFI.js';
|
|
10
9
|
import 'lodash/camelCase';
|
|
11
10
|
import 'lodash/castArray';
|
|
12
11
|
import 'lodash/upperFirst';
|
|
@@ -23,10 +22,10 @@ import 'lodash/maxBy';
|
|
|
23
22
|
import 'react-inlinesvg';
|
|
24
23
|
import '../hoc/urlWithAssetPrefix.js';
|
|
25
24
|
import '../context/UrlAssetPrefix.js';
|
|
26
|
-
import '../
|
|
27
|
-
import '../
|
|
25
|
+
import '../Link_es_P2b6ya7P.js';
|
|
26
|
+
import '../Text_es_CnymlElo.js';
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const modalSheetBottomAppearance = {
|
|
30
29
|
sizeL: {
|
|
31
30
|
size: 'l',
|
|
32
31
|
titleTextSize: 'h4',
|
|
@@ -40,31 +39,31 @@ var modalSheetBottomAppearance = {
|
|
|
40
39
|
},
|
|
41
40
|
};
|
|
42
41
|
|
|
43
|
-
|
|
42
|
+
const modalSheetBottomConfig = {
|
|
44
43
|
appearance: modalSheetBottomAppearance};
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
44
|
+
const ModalSheetBottom = React.forwardRef(function Modal(props, ref) {
|
|
45
|
+
const { appearance, initialIsOpen, title, isDisabled, closeButton, onCloseModalSheetBottom, onOpenModalSheetBottom, children, } = props;
|
|
46
|
+
const [isOpen, setIsOpen] = useState(initialIsOpen);
|
|
47
|
+
const openModalSheetBottom = useCallback(() => {
|
|
49
48
|
setIsOpen(true);
|
|
50
49
|
onOpenModalSheetBottom && onOpenModalSheetBottom();
|
|
51
50
|
}, [onOpenModalSheetBottom]);
|
|
52
|
-
|
|
51
|
+
const closeModalSheetBottom = useCallback(() => {
|
|
53
52
|
setIsOpen(false);
|
|
54
53
|
onCloseModalSheetBottom && onCloseModalSheetBottom();
|
|
55
54
|
}, [onCloseModalSheetBottom]);
|
|
56
55
|
// Save ref things
|
|
57
|
-
useImperativeHandle(ref,
|
|
56
|
+
useImperativeHandle(ref, () => ({
|
|
58
57
|
openModal: openModalSheetBottom,
|
|
59
58
|
closeModal: closeModalSheetBottom,
|
|
60
59
|
isOpen: isOpen,
|
|
61
|
-
})
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
60
|
+
}), [isOpen, openModalSheetBottom, closeModalSheetBottom]);
|
|
61
|
+
const appearanceConfig = useAppearanceConfig(appearance, modalSheetBottomConfig, isDisabled);
|
|
62
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
63
|
+
const { titleTextColor, titleTextColorHover, titleTextSize, titleTextTruncate, titleTextWeight, titleTextWidth, titleTextWrap, zeroPadding, } = propsGenerator;
|
|
65
64
|
// @ts-expect-error
|
|
66
|
-
|
|
67
|
-
return (jsxs(Sheet,
|
|
65
|
+
const { styles } = useStyles(props);
|
|
66
|
+
return (jsxs(Sheet, { className: "modal-sheet-bottom", isOpen: isOpen, onClose: closeModalSheetBottom, ...props, children: [jsxs(Sheet.Container, { className: "modal-sheet-bottom__container", style: styles, children: [jsx(Sheet.Header, { className: "modal-sheet-bottom__header", children: closeButton && (jsx("div", { className: "modal-sheet-bottom__close", onClick: closeModalSheetBottom, children: closeButton })) }), jsx(Sheet.Content, { className: "modal-sheet-bottom__content", children: jsx(Sheet.Scroller, { autoPadding: true, children: jsxs("div", { className: clsx('modal-sheet-bottom__content-wrapper', zeroPadding && 'modal-sheet-bottom__content-reset-padding'), children: [title && (jsx(Title, { className: "modal__title", width: titleTextWidth, size: titleTextSize, textColor: titleTextColor, textColorHover: titleTextColorHover, textTruncate: titleTextTruncate, textWeight: titleTextWeight, textWrap: titleTextWrap, children: title })), children] }) }) })] }), jsx(Sheet.Backdrop, { className: "modal-sheet-bottom__backdrop", onClick: closeModalSheetBottom })] }));
|
|
68
67
|
});
|
|
69
68
|
|
|
70
69
|
export { ModalSheetBottom, modalSheetBottomAppearance };
|
|
@@ -3,9 +3,8 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import { I as Icon } from '../
|
|
7
|
-
import { T as Text } from '../
|
|
8
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
6
|
+
import { I as Icon } from '../Icon_es_D5eiycFI.js';
|
|
7
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
9
8
|
import { icons20 } from '@itcase/icons/default';
|
|
10
9
|
import { useNotifications, useNotificationsAPI } from '../context/Notifications.js';
|
|
11
10
|
import '../context/UIContext.js';
|
|
@@ -24,9 +23,9 @@ import 'lodash/maxBy';
|
|
|
24
23
|
import 'react-inlinesvg';
|
|
25
24
|
import '../hoc/urlWithAssetPrefix.js';
|
|
26
25
|
import '../context/UrlAssetPrefix.js';
|
|
27
|
-
import '../
|
|
26
|
+
import '../Link_es_P2b6ya7P.js';
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const notificationAppearanceDefault = {
|
|
30
29
|
defaultPrimary: {
|
|
31
30
|
fill: 'surfacePrimary',
|
|
32
31
|
fillHover: 'surfacePrimaryHover',
|
|
@@ -42,7 +41,7 @@ var notificationAppearanceDefault = {
|
|
|
42
41
|
},
|
|
43
42
|
};
|
|
44
43
|
|
|
45
|
-
|
|
44
|
+
const notificationAppearanceError = {
|
|
46
45
|
errorPrimary: {
|
|
47
46
|
fill: 'errorPrimary',
|
|
48
47
|
fillHover: 'errorPrimaryHover',
|
|
@@ -58,7 +57,7 @@ var notificationAppearanceError = {
|
|
|
58
57
|
},
|
|
59
58
|
};
|
|
60
59
|
|
|
61
|
-
|
|
60
|
+
const notificationAppearanceInfo = {
|
|
62
61
|
infoPrimary: {
|
|
63
62
|
fill: 'infoPrimary',
|
|
64
63
|
fillHover: 'infoPrimaryHover',
|
|
@@ -74,9 +73,9 @@ var notificationAppearanceInfo = {
|
|
|
74
73
|
},
|
|
75
74
|
};
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
const notificationAppearanceSize = {};
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
const notificationAppearanceStyle = {
|
|
80
79
|
solid: {
|
|
81
80
|
borderColor: 'none',
|
|
82
81
|
},
|
|
@@ -90,7 +89,7 @@ var notificationAppearanceStyle = {
|
|
|
90
89
|
},
|
|
91
90
|
};
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
const notificationAppearanceSuccess = {
|
|
94
93
|
successPrimary: {
|
|
95
94
|
fill: 'successPrimary',
|
|
96
95
|
fillHover: 'successPrimaryHover',
|
|
@@ -106,7 +105,7 @@ var notificationAppearanceSuccess = {
|
|
|
106
105
|
},
|
|
107
106
|
};
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
const notificationAppearanceWarning = {
|
|
110
109
|
warningPrimary: {
|
|
111
110
|
fill: 'warningPrimary',
|
|
112
111
|
fillHover: 'warningPrimaryHover',
|
|
@@ -122,29 +121,37 @@ var notificationAppearanceWarning = {
|
|
|
122
121
|
},
|
|
123
122
|
};
|
|
124
123
|
|
|
125
|
-
|
|
124
|
+
const notificationAppearance = {
|
|
125
|
+
...notificationAppearanceDefault,
|
|
126
|
+
...notificationAppearanceSize,
|
|
127
|
+
...notificationAppearanceStyle,
|
|
128
|
+
...notificationAppearanceError,
|
|
129
|
+
...notificationAppearanceInfo,
|
|
130
|
+
...notificationAppearanceSuccess,
|
|
131
|
+
...notificationAppearanceWarning,
|
|
132
|
+
};
|
|
126
133
|
|
|
127
|
-
|
|
134
|
+
const notificationConfig = {
|
|
128
135
|
appearance: notificationAppearance,
|
|
129
|
-
setAppearance:
|
|
136
|
+
setAppearance: (appearanceConfig) => {
|
|
130
137
|
notificationConfig.appearance = appearanceConfig;
|
|
131
138
|
},
|
|
132
139
|
};
|
|
133
140
|
function Notification(props) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
141
|
+
const { id, dataTestId, dataTour, className, appearance, title, desc, before, after, close, isSkeleton, onClickClose, } = props;
|
|
142
|
+
const appearanceConfig = useAppearanceConfig(appearance, notificationConfig);
|
|
143
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
144
|
+
const { fillClass, titleTextColor, titleTextSize, descTextColor, descTextSize, elevationClass, sizeClass, widthClass, closeIcon, closeIconFill, closeIconFillIcon, closeIconFillSize, closeIconShape, closeIconSize, closeIconSrc, } = propsGenerator;
|
|
138
145
|
// @ts-expect-error
|
|
139
|
-
|
|
140
|
-
return (jsxs("div", { className: clsx('notification__item', elevationClass &&
|
|
146
|
+
const { styles: notificationStyles } = useStyles(props);
|
|
147
|
+
return (jsxs("div", { className: clsx('notification__item', elevationClass && `elevation_${elevationClass}`, sizeClass && `notification__item_set_${sizeClass}`, widthClass && `width_${widthClass}`, fillClass && `fill_${fillClass}`, isSkeleton && `notification__item_skeleton`), "data-test-id": dataTestId, "data-tour": dataTour, style: notificationStyles, children: [before, jsxs("div", { className: clsx(className, 'notification__item-wrapper'), children: [title && (jsx(Text, { className: "notification__item-title", size: titleTextSize, textColor: titleTextColor, children: title })), desc && (jsx(Text, { className: "notification__item-text", size: descTextSize, textColor: descTextColor, children: desc })), close && (closeIcon || closeIconSrc) && (jsx(Icon, { className: clsx('notification__item-close', 'cursor_type_pointer'), fill: closeIconFill, fillSize: closeIconFillSize, iconFill: closeIconFillIcon, iconSize: closeIconSize, imageSrc: closeIconSrc, shape: closeIconShape, SvgImage: closeIcon, onClick: () => onClickClose && onClickClose(id) }))] }), after] }));
|
|
141
148
|
}
|
|
142
149
|
|
|
143
150
|
function NotificationWrapper(props) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return (jsx("div", { className: clsx('notification', className), children: jsx("div", { className: "notification__wrapper", children: notifications.map(
|
|
151
|
+
const notifications = useNotifications();
|
|
152
|
+
const { hideNotifications } = useNotificationsAPI();
|
|
153
|
+
const { className, close } = props;
|
|
154
|
+
return (jsx("div", { className: clsx('notification', className), children: jsx("div", { className: "notification__wrapper", children: notifications.map((notification, i) => (jsx(Notification, { id: notification.id, appearance: notification.appearance, title: notification.title, status: notification.status, text: notification.text, close: close, onClickClose: hideNotifications }, i))) }) }));
|
|
148
155
|
}
|
|
149
156
|
|
|
150
157
|
export { Notification, NotificationWrapper, notificationAppearance, notificationConfig };
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { O as Overlay, a as overlayAppearance, o as overlayConfig } from '../
|
|
1
|
+
export { O as Overlay, a as overlayAppearance, o as overlayConfig } from '../Overlay_es_BS7OTFoy.js';
|
|
2
2
|
import 'react/jsx-runtime';
|
|
3
3
|
import 'clsx';
|
|
4
4
|
import '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
|
-
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
6
5
|
import 'react';
|
|
7
6
|
import '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
7
|
import 'lodash/camelCase';
|
|
@@ -6,10 +6,9 @@ import ReactPaginate from 'react-paginate';
|
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { D as Dropdown, a as DropdownItem } from '../
|
|
10
|
-
import { I as Icon } from '../
|
|
11
|
-
import { T as Text } from '../
|
|
12
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
9
|
+
import { D as Dropdown, a as DropdownItem } from '../DropdownItem_es_B-1qtEa7.js';
|
|
10
|
+
import { I as Icon } from '../Icon_es_D5eiycFI.js';
|
|
11
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
13
12
|
import { icons14, icons24, icons16 } from '@itcase/icons/default';
|
|
14
13
|
import 'lodash/camelCase';
|
|
15
14
|
import 'lodash/castArray';
|
|
@@ -24,13 +23,13 @@ import '../utils/setViewportProperty.js';
|
|
|
24
23
|
import '../hooks.js';
|
|
25
24
|
import '../hooks/useStyles/styleAttributes.js';
|
|
26
25
|
import 'lodash/maxBy';
|
|
27
|
-
import '../
|
|
26
|
+
import '../Divider_es_BiYozVBS.js';
|
|
28
27
|
import 'react-inlinesvg';
|
|
29
28
|
import '../hoc/urlWithAssetPrefix.js';
|
|
30
29
|
import '../context/UrlAssetPrefix.js';
|
|
31
|
-
import '../
|
|
30
|
+
import '../Link_es_P2b6ya7P.js';
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
const paginationAppearanceAccent = {
|
|
34
33
|
accent: {
|
|
35
34
|
fill: 'accentPrimary',
|
|
36
35
|
fillHover: 'accentPrimaryHover',
|
|
@@ -72,7 +71,7 @@ var paginationAppearanceAccent = {
|
|
|
72
71
|
},
|
|
73
72
|
};
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
const paginationAppearanceSize = {
|
|
76
75
|
sizeL: {
|
|
77
76
|
size: 'l',
|
|
78
77
|
labelTextSize: 'l',
|
|
@@ -149,7 +148,7 @@ var paginationAppearanceSize = {
|
|
|
149
148
|
},
|
|
150
149
|
};
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
const paginationAppearanceStyle = {
|
|
153
152
|
solid: {
|
|
154
153
|
borderColor: 'none',
|
|
155
154
|
},
|
|
@@ -163,7 +162,7 @@ var paginationAppearanceStyle = {
|
|
|
163
162
|
},
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
const paginationAppearanceSurface = {
|
|
167
166
|
surfacePrimary: {
|
|
168
167
|
fill: 'surfacePrimary',
|
|
169
168
|
fillHover: 'surfaceTertiary',
|
|
@@ -194,57 +193,62 @@ var paginationAppearanceSurface = {
|
|
|
194
193
|
},
|
|
195
194
|
};
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
const paginationAppearance = {
|
|
197
|
+
...paginationAppearanceSurface,
|
|
198
|
+
...paginationAppearanceAccent,
|
|
199
|
+
...paginationAppearanceSize,
|
|
200
|
+
...paginationAppearanceStyle,
|
|
201
|
+
};
|
|
198
202
|
|
|
199
|
-
|
|
203
|
+
const paginationConfig = {
|
|
200
204
|
appearance: paginationAppearance,
|
|
201
|
-
setAppearance:
|
|
205
|
+
setAppearance: (appearanceConfig) => {
|
|
202
206
|
paginationConfig.appearance = appearanceConfig;
|
|
203
207
|
},
|
|
204
208
|
};
|
|
205
209
|
function Pagination(props) {
|
|
206
|
-
|
|
210
|
+
const { className, appearance, allItemsCount = 0, dataTestId, dataTour, pageCountArray = [10, 20, 50, 100], pageCountDesc = 'кол-во строк', pageCountDropdownItemDividerDirection, pageNumber = 0, perPageCount = 0, isPageCount, isDisabled, isPageCountDropdownReversed = false, isPageLabelBuilder, isSkeleton, onChangePage, onChangePerPageCount,
|
|
207
211
|
/**
|
|
208
212
|
* @deprecated The method should not be used
|
|
209
213
|
*/
|
|
210
|
-
onPageChange
|
|
214
|
+
onPageChange,
|
|
211
215
|
/**
|
|
212
216
|
* @deprecated The method should not be used
|
|
213
217
|
*/
|
|
214
|
-
onPerPageCountChange = props
|
|
215
|
-
|
|
218
|
+
onPerPageCountChange, } = props;
|
|
219
|
+
const _onChangePage = useMemo(() => {
|
|
216
220
|
if (onPageChange) {
|
|
217
221
|
console.warn('@itcase/ui Pagination warning: "onPageChange" is deprecated, use "onChangePage" instead.');
|
|
218
222
|
return onPageChange;
|
|
219
223
|
}
|
|
220
224
|
return onChangePage;
|
|
221
225
|
}, [onChangePage, onPageChange]);
|
|
222
|
-
|
|
226
|
+
const _onChangePerPageCount = useMemo(() => {
|
|
223
227
|
if (onPerPageCountChange) {
|
|
224
228
|
console.warn('@itcase/ui Pagination warning: "onPerPageCountChange" is deprecated, use "onChangePerPageCount" instead.');
|
|
225
229
|
return onPerPageCountChange;
|
|
226
230
|
}
|
|
227
231
|
return onChangePerPageCount;
|
|
228
232
|
}, [onChangePerPageCount, onPerPageCountChange]);
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
|
|
234
|
+
const [activeDropdownItem, setActiveDropdownItem] = useState(perPageCount);
|
|
235
|
+
const pageCountDropdownArray = useMemo(() => {
|
|
232
236
|
return isPageCountDropdownReversed
|
|
233
|
-
? pageCountArray
|
|
237
|
+
? pageCountArray?.reverse()
|
|
234
238
|
: pageCountArray;
|
|
235
239
|
}, [isPageCountDropdownReversed, pageCountArray]);
|
|
236
240
|
// Toggle command menu
|
|
237
|
-
|
|
238
|
-
setIsOpenDropdown(
|
|
241
|
+
const onClickCommandMenuButton = useCallback(() => {
|
|
242
|
+
setIsOpenDropdown((state) => !state);
|
|
239
243
|
}, []);
|
|
240
|
-
|
|
244
|
+
const handleDropdownItemClick = useCallback((event, item) => {
|
|
241
245
|
event.stopPropagation();
|
|
242
246
|
_onChangePerPageCount && _onChangePerPageCount(item);
|
|
243
247
|
setActiveDropdownItem(item);
|
|
244
248
|
setIsOpenDropdown(false);
|
|
245
249
|
}, [_onChangePerPageCount]);
|
|
246
250
|
// Calculate count of pages for all items
|
|
247
|
-
|
|
251
|
+
const paginationPagesCount = useMemo(() => {
|
|
248
252
|
if (allItemsCount && allItemsCount > 0) {
|
|
249
253
|
// Round up. "perPageCount" may be is a query params "limit"
|
|
250
254
|
return ceil(allItemsCount / perPageCount);
|
|
@@ -252,29 +256,27 @@ function Pagination(props) {
|
|
|
252
256
|
return 0;
|
|
253
257
|
}, [allItemsCount, perPageCount]);
|
|
254
258
|
// Index for pagination state
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
const paginationPageIndex = useMemo(() => {
|
|
260
|
+
const intPageNumber = parseInt(pageNumber);
|
|
257
261
|
// For pagination need index of page, not number
|
|
258
262
|
if (!isNaN(intPageNumber) && intPageNumber > 1) {
|
|
259
263
|
return intPageNumber - 1;
|
|
260
264
|
}
|
|
261
265
|
return 0;
|
|
262
266
|
}, [pageNumber]);
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return (jsxs("div", { className: clsx('pagination', sizeClass &&
|
|
268
|
-
|
|
267
|
+
const appearanceConfig = useAppearanceConfig(appearance, paginationConfig, isDisabled);
|
|
268
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
269
|
+
const { justifyContentClass, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, fillInputClass, fillInputHoverClass, textColorClass, textSizeClass, builderIcon, builderIconFill, builderIconFillIcon, builderIconFillSize, builderIconSize, marginPagesDisplayed, nextIcon, nextIconFill, nextIconFillIcon, nextIconFillSize, nextIconSize, pageCountDescTextColor, pageCountDescTextSize, pageCountDropdownAlignment, pageCountDropdownElevation, pageCountDropdownFill, pageCountDropdownItemDividerFill, pageCountDropdownItemDividerSize, pageCountDropdownItemFill, pageCountDropdownItemFillActive, pageCountDropdownItemFillActiveHover, pageCountDropdownItemFillHover, pageCountDropdownItemLabelAlign, pageCountDropdownItemLabelColor, pageCountDropdownItemLabelColorActive, pageCountDropdownItemLabelColorActiveHover, pageCountDropdownItemLabelColorHover, pageCountDropdownItemLabelSize, pageCountDropdownItemLabelWrap, pageCountDropdownItemShowDivider, pageCountDropdownItemSize, pageCountDropdownItemWidth, pageCountDropdownShape, pageCountInputIcon, pageCountInputIconColor, pageCountInputIconFillSize, pageCountInputIconSrc, pageCountInputTextColor, pageCountInputTextSize, pageRangeDisplayed, previousIcon, previousIconFill, previousIconFillIcon, previousIconFillSize, previousIconSize, sizeClass, } = propsGenerator;
|
|
270
|
+
const { styles: paginationStyles } = useStyles(props);
|
|
271
|
+
return (jsxs("div", { className: clsx('pagination', sizeClass && `pagination_size_${sizeClass}`, isSkeleton && `pagination_skeleton`), "data-test-id": dataTestId, "data-tour": dataTour, style: paginationStyles, children: [jsx(ReactPaginate, { disabledClassName: "pagination__item_state_disabled cursor_type_default", disabledLinkClassName: "pagination__item_state_disabled", activeClassName: clsx('pagination__item_state_active cursor_type_default', fillActiveClass && `fill_active_${fillActiveClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`), activeLinkClassName: "pagination__item-link_state_active", breakClassName: "pagination__item pagination__item_break", breakLabel: "...", breakLinkClassName: "pagination__item-link", containerClassName: clsx(className, 'pagination__container', justifyContentClass &&
|
|
272
|
+
`pagination_justify-content_${justifyContentClass}`),
|
|
269
273
|
// pages settings
|
|
270
|
-
forcePage: paginationPageIndex, marginPagesDisplayed: marginPagesDisplayed, nextClassName: clsx('pagination__item pagination__item_next', sizeClass &&
|
|
274
|
+
forcePage: paginationPageIndex, marginPagesDisplayed: marginPagesDisplayed, nextClassName: clsx('pagination__item pagination__item_next', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`),
|
|
271
275
|
// next button
|
|
272
|
-
nextLabel: jsx(Icon, { fill: nextIconFill, fillSize: nextIconFillSize, iconFill: nextIconFillIcon, iconSize: nextIconSize, shape: "circular", SvgImage: nextIcon }), nextLinkClassName: "pagination__item-link", pageClassName: clsx('pagination__item', sizeClass &&
|
|
273
|
-
(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
pageCountDropdownItemShowDivider, isActive: false, onClick: function (event) { return handleDropdownItemClick(event, item); } }, item));
|
|
277
|
-
}) })] })] }))] }));
|
|
276
|
+
nextLabel: jsx(Icon, { fill: nextIconFill, fillSize: nextIconFillSize, iconFill: nextIconFillIcon, iconSize: nextIconSize, shape: "circular", SvgImage: nextIcon }), nextLinkClassName: "pagination__item-link", pageClassName: clsx('pagination__item', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`), pageCount: paginationPagesCount, pageLabelBuilder: isPageLabelBuilder &&
|
|
277
|
+
(() => (jsx(Icon, { fill: builderIconFill, fillSize: builderIconFillSize, iconFill: builderIconFillIcon, iconSize: builderIconSize, shape: "circular", SvgImage: builderIcon }))), pageLinkClassName: clsx('pagination__item-link', textSizeClass && `pagination__item-link_size_${textSizeClass}`, textColorClass && 'text', textColorClass && `text-color_${textColorClass}`), pageRangeDisplayed: pageRangeDisplayed, previousClassName: clsx('pagination__item pagination__item_previous', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`), previousLabel: jsx(Icon, { fill: previousIconFill, fillSize: previousIconFillSize, iconFill: previousIconFillIcon, iconSize: previousIconSize, shape: "circular", SvgImage: previousIcon }), previousLinkClassName: "pagination__item-link", onPageChange: _onChangePage }), isPageCount && (jsxs("div", { className: clsx(className, 'pagination__count'), children: [jsx(Text, { className: "pagination__count-text", size: pageCountDescTextSize, textColor: pageCountDescTextColor, children: pageCountDesc }), jsxs("div", { className: clsx('pagination__input', 'cursor_type_pointer', fillClass && `fill_${fillInputClass}`, fillHoverClass && `fill_hover_${fillInputHoverClass}`), onClick: onClickCommandMenuButton, children: [jsx(Text, { size: pageCountInputTextSize, textColor: pageCountInputTextColor, children: activeDropdownItem }), jsx(Icon, { fillSize: pageCountInputIconFillSize, iconFill: pageCountInputIconColor, imageSrc: pageCountInputIconSrc, SvgImage: pageCountInputIcon }), jsx(Dropdown, { className: "pagination__dropdown", alignment: pageCountDropdownAlignment, fill: pageCountDropdownFill, elevation: pageCountDropdownElevation, setIsOpen: setIsOpenDropdown, shape: pageCountDropdownShape, isOpen: isOpenDropdown, children: pageCountDropdownArray.map((item, index) => activeDropdownItem === item ? (jsx(DropdownItem, { width: pageCountDropdownItemWidth, size: pageCountDropdownItemSize, fill: pageCountDropdownItemFill, fillActive: pageCountDropdownItemFillActive, fillActiveHover: pageCountDropdownItemFillActiveHover, fillHover: pageCountDropdownItemFillHover, label: item.toString(), labelTextAlign: pageCountDropdownItemLabelAlign, labelTextColor: pageCountDropdownItemLabelColor, labelTextColorActive: pageCountDropdownItemLabelColorActive, labelTextColorActiveHover: pageCountDropdownItemLabelColorActiveHover, labelTextColorHover: pageCountDropdownItemLabelColorHover, labelTextSize: pageCountDropdownItemLabelSize, labelTextWrap: pageCountDropdownItemLabelWrap, dividerDirection: pageCountDropdownItemDividerDirection, dividerFill: pageCountDropdownItemDividerFill, dividerSize: pageCountDropdownItemDividerSize, showDivider: index < pageCountArray.length - 1 &&
|
|
278
|
+
pageCountDropdownItemShowDivider, isActive: true, onClick: (event) => handleDropdownItemClick(event, item) }, item)) : (jsx(DropdownItem, { width: pageCountDropdownItemWidth, size: pageCountDropdownItemSize, fill: pageCountDropdownItemFill, fillHover: pageCountDropdownItemFillHover, label: item.toString(), labelTextAlign: pageCountDropdownItemLabelAlign, labelTextColor: pageCountDropdownItemLabelColor, labelTextColorHover: pageCountDropdownItemLabelColorHover, labelTextSize: pageCountDropdownItemLabelSize, labelTextWrap: pageCountDropdownItemLabelWrap, dividerDirection: pageCountDropdownItemDividerDirection, dividerFill: pageCountDropdownItemDividerFill, dividerSize: pageCountDropdownItemDividerSize, showDivider: index < pageCountArray.length - 1 &&
|
|
279
|
+
pageCountDropdownItemShowDivider, isActive: false, onClick: (event) => handleDropdownItemClick(event, item) }, item))) })] })] }))] }));
|
|
278
280
|
}
|
|
279
281
|
|
|
280
282
|
export { Pagination, paginationAppearance, paginationConfig };
|
package/dist/components/Radio.js
CHANGED
|
@@ -2,8 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
|
-
import { T as Text } from '../
|
|
6
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
5
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
7
6
|
import 'react';
|
|
8
7
|
import 'lodash/camelCase';
|
|
9
8
|
import 'lodash/castArray';
|
|
@@ -20,7 +19,7 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
20
19
|
import '../hooks/useStyles/useStyles.js';
|
|
21
20
|
import 'lodash/maxBy';
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
const radioAppearanceDefault = {
|
|
24
23
|
defaultPrimary: {
|
|
25
24
|
fill: 'surfaceSecondary',
|
|
26
25
|
fillCheckmark: 'surfaceQuaternary',
|
|
@@ -38,7 +37,7 @@ var radioAppearanceDefault = {
|
|
|
38
37
|
},
|
|
39
38
|
};
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
const radioAppearanceDisabled = {
|
|
42
41
|
disabledPrimary: {
|
|
43
42
|
fill: 'surfaceDisabled',
|
|
44
43
|
fillCheckmark: 'surfaceQuaternary',
|
|
@@ -52,7 +51,7 @@ var radioAppearanceDisabled = {
|
|
|
52
51
|
},
|
|
53
52
|
};
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
const radioAppearanceError = {
|
|
56
55
|
errorPrimary: {
|
|
57
56
|
fill: 'errorTertiary',
|
|
58
57
|
fillCheckmark: 'errorPrimary',
|
|
@@ -66,7 +65,7 @@ var radioAppearanceError = {
|
|
|
66
65
|
},
|
|
67
66
|
};
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
const radioAppearanceRequire = {
|
|
70
69
|
requirePrimary: {
|
|
71
70
|
fill: 'warningTertiary',
|
|
72
71
|
fillCheckmark: 'warningPrimary',
|
|
@@ -80,7 +79,7 @@ var radioAppearanceRequire = {
|
|
|
80
79
|
},
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
const radioAppearanceShape = {
|
|
84
83
|
circular: {
|
|
85
84
|
shape: 'circular',
|
|
86
85
|
},
|
|
@@ -105,7 +104,7 @@ var radioAppearanceShape = {
|
|
|
105
104
|
},
|
|
106
105
|
};
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
const radioAppearanceSize = {
|
|
109
108
|
sizeM: {
|
|
110
109
|
size: 'm',
|
|
111
110
|
labelTextSize: 's',
|
|
@@ -123,7 +122,7 @@ var radioAppearanceSize = {
|
|
|
123
122
|
},
|
|
124
123
|
};
|
|
125
124
|
|
|
126
|
-
|
|
125
|
+
const radioAppearanceStyle = {
|
|
127
126
|
solid: {
|
|
128
127
|
fill: 'none',
|
|
129
128
|
fillHover: 'none',
|
|
@@ -147,7 +146,7 @@ var radioAppearanceStyle = {
|
|
|
147
146
|
},
|
|
148
147
|
};
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
const radioAppearanceSuccess = {
|
|
151
150
|
successPrimary: {
|
|
152
151
|
fill: 'successTertiary',
|
|
153
152
|
fillCheckmark: 'accentItemSecondary',
|
|
@@ -161,33 +160,42 @@ var radioAppearanceSuccess = {
|
|
|
161
160
|
},
|
|
162
161
|
};
|
|
163
162
|
|
|
164
|
-
|
|
163
|
+
const radioAppearance = {
|
|
164
|
+
...radioAppearanceDefault,
|
|
165
|
+
...radioAppearanceError,
|
|
166
|
+
...radioAppearanceSuccess,
|
|
167
|
+
...radioAppearanceRequire,
|
|
168
|
+
...radioAppearanceDisabled,
|
|
169
|
+
...radioAppearanceSize,
|
|
170
|
+
...radioAppearanceShape,
|
|
171
|
+
...radioAppearanceStyle,
|
|
172
|
+
};
|
|
165
173
|
|
|
166
|
-
|
|
174
|
+
const radioConfig = {
|
|
167
175
|
appearance: radioAppearance,
|
|
168
|
-
setAppearance:
|
|
176
|
+
setAppearance: (appearanceConfig) => {
|
|
169
177
|
radioConfig.appearance = appearanceConfig;
|
|
170
178
|
},
|
|
171
179
|
};
|
|
172
180
|
function Radio(props) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return (jsxs(Tag, { className: clsx(className, 'radio', fillClass &&
|
|
178
|
-
? fillRadioClass &&
|
|
179
|
-
: fillRadioActiveClass &&
|
|
180
|
-
? fillRadioHoverClass &&
|
|
181
|
+
const { id, className, appearance, label, desc, isDisabled, checked, tag: Tag = 'label', value, isActive, isSkeleton, onChange, } = props;
|
|
182
|
+
const appearanceConfig = useAppearanceConfig(appearance, radioConfig, isDisabled);
|
|
183
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
184
|
+
const { fillCheckmarkClass, fillClass, fillHoverClass, fillRadioActiveClass, fillRadioActiveHoverClass, fillRadioClass, fillRadioHoverClass, labelTextColor, labelTextSize, labelTextWeight, descTextColor, descTextSize, descTextWeight, borderRadioColorClass, borderRadioColorActiveClass, borderRadioColorActiveHoverClass, borderRadioColorHoverClass, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
185
|
+
return (jsxs(Tag, { className: clsx(className, 'radio', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_${fillHoverClass}`, isSkeleton && 'radio_skeleton', sizeClass && `radio_size_${sizeClass}`, !checked || !isActive
|
|
186
|
+
? fillRadioClass && `radio_fill_${fillRadioClass}`
|
|
187
|
+
: fillRadioActiveClass && `radio_fill_active_${fillRadioActiveClass}`, !checked || !isActive
|
|
188
|
+
? fillRadioHoverClass && `radio_fill_hover_${fillRadioHoverClass}`
|
|
181
189
|
: fillRadioActiveHoverClass &&
|
|
182
|
-
|
|
190
|
+
`radio_fill_active_hover_${fillRadioActiveHoverClass}`, !checked || !isActive
|
|
183
191
|
? borderRadioColorClass &&
|
|
184
|
-
|
|
192
|
+
`radio_border-color_${borderRadioColorClass}`
|
|
185
193
|
: borderRadioColorActiveClass &&
|
|
186
|
-
|
|
194
|
+
`radio_border-color_active_${borderRadioColorActiveClass}`, !checked || !isActive
|
|
187
195
|
? borderRadioColorHoverClass &&
|
|
188
|
-
|
|
196
|
+
`radio_border-color_hover_${borderRadioColorHoverClass}`
|
|
189
197
|
: borderRadioColorActiveHoverClass &&
|
|
190
|
-
|
|
198
|
+
`radio_border-color_active_hover_${borderRadioColorActiveHoverClass}`), htmlFor: id, children: [jsxs("div", { className: clsx('radio__item'), children: [jsx("input", { id: String(id), className: "radio__input", type: "radio", disabled: isDisabled && 'disabled', checked: checked, value: value, onChange: onChange }), jsx("div", { className: clsx('radio__state', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && `fill_${fillCheckmarkClass}`), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
export { Radio, radioAppearance, radioConfig };
|
|
@@ -3,7 +3,6 @@ import clsx from 'clsx';
|
|
|
3
3
|
import Slider from 'rc-slider';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
7
6
|
import 'react';
|
|
8
7
|
import 'lodash/camelCase';
|
|
9
8
|
import 'lodash/castArray';
|
|
@@ -20,15 +19,15 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
20
19
|
import 'lodash/maxBy';
|
|
21
20
|
|
|
22
21
|
function RangeSlider(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const { className, min, max, disabled, pushable, range, value, vertical, before, after, set, onChangeSlider, children, } = props;
|
|
23
|
+
const propsGenerator = useDevicePropsGenerator(props);
|
|
24
|
+
const { fillClass, fillHandleClass, fillHandleDraggingClass, fillHandleDraggingHoverClass, fillHandleHoverClass, fillRailClass, fillTrackClass, shapeClass, widthClass, } = propsGenerator;
|
|
26
25
|
// @ts-expect-error
|
|
27
|
-
|
|
28
|
-
return (jsxs("div", { className: clsx(className, 'range-slider', set &&
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const { styles: rangeSliderStyles } = useStyles(props);
|
|
27
|
+
return (jsxs("div", { className: clsx(className, 'range-slider', set && `range-slider_set_${set}`, fillClass && `fill_${fillClass}`, fillTrackClass && `range-slider-track-fill_${fillTrackClass}`, fillRailClass && `range-slider-rail-fill_${fillRailClass}`, fillHandleClass && `range-slider-handle-fill_${fillHandleClass}`, fillHandleHoverClass &&
|
|
28
|
+
`range-slider-handle-fill-hover_${fillHandleHoverClass}`, fillHandleDraggingClass &&
|
|
29
|
+
`range-slider-handle-dragging-fill_${fillHandleDraggingClass}`, fillHandleDraggingHoverClass &&
|
|
30
|
+
`range-slider-handle-dragging-fill-hover_${fillHandleDraggingHoverClass}`, shapeClass && `range-slider_shape_${shapeClass}`, widthClass && `width_${widthClass}`), style: rangeSliderStyles, children: [before && jsx("div", { className: "range-slider__before", children: before }), jsx(Slider, { className: "range-slider__wrapper", min: min, max: max, disabled: disabled, pushable: pushable, range: range, value: value, vertical: vertical, onChange: onChangeSlider }), children, after && jsx("div", { className: "range-slider__after", children: after })] }));
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export { RangeSlider };
|