@itcase/ui 1.8.123 → 1.8.125
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_AwXEUY8j.js +161 -0
- package/dist/Avatar_es_BtlaCRc5.js +157 -0
- package/dist/{Button_cjs_Ce97psFT.js → Button_cjs_C34BU1BK.js} +46 -34
- package/dist/{Button_es_CZss7cXh.js → Button_es_DnlzLBUT.js} +46 -34
- package/dist/ChipsGroup_cjs_DfAKN5CA.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_DBKY2UyF.js} +48 -35
- package/dist/DatePicker_cjs_DfbeIL2m.js +182 -0
- package/dist/DatePicker_es_BIJNx427.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_vHuzXW9M.js +211 -0
- package/dist/DropdownItem_es_DVHWWgnU.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_BVLGzj7Y.js} +170 -157
- package/dist/{Icon_es_BrwLifge.js → Icon_es_DkVkzTha.js} +170 -157
- package/dist/Image_cjs_BUM81t4Y.js +28 -0
- package/dist/Image_es_C-IjVkKX.js +26 -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_DwAmukik.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_B2kcstsG.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 -29
- 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 -29
- 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/Button/Button.appearance.d.ts +232 -232
- package/dist/types/components/Button/Button.d.ts +4 -4
- package/dist/types/components/Button/Button.interface.d.ts +5 -5
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Text/Text.appearance.d.ts +58 -58
- package/dist/types/components/Text/Text.interface.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,22 +1,21 @@
|
|
|
1
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
-
import { I as Icon } from './
|
|
5
|
-
import { a as LinkWrapper } from './
|
|
6
|
-
import { L as Loader } from './
|
|
7
|
-
import { T as Text } from './
|
|
4
|
+
import { I as Icon } from './Icon_es_DkVkzTha.js';
|
|
5
|
+
import { a as LinkWrapper } from './Link_es_P2b6ya7P.js';
|
|
6
|
+
import { L as Loader } from './Loader_es_CmSggwbR.js';
|
|
7
|
+
import { T as Text } from './Text_es_CnymlElo.js';
|
|
8
8
|
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
9
9
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
10
10
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
11
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
const buttonAppearanceAccent = {
|
|
14
13
|
accentMutedPrimary: {
|
|
15
14
|
fill: 'accentTertiary',
|
|
16
15
|
fillHover: 'accentHoverTertiary',
|
|
17
|
-
borderColor: 'accentBorderSecondary',
|
|
18
16
|
labelTextColor: 'accentTextQuaternary',
|
|
19
17
|
labelTextColorHover: 'accentTextQuaternary',
|
|
18
|
+
borderColor: 'accentBorderSecondary',
|
|
20
19
|
iconAfterFillIcon: 'accentItemQuaternary',
|
|
21
20
|
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
22
21
|
iconFillIcon: 'accentItemQuaternary',
|
|
@@ -25,9 +24,9 @@ var buttonAppearanceAccent = {
|
|
|
25
24
|
accentPrimary: {
|
|
26
25
|
fill: 'accentPrimary',
|
|
27
26
|
fillHover: 'accentHoverPrimary',
|
|
28
|
-
borderColor: 'accentBorderPrimary',
|
|
29
27
|
labelTextColor: 'accentTextPrimary',
|
|
30
28
|
labelTextColorHover: 'accentTextPrimary',
|
|
29
|
+
borderColor: 'accentBorderPrimary',
|
|
31
30
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
32
31
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
33
32
|
iconFillIcon: 'accentItemPrimary',
|
|
@@ -36,9 +35,9 @@ var buttonAppearanceAccent = {
|
|
|
36
35
|
accentSecondary: {
|
|
37
36
|
fill: 'accentPrimary',
|
|
38
37
|
fillHover: 'accentHoverPrimary',
|
|
39
|
-
borderColor: 'accentBorderPrimary',
|
|
40
38
|
labelTextColor: 'accentTextSecondary',
|
|
41
39
|
labelTextColorHover: 'accentTextSecondary',
|
|
40
|
+
borderColor: 'accentBorderPrimary',
|
|
42
41
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
43
42
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
44
43
|
iconFillIcon: 'accentItemPrimary',
|
|
@@ -46,13 +45,13 @@ var buttonAppearanceAccent = {
|
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
const buttonAppearanceDanger = {
|
|
50
49
|
dangerMutedPrimary: {
|
|
51
50
|
fill: 'dangerTertiary',
|
|
52
51
|
fillHover: 'dangerHover',
|
|
53
|
-
borderColor: 'dangerBorderSecondary',
|
|
54
52
|
labelTextColor: 'dangerTextQuaternary',
|
|
55
53
|
labelTextColorHover: 'dangerTextQuaternary',
|
|
54
|
+
borderColor: 'dangerBorderSecondary',
|
|
56
55
|
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
57
56
|
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
58
57
|
iconFillIcon: 'dangerItemQuaternary',
|
|
@@ -70,7 +69,7 @@ var buttonAppearanceDanger = {
|
|
|
70
69
|
},
|
|
71
70
|
};
|
|
72
71
|
|
|
73
|
-
|
|
72
|
+
const buttonAppearanceError = {
|
|
74
73
|
error: {
|
|
75
74
|
fill: 'errorPrimary',
|
|
76
75
|
fillHover: 'errorHover',
|
|
@@ -104,7 +103,7 @@ var buttonAppearanceError = {
|
|
|
104
103
|
},
|
|
105
104
|
};
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
const buttonAppearanceInfo = {
|
|
108
107
|
info: {
|
|
109
108
|
fill: 'infoPrimary',
|
|
110
109
|
fillHover: 'infoPrimaryHover',
|
|
@@ -151,7 +150,7 @@ var buttonAppearanceInfo = {
|
|
|
151
150
|
},
|
|
152
151
|
};
|
|
153
152
|
|
|
154
|
-
|
|
153
|
+
const buttonAppearancePrimary = {
|
|
155
154
|
primary: {
|
|
156
155
|
fill: 'primaryPrimary',
|
|
157
156
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -182,7 +181,7 @@ var buttonAppearancePrimary = {
|
|
|
182
181
|
},
|
|
183
182
|
};
|
|
184
183
|
|
|
185
|
-
|
|
184
|
+
const buttonAppearanceSecondary = {
|
|
186
185
|
secondary: {
|
|
187
186
|
fill: 'secondaryPrimary',
|
|
188
187
|
fillHover: 'secondaryHoverPrimary',
|
|
@@ -213,7 +212,7 @@ var buttonAppearanceSecondary = {
|
|
|
213
212
|
},
|
|
214
213
|
};
|
|
215
214
|
|
|
216
|
-
|
|
215
|
+
const buttonAppearanceShape = {
|
|
217
216
|
circular: {
|
|
218
217
|
shape: 'circular',
|
|
219
218
|
},
|
|
@@ -238,7 +237,7 @@ var buttonAppearanceShape = {
|
|
|
238
237
|
},
|
|
239
238
|
};
|
|
240
239
|
|
|
241
|
-
|
|
240
|
+
const buttonAppearanceSize = {
|
|
242
241
|
sizeXXL: {
|
|
243
242
|
size: 'xxl',
|
|
244
243
|
labelTextSize: 'xl',
|
|
@@ -304,7 +303,7 @@ var buttonAppearanceSize = {
|
|
|
304
303
|
},
|
|
305
304
|
};
|
|
306
305
|
|
|
307
|
-
|
|
306
|
+
const buttonAppearanceStyle = {
|
|
308
307
|
solid: {
|
|
309
308
|
borderColor: 'none',
|
|
310
309
|
},
|
|
@@ -318,7 +317,7 @@ var buttonAppearanceStyle = {
|
|
|
318
317
|
},
|
|
319
318
|
};
|
|
320
319
|
|
|
321
|
-
|
|
320
|
+
const buttonAppearanceSuccess = {
|
|
322
321
|
success: {
|
|
323
322
|
fill: 'successPrimary',
|
|
324
323
|
fillHover: 'successHover',
|
|
@@ -352,7 +351,7 @@ var buttonAppearanceSuccess = {
|
|
|
352
351
|
},
|
|
353
352
|
};
|
|
354
353
|
|
|
355
|
-
|
|
354
|
+
const buttonAppearanceSurface = {
|
|
356
355
|
surfaceMutedPrimary: {
|
|
357
356
|
fill: 'surfaceTertiary',
|
|
358
357
|
fillHover: 'surfaceTertiary',
|
|
@@ -404,10 +403,10 @@ var buttonAppearanceSurface = {
|
|
|
404
403
|
},
|
|
405
404
|
};
|
|
406
405
|
|
|
407
|
-
|
|
406
|
+
const buttonAppearanceWarning = {
|
|
408
407
|
warning: {
|
|
409
408
|
fill: 'warningPrimary',
|
|
410
|
-
fillHover: '
|
|
409
|
+
fillHover: 'warningHoverPrimary',
|
|
411
410
|
labelTextColor: 'warningTextPrimary',
|
|
412
411
|
labelTextColorHover: 'warningTextPrimary',
|
|
413
412
|
iconAfterFillIcon: 'warningItemPrimary',
|
|
@@ -418,9 +417,9 @@ var buttonAppearanceWarning = {
|
|
|
418
417
|
warningMutedPrimary: {
|
|
419
418
|
fill: 'warningTertiary',
|
|
420
419
|
fillHover: 'warningBorderHover',
|
|
421
|
-
borderColor: 'warningBorderHover',
|
|
422
420
|
labelTextColor: 'warningTextSecondary',
|
|
423
421
|
labelTextColorHover: 'warningTextPrimary',
|
|
422
|
+
borderColor: 'warningBorderHover',
|
|
424
423
|
iconAfterFillIcon: 'warningItemSecondary',
|
|
425
424
|
iconBeforeFillIcon: 'warningItemSecondary',
|
|
426
425
|
iconFillIcon: 'warningItemSecondary',
|
|
@@ -428,7 +427,7 @@ var buttonAppearanceWarning = {
|
|
|
428
427
|
},
|
|
429
428
|
warningPrimary: {
|
|
430
429
|
fill: 'warningPrimary',
|
|
431
|
-
fillHover: '
|
|
430
|
+
fillHover: 'warningHoverPrimary',
|
|
432
431
|
labelTextColor: 'warningTextPrimary',
|
|
433
432
|
labelTextColorHover: 'warningTextPrimary',
|
|
434
433
|
iconAfterFillIcon: 'warningItemPrimary',
|
|
@@ -438,21 +437,34 @@ var buttonAppearanceWarning = {
|
|
|
438
437
|
},
|
|
439
438
|
};
|
|
440
439
|
|
|
441
|
-
|
|
440
|
+
const buttonAppearance = {
|
|
441
|
+
...buttonAppearanceSize,
|
|
442
|
+
...buttonAppearanceShape,
|
|
443
|
+
...buttonAppearanceStyle,
|
|
444
|
+
...buttonAppearanceAccent,
|
|
445
|
+
...buttonAppearanceDanger,
|
|
446
|
+
...buttonAppearanceError,
|
|
447
|
+
...buttonAppearanceInfo,
|
|
448
|
+
...buttonAppearancePrimary,
|
|
449
|
+
...buttonAppearanceSecondary,
|
|
450
|
+
...buttonAppearanceSuccess,
|
|
451
|
+
...buttonAppearanceSurface,
|
|
452
|
+
...buttonAppearanceWarning,
|
|
453
|
+
};
|
|
442
454
|
|
|
443
|
-
|
|
455
|
+
const buttonConfig = {
|
|
444
456
|
appearance: buttonAppearance,
|
|
445
457
|
setAppearance: function (appearanceConfig) {
|
|
446
458
|
this.appearance = appearanceConfig;
|
|
447
459
|
},
|
|
448
460
|
};
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
461
|
+
const Button = React.forwardRef(function Button(props, ref) {
|
|
462
|
+
const { dataTestId, dataTour, className, appearance, label, Badge, href, htmlType = 'button', link, rel, target, before, after, isDisabled, isLoading = false, onClick, onMouseDown, children, } = props;
|
|
463
|
+
const appearanceConfig = useAppearanceConfig(appearance, buttonConfig, isDisabled);
|
|
464
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
465
|
+
const { fillClass, fillHoverClass, borderColorClass, borderTypeClass, borderWidthClass, labelTextColor, labelTextColorHover, labelTextSize, labelTextTruncate, labelTextWeight, labelTextWidth, labelTextWrap, elevationClass, icon, iconAfter, iconAfterFill, iconAfterFillIcon, iconAfterFillSize, iconAfterShape, iconAfterSize, iconAfterSrc, iconBefore, iconBeforeFill, iconBeforeFillIcon, iconBeforeFillSize, iconBeforeShape, iconBeforeSize, iconBeforeSrc, iconFill, iconFillIcon, iconFillSize, iconShape, iconSize, iconSrc, loaderAppearance, loaderAppearanceSize, loaderFill, loaderItemFill, loaderSize, loaderType = 'simple', shapeClass, shapeStrengthClass, sizeClass, widthClass, isSkeleton, } = propsGenerator;
|
|
466
|
+
const { label: labelStyles, styles: buttonStyles } = useStyles(props);
|
|
467
|
+
const buttonTypeClass = after ||
|
|
456
468
|
before ||
|
|
457
469
|
icon ||
|
|
458
470
|
iconAfter ||
|
|
@@ -466,7 +478,7 @@ var Button = React.forwardRef(function Button(props, ref) {
|
|
|
466
478
|
? 'buttom_type_label'
|
|
467
479
|
: buttonTypeClass
|
|
468
480
|
? 'button_type_icon'
|
|
469
|
-
: '', borderWidthClass &&
|
|
481
|
+
: '', borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, sizeClass && `button_size_${sizeClass}`, widthClass && `button_width_${widthClass}`, elevationClass && `elevation_${elevationClass}`, onClick && 'cursor_type_pointer', isDisabled && 'cursor_type_default', Badge && 'button_type_badge', isLoading && 'button_state_loading', isSkeleton && `button_skeleton`), type: htmlType, disabled: isDisabled, "data-test-id": dataTestId && `${dataTestId}Button`, "data-tour": dataTour, href: link || href, LinkComponent: "button", rel: rel, style: buttonStyles, target: target, onClick: onClick, onMouseDown: onMouseDown, children: jsxs("div", { className: "button__wrapper", ref: ref, children: [isLoading && (jsx(Loader, { appearance: `${loaderAppearance} ${loaderAppearanceSize}`, className: clsx(className, 'button__loader'), type: loaderType, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), before, (iconBefore || iconBeforeSrc) && (jsx(Icon, { className: "button__icon_before", fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), (icon || iconSrc) && (jsx(Icon, { className: "button__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), (children || label) && (jsx(Text, { className: "button__label", width: labelTextWidth, size: labelTextSize, textColor: labelTextColor, textColorHover: labelTextColorHover, textTruncate: labelTextTruncate, textWeight: labelTextWeight, textWrap: labelTextWrap, style: labelStyles, children: children || label })), (iconAfter || iconAfterSrc) && (jsx(Icon, { className: "button__icon_after", fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), Badge, after] }) }));
|
|
470
482
|
});
|
|
471
483
|
|
|
472
484
|
export { Button as B, buttonAppearance as a, buttonConfig as b };
|
|
@@ -0,0 +1,344 @@
|
|
|
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_BVLGzj7Y.js');
|
|
9
|
+
var Text = require('./Text_cjs_BDTjOTVB.js');
|
|
10
|
+
|
|
11
|
+
const chipsAppearanceAccent = {
|
|
12
|
+
accent: {
|
|
13
|
+
fill: 'accentPrimary',
|
|
14
|
+
fillHover: 'accentHoverPrimary',
|
|
15
|
+
labelTextColor: 'accentTextPrimary',
|
|
16
|
+
borderColor: 'accentBorderSecondary',
|
|
17
|
+
},
|
|
18
|
+
accentMutedPrimary: {
|
|
19
|
+
fill: 'accentTertiary',
|
|
20
|
+
fillHover: 'accentHoverPrimary',
|
|
21
|
+
labelTextColor: 'accentTextSecondary',
|
|
22
|
+
borderColor: 'accentBorderSecondary',
|
|
23
|
+
iconAfterFillIcon: 'accentItemQuaternary',
|
|
24
|
+
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
25
|
+
},
|
|
26
|
+
accentPrimary: {
|
|
27
|
+
fill: 'accentPrimary',
|
|
28
|
+
fillHover: 'accentHoverPrimary',
|
|
29
|
+
labelTextColor: 'accentTextPrimary',
|
|
30
|
+
borderColor: 'accentBorderSecondary',
|
|
31
|
+
iconAfterFillIcon: 'accentItemPrimary',
|
|
32
|
+
iconBeforeFillIcon: 'accentItemPrimary',
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
const chipsAppearanceDanger = {
|
|
37
|
+
dangerMutedPrimary: {
|
|
38
|
+
fill: 'dangerTertiary',
|
|
39
|
+
labelTextColor: 'dangerTextQuaternary',
|
|
40
|
+
borderColor: 'dangerBorderQuaternary',
|
|
41
|
+
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
42
|
+
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
43
|
+
},
|
|
44
|
+
dangerPrimary: {
|
|
45
|
+
fill: 'dangerPrimary',
|
|
46
|
+
labelTextColor: 'dangerTextPrimary',
|
|
47
|
+
borderColor: 'dangerBorderSecondary',
|
|
48
|
+
iconAfterFillIcon: 'dangerItemPrimary',
|
|
49
|
+
iconBeforeFillIcon: 'dangerItemPrimary',
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const chipsAppearanceDisabled = {
|
|
54
|
+
disabled: {
|
|
55
|
+
fill: 'surfaceDisabled',
|
|
56
|
+
labelTextColor: 'surfaceTextDisabled',
|
|
57
|
+
borderColor: 'surfaceBorderDisabled',
|
|
58
|
+
iconAfterFillIcon: 'surfaceItemDisabled',
|
|
59
|
+
iconBeforeFillIcon: 'surfaceItemDisabled',
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
const chipsAppearanceError = {
|
|
64
|
+
errorMutedPrimary: {
|
|
65
|
+
fill: 'errorDisabled',
|
|
66
|
+
labelTextColor: 'errorTextQuaternary',
|
|
67
|
+
borderColor: 'errorBorderQuaternary',
|
|
68
|
+
iconAfterFillIcon: 'errorItemQuaternary',
|
|
69
|
+
iconBeforeFillIcon: 'errorItemQuaternary',
|
|
70
|
+
},
|
|
71
|
+
errorPrimary: {
|
|
72
|
+
fill: 'errorPrimary',
|
|
73
|
+
labelTextColor: 'errorTextPrimary',
|
|
74
|
+
borderColor: 'errorBorderSecondary',
|
|
75
|
+
iconAfterFillIcon: 'errorItemPrimary',
|
|
76
|
+
iconBeforeFillIcon: 'errorItemPrimary',
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const chipsAppearanceInfo = {
|
|
81
|
+
infoMutedPrimary: {
|
|
82
|
+
fill: 'infoTertiary',
|
|
83
|
+
labelTextColor: 'infoTextPrimary',
|
|
84
|
+
borderColor: 'infoBorderSecondary',
|
|
85
|
+
iconAfterFillIcon: 'infoItemPrimary',
|
|
86
|
+
iconBeforeFillIcon: 'infoItemPrimary',
|
|
87
|
+
},
|
|
88
|
+
infoPrimary: {
|
|
89
|
+
fill: 'infoPrimary',
|
|
90
|
+
labelTextColor: 'infoTextHover',
|
|
91
|
+
borderColor: 'infoBorderHover',
|
|
92
|
+
iconAfterFillIcon: 'infoItemHover',
|
|
93
|
+
iconBeforeFillIcon: 'infoItemHover',
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
const chipsAppearancePrimary = {
|
|
98
|
+
primaryMutedPrimary: {
|
|
99
|
+
fill: 'primaryDisabled',
|
|
100
|
+
labelTextColor: 'primaryTextSecondary',
|
|
101
|
+
borderColor: 'primaryBorderSecondary',
|
|
102
|
+
iconAfterFillIcon: 'primaryItemSecondary',
|
|
103
|
+
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
104
|
+
},
|
|
105
|
+
primaryPrimary: {
|
|
106
|
+
fill: 'primaryPrimary',
|
|
107
|
+
labelTextColor: 'primaryTextPrimary',
|
|
108
|
+
borderColor: 'primaryBorderSecondary',
|
|
109
|
+
iconAfterFillIcon: 'primaryItemPrimary',
|
|
110
|
+
iconBeforeFillIcon: 'primaryItemPrimary',
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
const chipsAppearanceSecondary = {
|
|
115
|
+
secondaryMutedPrimary: {
|
|
116
|
+
fill: 'secondaryDisabled',
|
|
117
|
+
labelTextColor: 'secondaryTextQuaternary',
|
|
118
|
+
borderColor: 'secondaryBorderSecondary',
|
|
119
|
+
iconAfterFillIcon: 'secondaryItemQuaternary',
|
|
120
|
+
iconBeforeFillIcon: 'secondaryItemQuaternary',
|
|
121
|
+
},
|
|
122
|
+
secondaryPrimary: {
|
|
123
|
+
fill: 'secondaryPrimary',
|
|
124
|
+
labelTextColor: 'secondaryTextPrimary',
|
|
125
|
+
borderColor: 'secondaryBorderSecondary',
|
|
126
|
+
iconAfterFillIcon: 'secondaryItemPrimary',
|
|
127
|
+
iconBeforeFillIcon: 'secondaryItemPrimary',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const chipsAppearanceShape = {
|
|
132
|
+
circular: {
|
|
133
|
+
shape: 'circular',
|
|
134
|
+
},
|
|
135
|
+
rounded: {
|
|
136
|
+
shape: 'rounded',
|
|
137
|
+
},
|
|
138
|
+
roundedS: {
|
|
139
|
+
shape: 'rounded',
|
|
140
|
+
shapeStrength: '0_5m',
|
|
141
|
+
},
|
|
142
|
+
roundedM: {
|
|
143
|
+
shape: 'rounded',
|
|
144
|
+
shapeStrength: '1m',
|
|
145
|
+
},
|
|
146
|
+
roundedL: {
|
|
147
|
+
shape: 'rounded',
|
|
148
|
+
shapeStrength: '1_5m',
|
|
149
|
+
},
|
|
150
|
+
roundedXL: {
|
|
151
|
+
shape: 'rounded',
|
|
152
|
+
shapeStrength: '2m',
|
|
153
|
+
},
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
const chipsAppearanceSize = {
|
|
157
|
+
sizeXXL: {
|
|
158
|
+
size: 'xxl',
|
|
159
|
+
labelTextSize: 'xl',
|
|
160
|
+
iconAfterSize: 24,
|
|
161
|
+
iconBeforeSize: 24,
|
|
162
|
+
},
|
|
163
|
+
sizeXL: {
|
|
164
|
+
size: 'xl',
|
|
165
|
+
labelTextSize: 'm',
|
|
166
|
+
iconAfterSize: 20,
|
|
167
|
+
iconBeforeSize: 20,
|
|
168
|
+
},
|
|
169
|
+
sizeL: {
|
|
170
|
+
size: 'l',
|
|
171
|
+
labelTextSize: 'm',
|
|
172
|
+
iconAfterSize: 16,
|
|
173
|
+
iconBeforeSize: 16,
|
|
174
|
+
},
|
|
175
|
+
sizeM: {
|
|
176
|
+
size: 'm',
|
|
177
|
+
labelTextSize: 's',
|
|
178
|
+
iconAfterSize: 16,
|
|
179
|
+
iconBeforeSize: 16,
|
|
180
|
+
},
|
|
181
|
+
sizeS: {
|
|
182
|
+
size: 's',
|
|
183
|
+
labelTextSize: 's',
|
|
184
|
+
iconAfterSize: 16,
|
|
185
|
+
iconBeforeSize: 16,
|
|
186
|
+
},
|
|
187
|
+
sizeXS: {
|
|
188
|
+
size: 'xs',
|
|
189
|
+
labelTextSize: 'xs',
|
|
190
|
+
iconAfterSize: 14,
|
|
191
|
+
iconBeforeSize: 14,
|
|
192
|
+
},
|
|
193
|
+
sizeXXS: {
|
|
194
|
+
size: 'xxs',
|
|
195
|
+
labelTextSize: 'xxs',
|
|
196
|
+
iconAfterSize: 12,
|
|
197
|
+
iconBeforeSize: 12,
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
const chipsAppearanceStyle = {
|
|
202
|
+
solid: {
|
|
203
|
+
borderColor: 'none',
|
|
204
|
+
},
|
|
205
|
+
outlined: {
|
|
206
|
+
fill: 'none',
|
|
207
|
+
},
|
|
208
|
+
full: {},
|
|
209
|
+
ghost: {
|
|
210
|
+
fill: 'none',
|
|
211
|
+
borderColor: 'none',
|
|
212
|
+
},
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
const chipsAppearanceSuccess = {
|
|
216
|
+
successMutedPrimary: {
|
|
217
|
+
fill: 'successTertiary',
|
|
218
|
+
labelTextColor: 'successTextQuaternary',
|
|
219
|
+
borderColor: 'successBorderQuaternary',
|
|
220
|
+
iconAfterFillIcon: 'successItemQuaternary',
|
|
221
|
+
iconBeforeFillIcon: 'successItemQuaternary',
|
|
222
|
+
},
|
|
223
|
+
successPrimary: {
|
|
224
|
+
fill: 'successPrimary',
|
|
225
|
+
labelTextColor: 'successTextPrimary',
|
|
226
|
+
borderColor: 'successBorderSecondary',
|
|
227
|
+
iconAfterFillIcon: 'successItemPrimary',
|
|
228
|
+
iconBeforeFillIcon: 'successItemPrimary',
|
|
229
|
+
},
|
|
230
|
+
};
|
|
231
|
+
|
|
232
|
+
const chipsAppearanceSurface = {
|
|
233
|
+
surfaceMutedPrimary: {
|
|
234
|
+
fill: 'surfaceSecondary',
|
|
235
|
+
labelTextColor: 'surfaceTextQuaternary',
|
|
236
|
+
borderColor: 'surfaceBorderQuaternary',
|
|
237
|
+
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
238
|
+
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
239
|
+
},
|
|
240
|
+
surfacePrimary: {
|
|
241
|
+
fill: 'surfacePrimary',
|
|
242
|
+
fillActive: 'accentPrimary',
|
|
243
|
+
fillActiveHover: 'accentSecondary',
|
|
244
|
+
fillHover: 'surfaceTertiary',
|
|
245
|
+
labelTextActiveColor: 'accentTextPrimary',
|
|
246
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
247
|
+
labelTextHoverColor: 'surfaceTextPrimary',
|
|
248
|
+
borderColor: 'surfaceBorderTertiary',
|
|
249
|
+
activeIconItemFill: 'surfaceItemSecondary',
|
|
250
|
+
badgeAppearance: 'surfacePrimary sizeXS solid',
|
|
251
|
+
iconAfterFillActiveIcon: 'accentItemPrimary',
|
|
252
|
+
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
253
|
+
iconBeforeFillActiveIcon: 'accentItemPrimary',
|
|
254
|
+
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
255
|
+
},
|
|
256
|
+
surfaceSecondary: {
|
|
257
|
+
fill: 'surfaceSecondary',
|
|
258
|
+
fillActive: 'accentPrimary',
|
|
259
|
+
fillActiveHover: 'accentSecondary',
|
|
260
|
+
fillHover: 'surfaceTertiary',
|
|
261
|
+
labelTextActiveColor: 'accentTextPrimary',
|
|
262
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
263
|
+
labelTextHoverColor: 'surfaceTextPrimary',
|
|
264
|
+
borderColor: 'surfaceBorderSecondary',
|
|
265
|
+
iconAfterFillActiveIcon: 'accentItemPrimary',
|
|
266
|
+
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
267
|
+
iconBeforeFillActiveIcon: 'accentItemPrimary',
|
|
268
|
+
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
269
|
+
},
|
|
270
|
+
surfaceTertiary: {
|
|
271
|
+
fill: 'surfaceTertiary',
|
|
272
|
+
fillHover: 'surfaceHover',
|
|
273
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
274
|
+
borderColor: 'surfaceBorderTertiary',
|
|
275
|
+
},
|
|
276
|
+
};
|
|
277
|
+
|
|
278
|
+
const chipsAppearanceWarning = {
|
|
279
|
+
warningMutedPrimary: {
|
|
280
|
+
fill: 'warningTertiary',
|
|
281
|
+
labelTextColor: 'warningTextSecondary',
|
|
282
|
+
borderColor: 'warningBorderSecondary',
|
|
283
|
+
iconAfterFillIcon: 'warningItemSecondary',
|
|
284
|
+
iconBeforeFillIcon: 'warningItemSecondary',
|
|
285
|
+
},
|
|
286
|
+
warningPrimary: {
|
|
287
|
+
fill: 'warningPrimary',
|
|
288
|
+
labelTextColor: 'warningTextPrimary',
|
|
289
|
+
borderColor: 'warningBorderSecondary',
|
|
290
|
+
iconAfterFillIcon: 'warningItemPrimary',
|
|
291
|
+
iconBeforeFillIcon: 'warningItemPrimary',
|
|
292
|
+
},
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
const chipsAppearance = {
|
|
296
|
+
...chipsAppearanceSize,
|
|
297
|
+
...chipsAppearanceStyle,
|
|
298
|
+
...chipsAppearanceAccent,
|
|
299
|
+
...chipsAppearanceDanger,
|
|
300
|
+
...chipsAppearanceError,
|
|
301
|
+
...chipsAppearanceInfo,
|
|
302
|
+
...chipsAppearanceDisabled,
|
|
303
|
+
...chipsAppearancePrimary,
|
|
304
|
+
...chipsAppearanceSecondary,
|
|
305
|
+
...chipsAppearanceSuccess,
|
|
306
|
+
...chipsAppearanceSurface,
|
|
307
|
+
...chipsAppearanceWarning,
|
|
308
|
+
...chipsAppearanceShape,
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
const chipsConfig = {
|
|
312
|
+
appearance: chipsAppearance,
|
|
313
|
+
setAppearance: (appearanceConfig) => {
|
|
314
|
+
chipsConfig.appearance = appearanceConfig;
|
|
315
|
+
},
|
|
316
|
+
};
|
|
317
|
+
function Chips(props) {
|
|
318
|
+
const { dataTestId, dataTour, className, appearance, label = '', isDisabled, iconAfter, iconAfterSrc, iconBefore, iconBeforeSrc, isActive, isSkeleton, onClick, onClickIconAfter, onClickIconBefore, children, } = props;
|
|
319
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, chipsConfig, isDisabled);
|
|
320
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
321
|
+
const { alignClass, alignDirectionClass, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, labelTextActiveColor, labelTextActiveHoverColor, labelTextColor, labelTextHoverColor, labelTextSize, labelTextWeight, labelTextWrap, borderColorClass, borderTypeClass, badgeAppearance, badgeShape, badgeSize, badgeTextColor, badgeTextSize, badgeValue, cursorClass, iconAfterFill, iconAfterFillActiveIcon, iconAfterFillIcon, iconAfterFillSize, iconAfterShape, iconAfterSize, iconBeforeFill, iconBeforeFillActiveIcon, iconBeforeFillIcon, iconBeforeFillSize, iconBeforeShape, iconBeforeSize, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
322
|
+
const { styles: chipsStyles } = useStyles.useStyles(props);
|
|
323
|
+
return (jsxRuntime.jsx("div", { "data-test-id": dataTestId && `${dataTestId}Chips`, "data-tour": dataTour, className: clsx(className, 'chips', !isActive
|
|
324
|
+
? fillClass && `fill_${fillClass}`
|
|
325
|
+
: fillActiveClass && `fill_active_${fillActiveClass}`, !isActive
|
|
326
|
+
? fillHoverClass && `fill_hover_${fillHoverClass}`
|
|
327
|
+
: fillActiveHoverClass && `fill_active_hover_${fillActiveHoverClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `chips_size_${sizeClass}`, alignDirectionClass && `align_${alignDirectionClass}`, alignClass && `align_${alignClass}`, isActive && 'chips_state_active', isDisabled && `chips_state_disabled`, cursorClass && `cursor_${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 }))] }) }));
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
function ChipsGroup(props) {
|
|
331
|
+
const { className, chipsList, dataTestId, dataTour, horizontalScroll, style, onClick, children, } = props;
|
|
332
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
333
|
+
const { directionClass, alignClass, alignDirectionClass, fillClass, borderColorClass, borderTypeClass, borderWidthClass, chipsAppearance, widthClass, wrapClass, } = propsGenerator;
|
|
334
|
+
// @ts-expect-error
|
|
335
|
+
const { styles: groupStyles, wrapper: groupWrapperStyles } = useStyles.useStyles(props);
|
|
336
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'chips-group', 'group', widthClass && `width_${widthClass}`, alignDirectionClass && `align_${alignDirectionClass}`, directionClass && `group_direction_${directionClass}`, alignClass && `align_${alignClass}`, fillClass && `fill_${fillClass}`, horizontalScroll && 'group_type_horizontal_scroll', wrapClass && `group_wrap_${wrapClass}`, borderColorClass && `border-color_${borderColorClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${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
|
|
337
|
+
? children
|
|
338
|
+
: chipsList?.map((item) => (jsxRuntime.jsx(Chips, { appearance: chipsAppearance, label: item.label, isDisabled: item.isDisabled, iconAfter: item.iconAfter, iconBefore: item.iconBefore, isActive: item.isActive, onClick: () => onClick(item) }, item.id))) })) : children ? (children) : (chipsList?.map((item) => (jsxRuntime.jsx(Chips, { appearance: chipsAppearance, label: item.label, isDisabled: item.isDisabled, iconAfter: item.iconAfter, iconBefore: item.iconBefore, isActive: item.isActive, onClick: () => onClick(item) }, item.id)))) }));
|
|
339
|
+
}
|
|
340
|
+
|
|
341
|
+
exports.Chips = Chips;
|
|
342
|
+
exports.ChipsGroup = ChipsGroup;
|
|
343
|
+
exports.chipsAppearance = chipsAppearance;
|
|
344
|
+
exports.chipsConfig = chipsConfig;
|