@itcase/ui 1.8.123 → 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_Ce97psFT.js → Button_cjs_CZz8OjWi.js} +39 -27
- package/dist/{Button_es_CZss7cXh.js → Button_es_Cn3wtv3M.js} +39 -27
- 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_DRPK_RHK.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_Cv5nEb_n.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 +34 -26
- 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 +45 -34
- 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 +46 -41
- 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 +33 -27
- 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 +34 -26
- 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 +45 -34
- 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 +46 -41
- 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 +33 -27
- 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/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/Select/SelectContainer.d.ts +1 -1
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +3 -3
- package/dist/Avatar_cjs_CLJnKU39.js +0 -157
- package/dist/Avatar_es_BgN-fbOj.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_BzEtDAb8.js +0 -183
- package/dist/DatePicker_es_DRyCMO0I.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_DRhhc66R.js +0 -29
- package/dist/Image_es_BpMidmve.js +0 -27
- 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,153 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
|
-
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
-
import { I as Icon, B as Badge } from './Icon_es_BrwLifge.js';
|
|
7
|
-
import { I as Image } from './Image_es_BpMidmve.js';
|
|
8
|
-
import { T as Text } from './Text_es_CwV9rjFD.js';
|
|
9
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
10
|
-
|
|
11
|
-
var avatarAppearanceDefault = {
|
|
12
|
-
surfacePrimary: {
|
|
13
|
-
fill: 'surfacePrimary',
|
|
14
|
-
textColor: 'surfaceTextPrimary',
|
|
15
|
-
badgeAppearance: 'accentPrimary solid circular',
|
|
16
|
-
},
|
|
17
|
-
surfaceSecondary: {
|
|
18
|
-
fill: 'surfaceSecondary',
|
|
19
|
-
textColor: 'surfaceTextPrimary',
|
|
20
|
-
badgeAppearance: 'accentPrimary solid circular',
|
|
21
|
-
},
|
|
22
|
-
surfaceTertiary: {
|
|
23
|
-
fill: 'surfaceTertiary',
|
|
24
|
-
textColor: 'surfaceTextPrimary',
|
|
25
|
-
badgeAppearance: 'accentPrimary solid circular',
|
|
26
|
-
},
|
|
27
|
-
surfaceQuaternary: {
|
|
28
|
-
fill: 'surfaceQuaternary',
|
|
29
|
-
textColor: 'surfaceTextPrimary',
|
|
30
|
-
badgeAppearance: 'accentPrimary solid circular',
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
var avatarAppearanceShape = {
|
|
35
|
-
circular: {
|
|
36
|
-
shape: 'circular',
|
|
37
|
-
},
|
|
38
|
-
rounded: {
|
|
39
|
-
shape: 'rounded',
|
|
40
|
-
},
|
|
41
|
-
roundedXL: {
|
|
42
|
-
shape: 'rounded',
|
|
43
|
-
shapeStrength: '2m',
|
|
44
|
-
},
|
|
45
|
-
roundedL: {
|
|
46
|
-
shape: 'rounded',
|
|
47
|
-
shapeStrength: '1_5m',
|
|
48
|
-
},
|
|
49
|
-
roundedM: {
|
|
50
|
-
shape: 'rounded',
|
|
51
|
-
shapeStrength: '1m',
|
|
52
|
-
},
|
|
53
|
-
roundedS: {
|
|
54
|
-
shape: 'rounded',
|
|
55
|
-
shapeStrength: '0_5m',
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
var avatarAppearanceSize = {
|
|
60
|
-
size16: {
|
|
61
|
-
size: '16',
|
|
62
|
-
textSize: 'xxl',
|
|
63
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
64
|
-
iconFillSize: '12',
|
|
65
|
-
},
|
|
66
|
-
size20: {
|
|
67
|
-
size: '20',
|
|
68
|
-
textSize: 'xxl',
|
|
69
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
70
|
-
iconFillSize: '12',
|
|
71
|
-
},
|
|
72
|
-
size24: {
|
|
73
|
-
size: '24',
|
|
74
|
-
textSize: 'l',
|
|
75
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
76
|
-
iconFillSize: '12',
|
|
77
|
-
},
|
|
78
|
-
size32: {
|
|
79
|
-
size: '32',
|
|
80
|
-
textSize: 'l',
|
|
81
|
-
badgeAppearanceSize: 'sizeXS',
|
|
82
|
-
iconFillSize: '12',
|
|
83
|
-
},
|
|
84
|
-
size40: {
|
|
85
|
-
size: '40',
|
|
86
|
-
textSize: 'l',
|
|
87
|
-
badgeAppearanceSize: 'sizeS',
|
|
88
|
-
iconFillSize: '12',
|
|
89
|
-
},
|
|
90
|
-
size56: {
|
|
91
|
-
size: '56',
|
|
92
|
-
textSize: 'xxl',
|
|
93
|
-
badgeAppearanceSize: 'sizeM',
|
|
94
|
-
iconFillSize: '16',
|
|
95
|
-
},
|
|
96
|
-
size96: {
|
|
97
|
-
size: '96',
|
|
98
|
-
textSize: 'xxl',
|
|
99
|
-
badgeAppearanceSize: 'sizeXL',
|
|
100
|
-
iconFillSize: '32',
|
|
101
|
-
},
|
|
102
|
-
size144: {
|
|
103
|
-
size: '144',
|
|
104
|
-
textSize: 'xxl',
|
|
105
|
-
badgeAppearanceSize: 'sizeXXL',
|
|
106
|
-
iconFillSize: '40',
|
|
107
|
-
},
|
|
108
|
-
size240: {
|
|
109
|
-
size: '240',
|
|
110
|
-
textSize: 'xxl',
|
|
111
|
-
badgeAppearanceSize: 'sizeXXL',
|
|
112
|
-
iconFillSize: '40',
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
|
|
116
|
-
var avatarAppearanceStyle = {
|
|
117
|
-
solid: {
|
|
118
|
-
borderColor: 'none',
|
|
119
|
-
},
|
|
120
|
-
outlined: {
|
|
121
|
-
fill: 'none',
|
|
122
|
-
},
|
|
123
|
-
full: {
|
|
124
|
-
borderColor: 'none',
|
|
125
|
-
},
|
|
126
|
-
ghost: {
|
|
127
|
-
fill: 'none',
|
|
128
|
-
borderColor: 'none',
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var avatarAppearance = __assign(__assign(__assign(__assign({}, avatarAppearanceSize), avatarAppearanceStyle), avatarAppearanceShape), avatarAppearanceDefault);
|
|
133
|
-
|
|
134
|
-
var avatarConfig = {
|
|
135
|
-
appearance: avatarAppearance,
|
|
136
|
-
setAppearance: function (appearanceConfig) {
|
|
137
|
-
avatarConfig.appearance = appearanceConfig;
|
|
138
|
-
},
|
|
139
|
-
};
|
|
140
|
-
function Avatar(props) {
|
|
141
|
-
var className = props.className, appearance = props.appearance, src = props.src, _a = props.firstName, firstName = _a === void 0 ? '' : _a, _b = props.secondName, secondName = _b === void 0 ? '' : _b, count = props.count, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick;
|
|
142
|
-
var avatarChars = useMemo(function () {
|
|
143
|
-
var firstChar = ((firstName === null || firstName === void 0 ? void 0 : firstName[0]) || '').toUpperCase();
|
|
144
|
-
var secondChar = ((secondName === null || secondName === void 0 ? void 0 : secondName[0]) || '').toUpperCase();
|
|
145
|
-
return "".concat(firstChar).concat(secondChar);
|
|
146
|
-
}, [firstName, secondName]);
|
|
147
|
-
var appearanceConfig = useAppearanceConfig(appearance, avatarConfig);
|
|
148
|
-
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
149
|
-
var size = propsGenerator.size, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, textWeight = propsGenerator.textWeight, badge = propsGenerator.badge, badgeAppearance = propsGenerator.badgeAppearance, badgeAppearanceSize = propsGenerator.badgeAppearanceSize, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, icon = propsGenerator.icon, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, placeholderUrl = propsGenerator.placeholderUrl, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass;
|
|
150
|
-
return (jsx("div", { className: clsx(className, 'avatar', size && "avatar_size_".concat(sizeClass), (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && "avatar_skeleton", onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxs("div", { className: clsx('avatar__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass)), children: [before, src ? (jsx(Image, { className: clsx('avatar__image', shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass)), src: src, placeholderUrl: placeholderUrl })) : (jsx(Text, { className: "avatar__text", size: textSize, textColor: textColor, textWeight: textWeight, children: avatarChars || count })), (icon || iconSrc) && (jsx(Icon, { className: "avatar__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), (badge || badgeValue) && (jsx(Badge, { className: "avatar__badge", appearance: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), after] }) }));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export { Avatar as A, avatarConfig as a, avatarAppearance as b };
|
|
@@ -1,331 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var clsx = require('clsx');
|
|
5
|
-
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
6
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
-
var Icon = require('./Icon_cjs_Cz6IyOkb.js');
|
|
9
|
-
var Text = require('./Text_cjs_0EINiUq4.js');
|
|
10
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
11
|
-
|
|
12
|
-
var chipsAppearanceAccent = {
|
|
13
|
-
accent: {
|
|
14
|
-
fill: 'accentPrimary',
|
|
15
|
-
fillHover: 'accentHoverPrimary',
|
|
16
|
-
labelTextColor: 'accentTextPrimary',
|
|
17
|
-
borderColor: 'accentBorderSecondary',
|
|
18
|
-
},
|
|
19
|
-
accentMutedPrimary: {
|
|
20
|
-
fill: 'accentTertiary',
|
|
21
|
-
fillHover: 'accentHoverPrimary',
|
|
22
|
-
labelTextColor: 'accentTextSecondary',
|
|
23
|
-
borderColor: 'accentBorderSecondary',
|
|
24
|
-
iconAfterFillIcon: 'accentItemQuaternary',
|
|
25
|
-
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
26
|
-
},
|
|
27
|
-
accentPrimary: {
|
|
28
|
-
fill: 'accentPrimary',
|
|
29
|
-
fillHover: 'accentHoverPrimary',
|
|
30
|
-
labelTextColor: 'accentTextPrimary',
|
|
31
|
-
borderColor: 'accentBorderSecondary',
|
|
32
|
-
iconAfterFillIcon: 'accentItemPrimary',
|
|
33
|
-
iconBeforeFillIcon: 'accentItemPrimary',
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
var chipsAppearanceDanger = {
|
|
38
|
-
dangerMutedPrimary: {
|
|
39
|
-
fill: 'dangerTertiary',
|
|
40
|
-
labelTextColor: 'dangerTextQuaternary',
|
|
41
|
-
borderColor: 'dangerBorderQuaternary',
|
|
42
|
-
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
43
|
-
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
44
|
-
},
|
|
45
|
-
dangerPrimary: {
|
|
46
|
-
fill: 'dangerPrimary',
|
|
47
|
-
labelTextColor: 'dangerTextPrimary',
|
|
48
|
-
borderColor: 'dangerBorderSecondary',
|
|
49
|
-
iconAfterFillIcon: 'dangerItemPrimary',
|
|
50
|
-
iconBeforeFillIcon: 'dangerItemPrimary',
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
var chipsAppearanceDisabled = {
|
|
55
|
-
disabled: {
|
|
56
|
-
fill: 'surfaceDisabled',
|
|
57
|
-
labelTextColor: 'surfaceTextDisabled',
|
|
58
|
-
borderColor: 'surfaceBorderDisabled',
|
|
59
|
-
iconAfterFillIcon: 'surfaceItemDisabled',
|
|
60
|
-
iconBeforeFillIcon: 'surfaceItemDisabled',
|
|
61
|
-
},
|
|
62
|
-
};
|
|
63
|
-
|
|
64
|
-
var chipsAppearanceError = {
|
|
65
|
-
errorMutedPrimary: {
|
|
66
|
-
fill: 'errorDisabled',
|
|
67
|
-
labelTextColor: 'errorTextQuaternary',
|
|
68
|
-
borderColor: 'errorBorderQuaternary',
|
|
69
|
-
iconAfterFillIcon: 'errorItemQuaternary',
|
|
70
|
-
iconBeforeFillIcon: 'errorItemQuaternary',
|
|
71
|
-
},
|
|
72
|
-
errorPrimary: {
|
|
73
|
-
fill: 'errorPrimary',
|
|
74
|
-
labelTextColor: 'errorTextPrimary',
|
|
75
|
-
borderColor: 'errorBorderSecondary',
|
|
76
|
-
iconAfterFillIcon: 'errorItemPrimary',
|
|
77
|
-
iconBeforeFillIcon: 'errorItemPrimary',
|
|
78
|
-
},
|
|
79
|
-
};
|
|
80
|
-
|
|
81
|
-
var chipsAppearanceInfo = {
|
|
82
|
-
infoMutedPrimary: {
|
|
83
|
-
fill: 'infoTertiary',
|
|
84
|
-
labelTextColor: 'infoTextPrimary',
|
|
85
|
-
borderColor: 'infoBorderSecondary',
|
|
86
|
-
iconAfterFillIcon: 'infoItemPrimary',
|
|
87
|
-
iconBeforeFillIcon: 'infoItemPrimary',
|
|
88
|
-
},
|
|
89
|
-
infoPrimary: {
|
|
90
|
-
fill: 'infoPrimary',
|
|
91
|
-
labelTextColor: 'infoTextHover',
|
|
92
|
-
borderColor: 'infoBorderHover',
|
|
93
|
-
iconAfterFillIcon: 'infoItemHover',
|
|
94
|
-
iconBeforeFillIcon: 'infoItemHover',
|
|
95
|
-
},
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
var chipsAppearancePrimary = {
|
|
99
|
-
primaryMutedPrimary: {
|
|
100
|
-
fill: 'primaryDisabled',
|
|
101
|
-
labelTextColor: 'primaryTextSecondary',
|
|
102
|
-
borderColor: 'primaryBorderSecondary',
|
|
103
|
-
iconAfterFillIcon: 'primaryItemSecondary',
|
|
104
|
-
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
105
|
-
},
|
|
106
|
-
primaryPrimary: {
|
|
107
|
-
fill: 'primaryPrimary',
|
|
108
|
-
labelTextColor: 'primaryTextPrimary',
|
|
109
|
-
borderColor: 'primaryBorderSecondary',
|
|
110
|
-
iconAfterFillIcon: 'primaryItemPrimary',
|
|
111
|
-
iconBeforeFillIcon: 'primaryItemPrimary',
|
|
112
|
-
},
|
|
113
|
-
};
|
|
114
|
-
|
|
115
|
-
var chipsAppearanceSecondary = {
|
|
116
|
-
secondaryMutedPrimary: {
|
|
117
|
-
fill: 'secondaryDisabled',
|
|
118
|
-
labelTextColor: 'secondaryTextQuaternary',
|
|
119
|
-
borderColor: 'secondaryBorderSecondary',
|
|
120
|
-
iconAfterFillIcon: 'secondaryItemQuaternary',
|
|
121
|
-
iconBeforeFillIcon: 'secondaryItemQuaternary',
|
|
122
|
-
},
|
|
123
|
-
secondaryPrimary: {
|
|
124
|
-
fill: 'secondaryPrimary',
|
|
125
|
-
labelTextColor: 'secondaryTextPrimary',
|
|
126
|
-
borderColor: 'secondaryBorderSecondary',
|
|
127
|
-
iconAfterFillIcon: 'secondaryItemPrimary',
|
|
128
|
-
iconBeforeFillIcon: 'secondaryItemPrimary',
|
|
129
|
-
},
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
var chipsAppearanceShape = {
|
|
133
|
-
circular: {
|
|
134
|
-
shape: 'circular',
|
|
135
|
-
},
|
|
136
|
-
rounded: {
|
|
137
|
-
shape: 'rounded',
|
|
138
|
-
},
|
|
139
|
-
roundedS: {
|
|
140
|
-
shape: 'rounded',
|
|
141
|
-
shapeStrength: '0_5m',
|
|
142
|
-
},
|
|
143
|
-
roundedM: {
|
|
144
|
-
shape: 'rounded',
|
|
145
|
-
shapeStrength: '1m',
|
|
146
|
-
},
|
|
147
|
-
roundedL: {
|
|
148
|
-
shape: 'rounded',
|
|
149
|
-
shapeStrength: '1_5m',
|
|
150
|
-
},
|
|
151
|
-
roundedXL: {
|
|
152
|
-
shape: 'rounded',
|
|
153
|
-
shapeStrength: '2m',
|
|
154
|
-
},
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
var chipsAppearanceSize = {
|
|
158
|
-
sizeXXL: {
|
|
159
|
-
size: 'xxl',
|
|
160
|
-
labelTextSize: 'xl',
|
|
161
|
-
iconAfterSize: 24,
|
|
162
|
-
iconBeforeSize: 24,
|
|
163
|
-
},
|
|
164
|
-
sizeXL: {
|
|
165
|
-
size: 'xl',
|
|
166
|
-
labelTextSize: 'm',
|
|
167
|
-
iconAfterSize: 20,
|
|
168
|
-
iconBeforeSize: 20,
|
|
169
|
-
},
|
|
170
|
-
sizeL: {
|
|
171
|
-
size: 'l',
|
|
172
|
-
labelTextSize: 'm',
|
|
173
|
-
iconAfterSize: 16,
|
|
174
|
-
iconBeforeSize: 16,
|
|
175
|
-
},
|
|
176
|
-
sizeM: {
|
|
177
|
-
size: 'm',
|
|
178
|
-
labelTextSize: 's',
|
|
179
|
-
iconAfterSize: 16,
|
|
180
|
-
iconBeforeSize: 16,
|
|
181
|
-
},
|
|
182
|
-
sizeS: {
|
|
183
|
-
size: 's',
|
|
184
|
-
labelTextSize: 's',
|
|
185
|
-
iconAfterSize: 16,
|
|
186
|
-
iconBeforeSize: 16,
|
|
187
|
-
},
|
|
188
|
-
sizeXS: {
|
|
189
|
-
size: 'xs',
|
|
190
|
-
labelTextSize: 'xs',
|
|
191
|
-
iconAfterSize: 14,
|
|
192
|
-
iconBeforeSize: 14,
|
|
193
|
-
},
|
|
194
|
-
sizeXXS: {
|
|
195
|
-
size: 'xxs',
|
|
196
|
-
labelTextSize: 'xxs',
|
|
197
|
-
iconAfterSize: 12,
|
|
198
|
-
iconBeforeSize: 12,
|
|
199
|
-
},
|
|
200
|
-
};
|
|
201
|
-
|
|
202
|
-
var chipsAppearanceStyle = {
|
|
203
|
-
solid: {
|
|
204
|
-
borderColor: 'none',
|
|
205
|
-
},
|
|
206
|
-
outlined: {
|
|
207
|
-
fill: 'none',
|
|
208
|
-
},
|
|
209
|
-
full: {},
|
|
210
|
-
ghost: {
|
|
211
|
-
fill: 'none',
|
|
212
|
-
borderColor: 'none',
|
|
213
|
-
},
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
var chipsAppearanceSuccess = {
|
|
217
|
-
successMutedPrimary: {
|
|
218
|
-
fill: 'successTertiary',
|
|
219
|
-
labelTextColor: 'successTextQuaternary',
|
|
220
|
-
borderColor: 'successBorderQuaternary',
|
|
221
|
-
iconAfterFillIcon: 'successItemQuaternary',
|
|
222
|
-
iconBeforeFillIcon: 'successItemQuaternary',
|
|
223
|
-
},
|
|
224
|
-
successPrimary: {
|
|
225
|
-
fill: 'successPrimary',
|
|
226
|
-
labelTextColor: 'successTextPrimary',
|
|
227
|
-
borderColor: 'successBorderSecondary',
|
|
228
|
-
iconAfterFillIcon: 'successItemPrimary',
|
|
229
|
-
iconBeforeFillIcon: 'successItemPrimary',
|
|
230
|
-
},
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
var chipsAppearanceSurface = {
|
|
234
|
-
surfaceMutedPrimary: {
|
|
235
|
-
fill: 'surfaceSecondary',
|
|
236
|
-
labelTextColor: 'surfaceTextQuaternary',
|
|
237
|
-
borderColor: 'surfaceBorderQuaternary',
|
|
238
|
-
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
239
|
-
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
240
|
-
},
|
|
241
|
-
surfacePrimary: {
|
|
242
|
-
fill: 'surfacePrimary',
|
|
243
|
-
fillActive: 'accentPrimary',
|
|
244
|
-
fillActiveHover: 'accentSecondary',
|
|
245
|
-
fillHover: 'surfaceTertiary',
|
|
246
|
-
labelTextActiveColor: 'accentTextPrimary',
|
|
247
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
248
|
-
labelTextHoverColor: 'surfaceTextPrimary',
|
|
249
|
-
borderColor: 'surfaceBorderTertiary',
|
|
250
|
-
activeIconItemFill: 'surfaceItemSecondary',
|
|
251
|
-
badgeAppearance: 'surfacePrimary sizeXS solid',
|
|
252
|
-
iconAfterFillActiveIcon: 'accentItemPrimary',
|
|
253
|
-
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
254
|
-
iconBeforeFillActiveIcon: 'accentItemPrimary',
|
|
255
|
-
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
256
|
-
},
|
|
257
|
-
surfaceSecondary: {
|
|
258
|
-
fill: 'surfaceSecondary',
|
|
259
|
-
fillActive: 'accentPrimary',
|
|
260
|
-
fillActiveHover: 'accentSecondary',
|
|
261
|
-
fillHover: 'surfaceTertiary',
|
|
262
|
-
labelTextActiveColor: 'accentTextPrimary',
|
|
263
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
264
|
-
labelTextHoverColor: 'surfaceTextPrimary',
|
|
265
|
-
borderColor: 'surfaceBorderSecondary',
|
|
266
|
-
iconAfterFillActiveIcon: 'accentItemPrimary',
|
|
267
|
-
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
268
|
-
iconBeforeFillActiveIcon: 'accentItemPrimary',
|
|
269
|
-
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
270
|
-
},
|
|
271
|
-
surfaceTertiary: {
|
|
272
|
-
fill: 'surfaceTertiary',
|
|
273
|
-
fillHover: 'surfaceHover',
|
|
274
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
275
|
-
borderColor: 'surfaceBorderTertiary',
|
|
276
|
-
},
|
|
277
|
-
};
|
|
278
|
-
|
|
279
|
-
var chipsAppearanceWarning = {
|
|
280
|
-
warningMutedPrimary: {
|
|
281
|
-
fill: 'warningTertiary',
|
|
282
|
-
labelTextColor: 'warningTextSecondary',
|
|
283
|
-
borderColor: 'warningBorderSecondary',
|
|
284
|
-
iconAfterFillIcon: 'warningItemSecondary',
|
|
285
|
-
iconBeforeFillIcon: 'warningItemSecondary',
|
|
286
|
-
},
|
|
287
|
-
warningPrimary: {
|
|
288
|
-
fill: 'warningPrimary',
|
|
289
|
-
labelTextColor: 'warningTextPrimary',
|
|
290
|
-
borderColor: 'warningBorderSecondary',
|
|
291
|
-
iconAfterFillIcon: 'warningItemPrimary',
|
|
292
|
-
iconBeforeFillIcon: 'warningItemPrimary',
|
|
293
|
-
},
|
|
294
|
-
};
|
|
295
|
-
|
|
296
|
-
var chipsAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, chipsAppearanceSize), chipsAppearanceStyle), chipsAppearanceAccent), chipsAppearanceDanger), chipsAppearanceError), chipsAppearanceInfo), chipsAppearanceDisabled), chipsAppearancePrimary), chipsAppearanceSecondary), chipsAppearanceSuccess), chipsAppearanceSurface), chipsAppearanceWarning), chipsAppearanceShape);
|
|
297
|
-
|
|
298
|
-
var chipsConfig = {
|
|
299
|
-
appearance: chipsAppearance,
|
|
300
|
-
setAppearance: function (appearanceConfig) {
|
|
301
|
-
chipsConfig.appearance = appearanceConfig;
|
|
302
|
-
},
|
|
303
|
-
};
|
|
304
|
-
function Chips(props) {
|
|
305
|
-
var dataTestId = props.dataTestId, dataTour = props.dataTour, className = props.className, appearance = props.appearance, _a = props.label, label = _a === void 0 ? '' : _a, isDisabled = props.isDisabled, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, isActive = props.isActive, isSkeleton = props.isSkeleton, onClick = props.onClick, onClickIconAfter = props.onClickIconAfter, onClickIconBefore = props.onClickIconBefore, children = props.children;
|
|
306
|
-
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, chipsConfig, isDisabled);
|
|
307
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
308
|
-
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextActiveColor = propsGenerator.labelTextActiveColor, labelTextActiveHoverColor = propsGenerator.labelTextActiveHoverColor, labelTextColor = propsGenerator.labelTextColor, labelTextHoverColor = propsGenerator.labelTextHoverColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillActiveIcon = propsGenerator.iconAfterFillActiveIcon, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillActiveIcon = propsGenerator.iconBeforeFillActiveIcon, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass;
|
|
309
|
-
var chipsStyles = useStyles.useStyles(props).styles;
|
|
310
|
-
return (jsxRuntime.jsx("div", { "data-test-id": dataTestId && "".concat(dataTestId, "Chips"), "data-tour": dataTour, className: clsx(className, 'chips', !isActive
|
|
311
|
-
? fillClass && "fill_".concat(fillClass)
|
|
312
|
-
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
313
|
-
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
314
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass && "shape-strength_".concat(shapeStrengthClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "chips_size_".concat(sizeClass), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), isActive && 'chips_state_active', isDisabled && "chips_state_disabled", cursorClass && "cursor_".concat(cursorClass), onClick && 'cursor_type_pointer', isSkeleton && "chips_skeleton"), style: chipsStyles, onClick: !isDisabled ? onClick : undefined, children: jsxRuntime.jsxs("div", { className: "chips__inner", children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "chips__icon_before", size: iconBeforeSize, fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, iconFillActive: iconBeforeFillActiveIcon, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore, isActive: isActive, onClick: onClickIconBefore })), typeof label === 'string' ? (jsxRuntime.jsx(Text.Text, { className: "chips__label", size: labelTextSize, textColor: labelTextColor, textColorActive: labelTextActiveColor, textColorActiveHover: labelTextActiveHoverColor, textColorHover: labelTextHoverColor, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })) : (jsxRuntime.jsx("div", { className: "chips__label", children: label })), children, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "chips__icon_after", size: iconAfterSize, fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, iconFillActive: iconAfterFillActiveIcon, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter, isActive: isActive, onClick: onClickIconAfter })), badgeValue && (jsxRuntime.jsx(Icon.Badge, { className: "chips__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue }))] }) }));
|
|
315
|
-
}
|
|
316
|
-
|
|
317
|
-
function ChipsGroup(props) {
|
|
318
|
-
var className = props.className, chipsList = props.chipsList, dataTestId = props.dataTestId, dataTour = props.dataTour, horizontalScroll = props.horizontalScroll, style = props.style, onClick = props.onClick, children = props.children;
|
|
319
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
320
|
-
var directionClass = propsGenerator.directionClass, alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillClass = propsGenerator.fillClass, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, chipsAppearance = propsGenerator.chipsAppearance, widthClass = propsGenerator.widthClass, wrapClass = propsGenerator.wrapClass;
|
|
321
|
-
// @ts-expect-error
|
|
322
|
-
var _a = useStyles.useStyles(props), groupStyles = _a.styles, groupWrapperStyles = _a.wrapper;
|
|
323
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'chips-group', 'group', widthClass && "width_".concat(widthClass), alignDirectionClass && "align_".concat(alignDirectionClass), directionClass && "group_direction_".concat(directionClass), alignClass && "align_".concat(alignClass), fillClass && "fill_".concat(fillClass), horizontalScroll && 'group_type_horizontal_scroll', wrapClass && "group_wrap_".concat(wrapClass), borderColorClass && "border-color_".concat(borderColorClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass)), "data-test-id": dataTestId, "data-tour": dataTour, style: Object.assign({}, groupStyles, style), children: horizontalScroll ? (jsxRuntime.jsx("div", { className: "chips-group__wrapper", style: groupWrapperStyles, children: children
|
|
324
|
-
? children
|
|
325
|
-
: chipsList === null || chipsList === void 0 ? void 0 : chipsList.map(function (item) { return (jsxRuntime.jsx(Chips, { appearance: chipsAppearance, label: item.label, isDisabled: item.isDisabled, iconAfter: item.iconAfter, iconBefore: item.iconBefore, isActive: item.isActive, onClick: function () { return onClick(item); } }, item.id)); }) })) : children ? (children) : (chipsList === null || chipsList === void 0 ? void 0 : chipsList.map(function (item) { return (jsxRuntime.jsx(Chips, { appearance: chipsAppearance, label: item.label, isDisabled: item.isDisabled, iconAfter: item.iconAfter, iconBefore: item.iconBefore, isActive: item.isActive, onClick: function () { return onClick(item); } }, item.id)); })) }));
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
exports.Chips = Chips;
|
|
329
|
-
exports.ChipsGroup = ChipsGroup;
|
|
330
|
-
exports.chipsAppearance = chipsAppearance;
|
|
331
|
-
exports.chipsConfig = chipsConfig;
|
|
@@ -1,183 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
4
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
5
|
-
var React = require('react');
|
|
6
|
-
var clsx = require('clsx');
|
|
7
|
-
var locale = require('date-fns/locale');
|
|
8
|
-
var DatePicker = require('react-datepicker');
|
|
9
|
-
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
10
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
12
|
-
var Button = require('./Button_cjs_Ce97psFT.js');
|
|
13
|
-
var Icon = require('./Icon_cjs_Cz6IyOkb.js');
|
|
14
|
-
var Input = require('./Input_cjs_DRPK_RHK.js');
|
|
15
|
-
var Label = require('./Label_cjs_DMoaOoHi.js');
|
|
16
|
-
var Text = require('./Text_cjs_0EINiUq4.js');
|
|
17
|
-
var _default = require('@itcase/icons/default');
|
|
18
|
-
|
|
19
|
-
var datePickerSize = {
|
|
20
|
-
sizeL: {
|
|
21
|
-
size: 'l',
|
|
22
|
-
daySize: 'xs',
|
|
23
|
-
dayTextSize: 'm',
|
|
24
|
-
iconFillSize: 24,
|
|
25
|
-
iconLeft: _default.icons14.Arrow.ChevronLeft,
|
|
26
|
-
iconRight: _default.icons14.Arrow.ChevronRight,
|
|
27
|
-
},
|
|
28
|
-
sizeM: {
|
|
29
|
-
size: 'm',
|
|
30
|
-
daySize: 'xxl',
|
|
31
|
-
dayTextSize: 'm',
|
|
32
|
-
iconFillSize: 24,
|
|
33
|
-
iconLeft: _default.icons14.Arrow.ChevronLeft,
|
|
34
|
-
iconRight: _default.icons14.Arrow.ChevronRight,
|
|
35
|
-
iconSize: 14,
|
|
36
|
-
monthTextSize: 'm',
|
|
37
|
-
yearTextSize: 'm',
|
|
38
|
-
},
|
|
39
|
-
sizeS: {
|
|
40
|
-
size: 's',
|
|
41
|
-
daySize: 'xs',
|
|
42
|
-
dayTextSize: 'm',
|
|
43
|
-
iconFillSize: 24,
|
|
44
|
-
iconLeft: _default.icons14.Arrow.ChevronLeft,
|
|
45
|
-
iconRight: _default.icons14.Arrow.ChevronRight,
|
|
46
|
-
},
|
|
47
|
-
};
|
|
48
|
-
|
|
49
|
-
var datePickerStyle = {
|
|
50
|
-
solid: {
|
|
51
|
-
inputProps: {
|
|
52
|
-
borderColor: 'none',
|
|
53
|
-
},
|
|
54
|
-
},
|
|
55
|
-
outlined: {
|
|
56
|
-
inputProps: {
|
|
57
|
-
fill: 'none',
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
full: {},
|
|
61
|
-
ghost: {
|
|
62
|
-
inputProps: {
|
|
63
|
-
fill: 'none',
|
|
64
|
-
borderColor: 'none',
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
var datePickerAppearanceSurface = {
|
|
70
|
-
surfacePrimary: {
|
|
71
|
-
dayTextColor: 'surfaceTextPrimary',
|
|
72
|
-
dayTextShape: 'rounded',
|
|
73
|
-
iconFillHover: 'surfaceSecondary',
|
|
74
|
-
iconItemFill: 'surfaceItemPrimary',
|
|
75
|
-
iconShape: 'circular',
|
|
76
|
-
monthTextColor: 'surfaceTextPrimary',
|
|
77
|
-
monthTextWeight: 400,
|
|
78
|
-
placeholderTextColor: 'surfaceTextPrimary',
|
|
79
|
-
yearTextColor: 'surfaceTextPrimary',
|
|
80
|
-
yearTextWeight: 400,
|
|
81
|
-
},
|
|
82
|
-
};
|
|
83
|
-
|
|
84
|
-
var datePickerAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, datePickerAppearanceSurface), datePickerSize), datePickerStyle);
|
|
85
|
-
|
|
86
|
-
var datePickerConfig = {
|
|
87
|
-
appearance: datePickerAppearance,
|
|
88
|
-
setAppearance: function (appearanceConfig) {
|
|
89
|
-
datePickerConfig.appearance = appearanceConfig;
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
function DatePickerInput(props) {
|
|
93
|
-
var className = props.className, _a = props.datePickerProps, datePickerProps = _a === void 0 ? {} : _a, endValue = props.endValue, _b = props.inputProps, inputProps = _b === void 0 ? {} : _b, value = props.value, onChange = props.onChange;
|
|
94
|
-
var datepickerRef = React.useRef(null);
|
|
95
|
-
var customTimeInput = datePickerProps.customTimeInput, disablePastDays = datePickerProps.disablePastDays, monthsShown = datePickerProps.monthsShown, selectsRange = datePickerProps.selectsRange;
|
|
96
|
-
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(datePickerProps.appearance, datePickerConfig);
|
|
97
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(datePickerProps, appearanceConfig);
|
|
98
|
-
var daySize = propsGenerator.daySize, dayTextColor = propsGenerator.dayTextColor, dayTextShape = propsGenerator.dayTextShape, dayTextSize = propsGenerator.dayTextSize, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconLeft = propsGenerator.iconLeft, iconRight = propsGenerator.iconRight, iconShape = propsGenerator.iconShape, monthTextColor = propsGenerator.monthTextColor, monthTextSize = propsGenerator.monthTextSize, monthTextWeight = propsGenerator.monthTextWeight, popper = propsGenerator.popper, popperPlacement = propsGenerator.popperPlacement, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, yearTextColor = propsGenerator.yearTextColor, yearTextSize = propsGenerator.yearTextSize, yearTextWeight = propsGenerator.yearTextWeight, isClearable = propsGenerator.isClearable;
|
|
99
|
-
var _c = React.useMemo(function () {
|
|
100
|
-
var dateStart;
|
|
101
|
-
if (value) {
|
|
102
|
-
if (typeof value === 'string') {
|
|
103
|
-
dateStart = new Date(value);
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
dateStart = value;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
dateStart = undefined;
|
|
111
|
-
}
|
|
112
|
-
var dateEnd;
|
|
113
|
-
if (endValue) {
|
|
114
|
-
if (typeof endValue === 'string') {
|
|
115
|
-
dateEnd = new Date(endValue);
|
|
116
|
-
}
|
|
117
|
-
else {
|
|
118
|
-
dateEnd = endValue;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
else {
|
|
122
|
-
dateEnd = undefined;
|
|
123
|
-
}
|
|
124
|
-
return [dateStart, dateEnd];
|
|
125
|
-
}, [value, endValue]), dateStart = _c[0], dateEnd = _c[1];
|
|
126
|
-
var handleChange = React.useCallback(function (valuesList) {
|
|
127
|
-
var newDateStart = valuesList[0], newDateEnd = valuesList[1];
|
|
128
|
-
onChange(newDateStart, newDateEnd);
|
|
129
|
-
}, [onChange]);
|
|
130
|
-
var renderDayContents = React.useCallback(function (day, date) {
|
|
131
|
-
return (jsxRuntime.jsx(Button.Button, { className: "react-datepicker__day-button", size: daySize, label: date.getDate().toString(), labelTextColor: dayTextColor, labelTextSize: dayTextSize, shape: dayTextShape }));
|
|
132
|
-
}, [daySize, dayTextColor, dayTextShape, dayTextSize]);
|
|
133
|
-
var renderCustomHeader = React.useCallback(function (_a) {
|
|
134
|
-
var decreaseMonth = _a.decreaseMonth, increaseMonth = _a.increaseMonth, monthDate = _a.monthDate;
|
|
135
|
-
return (jsxRuntime.jsxs("div", { className: "react-datepicker__header--div", children: [iconLeft && (jsxRuntime.jsx(Icon.Icon, { className: "react-datepicker__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, shape: iconShape, SvgImage: iconLeft, onClick: decreaseMonth })), jsxRuntime.jsxs("div", { className: "react-datepicker__data", children: [jsxRuntime.jsx(Text.Text, { className: "react-datepicker__month", size: monthTextSize, textColor: monthTextColor, textWeight: monthTextWeight, children: monthDate.toLocaleString('ru-RU', { month: 'long' }) }), jsxRuntime.jsx(Text.Text, { className: "react-datepicker__year", size: yearTextSize, textColor: yearTextColor, textWeight: yearTextWeight, children: monthDate.toLocaleString('ru-RU', { year: 'numeric' }) })] }), iconRight && (jsxRuntime.jsx(Icon.Icon, { className: "react-datepicker__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, shape: iconShape, SvgImage: iconRight, onClick: increaseMonth }))] }));
|
|
136
|
-
}, [
|
|
137
|
-
iconFill,
|
|
138
|
-
iconFillHover,
|
|
139
|
-
iconFillSize,
|
|
140
|
-
iconItemFill,
|
|
141
|
-
iconLeft,
|
|
142
|
-
iconRight,
|
|
143
|
-
iconShape,
|
|
144
|
-
monthTextColor,
|
|
145
|
-
monthTextSize,
|
|
146
|
-
monthTextWeight,
|
|
147
|
-
yearTextColor,
|
|
148
|
-
yearTextSize,
|
|
149
|
-
yearTextWeight,
|
|
150
|
-
]);
|
|
151
|
-
var datePickerStyles = useStyles.useStyles(props).styles;
|
|
152
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'datepicker', monthsShown && 'datepicker_multiple-months', customTimeInput && 'datepicker_button', sizeClass && "datepicker_size_".concat(sizeClass), widthClass && "datepicker_width_".concat(widthClass)), style: datePickerStyles, children: jsxRuntime.jsx(DatePicker, tslib_es6.__assign({ minDate: disablePastDays ? new Date() : undefined, customInput: jsxRuntime.jsx(DatePickerCustomInput, { datepickerRef: datepickerRef, inputProps: inputProps, isClearable: isClearable }), endDate: selectsRange ? dateEnd : undefined, locale: locale.ru, popperClassName: popper && "react-datepicker-popper-".concat(popper), popperPlacement: popperPlacement, ref: datepickerRef, renderCustomHeader: renderCustomHeader, renderDayContents: renderDayContents, selected: dateStart, startDate: dateStart, onChange: selectsRange ? handleChange : onChange }, datePickerProps, {
|
|
153
|
-
// Important for use custom clear button
|
|
154
|
-
isClearable: false })) }));
|
|
155
|
-
}
|
|
156
|
-
var DatePickerCustomInput = React.forwardRef(function (props, ref) {
|
|
157
|
-
var inputIcon = props.inputIcon, inputProps = props.inputProps, value = props.value, isClearable = props.isClearable;
|
|
158
|
-
var multipleValue = React.useMemo(function () {
|
|
159
|
-
if (value) {
|
|
160
|
-
var twoDates = value.split(' - ');
|
|
161
|
-
return twoDates[0] === twoDates[1] ? twoDates[0] : value;
|
|
162
|
-
}
|
|
163
|
-
return '';
|
|
164
|
-
}, [value]);
|
|
165
|
-
return (jsxRuntime.jsxs(React.Fragment, { children: [jsxRuntime.jsx(Input.Input, tslib_es6.__assign({}, props, inputProps, { className: clsx(inputProps.className, 'datepicker__input'), autocomplete: "off", ref: ref, value: multipleValue })), inputIcon && jsxRuntime.jsx(DatePickerInputIcon, tslib_es6.__assign({}, inputProps)), isClearable && jsxRuntime.jsx(DatePickerClearButton, tslib_es6.__assign({}, inputProps))] }));
|
|
166
|
-
});
|
|
167
|
-
function DatePickerClearButton(props) {
|
|
168
|
-
var clearIcon = props.clearIcon, clearIconFill = props.clearIconFill, clearIconFillHover = props.clearIconFillHover, clearIconFillSize = props.clearIconFillSize, clearIconItemFill = props.clearIconItemFill, clearIconItemFillHover = props.clearIconItemFillHover, clearIconShape = props.clearIconShape, clearIconSize = props.clearIconSize, clearIconSrc = props.clearIconSrc, clearLabel = props.clearLabel, clearLabelTextColor = props.clearLabelTextColor, clearLabelTextColorHover = props.clearLabelTextColorHover, clearLabelTextSize = props.clearLabelTextSize, datepickerRef = props.datepickerRef;
|
|
169
|
-
var onClick = React.useCallback(function (event) {
|
|
170
|
-
var _a, _b;
|
|
171
|
-
(_a = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _a === void 0 ? void 0 : _a.onClearClick(event);
|
|
172
|
-
(_b = datepickerRef === null || datepickerRef === void 0 ? void 0 : datepickerRef.current) === null || _b === void 0 ? void 0 : _b.handleFocus(event);
|
|
173
|
-
}, []);
|
|
174
|
-
return (jsxRuntime.jsx(React.Fragment, { children: clearLabel ? (jsxRuntime.jsx(Label.Label, { className: clsx('react-datepicker__clear-label', 'cursor_type_pointer'), label: clearLabel, labelTextColor: clearLabelTextColor, labelTextColorHover: clearLabelTextColorHover, labelTextSize: clearLabelTextSize, onClick: onClick })) : ((clearIcon || clearIconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: clsx('react-datepicker__clear-icon', 'cursor_type_pointer'), size: clearIconSize, fill: clearIconFill, fillHover: clearIconFillHover, fillSize: clearIconFillSize, iconFill: clearIconItemFill, iconFillHover: clearIconItemFillHover, imageSrc: clearIconSrc, shape: clearIconShape, SvgImage: clearIcon, onClick: onClick }))) }));
|
|
175
|
-
}
|
|
176
|
-
function DatePickerInputIcon(props) {
|
|
177
|
-
var inputIcon = props.inputIcon, inputIconFill = props.inputIconFill, inputIconFillHover = props.inputIconFillHover, inputIconFillSize = props.inputIconFillSize, inputIconItemFill = props.inputIconItemFill, inputIconShape = props.inputIconShape, inputIconSize = props.inputIconSize, inputIconSrc = props.inputIconSrc, onClick = props.onClick;
|
|
178
|
-
return (jsxRuntime.jsx(Icon.Icon, { className: clsx('react-datepicker__input-icon', 'cursor_type_pointer'), size: inputIconSize, fill: inputIconFill, fillHover: inputIconFillHover, fillSize: inputIconFillSize, iconFill: inputIconItemFill, imageSrc: inputIconSrc, shape: inputIconShape, SvgImage: inputIcon, onClick: function () { return onClick && onClick(); } }));
|
|
179
|
-
}
|
|
180
|
-
|
|
181
|
-
exports.DatePickerInput = DatePickerInput;
|
|
182
|
-
exports.datePickerAppearance = datePickerAppearance;
|
|
183
|
-
exports.datePickerConfig = datePickerConfig;
|