@itcase/ui 1.8.122 → 1.8.124
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar_cjs_mojzcWRL.js +161 -0
- package/dist/Avatar_es_BFom0nAS.js +157 -0
- package/dist/{Button_cjs_i0Dn1pkl.js → Button_cjs_CZz8OjWi.js} +42 -30
- package/dist/{Button_es_CtH5EKJd.js → Button_es_Cn3wtv3M.js} +42 -30
- package/dist/ChipsGroup_cjs_Dgskkc1e.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_BVQ7_n0k.js} +48 -35
- package/dist/DatePicker_cjs_Lzrr9Amf.js +182 -0
- package/dist/DatePicker_es_D1LvY5RT.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_rKLdFxSj.js +211 -0
- package/dist/DropdownItem_es_B-1qtEa7.js +206 -0
- package/dist/Group_cjs_DmfeUcFI.js +59 -0
- package/dist/Group_es_BU5k8f5S.js +55 -0
- package/dist/{Icon_cjs_Cz6IyOkb.js → Icon_cjs_DpFxIFv5.js} +170 -121
- package/dist/{Icon_es_BrwLifge.js → Icon_es_D5eiycFI.js} +170 -121
- package/dist/Image_cjs_CBDMUzv_.js +29 -0
- package/dist/Image_es_BHec4iVN.js +27 -0
- package/dist/{Input_cjs_Du73R-wm.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_CiDHjDqJ.js → Input_es_BnCXATnh.js} +27 -19
- package/dist/{Label_cjs_DMoaOoHi.js → Label_cjs_C-x9blCL.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_DCqpSw_F.js} +45 -33
- package/dist/{Link_cjs_C5UsZUiF.js → Link_cjs_qKXVfU8e.js} +43 -30
- package/dist/{Link_es_XiqbdwLp.js → Link_es_P2b6ya7P.js} +43 -30
- package/dist/Loader_cjs_DIDsIq3J.js +143 -0
- package/dist/Loader_es_CmSggwbR.js +139 -0
- package/dist/Overlay_cjs_tGA2fU43.js +42 -0
- package/dist/Overlay_es_BS7OTFoy.js +38 -0
- package/dist/{Scrollbar_cjs_DcKOfcNp.js → Scrollbar_cjs_Cp-7v2Mt.js} +1 -1
- package/dist/{Scrollbar_es_CThJeCLF.js → Scrollbar_es_CcMgNvGi.js} +1 -1
- package/dist/Text_cjs_BDTjOTVB.js +69 -0
- package/dist/Text_es_CnymlElo.js +65 -0
- package/dist/cjs/components/Accordion.js +37 -34
- package/dist/cjs/components/Avatar.js +5 -6
- package/dist/cjs/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/cjs/components/AvatarStack.js +17 -16
- package/dist/cjs/components/Badge.js +3 -4
- package/dist/cjs/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/cjs/components/Breadcrumbs.js +27 -23
- package/dist/cjs/components/Button.js +5 -6
- package/dist/cjs/components/Cell/stories/__mock__.js +1 -1
- package/dist/cjs/components/Cell.js +28 -25
- package/dist/cjs/components/Checkbox.js +33 -26
- package/dist/cjs/components/Checkmark.js +28 -23
- package/dist/cjs/components/Chips/stories/__mock__.js +1 -1
- package/dist/cjs/components/Chips.js +4 -5
- package/dist/cjs/components/Choice/stories/__mock__.js +2 -2
- package/dist/cjs/components/Choice.js +46 -40
- package/dist/cjs/components/Code.js +34 -26
- package/dist/cjs/components/CookiesWarning.js +23 -23
- package/dist/cjs/components/Dadata.js +14 -9
- package/dist/cjs/components/DatePeriod.js +32 -30
- package/dist/cjs/components/DatePicker.js +8 -9
- package/dist/cjs/components/Divider.js +1 -2
- package/dist/cjs/components/Dot.js +5 -6
- package/dist/cjs/components/Drawer.js +23 -21
- package/dist/cjs/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/cjs/components/Dropdown.js +5 -6
- package/dist/cjs/components/Flex.js +11 -12
- package/dist/cjs/components/Grid.js +15 -16
- package/dist/cjs/components/Group.js +1 -2
- package/dist/cjs/components/HTMLContent.js +5 -6
- package/dist/cjs/components/HeroTitle.js +17 -16
- package/dist/cjs/components/Icon.js +3 -4
- package/dist/cjs/components/Image.js +1 -2
- package/dist/cjs/components/Input.js +1 -2
- package/dist/cjs/components/InputPassword.js +114 -84
- package/dist/cjs/components/Label.js +4 -5
- package/dist/cjs/components/Link.js +1 -2
- package/dist/cjs/components/List.js +39 -28
- package/dist/cjs/components/Loader.js +2 -3
- package/dist/cjs/components/Logo.js +10 -11
- package/dist/cjs/components/MenuItem.js +36 -33
- package/dist/cjs/components/Modal.js +40 -38
- package/dist/cjs/components/ModalSheetBottom.js +17 -18
- package/dist/cjs/components/Notification/stories/__mock__.js +1 -1
- package/dist/cjs/components/Notification.js +31 -24
- package/dist/cjs/components/Overlay.js +1 -2
- package/dist/cjs/components/Pagination.js +43 -41
- package/dist/cjs/components/Radio.js +34 -26
- package/dist/cjs/components/RangeSlider.js +8 -9
- package/dist/cjs/components/Response/img.js +1 -1
- package/dist/cjs/components/Response.js +102 -84
- package/dist/cjs/components/SVGContent.js +6 -7
- package/dist/cjs/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/cjs/components/ScrollOnDrag.js +7 -8
- package/dist/cjs/components/ScrollToView.js +8 -9
- package/dist/cjs/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/cjs/components/Scrollbar.js +1 -1
- package/dist/cjs/components/Search.js +39 -31
- package/dist/cjs/components/Segmented/stories/__mock__.js +23 -10
- package/dist/cjs/components/Segmented.js +47 -42
- package/dist/cjs/components/Select.js +118 -113
- package/dist/cjs/components/Swiper/stories/__mock__.js +3 -3
- package/dist/cjs/components/Swiper.js +27 -29
- package/dist/cjs/components/Switch.js +33 -26
- package/dist/cjs/components/Tab/stories/__mock__.js +1 -1
- package/dist/cjs/components/Tab.js +59 -69
- package/dist/cjs/components/Text.js +1 -2
- package/dist/cjs/components/Textarea.js +26 -18
- package/dist/cjs/components/Tile.js +21 -17
- package/dist/cjs/components/Title.js +3 -4
- package/dist/cjs/components/Tooltip.js +3 -4
- package/dist/cjs/components/Video/stories/__mocks__.js +1 -1
- package/dist/cjs/components/Video.js +3 -4
- package/dist/cjs/components/Warning.js +26 -20
- package/dist/cjs/context/Notifications.js +38 -42
- package/dist/cjs/context/UIContext.js +19 -17
- package/dist/cjs/context/UrlAssetPrefix.js +3 -3
- package/dist/cjs/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/cjs/hooks/useAppearanceConfig.js +0 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/cjs/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/cjs/hooks/useDeviceTargetClass.js +0 -1
- package/dist/cjs/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +0 -1
- package/dist/cjs/hooks/useStyles.js +0 -1
- package/dist/cjs/hooks/useViewportFix.js +5 -5
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/utils/setViewportProperty.js +3 -3
- package/dist/components/Accordion.js +37 -34
- package/dist/components/Avatar.js +5 -6
- package/dist/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/components/AvatarStack.js +17 -16
- package/dist/components/Badge.js +3 -4
- package/dist/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/components/Breadcrumbs.js +27 -23
- package/dist/components/Button.js +5 -6
- package/dist/components/Cell/stories/__mock__.js +1 -1
- package/dist/components/Cell.js +28 -25
- package/dist/components/Checkbox.js +33 -26
- package/dist/components/Checkmark.js +28 -23
- package/dist/components/Chips/stories/__mock__.js +1 -1
- package/dist/components/Chips.js +4 -5
- package/dist/components/Choice/stories/__mock__.js +2 -2
- package/dist/components/Choice.js +46 -40
- package/dist/components/Code.js +34 -26
- package/dist/components/CookiesWarning.js +23 -23
- package/dist/components/Dadata.js +14 -9
- package/dist/components/DatePeriod.js +32 -30
- package/dist/components/DatePicker.js +8 -9
- package/dist/components/Divider.js +1 -2
- package/dist/components/Dot.js +5 -6
- package/dist/components/Drawer.js +23 -21
- package/dist/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/components/Dropdown.js +5 -6
- package/dist/components/Flex.js +11 -12
- package/dist/components/Grid.js +15 -16
- package/dist/components/Group.js +1 -2
- package/dist/components/HTMLContent.js +5 -6
- package/dist/components/HeroTitle.js +17 -16
- package/dist/components/Icon.js +3 -4
- package/dist/components/Image.js +1 -2
- package/dist/components/Input.js +1 -2
- package/dist/components/InputPassword.js +114 -84
- package/dist/components/Label.js +4 -5
- package/dist/components/Link.js +1 -2
- package/dist/components/List.js +39 -28
- package/dist/components/Loader.js +2 -3
- package/dist/components/Logo.js +10 -11
- package/dist/components/MenuItem.js +36 -33
- package/dist/components/Modal.js +40 -38
- package/dist/components/ModalSheetBottom.js +17 -18
- package/dist/components/Notification/stories/__mock__.js +1 -1
- package/dist/components/Notification.js +31 -24
- package/dist/components/Overlay.js +1 -2
- package/dist/components/Pagination.js +43 -41
- package/dist/components/Radio.js +34 -26
- package/dist/components/RangeSlider.js +8 -9
- package/dist/components/Response/img.js +1 -1
- package/dist/components/Response.js +102 -84
- package/dist/components/SVGContent.js +6 -7
- package/dist/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/components/ScrollOnDrag.js +7 -8
- package/dist/components/ScrollToView.js +8 -9
- package/dist/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/components/Scrollbar.js +1 -1
- package/dist/components/Search.js +39 -31
- package/dist/components/Segmented/stories/__mock__.js +23 -10
- package/dist/components/Segmented.js +47 -42
- package/dist/components/Select.js +118 -113
- package/dist/components/Swiper/stories/__mock__.js +3 -3
- package/dist/components/Swiper.js +27 -29
- package/dist/components/Switch.js +33 -26
- package/dist/components/Tab/stories/__mock__.js +1 -1
- package/dist/components/Tab.js +59 -69
- package/dist/components/Text.js +1 -2
- package/dist/components/Textarea.js +26 -18
- package/dist/components/Tile.js +21 -17
- package/dist/components/Title.js +3 -4
- package/dist/components/Tooltip.js +3 -4
- package/dist/components/Video/stories/__mocks__.js +1 -1
- package/dist/components/Video.js +3 -4
- package/dist/components/Warning.js +26 -20
- package/dist/context/Notifications.js +38 -42
- package/dist/context/UIContext.js +19 -17
- package/dist/context/UrlAssetPrefix.js +3 -3
- package/dist/css/components/Checkmark/Checkmark.css +2 -0
- package/dist/css/components/DatePeriod/DatePeriod.css +3 -0
- package/dist/css/components/Input/Input.css +0 -8
- package/dist/css/components/InputPassword/InputPassword.css +34 -43
- package/dist/css/components/Tile/Tile.css +3 -3
- package/dist/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/hooks/useAppearanceConfig.js +0 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/hooks/useDeviceTargetClass.js +0 -1
- package/dist/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/hooks/useStyles/useStyles.js +0 -1
- package/dist/hooks/useStyles.js +0 -1
- package/dist/hooks/useViewportFix.js +5 -5
- package/dist/hooks.js +1 -1
- package/dist/types/components/InputPassword/InputPassword.appearance.d.ts +179 -2
- package/dist/types/components/InputPassword/appearance/inputPasswordDefault.d.ts +7 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordDisabled.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordError.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordRequire.d.ts +6 -4
- package/dist/types/components/InputPassword/appearance/inputPasswordShape.d.ts +25 -0
- package/dist/types/components/InputPassword/appearance/inputPasswordSize.d.ts +14 -28
- package/dist/types/components/InputPassword/appearance/inputPasswordStyle.d.ts +5 -5
- package/dist/types/components/InputPassword/appearance/inputPasswordSuccess.d.ts +6 -4
- package/dist/types/components/Response/Response.constant.d.ts +32 -35
- package/dist/types/components/Response/appearance/responseConfirm.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseDanger.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseEmpty.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseError.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseFail.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseNothingFound.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseRefresh.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseSuccess.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseUnableLoadData.d.ts +1 -0
- package/dist/types/components/Response/appearance/responseWarning.d.ts +1 -0
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Tab/appearance/tabSize.d.ts +0 -14
- package/dist/types/components/Tab/appearance/tabSurface.d.ts +7 -7
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +14 -14
- package/dist/Avatar_cjs_kuE0Rueg.js +0 -157
- package/dist/Avatar_es_lx7s4Vla.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_DsIAoi01.js +0 -183
- package/dist/DatePicker_es_BP5BrEr-.js +0 -179
- package/dist/Divider_cjs_DUYtmwn2.js +0 -97
- package/dist/Divider_es_CCLBFIx6.js +0 -93
- package/dist/DropdownItem_cjs_Bhss6lyM.js +0 -207
- package/dist/DropdownItem_es_BXl6lPJx.js +0 -202
- package/dist/Group_cjs_CsJ6ICKK.js +0 -59
- package/dist/Group_es_DRqIIM9m.js +0 -55
- package/dist/Image_cjs_B6YlGx8G.js +0 -28
- package/dist/Image_es_BvYo_cHH.js +0 -26
- package/dist/Loader_cjs_D3lnxPlI.js +0 -132
- package/dist/Loader_es_BUSqFrCd.js +0 -128
- package/dist/Overlay_cjs_CcfJYN5o.js +0 -41
- package/dist/Overlay_es_DF3DAdxS.js +0 -37
- package/dist/Text_cjs_0EINiUq4.js +0 -68
- package/dist/Text_es_CwV9rjFD.js +0 -64
- package/dist/tslib.es6_cjs_CCZ3TN_7.js +0 -59
- package/dist/tslib.es6_es_Bwu1Cn-t.js +0 -56
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
4
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
@@ -9,10 +8,10 @@ var urlWithAssetPrefix = require('./cjs/hoc/urlWithAssetPrefix.js');
|
|
|
9
8
|
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
10
9
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
10
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
12
|
-
var Link = require('./
|
|
13
|
-
var Text = require('./
|
|
11
|
+
var Link = require('./Link_cjs_qKXVfU8e.js');
|
|
12
|
+
var Text = require('./Text_cjs_BDTjOTVB.js');
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const badgeAppearanceAccent = {
|
|
16
15
|
accent: {
|
|
17
16
|
fill: 'accentPrimary',
|
|
18
17
|
borderColor: 'accentBorderQuaternary',
|
|
@@ -50,7 +49,7 @@ var badgeAppearanceAccent = {
|
|
|
50
49
|
},
|
|
51
50
|
};
|
|
52
51
|
|
|
53
|
-
|
|
52
|
+
const badgeAppearanceDanger = {
|
|
54
53
|
danger: {
|
|
55
54
|
fill: 'dangerPrimary',
|
|
56
55
|
borderColor: 'dangerBorderPrimary',
|
|
@@ -67,7 +66,7 @@ var badgeAppearanceDanger = {
|
|
|
67
66
|
},
|
|
68
67
|
};
|
|
69
68
|
|
|
70
|
-
|
|
69
|
+
const badgeAppearanceDisabled = {
|
|
71
70
|
disabled: {
|
|
72
71
|
fill: 'surfaceDisabled',
|
|
73
72
|
borderColor: 'surfaceBorderDisabled',
|
|
@@ -82,7 +81,7 @@ var badgeAppearanceDisabled = {
|
|
|
82
81
|
},
|
|
83
82
|
};
|
|
84
83
|
|
|
85
|
-
|
|
84
|
+
const badgeAppearanceError = {
|
|
86
85
|
error: {
|
|
87
86
|
fill: 'errorPrimary',
|
|
88
87
|
fillHover: 'errorPrimaryHover',
|
|
@@ -99,7 +98,7 @@ var badgeAppearanceError = {
|
|
|
99
98
|
},
|
|
100
99
|
};
|
|
101
100
|
|
|
102
|
-
|
|
101
|
+
const badgeAppearanceInfo = {
|
|
103
102
|
infoPrimary: {
|
|
104
103
|
fill: 'infoPrimary',
|
|
105
104
|
borderColor: 'infoBorderSecondary',
|
|
@@ -115,7 +114,7 @@ var badgeAppearanceInfo = {
|
|
|
115
114
|
},
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
const badgeAppearancePrimary = {
|
|
119
118
|
primary: {
|
|
120
119
|
fill: 'primaryPrimary',
|
|
121
120
|
borderColor: 'primaryBorderSecondary',
|
|
@@ -132,7 +131,7 @@ var badgeAppearancePrimary = {
|
|
|
132
131
|
},
|
|
133
132
|
};
|
|
134
133
|
|
|
135
|
-
|
|
134
|
+
const badgeAppearanceSecondary = {
|
|
136
135
|
secondary: {
|
|
137
136
|
fill: 'secondaryPrimary',
|
|
138
137
|
borderColor: 'secondaryBorderSecondary',
|
|
@@ -149,7 +148,7 @@ var badgeAppearanceSecondary = {
|
|
|
149
148
|
},
|
|
150
149
|
};
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
const badgeAppearanceShape = {
|
|
153
152
|
circular: {
|
|
154
153
|
shape: 'circular',
|
|
155
154
|
},
|
|
@@ -174,7 +173,7 @@ var badgeAppearanceShape = {
|
|
|
174
173
|
},
|
|
175
174
|
};
|
|
176
175
|
|
|
177
|
-
|
|
176
|
+
const badgeAppearanceSize = {
|
|
178
177
|
sizeXXL: {
|
|
179
178
|
size: 'xxl',
|
|
180
179
|
textSize: 'xl',
|
|
@@ -212,7 +211,7 @@ var badgeAppearanceSize = {
|
|
|
212
211
|
},
|
|
213
212
|
};
|
|
214
213
|
|
|
215
|
-
|
|
214
|
+
const badgeAppearanceStyle = {
|
|
216
215
|
solid: {
|
|
217
216
|
borderColor: 'none',
|
|
218
217
|
},
|
|
@@ -226,7 +225,7 @@ var badgeAppearanceStyle = {
|
|
|
226
225
|
},
|
|
227
226
|
};
|
|
228
227
|
|
|
229
|
-
|
|
228
|
+
const badgeAppearanceSuccess = {
|
|
230
229
|
success: {
|
|
231
230
|
fill: 'successPrimary',
|
|
232
231
|
borderColor: 'successBorderPrimary',
|
|
@@ -243,7 +242,7 @@ var badgeAppearanceSuccess = {
|
|
|
243
242
|
},
|
|
244
243
|
};
|
|
245
244
|
|
|
246
|
-
|
|
245
|
+
const badgeAppearanceSurface = {
|
|
247
246
|
surfacePrimary: {
|
|
248
247
|
fill: 'surfacePrimary',
|
|
249
248
|
borderColor: 'surfaceBorderTertiary',
|
|
@@ -268,7 +267,7 @@ var badgeAppearanceSurface = {
|
|
|
268
267
|
},
|
|
269
268
|
};
|
|
270
269
|
|
|
271
|
-
|
|
270
|
+
const badgeAppearanceWarning = {
|
|
272
271
|
warning: {
|
|
273
272
|
fill: 'warningPrimary',
|
|
274
273
|
borderColor: 'warningBorderPrimary',
|
|
@@ -285,22 +284,36 @@ var badgeAppearanceWarning = {
|
|
|
285
284
|
},
|
|
286
285
|
};
|
|
287
286
|
|
|
288
|
-
|
|
287
|
+
const badgeAppearance = {
|
|
288
|
+
...badgeAppearanceSize,
|
|
289
|
+
...badgeAppearanceShape,
|
|
290
|
+
...badgeAppearanceStyle,
|
|
291
|
+
...badgeAppearanceAccent,
|
|
292
|
+
...badgeAppearanceDanger,
|
|
293
|
+
...badgeAppearanceError,
|
|
294
|
+
...badgeAppearanceInfo,
|
|
295
|
+
...badgeAppearancePrimary,
|
|
296
|
+
...badgeAppearanceSecondary,
|
|
297
|
+
...badgeAppearanceSuccess,
|
|
298
|
+
...badgeAppearanceDisabled,
|
|
299
|
+
...badgeAppearanceSurface,
|
|
300
|
+
...badgeAppearanceWarning,
|
|
301
|
+
};
|
|
289
302
|
|
|
290
|
-
|
|
303
|
+
const badgeConfig = {
|
|
291
304
|
appearance: badgeAppearance,
|
|
292
|
-
setAppearance:
|
|
305
|
+
setAppearance: (appearanceConfig) => {
|
|
293
306
|
badgeConfig.appearance = appearanceConfig;
|
|
294
307
|
},
|
|
295
308
|
};
|
|
296
309
|
function Badge(props) {
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
310
|
+
const { className, appearance, dot, icon, iconSrc, value, isSkeleton, children, } = props;
|
|
311
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, badgeConfig);
|
|
312
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
313
|
+
const { fillClass, fillHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColor, textSize, dotFillClass, iconFill, iconShape, iconSize, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
301
314
|
// @ts-expect-error
|
|
302
|
-
|
|
303
|
-
|
|
315
|
+
const { styles: badgeStyles } = useStyles.useStyles(props);
|
|
316
|
+
const badgeTypeClass = value
|
|
304
317
|
? icon
|
|
305
318
|
? dot
|
|
306
319
|
? 'badge_type_dot-icon-counter'
|
|
@@ -311,11 +324,11 @@ function Badge(props) {
|
|
|
311
324
|
: dot
|
|
312
325
|
? 'badge_type_dot'
|
|
313
326
|
: 'badge_type_fill';
|
|
314
|
-
return (jsxRuntime.jsxs("div", { className: clsx(className, 'badge', borderColorClass &&
|
|
327
|
+
return (jsxRuntime.jsxs("div", { className: clsx(className, 'badge', borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, sizeClass && `badge_size_${sizeClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, badgeTypeClass, isSkeleton && 'badge_skeleton'), style: badgeStyles, children: [dot && (jsxRuntime.jsx("div", { className: clsx('badge__dot', dotFillClass && `svg_fill_${dotFillClass}`), children: jsxRuntime.jsx("svg", { width: "6", height: "6", viewBox: "0 0 6 6", xmlns: "http://www.w3.org/2000/svg", children: jsxRuntime.jsx("rect", { width: "6", height: "6", rx: "50" }) }) })), icon && (jsxRuntime.jsx(Icon, { className: "badge__icon", size: iconSize, iconFill: iconFill, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), children ||
|
|
315
328
|
(value && (jsxRuntime.jsx(Text.Text, { className: "badge__value", size: textSize, textColor: textColor, children: value })))] }));
|
|
316
329
|
}
|
|
317
330
|
|
|
318
|
-
|
|
331
|
+
const titleAppearanceAccent = {
|
|
319
332
|
accent: {
|
|
320
333
|
fill: 'accentPrimary',
|
|
321
334
|
fillHover: 'accentHoverPrimary',
|
|
@@ -330,14 +343,14 @@ var titleAppearanceAccent = {
|
|
|
330
343
|
},
|
|
331
344
|
};
|
|
332
345
|
|
|
333
|
-
|
|
346
|
+
const titleAppearanceDanger = {
|
|
334
347
|
danger: {
|
|
335
348
|
fill: 'dangerPrimary',
|
|
336
349
|
fillHover: 'dangerPrimaryHover',
|
|
337
350
|
},
|
|
338
351
|
};
|
|
339
352
|
|
|
340
|
-
|
|
353
|
+
const titleAppearanceDisabled = {
|
|
341
354
|
disabledPrimary: {
|
|
342
355
|
fill: 'surfaceFillDisabled',
|
|
343
356
|
borderColor: 'errorBorderQuaternary',
|
|
@@ -357,7 +370,7 @@ var titleAppearanceDisabled = {
|
|
|
357
370
|
},
|
|
358
371
|
};
|
|
359
372
|
|
|
360
|
-
|
|
373
|
+
const titleAppearanceError = {
|
|
361
374
|
error: {
|
|
362
375
|
fill: 'errorPrimary',
|
|
363
376
|
fillHover: 'errorPrimaryHover',
|
|
@@ -366,7 +379,7 @@ var titleAppearanceError = {
|
|
|
366
379
|
},
|
|
367
380
|
};
|
|
368
381
|
|
|
369
|
-
|
|
382
|
+
const titleAppearanceInfo = {
|
|
370
383
|
info: {
|
|
371
384
|
fill: 'accentPrimary',
|
|
372
385
|
fillHover: 'accentPrimaryHover',
|
|
@@ -377,14 +390,14 @@ var titleAppearanceInfo = {
|
|
|
377
390
|
},
|
|
378
391
|
};
|
|
379
392
|
|
|
380
|
-
|
|
393
|
+
const titleAppearancePrimary = {
|
|
381
394
|
primary: {
|
|
382
395
|
fill: 'primaryPrimary',
|
|
383
396
|
fillHover: 'primaryPrimaryHover',
|
|
384
397
|
},
|
|
385
398
|
};
|
|
386
399
|
|
|
387
|
-
|
|
400
|
+
const titleAppearanceRequire = {
|
|
388
401
|
requirePrimary: {
|
|
389
402
|
fill: 'warningTertiary',
|
|
390
403
|
borderColor: 'warningBorderQuaternary',
|
|
@@ -404,7 +417,7 @@ var titleAppearanceRequire = {
|
|
|
404
417
|
},
|
|
405
418
|
};
|
|
406
419
|
|
|
407
|
-
|
|
420
|
+
const titleAppearanceSecondary = {
|
|
408
421
|
secondary: {
|
|
409
422
|
fill: 'secondaryPrimary',
|
|
410
423
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -412,7 +425,7 @@ var titleAppearanceSecondary = {
|
|
|
412
425
|
},
|
|
413
426
|
};
|
|
414
427
|
|
|
415
|
-
|
|
428
|
+
const titleAppearanceSize = {
|
|
416
429
|
h1: {
|
|
417
430
|
size: 'h1',
|
|
418
431
|
iconAfterFillSize: '24',
|
|
@@ -457,7 +470,7 @@ var titleAppearanceSize = {
|
|
|
457
470
|
},
|
|
458
471
|
};
|
|
459
472
|
|
|
460
|
-
|
|
473
|
+
const titleAppearanceStyle = {
|
|
461
474
|
solid: {},
|
|
462
475
|
outlined: {
|
|
463
476
|
fill: 'none',
|
|
@@ -468,14 +481,14 @@ var titleAppearanceStyle = {
|
|
|
468
481
|
},
|
|
469
482
|
};
|
|
470
483
|
|
|
471
|
-
|
|
484
|
+
const titleAppearanceSuccess = {
|
|
472
485
|
success: {
|
|
473
486
|
fill: 'successPrimary',
|
|
474
487
|
fillHover: 'successPrimaryHover',
|
|
475
488
|
},
|
|
476
489
|
};
|
|
477
490
|
|
|
478
|
-
|
|
491
|
+
const titleAppearanceSurface = {
|
|
479
492
|
surfacePrimary: {
|
|
480
493
|
fill: 'surfacePrimary',
|
|
481
494
|
fillHover: 'surfacePrimaryHover',
|
|
@@ -494,7 +507,7 @@ var titleAppearanceSurface = {
|
|
|
494
507
|
},
|
|
495
508
|
};
|
|
496
509
|
|
|
497
|
-
|
|
510
|
+
const titleAppearanceWarning = {
|
|
498
511
|
warning: {
|
|
499
512
|
fill: 'warningPrimary',
|
|
500
513
|
fillHover: 'warningPrimaryHover',
|
|
@@ -503,46 +516,60 @@ var titleAppearanceWarning = {
|
|
|
503
516
|
},
|
|
504
517
|
};
|
|
505
518
|
|
|
506
|
-
|
|
519
|
+
const titleAppearance = {
|
|
520
|
+
...titleAppearanceSize,
|
|
521
|
+
...titleAppearanceDisabled,
|
|
522
|
+
...titleAppearanceRequire,
|
|
523
|
+
...titleAppearanceStyle,
|
|
524
|
+
...titleAppearanceAccent,
|
|
525
|
+
...titleAppearanceDanger,
|
|
526
|
+
...titleAppearanceError,
|
|
527
|
+
...titleAppearanceInfo,
|
|
528
|
+
...titleAppearancePrimary,
|
|
529
|
+
...titleAppearanceSecondary,
|
|
530
|
+
...titleAppearanceSuccess,
|
|
531
|
+
...titleAppearanceSurface,
|
|
532
|
+
...titleAppearanceWarning,
|
|
533
|
+
};
|
|
507
534
|
|
|
508
|
-
|
|
535
|
+
const titleConfig = {
|
|
509
536
|
appearance: titleAppearance,
|
|
510
|
-
setAppearance:
|
|
537
|
+
setAppearance: (appearanceConfig) => {
|
|
511
538
|
titleConfig.appearance = appearanceConfig;
|
|
512
539
|
},
|
|
513
540
|
};
|
|
514
541
|
function Title(props) {
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
542
|
+
const { dataTestId, dataTour, className, appearance, isDisabled, text, afterWrapper, beforeWrapper, tag = 'span', before, after, isActive, isSkeleton, onClick, children, } = props;
|
|
543
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, titleConfig, isDisabled);
|
|
544
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
545
|
+
const { directionClass, size, fillClass, fillHoverClass, textColorDisabledClass, textAlignClass, textColorActiveClass, textColorActiveHoverClass, textColorClass, textColorHoverClass, textStyleClass, textTruncateClass, textWeightClass, textWrap, heightClass, iconAfter, iconAfterFill, iconAfterFillIcon, iconAfterFillSize, iconAfterShape, iconAfterSize, iconAfterSrc, iconBadgeAppearance, iconBadgeShape, iconBadgeSize, iconBadgeTextColor, iconBadgeTextSize, iconBadgeValue, iconBefore, iconBeforeFill, iconBeforeFillIcon, iconBeforeFillSize, iconBeforeShape, iconBeforeSize, iconBeforeSrc, svgFillClass, svgFillHoverClass, widthClass, wrapperDirectionClass, } = propsGenerator;
|
|
519
546
|
// @ts-expect-error
|
|
520
|
-
|
|
547
|
+
const { styles: titleStyles, wrapper: titleWrapperStyles } = useStyles.useStyles(props);
|
|
521
548
|
// Element type (h1, h2, ..., h6)
|
|
522
|
-
|
|
549
|
+
const Tag = React.useMemo(() => {
|
|
523
550
|
if (tag) {
|
|
524
551
|
return tag;
|
|
525
552
|
}
|
|
526
553
|
return size ? size : 'span';
|
|
527
554
|
}, [tag, size]);
|
|
528
|
-
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'title', fillClass &&
|
|
555
|
+
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'title', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillClass}`, svgFillClass && `svg_fill_${svgFillClass}`, svgFillHoverClass && `svg_fill_hover_${svgFillHoverClass}`, widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, size && `title_size_${size}`, directionClass && `title_direction_${directionClass}`, isDisabled &&
|
|
529
556
|
textColorDisabledClass &&
|
|
530
|
-
|
|
557
|
+
`text-color_${textColorDisabledClass}`, !isActive &&
|
|
531
558
|
!isDisabled &&
|
|
532
559
|
textColorClass &&
|
|
533
|
-
|
|
560
|
+
`text-color_${textColorClass}`, isActive &&
|
|
534
561
|
!isDisabled &&
|
|
535
562
|
textColorActiveClass &&
|
|
536
|
-
|
|
563
|
+
`text-color_active_${textColorActiveClass}`, !isActive &&
|
|
537
564
|
!isDisabled &&
|
|
538
565
|
textColorHoverClass &&
|
|
539
|
-
|
|
566
|
+
`text-color_hover_${textColorHoverClass}`, isActive &&
|
|
540
567
|
!isDisabled &&
|
|
541
568
|
textColorActiveHoverClass &&
|
|
542
|
-
|
|
569
|
+
`text-color_active_hover${textColorActiveHoverClass}`, textStyleClass && `text-style_${textStyleClass}`, textWeightClass && `text-weight_${textWeightClass}`, textWrap && `word-wrap_${textWrap}`, iconBadgeValue && 'title_badge', isSkeleton && 'title_skeleton'), "data-test-id": dataTestId, "data-tour": dataTour, style: titleStyles, onClick: onClick, children: [before, jsxRuntime.jsxs("span", { className: clsx(textAlignClass && `text-align_${textAlignClass}`, wrapperDirectionClass && `title_direction_${wrapperDirectionClass}`, 'title__wrapper', textTruncateClass && `text-truncate_${textTruncateClass}`), style: titleWrapperStyles, children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_before', iconBadgeValue && 'title__icon_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), beforeWrapper, children || text, afterWrapper, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_after', iconBadgeValue && 'title__icon_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }), after] }));
|
|
543
570
|
}
|
|
544
571
|
|
|
545
|
-
|
|
572
|
+
const tooltipAppearanceDefault = {
|
|
546
573
|
defaultPrimary: {
|
|
547
574
|
fill: 'surfacePrimary',
|
|
548
575
|
fillHover: 'surfaceHoverPrimary',
|
|
@@ -552,7 +579,7 @@ var tooltipAppearanceDefault = {
|
|
|
552
579
|
},
|
|
553
580
|
};
|
|
554
581
|
|
|
555
|
-
|
|
582
|
+
const tooltipAppearanceDisabled = {
|
|
556
583
|
disabledPrimary: {
|
|
557
584
|
fill: 'disabledPrimary',
|
|
558
585
|
fillHover: 'disabledHoverPrimary',
|
|
@@ -561,7 +588,7 @@ var tooltipAppearanceDisabled = {
|
|
|
561
588
|
},
|
|
562
589
|
};
|
|
563
590
|
|
|
564
|
-
|
|
591
|
+
const tooltipAppearanceError = {
|
|
565
592
|
errorPrimary: {
|
|
566
593
|
fill: 'errorPrimary',
|
|
567
594
|
fillHover: 'errorHoverPrimary',
|
|
@@ -571,7 +598,7 @@ var tooltipAppearanceError = {
|
|
|
571
598
|
},
|
|
572
599
|
};
|
|
573
600
|
|
|
574
|
-
|
|
601
|
+
const tooltipAppearanceRequire = {
|
|
575
602
|
requirePrimary: {
|
|
576
603
|
fill: 'warningPrimary',
|
|
577
604
|
fillHover: 'warningHoverPrimary',
|
|
@@ -581,7 +608,7 @@ var tooltipAppearanceRequire = {
|
|
|
581
608
|
},
|
|
582
609
|
};
|
|
583
610
|
|
|
584
|
-
|
|
611
|
+
const tooltipAppearanceSize = {
|
|
585
612
|
sizeL: {
|
|
586
613
|
size: 'l',
|
|
587
614
|
titleSize: 'h5',
|
|
@@ -599,7 +626,7 @@ var tooltipAppearanceSize = {
|
|
|
599
626
|
},
|
|
600
627
|
};
|
|
601
628
|
|
|
602
|
-
|
|
629
|
+
const tooltipAppearanceStyle = {
|
|
603
630
|
solid: {
|
|
604
631
|
borderColor: 'none',
|
|
605
632
|
},
|
|
@@ -613,7 +640,7 @@ var tooltipAppearanceStyle = {
|
|
|
613
640
|
},
|
|
614
641
|
};
|
|
615
642
|
|
|
616
|
-
|
|
643
|
+
const tooltipAppearanceSuccess = {
|
|
617
644
|
successPrimary: {
|
|
618
645
|
fill: 'successPrimary',
|
|
619
646
|
fillHover: 'successHoverPrimary',
|
|
@@ -623,43 +650,51 @@ var tooltipAppearanceSuccess = {
|
|
|
623
650
|
},
|
|
624
651
|
};
|
|
625
652
|
|
|
626
|
-
|
|
653
|
+
const tooltipAppearance = {
|
|
654
|
+
...tooltipAppearanceDefault,
|
|
655
|
+
...tooltipAppearanceSize,
|
|
656
|
+
...tooltipAppearanceDisabled,
|
|
657
|
+
...tooltipAppearanceRequire,
|
|
658
|
+
...tooltipAppearanceStyle,
|
|
659
|
+
...tooltipAppearanceError,
|
|
660
|
+
...tooltipAppearanceSuccess,
|
|
661
|
+
};
|
|
627
662
|
|
|
628
|
-
|
|
663
|
+
const tooltipConfig = {
|
|
629
664
|
appearance: tooltipAppearance,
|
|
630
|
-
setAppearance:
|
|
665
|
+
setAppearance: (appearanceConfig) => {
|
|
631
666
|
tooltipConfig.appearance = appearanceConfig;
|
|
632
667
|
},
|
|
633
668
|
};
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
669
|
+
const Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
670
|
+
const { className, appearance, initialIsVisible, title, text, before, after, openTimeoutDelay = 500, closeTimeoutDelay = 250, isSkeleton, children, } = props;
|
|
671
|
+
const tooltipElementRef = React.useRef(null);
|
|
672
|
+
const tooltipTimeoutHideRef = React.useRef(null);
|
|
673
|
+
const tooltipTimeoutShowRef = React.useRef(null);
|
|
674
|
+
const isTooltipCloseAnimationInProgressRef = React.useRef(false);
|
|
640
675
|
// TODO: rename to open?
|
|
641
|
-
|
|
676
|
+
const [isTooltipVisible, setIsTooltipVisible] = React.useState(initialIsVisible);
|
|
642
677
|
// TODO: or rename to show/hide?
|
|
643
|
-
|
|
678
|
+
const openTooltip = React.useCallback(() => {
|
|
644
679
|
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
645
680
|
if (tooltipTimeoutHideRef.current) {
|
|
646
681
|
clearTimeout(tooltipTimeoutHideRef.current);
|
|
647
682
|
}
|
|
648
|
-
tooltipTimeoutShowRef.current = setTimeout(
|
|
683
|
+
tooltipTimeoutShowRef.current = setTimeout(() => {
|
|
649
684
|
setIsTooltipVisible(true);
|
|
650
685
|
}, openTimeoutDelay);
|
|
651
686
|
}
|
|
652
687
|
}, [openTimeoutDelay]);
|
|
653
|
-
|
|
688
|
+
const closeTooltip = React.useCallback(() => {
|
|
654
689
|
if (tooltipTimeoutShowRef.current) {
|
|
655
690
|
clearTimeout(tooltipTimeoutShowRef.current);
|
|
656
691
|
}
|
|
657
692
|
// Make a small delay to be able to move cursor on the tooltip without
|
|
658
693
|
// triggering a close, because the label and the tooltip have space between
|
|
659
|
-
tooltipTimeoutHideRef.current = setTimeout(
|
|
694
|
+
tooltipTimeoutHideRef.current = setTimeout(() => {
|
|
660
695
|
// @ts-expect-error
|
|
661
|
-
setIsTooltipVisible(
|
|
662
|
-
|
|
696
|
+
setIsTooltipVisible((prevState) => {
|
|
697
|
+
const newState = false;
|
|
663
698
|
if (prevState === true) {
|
|
664
699
|
isTooltipCloseAnimationInProgressRef.current = true;
|
|
665
700
|
}
|
|
@@ -667,26 +702,26 @@ var Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
|
667
702
|
});
|
|
668
703
|
}, closeTimeoutDelay);
|
|
669
704
|
}, [closeTimeoutDelay]);
|
|
670
|
-
|
|
705
|
+
const onAnimationEnd = React.useCallback(() => {
|
|
671
706
|
isTooltipCloseAnimationInProgressRef.current = false;
|
|
672
707
|
}, []);
|
|
673
|
-
React.useImperativeHandle(ref,
|
|
708
|
+
React.useImperativeHandle(ref, () => ({
|
|
674
709
|
get tooltipElement() {
|
|
675
710
|
return tooltipElementRef.current;
|
|
676
711
|
},
|
|
677
712
|
openTooltip: openTooltip,
|
|
678
713
|
closeTooltip: closeTooltip,
|
|
679
714
|
isTooltipVisible: isTooltipVisible,
|
|
680
|
-
})
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
715
|
+
}), [isTooltipVisible, openTooltip, closeTooltip]);
|
|
716
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, tooltipConfig);
|
|
717
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
718
|
+
const { alignClass, alignDirectionClass, alignmentClass, alignPosition, fillClass, borderColorClass, borderTypeClass, borderWidthClass, titleColor, titleSize, titleWeight, textColor, textSize, textWeight, arrowPosition, centeringClass, elevationClass, shapeClass, shapeStrengthClass, sizeClass, widthClass, } = propsGenerator;
|
|
684
719
|
// @ts-expect-error
|
|
685
|
-
|
|
686
|
-
return (jsxRuntime.jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible ? 'tooltip_state_open' : 'tooltip_state_close', fillClass &&
|
|
720
|
+
const { styles: tooltipStyles } = useStyles.useStyles(props);
|
|
721
|
+
return (jsxRuntime.jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible ? 'tooltip_state_open' : 'tooltip_state_close', fillClass && `fill_${fillClass}`, alignPosition && `tooltip_align-position_${alignPosition}`, alignDirectionClass && `align_${alignDirectionClass}`, alignClass && `align_${alignClass}`, elevationClass && `elevation_${elevationClass}`, centeringClass && `centering_${centeringClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, alignmentClass && `alignment_${alignmentClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `tooltip_size_${sizeClass}`, isSkeleton && 'tooltip_skeleton', widthClass && `width_${widthClass}`), ref: tooltipElementRef, style: tooltipStyles, onAnimationEnd: onAnimationEnd, children: [jsxRuntime.jsx("div", { className: clsx('tooltip__arrow', arrowPosition && `tooltip__arrow_position_${arrowPosition}`, fillClass && `fill_${fillClass}`), children: "\u00A0" }), before, jsxRuntime.jsxs("div", { className: "tooltip__inner", children: [title && (jsxRuntime.jsx(Title, { className: "tooltip__title text", size: titleSize, textColor: titleColor, textWeight: titleWeight, children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "tooltip__text", size: textSize, textColor: textColor, textWeight: textWeight, children: text })), children] }), after] }));
|
|
687
722
|
});
|
|
688
723
|
|
|
689
|
-
|
|
724
|
+
const iconAppearanceAccent = {
|
|
690
725
|
accent: {
|
|
691
726
|
fill: 'accentPrimary',
|
|
692
727
|
fillHover: 'accentHover',
|
|
@@ -709,7 +744,7 @@ var iconAppearanceAccent = {
|
|
|
709
744
|
},
|
|
710
745
|
};
|
|
711
746
|
|
|
712
|
-
|
|
747
|
+
const iconAppearanceDanger = {
|
|
713
748
|
danger: {
|
|
714
749
|
fill: 'dangerPrimary',
|
|
715
750
|
fillHover: 'dangerHover',
|
|
@@ -723,7 +758,7 @@ var iconAppearanceDanger = {
|
|
|
723
758
|
},
|
|
724
759
|
};
|
|
725
760
|
|
|
726
|
-
|
|
761
|
+
const iconAppearanceDisabled = {
|
|
727
762
|
disabledPrimary: {
|
|
728
763
|
fill: 'surfaceDisabled',
|
|
729
764
|
borderColor: 'surfaceBorderDisabled',
|
|
@@ -732,7 +767,7 @@ var iconAppearanceDisabled = {
|
|
|
732
767
|
},
|
|
733
768
|
};
|
|
734
769
|
|
|
735
|
-
|
|
770
|
+
const iconAppearanceError = {
|
|
736
771
|
error: {
|
|
737
772
|
fill: 'errorPrimary',
|
|
738
773
|
fillHover: 'errorHover',
|
|
@@ -748,7 +783,7 @@ var iconAppearanceError = {
|
|
|
748
783
|
},
|
|
749
784
|
};
|
|
750
785
|
|
|
751
|
-
|
|
786
|
+
const iconAppearanceInfo = {
|
|
752
787
|
info: {
|
|
753
788
|
fill: 'accentPrimary',
|
|
754
789
|
fillHover: 'accentPrimaryHover',
|
|
@@ -767,7 +802,7 @@ var iconAppearanceInfo = {
|
|
|
767
802
|
},
|
|
768
803
|
};
|
|
769
804
|
|
|
770
|
-
|
|
805
|
+
const iconAppearancePrimary = {
|
|
771
806
|
primary: {
|
|
772
807
|
fill: 'primaryPrimary',
|
|
773
808
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -783,7 +818,7 @@ var iconAppearancePrimary = {
|
|
|
783
818
|
},
|
|
784
819
|
};
|
|
785
820
|
|
|
786
|
-
|
|
821
|
+
const iconAppearanceSecondary = {
|
|
787
822
|
secondary: {
|
|
788
823
|
fill: 'secondaryPrimary',
|
|
789
824
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -797,7 +832,7 @@ var iconAppearanceSecondary = {
|
|
|
797
832
|
},
|
|
798
833
|
};
|
|
799
834
|
|
|
800
|
-
|
|
835
|
+
const iconAppearanceShape = {
|
|
801
836
|
circular: {
|
|
802
837
|
shape: 'circular',
|
|
803
838
|
},
|
|
@@ -822,7 +857,7 @@ var iconAppearanceShape = {
|
|
|
822
857
|
},
|
|
823
858
|
};
|
|
824
859
|
|
|
825
|
-
|
|
860
|
+
const iconAppearanceSize = {
|
|
826
861
|
size12_12: {
|
|
827
862
|
fillSize: '12',
|
|
828
863
|
badgeAppearanceSize: 'sizeXXS',
|
|
@@ -965,7 +1000,7 @@ var iconAppearanceSize = {
|
|
|
965
1000
|
},
|
|
966
1001
|
};
|
|
967
1002
|
|
|
968
|
-
|
|
1003
|
+
const iconAppearanceStyle = {
|
|
969
1004
|
solid: {
|
|
970
1005
|
borderColor: 'none',
|
|
971
1006
|
},
|
|
@@ -979,7 +1014,7 @@ var iconAppearanceStyle = {
|
|
|
979
1014
|
},
|
|
980
1015
|
};
|
|
981
1016
|
|
|
982
|
-
|
|
1017
|
+
const iconAppearanceSuccess = {
|
|
983
1018
|
success: {
|
|
984
1019
|
fill: 'successPrimary',
|
|
985
1020
|
fillHover: 'successHover',
|
|
@@ -993,7 +1028,7 @@ var iconAppearanceSuccess = {
|
|
|
993
1028
|
},
|
|
994
1029
|
};
|
|
995
1030
|
|
|
996
|
-
|
|
1031
|
+
const iconAppearanceSurface = {
|
|
997
1032
|
surfacePrimary: {
|
|
998
1033
|
fill: 'surfacePrimary',
|
|
999
1034
|
fillHover: 'surfaceSecondary',
|
|
@@ -1021,7 +1056,7 @@ var iconAppearanceSurface = {
|
|
|
1021
1056
|
},
|
|
1022
1057
|
};
|
|
1023
1058
|
|
|
1024
|
-
|
|
1059
|
+
const iconAppearanceWarning = {
|
|
1025
1060
|
warning: {
|
|
1026
1061
|
fill: 'warningPrimary',
|
|
1027
1062
|
fillHover: 'warningHover',
|
|
@@ -1037,28 +1072,42 @@ var iconAppearanceWarning = {
|
|
|
1037
1072
|
},
|
|
1038
1073
|
};
|
|
1039
1074
|
|
|
1040
|
-
|
|
1075
|
+
const iconAppearance = {
|
|
1076
|
+
...iconAppearanceDisabled,
|
|
1077
|
+
...iconAppearanceSize,
|
|
1078
|
+
...iconAppearanceStyle,
|
|
1079
|
+
...iconAppearanceAccent,
|
|
1080
|
+
...iconAppearanceShape,
|
|
1081
|
+
...iconAppearanceDanger,
|
|
1082
|
+
...iconAppearanceError,
|
|
1083
|
+
...iconAppearanceInfo,
|
|
1084
|
+
...iconAppearancePrimary,
|
|
1085
|
+
...iconAppearanceSecondary,
|
|
1086
|
+
...iconAppearanceSuccess,
|
|
1087
|
+
...iconAppearanceSurface,
|
|
1088
|
+
...iconAppearanceWarning,
|
|
1089
|
+
};
|
|
1041
1090
|
|
|
1042
|
-
|
|
1091
|
+
const iconConfig = {
|
|
1043
1092
|
appearance: iconAppearance,
|
|
1044
|
-
setAppearance:
|
|
1093
|
+
setAppearance: (appearanceConfig) => {
|
|
1045
1094
|
iconConfig.appearance = appearanceConfig;
|
|
1046
1095
|
},
|
|
1047
1096
|
};
|
|
1048
|
-
|
|
1097
|
+
const Icon = urlWithAssetPrefix.urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
|
|
1049
1098
|
// TODO: Tooltip doesn't work that anymore
|
|
1050
1099
|
// const [isTooltipVisible, setIsTooltipVisible] = useState(false)
|
|
1051
|
-
|
|
1052
|
-
|
|
1100
|
+
const { id, appearance, className, dataTour, width, height, badgeClass, href, imageSrc, link, linkRel, linkTarget, notification, showTooltip, SvgImage, before, after, isActive, isDisabled, isSkeleton, onClick, onMouseEnter, onMouseLeave, } = props;
|
|
1101
|
+
const ImageComponent = React.useMemo(() => {
|
|
1053
1102
|
if (SvgImage) {
|
|
1054
|
-
|
|
1103
|
+
const sizes = {};
|
|
1055
1104
|
if (width) {
|
|
1056
1105
|
sizes.width = width;
|
|
1057
1106
|
}
|
|
1058
1107
|
if (height) {
|
|
1059
1108
|
sizes.height = height;
|
|
1060
1109
|
}
|
|
1061
|
-
return jsxRuntime.jsx(SvgImage,
|
|
1110
|
+
return jsxRuntime.jsx(SvgImage, { ...sizes });
|
|
1062
1111
|
}
|
|
1063
1112
|
if (imageSrc) {
|
|
1064
1113
|
if (imageSrc.endsWith('.svg')) {
|
|
@@ -1068,27 +1117,27 @@ var Icon = urlWithAssetPrefix.urlWithAssetPrefix(React.forwardRef(function Icon(
|
|
|
1068
1117
|
}
|
|
1069
1118
|
return null;
|
|
1070
1119
|
}, [SvgImage, width, height, imageSrc]);
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1120
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, iconConfig, isDisabled);
|
|
1121
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
1122
|
+
const { alignmentClass, fillActiveClass, fillActiveHoverClass, fillClass, fillDisabledClass, fillHoverClass, fillSizeClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, iconFillDisabledClass, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, badgeValue, centeringClass, iconFillActiveClass, iconFillActiveHoverClass, iconFillClass, iconFillHoverClass, iconSizeClass, shapeClass, shapeStrengthClass, tooltipAppearance, tooltipText, tooltipTextSize, tooltipTitle, tooltipTitleSize, } = propsGenerator;
|
|
1074
1123
|
// @ts-expect-error - TODO: сделать useStyles на ts
|
|
1075
|
-
|
|
1124
|
+
const { styles: iconStyles } = useStyles.useStyles(props);
|
|
1076
1125
|
return (jsxRuntime.jsxs("div", { id: id, className: clsx(className, 'icon', !isActive
|
|
1077
|
-
? fillClass &&
|
|
1078
|
-
: fillActiveClass &&
|
|
1079
|
-
? fillHoverClass &&
|
|
1126
|
+
? fillClass && `fill_${fillClass}`
|
|
1127
|
+
: fillActiveClass && `fill_active_${fillActiveClass}`, !isActive
|
|
1128
|
+
? fillHoverClass && `fill_hover_${fillHoverClass}`
|
|
1080
1129
|
: fillActiveHoverClass &&
|
|
1081
|
-
|
|
1082
|
-
? iconFillClass &&
|
|
1083
|
-
: iconFillActiveClass &&
|
|
1084
|
-
? iconFillHoverClass &&
|
|
1130
|
+
`fill_active_hover_${fillActiveHoverClass}`, fillSizeClass && `icon_fill_size_${fillSizeClass}`, fillDisabledClass && `fill_disabled_${fillDisabledClass}`, !isActive
|
|
1131
|
+
? iconFillClass && `icon_fill_${iconFillClass}`
|
|
1132
|
+
: iconFillActiveClass && `icon_fill_active_${iconFillActiveClass}`, !isActive
|
|
1133
|
+
? iconFillHoverClass && `icon_fill_hover_${iconFillHoverClass}`
|
|
1085
1134
|
: iconFillActiveHoverClass &&
|
|
1086
|
-
|
|
1135
|
+
`icon_fill_active_hover_${iconFillActiveHoverClass}`, isDisabled &&
|
|
1087
1136
|
iconFillDisabledClass &&
|
|
1088
|
-
|
|
1089
|
-
|
|
1137
|
+
`icon_fill_disabled_${iconFillDisabledClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass &&
|
|
1138
|
+
`border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, badgeValue && 'icon_with-badge', centeringClass && `centering_${centeringClass}`, onClick && 'cursor_type_pointer', isSkeleton && `icon_skeleton`), ref: ref, "data-tour": dataTour, style: iconStyles, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, children: [before, jsxRuntime.jsxs(Link.LinkWrapper, { className: clsx((link || href || onClick) && 'cursor_type_pointer', link || href ? 'icon__link' : 'icon__item', iconSizeClass && `icon_size_${iconSizeClass}`), href: link || href, LinkComponent: "div", rel: linkRel, target: linkTarget, children: [ImageComponent, (badgeValue || notification) && (jsxRuntime.jsx(Badge, { className: clsx(badgeClass, 'icon__badge'), appearance: `${badgeAppearance} ${badgeAppearanceSize}`, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), showTooltip && (jsxRuntime.jsx(Tooltip, { className: clsx(className, 'icon__tooltip', alignmentClass && `alignment_${alignmentClass}`), appearance: tooltipAppearance, title: tooltipTitle, titleSize: tooltipTitleSize, text: tooltipText, textSize: tooltipTextSize }))] }), after] }));
|
|
1090
1139
|
}));
|
|
1091
|
-
|
|
1140
|
+
const removeFillStroke = (code) => {
|
|
1092
1141
|
return code
|
|
1093
1142
|
.replace(/fill=".*?"/g, 'fill=""')
|
|
1094
1143
|
.replace(/stroke=".*?"/g, 'stroke=""');
|