@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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var clsx = require('clsx');
|
|
6
|
+
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
7
|
+
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
|
+
var Icon = require('./Icon_cjs_BVLGzj7Y.js');
|
|
9
|
+
var Image = require('./Image_cjs_BUM81t4Y.js');
|
|
10
|
+
var Text = require('./Text_cjs_BDTjOTVB.js');
|
|
11
|
+
|
|
12
|
+
const avatarAppearanceDefault = {
|
|
13
|
+
surfacePrimary: {
|
|
14
|
+
fill: 'surfacePrimary',
|
|
15
|
+
textColor: 'surfaceTextPrimary',
|
|
16
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
17
|
+
},
|
|
18
|
+
surfaceSecondary: {
|
|
19
|
+
fill: 'surfaceSecondary',
|
|
20
|
+
textColor: 'surfaceTextPrimary',
|
|
21
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
22
|
+
},
|
|
23
|
+
surfaceTertiary: {
|
|
24
|
+
fill: 'surfaceTertiary',
|
|
25
|
+
textColor: 'surfaceTextPrimary',
|
|
26
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
27
|
+
},
|
|
28
|
+
surfaceQuaternary: {
|
|
29
|
+
fill: 'surfaceQuaternary',
|
|
30
|
+
textColor: 'surfaceTextPrimary',
|
|
31
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
32
|
+
},
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
const avatarAppearanceShape = {
|
|
36
|
+
circular: {
|
|
37
|
+
shape: 'circular',
|
|
38
|
+
},
|
|
39
|
+
rounded: {
|
|
40
|
+
shape: 'rounded',
|
|
41
|
+
},
|
|
42
|
+
roundedXL: {
|
|
43
|
+
shape: 'rounded',
|
|
44
|
+
shapeStrength: '2m',
|
|
45
|
+
},
|
|
46
|
+
roundedL: {
|
|
47
|
+
shape: 'rounded',
|
|
48
|
+
shapeStrength: '1_5m',
|
|
49
|
+
},
|
|
50
|
+
roundedM: {
|
|
51
|
+
shape: 'rounded',
|
|
52
|
+
shapeStrength: '1m',
|
|
53
|
+
},
|
|
54
|
+
roundedS: {
|
|
55
|
+
shape: 'rounded',
|
|
56
|
+
shapeStrength: '0_5m',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
const avatarAppearanceSize = {
|
|
61
|
+
size16: {
|
|
62
|
+
size: '16',
|
|
63
|
+
textSize: 'xxl',
|
|
64
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
65
|
+
iconFillSize: '12',
|
|
66
|
+
},
|
|
67
|
+
size20: {
|
|
68
|
+
size: '20',
|
|
69
|
+
textSize: 'xxl',
|
|
70
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
71
|
+
iconFillSize: '12',
|
|
72
|
+
},
|
|
73
|
+
size24: {
|
|
74
|
+
size: '24',
|
|
75
|
+
textSize: 'l',
|
|
76
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
77
|
+
iconFillSize: '12',
|
|
78
|
+
},
|
|
79
|
+
size32: {
|
|
80
|
+
size: '32',
|
|
81
|
+
textSize: 'l',
|
|
82
|
+
badgeAppearanceSize: 'sizeXS',
|
|
83
|
+
iconFillSize: '12',
|
|
84
|
+
},
|
|
85
|
+
size40: {
|
|
86
|
+
size: '40',
|
|
87
|
+
textSize: 'l',
|
|
88
|
+
badgeAppearanceSize: 'sizeS',
|
|
89
|
+
iconFillSize: '12',
|
|
90
|
+
},
|
|
91
|
+
size56: {
|
|
92
|
+
size: '56',
|
|
93
|
+
textSize: 'xxl',
|
|
94
|
+
badgeAppearanceSize: 'sizeM',
|
|
95
|
+
iconFillSize: '16',
|
|
96
|
+
},
|
|
97
|
+
size96: {
|
|
98
|
+
size: '96',
|
|
99
|
+
textSize: 'xxl',
|
|
100
|
+
badgeAppearanceSize: 'sizeXL',
|
|
101
|
+
iconFillSize: '32',
|
|
102
|
+
},
|
|
103
|
+
size144: {
|
|
104
|
+
size: '144',
|
|
105
|
+
textSize: 'xxl',
|
|
106
|
+
badgeAppearanceSize: 'sizeXXL',
|
|
107
|
+
iconFillSize: '40',
|
|
108
|
+
},
|
|
109
|
+
size240: {
|
|
110
|
+
size: '240',
|
|
111
|
+
textSize: 'xxl',
|
|
112
|
+
badgeAppearanceSize: 'sizeXXL',
|
|
113
|
+
iconFillSize: '40',
|
|
114
|
+
},
|
|
115
|
+
};
|
|
116
|
+
|
|
117
|
+
const avatarAppearanceStyle = {
|
|
118
|
+
solid: {
|
|
119
|
+
borderColor: 'none',
|
|
120
|
+
},
|
|
121
|
+
outlined: {
|
|
122
|
+
fill: 'none',
|
|
123
|
+
},
|
|
124
|
+
full: {
|
|
125
|
+
borderColor: 'none',
|
|
126
|
+
},
|
|
127
|
+
ghost: {
|
|
128
|
+
fill: 'none',
|
|
129
|
+
borderColor: 'none',
|
|
130
|
+
},
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
const avatarAppearance = {
|
|
134
|
+
...avatarAppearanceSize,
|
|
135
|
+
...avatarAppearanceStyle,
|
|
136
|
+
...avatarAppearanceShape,
|
|
137
|
+
...avatarAppearanceDefault,
|
|
138
|
+
};
|
|
139
|
+
|
|
140
|
+
const avatarConfig = {
|
|
141
|
+
appearance: avatarAppearance,
|
|
142
|
+
setAppearance: (appearanceConfig) => {
|
|
143
|
+
avatarConfig.appearance = appearanceConfig;
|
|
144
|
+
},
|
|
145
|
+
};
|
|
146
|
+
function Avatar(props) {
|
|
147
|
+
const { className, appearance, src, firstName = '', secondName = '', count, before, after, isSkeleton, onClick, } = props;
|
|
148
|
+
const avatarChars = React.useMemo(() => {
|
|
149
|
+
const firstChar = (firstName?.[0] || '').toUpperCase();
|
|
150
|
+
const secondChar = (secondName?.[0] || '').toUpperCase();
|
|
151
|
+
return `${firstChar}${secondChar}`;
|
|
152
|
+
}, [firstName, secondName]);
|
|
153
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, avatarConfig);
|
|
154
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
155
|
+
const { size, fillClass, fillHoverClass, textColor, textSize, textWeight, badge, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, badgeValue, icon, iconFill, iconFillHover, iconFillSize, iconItemFill, iconShape, iconSize, iconSrc, placeholderUrl, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
156
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'avatar', size && `avatar_size_${sizeClass}`, (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && `avatar_skeleton`, onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxRuntime.jsxs("div", { className: clsx('avatar__wrapper', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: [before, src ? (jsxRuntime.jsx(Image.Image, { className: clsx('avatar__image', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), src: src, placeholderUrl: placeholderUrl })) : (jsxRuntime.jsx(Text.Text, { className: "avatar__text", size: textSize, textColor: textColor, textWeight: textWeight, children: avatarChars || count })), (icon || iconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "avatar__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), (badge || badgeValue) && (jsxRuntime.jsx(Icon.Badge, { className: "avatar__badge", appearance: `${badgeAppearance} ${badgeAppearanceSize}`, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), after] }) }));
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
exports.Avatar = Avatar;
|
|
160
|
+
exports.avatarAppearance = avatarAppearance;
|
|
161
|
+
exports.avatarConfig = avatarConfig;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
import clsx from 'clsx';
|
|
4
|
+
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
|
+
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
+
import { I as Icon, B as Badge } from './Icon_es_DkVkzTha.js';
|
|
7
|
+
import { I as Image } from './Image_es_C-IjVkKX.js';
|
|
8
|
+
import { T as Text } from './Text_es_CnymlElo.js';
|
|
9
|
+
|
|
10
|
+
const avatarAppearanceDefault = {
|
|
11
|
+
surfacePrimary: {
|
|
12
|
+
fill: 'surfacePrimary',
|
|
13
|
+
textColor: 'surfaceTextPrimary',
|
|
14
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
15
|
+
},
|
|
16
|
+
surfaceSecondary: {
|
|
17
|
+
fill: 'surfaceSecondary',
|
|
18
|
+
textColor: 'surfaceTextPrimary',
|
|
19
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
20
|
+
},
|
|
21
|
+
surfaceTertiary: {
|
|
22
|
+
fill: 'surfaceTertiary',
|
|
23
|
+
textColor: 'surfaceTextPrimary',
|
|
24
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
25
|
+
},
|
|
26
|
+
surfaceQuaternary: {
|
|
27
|
+
fill: 'surfaceQuaternary',
|
|
28
|
+
textColor: 'surfaceTextPrimary',
|
|
29
|
+
badgeAppearance: 'accentPrimary solid circular',
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const avatarAppearanceShape = {
|
|
34
|
+
circular: {
|
|
35
|
+
shape: 'circular',
|
|
36
|
+
},
|
|
37
|
+
rounded: {
|
|
38
|
+
shape: 'rounded',
|
|
39
|
+
},
|
|
40
|
+
roundedXL: {
|
|
41
|
+
shape: 'rounded',
|
|
42
|
+
shapeStrength: '2m',
|
|
43
|
+
},
|
|
44
|
+
roundedL: {
|
|
45
|
+
shape: 'rounded',
|
|
46
|
+
shapeStrength: '1_5m',
|
|
47
|
+
},
|
|
48
|
+
roundedM: {
|
|
49
|
+
shape: 'rounded',
|
|
50
|
+
shapeStrength: '1m',
|
|
51
|
+
},
|
|
52
|
+
roundedS: {
|
|
53
|
+
shape: 'rounded',
|
|
54
|
+
shapeStrength: '0_5m',
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
|
|
58
|
+
const avatarAppearanceSize = {
|
|
59
|
+
size16: {
|
|
60
|
+
size: '16',
|
|
61
|
+
textSize: 'xxl',
|
|
62
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
63
|
+
iconFillSize: '12',
|
|
64
|
+
},
|
|
65
|
+
size20: {
|
|
66
|
+
size: '20',
|
|
67
|
+
textSize: 'xxl',
|
|
68
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
69
|
+
iconFillSize: '12',
|
|
70
|
+
},
|
|
71
|
+
size24: {
|
|
72
|
+
size: '24',
|
|
73
|
+
textSize: 'l',
|
|
74
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
75
|
+
iconFillSize: '12',
|
|
76
|
+
},
|
|
77
|
+
size32: {
|
|
78
|
+
size: '32',
|
|
79
|
+
textSize: 'l',
|
|
80
|
+
badgeAppearanceSize: 'sizeXS',
|
|
81
|
+
iconFillSize: '12',
|
|
82
|
+
},
|
|
83
|
+
size40: {
|
|
84
|
+
size: '40',
|
|
85
|
+
textSize: 'l',
|
|
86
|
+
badgeAppearanceSize: 'sizeS',
|
|
87
|
+
iconFillSize: '12',
|
|
88
|
+
},
|
|
89
|
+
size56: {
|
|
90
|
+
size: '56',
|
|
91
|
+
textSize: 'xxl',
|
|
92
|
+
badgeAppearanceSize: 'sizeM',
|
|
93
|
+
iconFillSize: '16',
|
|
94
|
+
},
|
|
95
|
+
size96: {
|
|
96
|
+
size: '96',
|
|
97
|
+
textSize: 'xxl',
|
|
98
|
+
badgeAppearanceSize: 'sizeXL',
|
|
99
|
+
iconFillSize: '32',
|
|
100
|
+
},
|
|
101
|
+
size144: {
|
|
102
|
+
size: '144',
|
|
103
|
+
textSize: 'xxl',
|
|
104
|
+
badgeAppearanceSize: 'sizeXXL',
|
|
105
|
+
iconFillSize: '40',
|
|
106
|
+
},
|
|
107
|
+
size240: {
|
|
108
|
+
size: '240',
|
|
109
|
+
textSize: 'xxl',
|
|
110
|
+
badgeAppearanceSize: 'sizeXXL',
|
|
111
|
+
iconFillSize: '40',
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const avatarAppearanceStyle = {
|
|
116
|
+
solid: {
|
|
117
|
+
borderColor: 'none',
|
|
118
|
+
},
|
|
119
|
+
outlined: {
|
|
120
|
+
fill: 'none',
|
|
121
|
+
},
|
|
122
|
+
full: {
|
|
123
|
+
borderColor: 'none',
|
|
124
|
+
},
|
|
125
|
+
ghost: {
|
|
126
|
+
fill: 'none',
|
|
127
|
+
borderColor: 'none',
|
|
128
|
+
},
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const avatarAppearance = {
|
|
132
|
+
...avatarAppearanceSize,
|
|
133
|
+
...avatarAppearanceStyle,
|
|
134
|
+
...avatarAppearanceShape,
|
|
135
|
+
...avatarAppearanceDefault,
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
const avatarConfig = {
|
|
139
|
+
appearance: avatarAppearance,
|
|
140
|
+
setAppearance: (appearanceConfig) => {
|
|
141
|
+
avatarConfig.appearance = appearanceConfig;
|
|
142
|
+
},
|
|
143
|
+
};
|
|
144
|
+
function Avatar(props) {
|
|
145
|
+
const { className, appearance, src, firstName = '', secondName = '', count, before, after, isSkeleton, onClick, } = props;
|
|
146
|
+
const avatarChars = useMemo(() => {
|
|
147
|
+
const firstChar = (firstName?.[0] || '').toUpperCase();
|
|
148
|
+
const secondChar = (secondName?.[0] || '').toUpperCase();
|
|
149
|
+
return `${firstChar}${secondChar}`;
|
|
150
|
+
}, [firstName, secondName]);
|
|
151
|
+
const appearanceConfig = useAppearanceConfig(appearance, avatarConfig);
|
|
152
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
153
|
+
const { size, fillClass, fillHoverClass, textColor, textSize, textWeight, badge, badgeAppearance, badgeAppearanceSize, badgeShape, badgeSize, badgeTextColor, badgeTextSize, badgeValue, icon, iconFill, iconFillHover, iconFillSize, iconItemFill, iconShape, iconSize, iconSrc, placeholderUrl, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
154
|
+
return (jsx("div", { className: clsx(className, 'avatar', size && `avatar_size_${sizeClass}`, (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && `avatar_skeleton`, onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxs("div", { className: clsx('avatar__wrapper', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: [before, src ? (jsx(Image, { className: clsx('avatar__image', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), src: src, placeholderUrl: placeholderUrl })) : (jsx(Text, { className: "avatar__text", size: textSize, textColor: textColor, textWeight: textWeight, children: avatarChars || count })), (icon || iconSrc) && (jsx(Icon, { className: "avatar__icon", fill: iconFill, fillHover: iconFillHover, fillSize: iconFillSize, iconFill: iconItemFill, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), (badge || badgeValue) && (jsx(Badge, { className: "avatar__badge", appearance: `${badgeAppearance} ${badgeAppearanceSize}`, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), after] }) }));
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
export { Avatar as A, avatarConfig as a, avatarAppearance as b };
|
|
@@ -3,22 +3,21 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
|
-
var Icon = require('./
|
|
7
|
-
var Link = require('./
|
|
8
|
-
var Loader = require('./
|
|
9
|
-
var Text = require('./
|
|
6
|
+
var Icon = require('./Icon_cjs_BVLGzj7Y.js');
|
|
7
|
+
var Link = require('./Link_cjs_qKXVfU8e.js');
|
|
8
|
+
var Loader = require('./Loader_cjs_DIDsIq3J.js');
|
|
9
|
+
var Text = require('./Text_cjs_BDTjOTVB.js');
|
|
10
10
|
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
11
11
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
12
12
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
13
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
const buttonAppearanceAccent = {
|
|
16
15
|
accentMutedPrimary: {
|
|
17
16
|
fill: 'accentTertiary',
|
|
18
17
|
fillHover: 'accentHoverTertiary',
|
|
19
|
-
borderColor: 'accentBorderSecondary',
|
|
20
18
|
labelTextColor: 'accentTextQuaternary',
|
|
21
19
|
labelTextColorHover: 'accentTextQuaternary',
|
|
20
|
+
borderColor: 'accentBorderSecondary',
|
|
22
21
|
iconAfterFillIcon: 'accentItemQuaternary',
|
|
23
22
|
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
24
23
|
iconFillIcon: 'accentItemQuaternary',
|
|
@@ -27,9 +26,9 @@ var buttonAppearanceAccent = {
|
|
|
27
26
|
accentPrimary: {
|
|
28
27
|
fill: 'accentPrimary',
|
|
29
28
|
fillHover: 'accentHoverPrimary',
|
|
30
|
-
borderColor: 'accentBorderPrimary',
|
|
31
29
|
labelTextColor: 'accentTextPrimary',
|
|
32
30
|
labelTextColorHover: 'accentTextPrimary',
|
|
31
|
+
borderColor: 'accentBorderPrimary',
|
|
33
32
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
34
33
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
35
34
|
iconFillIcon: 'accentItemPrimary',
|
|
@@ -38,9 +37,9 @@ var buttonAppearanceAccent = {
|
|
|
38
37
|
accentSecondary: {
|
|
39
38
|
fill: 'accentPrimary',
|
|
40
39
|
fillHover: 'accentHoverPrimary',
|
|
41
|
-
borderColor: 'accentBorderPrimary',
|
|
42
40
|
labelTextColor: 'accentTextSecondary',
|
|
43
41
|
labelTextColorHover: 'accentTextSecondary',
|
|
42
|
+
borderColor: 'accentBorderPrimary',
|
|
44
43
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
45
44
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
46
45
|
iconFillIcon: 'accentItemPrimary',
|
|
@@ -48,13 +47,13 @@ var buttonAppearanceAccent = {
|
|
|
48
47
|
},
|
|
49
48
|
};
|
|
50
49
|
|
|
51
|
-
|
|
50
|
+
const buttonAppearanceDanger = {
|
|
52
51
|
dangerMutedPrimary: {
|
|
53
52
|
fill: 'dangerTertiary',
|
|
54
53
|
fillHover: 'dangerHover',
|
|
55
|
-
borderColor: 'dangerBorderSecondary',
|
|
56
54
|
labelTextColor: 'dangerTextQuaternary',
|
|
57
55
|
labelTextColorHover: 'dangerTextQuaternary',
|
|
56
|
+
borderColor: 'dangerBorderSecondary',
|
|
58
57
|
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
59
58
|
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
60
59
|
iconFillIcon: 'dangerItemQuaternary',
|
|
@@ -72,7 +71,7 @@ var buttonAppearanceDanger = {
|
|
|
72
71
|
},
|
|
73
72
|
};
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
const buttonAppearanceError = {
|
|
76
75
|
error: {
|
|
77
76
|
fill: 'errorPrimary',
|
|
78
77
|
fillHover: 'errorHover',
|
|
@@ -106,7 +105,7 @@ var buttonAppearanceError = {
|
|
|
106
105
|
},
|
|
107
106
|
};
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
const buttonAppearanceInfo = {
|
|
110
109
|
info: {
|
|
111
110
|
fill: 'infoPrimary',
|
|
112
111
|
fillHover: 'infoPrimaryHover',
|
|
@@ -153,7 +152,7 @@ var buttonAppearanceInfo = {
|
|
|
153
152
|
},
|
|
154
153
|
};
|
|
155
154
|
|
|
156
|
-
|
|
155
|
+
const buttonAppearancePrimary = {
|
|
157
156
|
primary: {
|
|
158
157
|
fill: 'primaryPrimary',
|
|
159
158
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -184,7 +183,7 @@ var buttonAppearancePrimary = {
|
|
|
184
183
|
},
|
|
185
184
|
};
|
|
186
185
|
|
|
187
|
-
|
|
186
|
+
const buttonAppearanceSecondary = {
|
|
188
187
|
secondary: {
|
|
189
188
|
fill: 'secondaryPrimary',
|
|
190
189
|
fillHover: 'secondaryHoverPrimary',
|
|
@@ -215,7 +214,7 @@ var buttonAppearanceSecondary = {
|
|
|
215
214
|
},
|
|
216
215
|
};
|
|
217
216
|
|
|
218
|
-
|
|
217
|
+
const buttonAppearanceShape = {
|
|
219
218
|
circular: {
|
|
220
219
|
shape: 'circular',
|
|
221
220
|
},
|
|
@@ -240,7 +239,7 @@ var buttonAppearanceShape = {
|
|
|
240
239
|
},
|
|
241
240
|
};
|
|
242
241
|
|
|
243
|
-
|
|
242
|
+
const buttonAppearanceSize = {
|
|
244
243
|
sizeXXL: {
|
|
245
244
|
size: 'xxl',
|
|
246
245
|
labelTextSize: 'xl',
|
|
@@ -306,7 +305,7 @@ var buttonAppearanceSize = {
|
|
|
306
305
|
},
|
|
307
306
|
};
|
|
308
307
|
|
|
309
|
-
|
|
308
|
+
const buttonAppearanceStyle = {
|
|
310
309
|
solid: {
|
|
311
310
|
borderColor: 'none',
|
|
312
311
|
},
|
|
@@ -320,7 +319,7 @@ var buttonAppearanceStyle = {
|
|
|
320
319
|
},
|
|
321
320
|
};
|
|
322
321
|
|
|
323
|
-
|
|
322
|
+
const buttonAppearanceSuccess = {
|
|
324
323
|
success: {
|
|
325
324
|
fill: 'successPrimary',
|
|
326
325
|
fillHover: 'successHover',
|
|
@@ -354,7 +353,7 @@ var buttonAppearanceSuccess = {
|
|
|
354
353
|
},
|
|
355
354
|
};
|
|
356
355
|
|
|
357
|
-
|
|
356
|
+
const buttonAppearanceSurface = {
|
|
358
357
|
surfaceMutedPrimary: {
|
|
359
358
|
fill: 'surfaceTertiary',
|
|
360
359
|
fillHover: 'surfaceTertiary',
|
|
@@ -406,10 +405,10 @@ var buttonAppearanceSurface = {
|
|
|
406
405
|
},
|
|
407
406
|
};
|
|
408
407
|
|
|
409
|
-
|
|
408
|
+
const buttonAppearanceWarning = {
|
|
410
409
|
warning: {
|
|
411
410
|
fill: 'warningPrimary',
|
|
412
|
-
fillHover: '
|
|
411
|
+
fillHover: 'warningHoverPrimary',
|
|
413
412
|
labelTextColor: 'warningTextPrimary',
|
|
414
413
|
labelTextColorHover: 'warningTextPrimary',
|
|
415
414
|
iconAfterFillIcon: 'warningItemPrimary',
|
|
@@ -420,9 +419,9 @@ var buttonAppearanceWarning = {
|
|
|
420
419
|
warningMutedPrimary: {
|
|
421
420
|
fill: 'warningTertiary',
|
|
422
421
|
fillHover: 'warningBorderHover',
|
|
423
|
-
borderColor: 'warningBorderHover',
|
|
424
422
|
labelTextColor: 'warningTextSecondary',
|
|
425
423
|
labelTextColorHover: 'warningTextPrimary',
|
|
424
|
+
borderColor: 'warningBorderHover',
|
|
426
425
|
iconAfterFillIcon: 'warningItemSecondary',
|
|
427
426
|
iconBeforeFillIcon: 'warningItemSecondary',
|
|
428
427
|
iconFillIcon: 'warningItemSecondary',
|
|
@@ -430,7 +429,7 @@ var buttonAppearanceWarning = {
|
|
|
430
429
|
},
|
|
431
430
|
warningPrimary: {
|
|
432
431
|
fill: 'warningPrimary',
|
|
433
|
-
fillHover: '
|
|
432
|
+
fillHover: 'warningHoverPrimary',
|
|
434
433
|
labelTextColor: 'warningTextPrimary',
|
|
435
434
|
labelTextColorHover: 'warningTextPrimary',
|
|
436
435
|
iconAfterFillIcon: 'warningItemPrimary',
|
|
@@ -440,21 +439,34 @@ var buttonAppearanceWarning = {
|
|
|
440
439
|
},
|
|
441
440
|
};
|
|
442
441
|
|
|
443
|
-
|
|
442
|
+
const buttonAppearance = {
|
|
443
|
+
...buttonAppearanceSize,
|
|
444
|
+
...buttonAppearanceShape,
|
|
445
|
+
...buttonAppearanceStyle,
|
|
446
|
+
...buttonAppearanceAccent,
|
|
447
|
+
...buttonAppearanceDanger,
|
|
448
|
+
...buttonAppearanceError,
|
|
449
|
+
...buttonAppearanceInfo,
|
|
450
|
+
...buttonAppearancePrimary,
|
|
451
|
+
...buttonAppearanceSecondary,
|
|
452
|
+
...buttonAppearanceSuccess,
|
|
453
|
+
...buttonAppearanceSurface,
|
|
454
|
+
...buttonAppearanceWarning,
|
|
455
|
+
};
|
|
444
456
|
|
|
445
|
-
|
|
457
|
+
const buttonConfig = {
|
|
446
458
|
appearance: buttonAppearance,
|
|
447
459
|
setAppearance: function (appearanceConfig) {
|
|
448
460
|
this.appearance = appearanceConfig;
|
|
449
461
|
},
|
|
450
462
|
};
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
463
|
+
const Button = React.forwardRef(function Button(props, ref) {
|
|
464
|
+
const { dataTestId, dataTour, className, appearance, label, Badge, href, htmlType = 'button', link, rel, target, before, after, isDisabled, isLoading = false, onClick, onMouseDown, children, } = props;
|
|
465
|
+
const appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, buttonConfig, isDisabled);
|
|
466
|
+
const propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
467
|
+
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;
|
|
468
|
+
const { label: labelStyles, styles: buttonStyles } = useStyles.useStyles(props);
|
|
469
|
+
const buttonTypeClass = after ||
|
|
458
470
|
before ||
|
|
459
471
|
icon ||
|
|
460
472
|
iconAfter ||
|
|
@@ -468,7 +480,7 @@ var Button = React.forwardRef(function Button(props, ref) {
|
|
|
468
480
|
? 'buttom_type_label'
|
|
469
481
|
: buttonTypeClass
|
|
470
482
|
? 'button_type_icon'
|
|
471
|
-
: '', borderWidthClass &&
|
|
483
|
+
: '', 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: jsxRuntime.jsxs("div", { className: "button__wrapper", ref: ref, children: [isLoading && (jsxRuntime.jsx(Loader.Loader, { appearance: `${loaderAppearance} ${loaderAppearanceSize}`, className: clsx(className, 'button__loader'), type: loaderType, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "button__icon_before", fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), (icon || iconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "button__icon", fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, iconSize: iconSize, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), (children || label) && (jsxRuntime.jsx(Text.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) && (jsxRuntime.jsx(Icon.Icon, { className: "button__icon_after", fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), Badge, after] }) }));
|
|
472
484
|
});
|
|
473
485
|
|
|
474
486
|
exports.Button = Button;
|