@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
|
@@ -4,11 +4,10 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
6
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
7
|
-
import { I as Icon, T as Tooltip } from './
|
|
8
|
-
import { T as Text } from './
|
|
9
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
7
|
+
import { I as Icon, T as Tooltip } from './Icon_es_D5eiycFI.js';
|
|
8
|
+
import { T as Text } from './Text_es_CnymlElo.js';
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const labelAppearanceAccent = {
|
|
12
11
|
accentMutedPrimary: {
|
|
13
12
|
fill: 'accentTertiary',
|
|
14
13
|
borderColor: 'accentBorderSecondary',
|
|
@@ -29,7 +28,7 @@ var labelAppearanceAccent = {
|
|
|
29
28
|
},
|
|
30
29
|
};
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
const labelAppearanceDanger = {
|
|
33
32
|
dangerMutedPrimary: {
|
|
34
33
|
fill: 'dangerTertiary',
|
|
35
34
|
labelTextColor: 'dangerTextQuaternary',
|
|
@@ -46,7 +45,7 @@ var labelAppearanceDanger = {
|
|
|
46
45
|
},
|
|
47
46
|
};
|
|
48
47
|
|
|
49
|
-
|
|
48
|
+
const labelAppearanceDisabled = {
|
|
50
49
|
disabledMutedPrimary: {
|
|
51
50
|
fill: 'disabledMuted',
|
|
52
51
|
labelTextColor: 'disabledMutedTextPrimary',
|
|
@@ -63,7 +62,7 @@ var labelAppearanceDisabled = {
|
|
|
63
62
|
},
|
|
64
63
|
};
|
|
65
64
|
|
|
66
|
-
|
|
65
|
+
const labelAppearanceError = {
|
|
67
66
|
errorMutedPrimary: {
|
|
68
67
|
fill: 'errorDisabled',
|
|
69
68
|
labelTextColor: 'errorTextQuaternary',
|
|
@@ -80,7 +79,7 @@ var labelAppearanceError = {
|
|
|
80
79
|
},
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
const labelAppearanceGradient = {
|
|
84
83
|
gradientPrimary: {
|
|
85
84
|
fill: 'gradientPrimaryDiagonal',
|
|
86
85
|
labelTextColor: 'white',
|
|
@@ -90,7 +89,7 @@ var labelAppearanceGradient = {
|
|
|
90
89
|
},
|
|
91
90
|
};
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
const labelAppearanceInfo = {
|
|
94
93
|
infoMutedPrimary: {
|
|
95
94
|
fill: 'infoMuted',
|
|
96
95
|
labelTextColor: 'infoMutedTextPrimary',
|
|
@@ -114,7 +113,7 @@ var labelAppearanceInfo = {
|
|
|
114
113
|
},
|
|
115
114
|
};
|
|
116
115
|
|
|
117
|
-
|
|
116
|
+
const labelAppearancePrimary = {
|
|
118
117
|
primaryMutedPrimary: {
|
|
119
118
|
fill: 'primaryDisabled',
|
|
120
119
|
labelTextColor: 'primaryTextSecondary',
|
|
@@ -131,7 +130,7 @@ var labelAppearancePrimary = {
|
|
|
131
130
|
},
|
|
132
131
|
};
|
|
133
132
|
|
|
134
|
-
|
|
133
|
+
const labelAppearanceSecondary = {
|
|
135
134
|
secondaryMutedPrimary: {
|
|
136
135
|
fill: 'secondaryDisabled',
|
|
137
136
|
labelTextColor: 'secondaryTextQuaternary',
|
|
@@ -148,7 +147,7 @@ var labelAppearanceSecondary = {
|
|
|
148
147
|
},
|
|
149
148
|
};
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
const labelAppearanceShape = {
|
|
152
151
|
circular: {
|
|
153
152
|
shape: 'circular',
|
|
154
153
|
},
|
|
@@ -173,7 +172,7 @@ var labelAppearanceShape = {
|
|
|
173
172
|
},
|
|
174
173
|
};
|
|
175
174
|
|
|
176
|
-
|
|
175
|
+
const labelAppearanceSize = {
|
|
177
176
|
sizeXXL: {
|
|
178
177
|
size: 'xxl',
|
|
179
178
|
labelTextSize: 'xxl',
|
|
@@ -232,7 +231,7 @@ var labelAppearanceSize = {
|
|
|
232
231
|
},
|
|
233
232
|
};
|
|
234
233
|
|
|
235
|
-
|
|
234
|
+
const labelAppearanceStyle = {
|
|
236
235
|
solid: {
|
|
237
236
|
borderColor: 'none',
|
|
238
237
|
},
|
|
@@ -246,7 +245,7 @@ var labelAppearanceStyle = {
|
|
|
246
245
|
},
|
|
247
246
|
};
|
|
248
247
|
|
|
249
|
-
|
|
248
|
+
const labelAppearanceSuccess = {
|
|
250
249
|
successMutedPrimary: {
|
|
251
250
|
fill: 'successTertiary',
|
|
252
251
|
labelTextColor: 'successTextQuaternary',
|
|
@@ -263,7 +262,7 @@ var labelAppearanceSuccess = {
|
|
|
263
262
|
},
|
|
264
263
|
};
|
|
265
264
|
|
|
266
|
-
|
|
265
|
+
const labelAppearanceSurface = {
|
|
267
266
|
surfaceMutedPrimary: {
|
|
268
267
|
fill: 'surfaceSecondary',
|
|
269
268
|
labelTextColor: 'surfaceTextQuaternary',
|
|
@@ -292,7 +291,7 @@ var labelAppearanceSurface = {
|
|
|
292
291
|
},
|
|
293
292
|
};
|
|
294
293
|
|
|
295
|
-
|
|
294
|
+
const labelAppearanceWarning = {
|
|
296
295
|
warningMutedPrimary: {
|
|
297
296
|
fill: 'warningTertiary',
|
|
298
297
|
labelTextColor: 'warningTextSecondary',
|
|
@@ -309,31 +308,44 @@ var labelAppearanceWarning = {
|
|
|
309
308
|
},
|
|
310
309
|
};
|
|
311
310
|
|
|
312
|
-
|
|
311
|
+
const labelAppearance = {
|
|
312
|
+
...labelAppearanceDisabled,
|
|
313
|
+
...labelAppearanceShape,
|
|
314
|
+
...labelAppearanceSize,
|
|
315
|
+
...labelAppearanceStyle,
|
|
316
|
+
...labelAppearanceGradient,
|
|
317
|
+
...labelAppearanceAccent,
|
|
318
|
+
...labelAppearanceDanger,
|
|
319
|
+
...labelAppearanceError,
|
|
320
|
+
...labelAppearanceInfo,
|
|
321
|
+
...labelAppearancePrimary,
|
|
322
|
+
...labelAppearanceSecondary,
|
|
323
|
+
...labelAppearanceSuccess,
|
|
324
|
+
...labelAppearanceSurface,
|
|
325
|
+
...labelAppearanceWarning,
|
|
326
|
+
};
|
|
313
327
|
|
|
314
|
-
|
|
328
|
+
const labelConfig = {
|
|
315
329
|
appearance: labelAppearance,
|
|
316
|
-
setAppearance:
|
|
330
|
+
setAppearance: (appearanceConfig) => {
|
|
317
331
|
labelConfig.appearance = appearanceConfig;
|
|
318
332
|
},
|
|
319
333
|
};
|
|
320
334
|
function Label(props) {
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.openTooltip();
|
|
335
|
+
const { dataTestId, dataTour, className, appearance, label, isDisabled, cursor, tooltipContent, before, after, isSkeleton, onClick, children, } = props;
|
|
336
|
+
const tooltipRef = useRef(null);
|
|
337
|
+
const onMouseEnterLabel = useCallback(() => {
|
|
338
|
+
tooltipRef.current?.openTooltip();
|
|
326
339
|
}, []);
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
(_a = tooltipRef.current) === null || _a === void 0 ? void 0 : _a.closeTooltip();
|
|
340
|
+
const onMouseLeaveLabel = useCallback(() => {
|
|
341
|
+
tooltipRef.current?.closeTooltip();
|
|
330
342
|
}, []);
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
343
|
+
const appearanceConfig = useAppearanceConfig(appearance, labelConfig, isDisabled);
|
|
344
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
345
|
+
const { alignClass, fillClass, fillHoverClass, borderColorClass, borderTypeClass, labelTextColor, labelTextColorHover, labelTextSize, labelTextWeight, labelTextWrap, iconAfter, iconAfterFill, iconAfterFillIcon, iconAfterFillSize, iconAfterShape, iconAfterSize, iconAfterSrc, iconBefore, iconBeforeFill, iconBeforeFillIcon, iconBeforeFillSize, iconBeforeShape, iconBeforeSize, iconBeforeSrc, shapeClass, shapeStrengthClass, sizeClass, tooltipAlignment, tooltipAppearance, tooltipArrowPosition, tooltipText, tooltipTextSize, tooltipTextWeight, tooltipTitle, tooltipTitleSize, tooltipTitleWeight, widthClass, wrapClass, } = propsGenerator;
|
|
334
346
|
// @ts-expect-error
|
|
335
|
-
|
|
336
|
-
return (jsxs("div", { className: clsx(className, 'label', fillClass &&
|
|
347
|
+
const { styles: labelStyles } = useStyles(props);
|
|
348
|
+
return (jsxs("div", { className: clsx(className, 'label', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, shapeClass && `shape_${shapeClass}`, borderColorClass && `border-color_${borderColorClass}`, borderTypeClass && `border_type_${borderTypeClass}`, sizeClass && `label_size_${sizeClass}`, wrapClass && `word-wrap_${wrapClass}`, widthClass && `label_width_${widthClass}`, alignClass && `align_${alignClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, isSkeleton && `label_skeleton`, onClick && (cursor || 'cursor_type_pointer')), "data-test-id": dataTestId, "data-tour": dataTour, style: labelStyles, onClick: onClick, onMouseEnter: onMouseEnterLabel, onMouseLeave: onMouseLeaveLabel, children: [before, (iconBefore || iconBeforeSrc) && (jsx(Icon, { className: clsx('label__icon_before'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), jsxs("div", { className: "label__inner", children: [typeof label === 'string' ? (jsx(Text, { className: "label__text", size: labelTextSize, textColor: labelTextColor, textColorHover: labelTextColorHover, textWeight: labelTextWeight, textWrap: labelTextWrap, children: label })) : (jsx("div", { className: "label__text", children: label })), children, tooltipContent && (jsx(Tooltip, { className: "label__tooltip", ref: tooltipRef, appearance: tooltipAppearance, alignment: tooltipAlignment, title: tooltipTitle, titleSize: tooltipTitleSize, titleWeight: tooltipTitleWeight, text: tooltipText, textSize: tooltipTextSize, textWeight: tooltipTextWeight, arrowPosition: tooltipArrowPosition, children: tooltipContent }))] }), (iconAfter || iconAfterSrc) && (jsx(Icon, { className: clsx('label__icon_after'), fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), after] }));
|
|
337
349
|
}
|
|
338
350
|
|
|
339
351
|
export { Label as L, labelAppearance as a, labelConfig as l };
|
|
@@ -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');
|
|
@@ -8,7 +7,7 @@ var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearance
|
|
|
8
7
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
9
8
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
10
9
|
|
|
11
|
-
|
|
10
|
+
const linkAppearanceAccent = {
|
|
12
11
|
accent: {
|
|
13
12
|
fill: 'accentPrimary',
|
|
14
13
|
fillHover: 'accentPrimaryHover',
|
|
@@ -28,14 +27,14 @@ var linkAppearanceAccent = {
|
|
|
28
27
|
},
|
|
29
28
|
};
|
|
30
29
|
|
|
31
|
-
|
|
30
|
+
const linkAppearanceDanger = {
|
|
32
31
|
danger: {
|
|
33
32
|
fill: 'dangerPrimary',
|
|
34
33
|
fillHover: 'dangerPrimaryHover',
|
|
35
34
|
},
|
|
36
35
|
};
|
|
37
36
|
|
|
38
|
-
|
|
37
|
+
const linkAppearanceDisabled = {
|
|
39
38
|
disabledPrimary: {
|
|
40
39
|
fill: 'surfaceFillDisabled',
|
|
41
40
|
borderColor: 'errorBorderQuaternary',
|
|
@@ -55,7 +54,7 @@ var linkAppearanceDisabled = {
|
|
|
55
54
|
},
|
|
56
55
|
};
|
|
57
56
|
|
|
58
|
-
|
|
57
|
+
const linkAppearanceError = {
|
|
59
58
|
error: {
|
|
60
59
|
fill: 'errorPrimary',
|
|
61
60
|
fillHover: 'errorPrimaryHover',
|
|
@@ -66,7 +65,7 @@ var linkAppearanceError = {
|
|
|
66
65
|
},
|
|
67
66
|
};
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
const linkAppearanceInfo = {
|
|
70
69
|
info: {
|
|
71
70
|
fill: 'accentPrimary',
|
|
72
71
|
fillHover: 'accentPrimaryHover',
|
|
@@ -87,7 +86,7 @@ var linkAppearanceInfo = {
|
|
|
87
86
|
},
|
|
88
87
|
};
|
|
89
88
|
|
|
90
|
-
|
|
89
|
+
const linkAppearancePrimary = {
|
|
91
90
|
primary: {
|
|
92
91
|
fill: 'primaryPrimary',
|
|
93
92
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -95,7 +94,7 @@ var linkAppearancePrimary = {
|
|
|
95
94
|
},
|
|
96
95
|
};
|
|
97
96
|
|
|
98
|
-
|
|
97
|
+
const linkAppearanceRequire = {
|
|
99
98
|
requirePrimary: {
|
|
100
99
|
fill: 'warningTertiary',
|
|
101
100
|
borderColor: 'warningBorderQuaternary',
|
|
@@ -115,7 +114,7 @@ var linkAppearanceRequire = {
|
|
|
115
114
|
},
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
|
|
117
|
+
const linkAppearanceSecondary = {
|
|
119
118
|
secondary: {
|
|
120
119
|
fill: 'secondaryPrimary',
|
|
121
120
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -123,7 +122,7 @@ var linkAppearanceSecondary = {
|
|
|
123
122
|
},
|
|
124
123
|
};
|
|
125
124
|
|
|
126
|
-
|
|
125
|
+
const linkAppearanceSize = {
|
|
127
126
|
sizeXXL: {
|
|
128
127
|
size: 'xxl',
|
|
129
128
|
labelTextSize: 'xxl',
|
|
@@ -182,7 +181,7 @@ var linkAppearanceSize = {
|
|
|
182
181
|
},
|
|
183
182
|
};
|
|
184
183
|
|
|
185
|
-
|
|
184
|
+
const linkAppearanceStyle = {
|
|
186
185
|
full: {
|
|
187
186
|
borderColor: '0',
|
|
188
187
|
},
|
|
@@ -198,7 +197,7 @@ var linkAppearanceStyle = {
|
|
|
198
197
|
},
|
|
199
198
|
};
|
|
200
199
|
|
|
201
|
-
|
|
200
|
+
const linkAppearanceSuccess = {
|
|
202
201
|
success: {
|
|
203
202
|
fill: 'successPrimary',
|
|
204
203
|
fillHover: 'successPrimaryHover',
|
|
@@ -209,7 +208,7 @@ var linkAppearanceSuccess = {
|
|
|
209
208
|
},
|
|
210
209
|
};
|
|
211
210
|
|
|
212
|
-
|
|
211
|
+
const linkAppearanceSurface = {
|
|
213
212
|
surfacePrimary: {
|
|
214
213
|
fill: 'surfacePrimary',
|
|
215
214
|
fillHover: 'surfacePrimaryHover',
|
|
@@ -234,7 +233,7 @@ var linkAppearanceSurface = {
|
|
|
234
233
|
},
|
|
235
234
|
};
|
|
236
235
|
|
|
237
|
-
|
|
236
|
+
const linkAppearanceWarning = {
|
|
238
237
|
warning: {
|
|
239
238
|
fill: 'warningPrimary',
|
|
240
239
|
fillHover: 'warningPrimaryHover',
|
|
@@ -245,50 +244,64 @@ var linkAppearanceWarning = {
|
|
|
245
244
|
},
|
|
246
245
|
};
|
|
247
246
|
|
|
248
|
-
|
|
247
|
+
const linkAppearance = {
|
|
248
|
+
...linkAppearanceSize,
|
|
249
|
+
...linkAppearanceDisabled,
|
|
250
|
+
...linkAppearanceRequire,
|
|
251
|
+
...linkAppearanceStyle,
|
|
252
|
+
...linkAppearanceAccent,
|
|
253
|
+
...linkAppearanceDanger,
|
|
254
|
+
...linkAppearanceError,
|
|
255
|
+
...linkAppearanceInfo,
|
|
256
|
+
...linkAppearancePrimary,
|
|
257
|
+
...linkAppearanceSecondary,
|
|
258
|
+
...linkAppearanceSuccess,
|
|
259
|
+
...linkAppearanceSurface,
|
|
260
|
+
...linkAppearanceWarning,
|
|
261
|
+
};
|
|
249
262
|
|
|
250
|
-
|
|
263
|
+
const linkConfig = {
|
|
251
264
|
appearance: linkAppearance,
|
|
252
265
|
LinkComponent: 'a',
|
|
253
|
-
setAppearance:
|
|
266
|
+
setAppearance: (appearanceConfig) => {
|
|
254
267
|
linkConfig.appearance = appearanceConfig;
|
|
255
268
|
},
|
|
256
|
-
setLinkComponent:
|
|
269
|
+
setLinkComponent: (newComponent) => {
|
|
257
270
|
linkConfig.LinkComponent = newComponent;
|
|
258
271
|
},
|
|
259
272
|
};
|
|
260
273
|
function Link(props) {
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
274
|
+
const { className, appearance, text, href, link, isDisabled, LinkComponent, rel, style, target, before, after, onClick, onMouseDown, children, } = props;
|
|
275
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, linkConfig, isDisabled);
|
|
276
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
277
|
+
const { directionClass, fillClass, fillHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColorClass, textColorHoverClass, textGradientClass, textStyleClass, textWeightClass, heightClass, shapeClass, sizeClass, svgFillClass, svgFillHoverClass, underline = 'underline', widthClass, } = propsGenerator;
|
|
265
278
|
// @ts-expect-error
|
|
266
|
-
|
|
267
|
-
return (jsxRuntime.jsxs(LinkWrapper, { className: clsx(className, 'link', widthClass &&
|
|
279
|
+
const { styles } = useStyles.useStyles(props);
|
|
280
|
+
return (jsxRuntime.jsxs(LinkWrapper, { className: clsx(className, 'link', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, directionClass && `link_direction_${directionClass}`, sizeClass && `text_size_${sizeClass}`, svgFillClass && `svg_fill_${svgFillClass}`, svgFillHoverClass && `svg_fill_hover_${svgFillHoverClass}`, underline && `link_underline_${underline}`, 'text', (textColorClass ||
|
|
268
281
|
textColorHoverClass ||
|
|
269
282
|
textGradientClass ||
|
|
270
283
|
textStyleClass ||
|
|
271
284
|
textWeightClass) &&
|
|
272
|
-
'text', textColorClass &&
|
|
285
|
+
'text', textColorClass && `text-color_${textColorClass}`, textColorHoverClass && `text-color_hover_${textColorHoverClass}`, textGradientClass && `text-gradient_${textGradientClass}`, textStyleClass && `text-style_${textStyleClass}`, textWeightClass && `text-weight_${textWeightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `link_shape_${shapeClass}`), href: href || link, LinkComponent: LinkComponent, rel: rel, style: Object.assign({}, styles, style), target: target, onClick: onClick, onMouseDown: onMouseDown, children: [before, children || text, after] }));
|
|
273
286
|
}
|
|
274
287
|
// Wrapper with "Link" by condition
|
|
275
288
|
function LinkWrapper(props) {
|
|
276
|
-
|
|
289
|
+
const { href, LinkComponent, rel, target, children, ...otherProps } = props;
|
|
277
290
|
if (href) {
|
|
278
291
|
// If href passed, make link-wrapper
|
|
279
|
-
|
|
292
|
+
const Component = LinkComponent || linkConfig.LinkComponent;
|
|
280
293
|
if (Component) {
|
|
281
|
-
return (jsxRuntime.jsx(Component,
|
|
294
|
+
return (jsxRuntime.jsx(Component, { href: href, rel: rel, target: target, ...otherProps, children: children }));
|
|
282
295
|
}
|
|
283
296
|
}
|
|
284
297
|
else if (LinkComponent) {
|
|
285
298
|
// If has default "Component" - render it
|
|
286
|
-
return jsxRuntime.jsx(LinkComponent,
|
|
299
|
+
return jsxRuntime.jsx(LinkComponent, { ...otherProps, children: children });
|
|
287
300
|
}
|
|
288
301
|
// Return children and pass current props to
|
|
289
302
|
return React.Children.toArray(children)
|
|
290
303
|
.filter(Boolean)
|
|
291
|
-
.map(
|
|
304
|
+
.map((child) => {
|
|
292
305
|
return React.isValidElement(child)
|
|
293
306
|
? React.cloneElement(child, otherProps)
|
|
294
307
|
: child;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { _ as __assign, b as __rest } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
@@ -6,7 +5,7 @@ import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceCo
|
|
|
6
5
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
7
6
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
const linkAppearanceAccent = {
|
|
10
9
|
accent: {
|
|
11
10
|
fill: 'accentPrimary',
|
|
12
11
|
fillHover: 'accentPrimaryHover',
|
|
@@ -26,14 +25,14 @@ var linkAppearanceAccent = {
|
|
|
26
25
|
},
|
|
27
26
|
};
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
const linkAppearanceDanger = {
|
|
30
29
|
danger: {
|
|
31
30
|
fill: 'dangerPrimary',
|
|
32
31
|
fillHover: 'dangerPrimaryHover',
|
|
33
32
|
},
|
|
34
33
|
};
|
|
35
34
|
|
|
36
|
-
|
|
35
|
+
const linkAppearanceDisabled = {
|
|
37
36
|
disabledPrimary: {
|
|
38
37
|
fill: 'surfaceFillDisabled',
|
|
39
38
|
borderColor: 'errorBorderQuaternary',
|
|
@@ -53,7 +52,7 @@ var linkAppearanceDisabled = {
|
|
|
53
52
|
},
|
|
54
53
|
};
|
|
55
54
|
|
|
56
|
-
|
|
55
|
+
const linkAppearanceError = {
|
|
57
56
|
error: {
|
|
58
57
|
fill: 'errorPrimary',
|
|
59
58
|
fillHover: 'errorPrimaryHover',
|
|
@@ -64,7 +63,7 @@ var linkAppearanceError = {
|
|
|
64
63
|
},
|
|
65
64
|
};
|
|
66
65
|
|
|
67
|
-
|
|
66
|
+
const linkAppearanceInfo = {
|
|
68
67
|
info: {
|
|
69
68
|
fill: 'accentPrimary',
|
|
70
69
|
fillHover: 'accentPrimaryHover',
|
|
@@ -85,7 +84,7 @@ var linkAppearanceInfo = {
|
|
|
85
84
|
},
|
|
86
85
|
};
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
const linkAppearancePrimary = {
|
|
89
88
|
primary: {
|
|
90
89
|
fill: 'primaryPrimary',
|
|
91
90
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -93,7 +92,7 @@ var linkAppearancePrimary = {
|
|
|
93
92
|
},
|
|
94
93
|
};
|
|
95
94
|
|
|
96
|
-
|
|
95
|
+
const linkAppearanceRequire = {
|
|
97
96
|
requirePrimary: {
|
|
98
97
|
fill: 'warningTertiary',
|
|
99
98
|
borderColor: 'warningBorderQuaternary',
|
|
@@ -113,7 +112,7 @@ var linkAppearanceRequire = {
|
|
|
113
112
|
},
|
|
114
113
|
};
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
const linkAppearanceSecondary = {
|
|
117
116
|
secondary: {
|
|
118
117
|
fill: 'secondaryPrimary',
|
|
119
118
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -121,7 +120,7 @@ var linkAppearanceSecondary = {
|
|
|
121
120
|
},
|
|
122
121
|
};
|
|
123
122
|
|
|
124
|
-
|
|
123
|
+
const linkAppearanceSize = {
|
|
125
124
|
sizeXXL: {
|
|
126
125
|
size: 'xxl',
|
|
127
126
|
labelTextSize: 'xxl',
|
|
@@ -180,7 +179,7 @@ var linkAppearanceSize = {
|
|
|
180
179
|
},
|
|
181
180
|
};
|
|
182
181
|
|
|
183
|
-
|
|
182
|
+
const linkAppearanceStyle = {
|
|
184
183
|
full: {
|
|
185
184
|
borderColor: '0',
|
|
186
185
|
},
|
|
@@ -196,7 +195,7 @@ var linkAppearanceStyle = {
|
|
|
196
195
|
},
|
|
197
196
|
};
|
|
198
197
|
|
|
199
|
-
|
|
198
|
+
const linkAppearanceSuccess = {
|
|
200
199
|
success: {
|
|
201
200
|
fill: 'successPrimary',
|
|
202
201
|
fillHover: 'successPrimaryHover',
|
|
@@ -207,7 +206,7 @@ var linkAppearanceSuccess = {
|
|
|
207
206
|
},
|
|
208
207
|
};
|
|
209
208
|
|
|
210
|
-
|
|
209
|
+
const linkAppearanceSurface = {
|
|
211
210
|
surfacePrimary: {
|
|
212
211
|
fill: 'surfacePrimary',
|
|
213
212
|
fillHover: 'surfacePrimaryHover',
|
|
@@ -232,7 +231,7 @@ var linkAppearanceSurface = {
|
|
|
232
231
|
},
|
|
233
232
|
};
|
|
234
233
|
|
|
235
|
-
|
|
234
|
+
const linkAppearanceWarning = {
|
|
236
235
|
warning: {
|
|
237
236
|
fill: 'warningPrimary',
|
|
238
237
|
fillHover: 'warningPrimaryHover',
|
|
@@ -243,50 +242,64 @@ var linkAppearanceWarning = {
|
|
|
243
242
|
},
|
|
244
243
|
};
|
|
245
244
|
|
|
246
|
-
|
|
245
|
+
const linkAppearance = {
|
|
246
|
+
...linkAppearanceSize,
|
|
247
|
+
...linkAppearanceDisabled,
|
|
248
|
+
...linkAppearanceRequire,
|
|
249
|
+
...linkAppearanceStyle,
|
|
250
|
+
...linkAppearanceAccent,
|
|
251
|
+
...linkAppearanceDanger,
|
|
252
|
+
...linkAppearanceError,
|
|
253
|
+
...linkAppearanceInfo,
|
|
254
|
+
...linkAppearancePrimary,
|
|
255
|
+
...linkAppearanceSecondary,
|
|
256
|
+
...linkAppearanceSuccess,
|
|
257
|
+
...linkAppearanceSurface,
|
|
258
|
+
...linkAppearanceWarning,
|
|
259
|
+
};
|
|
247
260
|
|
|
248
|
-
|
|
261
|
+
const linkConfig = {
|
|
249
262
|
appearance: linkAppearance,
|
|
250
263
|
LinkComponent: 'a',
|
|
251
|
-
setAppearance:
|
|
264
|
+
setAppearance: (appearanceConfig) => {
|
|
252
265
|
linkConfig.appearance = appearanceConfig;
|
|
253
266
|
},
|
|
254
|
-
setLinkComponent:
|
|
267
|
+
setLinkComponent: (newComponent) => {
|
|
255
268
|
linkConfig.LinkComponent = newComponent;
|
|
256
269
|
},
|
|
257
270
|
};
|
|
258
271
|
function Link(props) {
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
272
|
+
const { className, appearance, text, href, link, isDisabled, LinkComponent, rel, style, target, before, after, onClick, onMouseDown, children, } = props;
|
|
273
|
+
const appearanceConfig = useAppearanceConfig(appearance, linkConfig, isDisabled);
|
|
274
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
275
|
+
const { directionClass, fillClass, fillHoverClass, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, textColorClass, textColorHoverClass, textGradientClass, textStyleClass, textWeightClass, heightClass, shapeClass, sizeClass, svgFillClass, svgFillHoverClass, underline = 'underline', widthClass, } = propsGenerator;
|
|
263
276
|
// @ts-expect-error
|
|
264
|
-
|
|
265
|
-
return (jsxs(LinkWrapper, { className: clsx(className, 'link', widthClass &&
|
|
277
|
+
const { styles } = useStyles(props);
|
|
278
|
+
return (jsxs(LinkWrapper, { className: clsx(className, 'link', widthClass && `width_${widthClass}`, heightClass && `height_${heightClass}`, directionClass && `link_direction_${directionClass}`, sizeClass && `text_size_${sizeClass}`, svgFillClass && `svg_fill_${svgFillClass}`, svgFillHoverClass && `svg_fill_hover_${svgFillHoverClass}`, underline && `link_underline_${underline}`, 'text', (textColorClass ||
|
|
266
279
|
textColorHoverClass ||
|
|
267
280
|
textGradientClass ||
|
|
268
281
|
textStyleClass ||
|
|
269
282
|
textWeightClass) &&
|
|
270
|
-
'text', textColorClass &&
|
|
283
|
+
'text', textColorClass && `text-color_${textColorClass}`, textColorHoverClass && `text-color_hover_${textColorHoverClass}`, textGradientClass && `text-gradient_${textGradientClass}`, textStyleClass && `text-style_${textStyleClass}`, textWeightClass && `text-weight_${textWeightClass}`, fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, shapeClass && `link_shape_${shapeClass}`), href: href || link, LinkComponent: LinkComponent, rel: rel, style: Object.assign({}, styles, style), target: target, onClick: onClick, onMouseDown: onMouseDown, children: [before, children || text, after] }));
|
|
271
284
|
}
|
|
272
285
|
// Wrapper with "Link" by condition
|
|
273
286
|
function LinkWrapper(props) {
|
|
274
|
-
|
|
287
|
+
const { href, LinkComponent, rel, target, children, ...otherProps } = props;
|
|
275
288
|
if (href) {
|
|
276
289
|
// If href passed, make link-wrapper
|
|
277
|
-
|
|
290
|
+
const Component = LinkComponent || linkConfig.LinkComponent;
|
|
278
291
|
if (Component) {
|
|
279
|
-
return (jsx(Component,
|
|
292
|
+
return (jsx(Component, { href: href, rel: rel, target: target, ...otherProps, children: children }));
|
|
280
293
|
}
|
|
281
294
|
}
|
|
282
295
|
else if (LinkComponent) {
|
|
283
296
|
// If has default "Component" - render it
|
|
284
|
-
return jsx(LinkComponent,
|
|
297
|
+
return jsx(LinkComponent, { ...otherProps, children: children });
|
|
285
298
|
}
|
|
286
299
|
// Return children and pass current props to
|
|
287
300
|
return React.Children.toArray(children)
|
|
288
301
|
.filter(Boolean)
|
|
289
|
-
.map(
|
|
302
|
+
.map((child) => {
|
|
290
303
|
return React.isValidElement(child)
|
|
291
304
|
? React.cloneElement(child, otherProps)
|
|
292
305
|
: child;
|