@itcase/ui 1.8.38 → 1.8.40
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_nMPCDjk8.js → Avatar_cjs_BbeDJ-No.js} +2 -2
- package/dist/{Avatar_es_B73a6TzA.js → Avatar_es_B1Ao9Im_.js} +2 -2
- package/dist/{Button_cjs_plv5-qcj.js → Button_cjs_Ctkyt2ES.js} +1 -1
- package/dist/{Button_es_BigB2Wz6.js → Button_es_BiIuX0ER.js} +1 -1
- package/dist/{ChipsGroup_cjs_DrOhD-Fc.js → ChipsGroup_cjs_p99H-9a8.js} +48 -64
- package/dist/{ChipsGroup_es_B9m4l0wN.js → ChipsGroup_es_CWq3TR_1.js} +48 -64
- package/dist/{DatePicker_cjs_DKoF73mp.js → DatePicker_cjs_D_1v2mS0.js} +3 -3
- package/dist/{DatePicker_es_CdEYxtwj.js → DatePicker_es_CQwbdG0g.js} +3 -3
- package/dist/{DropdownItem_cjs_DQvByLbN.js → DropdownItem_cjs_B1gGciTB.js} +26 -9
- package/dist/{DropdownItem_es_KppIfto7.js → DropdownItem_es_JVT4f6Nb.js} +26 -9
- package/dist/{Image_cjs_CCWqbNn4.js → Image_cjs_2zEjohYE.js} +5 -4
- package/dist/{Image_es_DZUVp0FS.js → Image_es_ChF-63wh.js} +5 -4
- package/dist/{Label_cjs_BGJfyrOL.js → Label_cjs_Mb8j2bLu.js} +1 -5
- package/dist/{Label_es_C4Px7b-N.js → Label_es_CIDBUVgO.js} +1 -5
- package/dist/{Tooltip_cjs_DHduWa-v.js → Tooltip_cjs_BBwH8sjA.js} +16 -6
- package/dist/{Tooltip_es_ltCY-w4M.js → Tooltip_es_Y2aoFQW7.js} +16 -6
- package/dist/cjs/components/Accordion.js +3 -1
- package/dist/cjs/components/Avatar.js +5 -3
- package/dist/cjs/components/AvatarStack.js +5 -3
- package/dist/cjs/components/Badge.js +3 -1
- package/dist/cjs/components/Breadcrumbs.js +3 -1
- package/dist/cjs/components/Button.js +4 -2
- package/dist/cjs/components/Cell.js +4 -2
- package/dist/cjs/components/Chips.js +5 -2
- package/dist/cjs/components/Choice.js +3 -1
- package/dist/cjs/components/CookiesWarning.js +4 -2
- package/dist/cjs/components/DatePeriod.js +8 -5
- package/dist/cjs/components/DatePicker.js +6 -4
- package/dist/cjs/components/Drawer.js +3 -1
- package/dist/cjs/components/Dropdown/stories/__mock__.js +27 -4
- package/dist/cjs/components/Dropdown.js +5 -3
- package/dist/cjs/components/HeroTitle.js +3 -1
- package/dist/cjs/components/Icon.js +3 -1
- package/dist/cjs/components/Image.js +5 -3
- package/dist/cjs/components/InputPassword.js +3 -1
- package/dist/cjs/components/Label.js +4 -2
- package/dist/cjs/components/Logo.js +7 -5
- package/dist/cjs/components/MenuItem.js +3 -1
- package/dist/cjs/components/Modal.js +3 -1
- package/dist/cjs/components/Notification.js +3 -1
- package/dist/cjs/components/Pagination.js +68 -21
- package/dist/cjs/components/Radio.js +45 -65
- package/dist/cjs/components/Response.js +8 -5
- package/dist/cjs/components/SVGContent.js +5 -3
- package/dist/cjs/components/Search.js +3 -1
- package/dist/cjs/components/Segmented.js +3 -1
- package/dist/cjs/components/Select.js +5 -3
- package/dist/cjs/components/Swiper.js +3 -1
- package/dist/cjs/components/Tab.js +3 -1
- package/dist/cjs/components/Textarea.js +1 -1
- package/dist/cjs/components/Tile.js +3 -1
- package/dist/cjs/components/Title.js +3 -1
- package/dist/cjs/components/Tooltip.js +3 -1
- package/dist/cjs/context/UrlAssetPrefix.js +17 -0
- package/dist/cjs/hoc/urlWithAssetPrefix.js +64 -0
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +29 -0
- package/dist/cjs/hooks/useAppearanceConfig.js +9 -0
- package/dist/components/Accordion.js +3 -1
- package/dist/components/Avatar.js +5 -3
- package/dist/components/AvatarStack.js +5 -3
- package/dist/components/Badge.js +3 -1
- package/dist/components/Breadcrumbs.js +3 -1
- package/dist/components/Button.js +4 -2
- package/dist/components/Cell.js +4 -2
- package/dist/components/Chips.js +5 -2
- package/dist/components/Choice.js +3 -1
- package/dist/components/CookiesWarning.js +4 -2
- package/dist/components/DatePeriod.js +8 -5
- package/dist/components/DatePicker.js +6 -4
- package/dist/components/Drawer.js +3 -1
- package/dist/components/Dropdown/stories/__mock__.js +26 -5
- package/dist/components/Dropdown.js +5 -3
- package/dist/components/HeroTitle.js +3 -1
- package/dist/components/Icon.js +3 -1
- package/dist/components/Image.js +5 -3
- package/dist/components/InputPassword.js +3 -1
- package/dist/components/Label.js +4 -2
- package/dist/components/Logo.js +7 -5
- package/dist/components/MenuItem.js +3 -1
- package/dist/components/Modal.js +3 -1
- package/dist/components/Notification.js +3 -1
- package/dist/components/Pagination.js +69 -22
- package/dist/components/Radio.js +45 -65
- package/dist/components/Response.js +8 -5
- package/dist/components/SVGContent.js +5 -3
- package/dist/components/Search.js +3 -1
- package/dist/components/Segmented.js +3 -1
- package/dist/components/Select.js +5 -3
- package/dist/components/Swiper.js +3 -1
- package/dist/components/Tab.js +3 -1
- package/dist/components/Textarea.js +1 -1
- package/dist/components/Tile.js +3 -1
- package/dist/components/Title.js +3 -1
- package/dist/components/Tooltip.js +3 -1
- package/dist/context/UrlAssetPrefix.js +14 -0
- package/dist/css/components/Dropdown/Dropdown.css +24 -0
- package/dist/css/components/Pagination/Pagination.css +82 -30
- package/dist/css/components/Pagination/css/__item/pagination__item.css +8 -8
- package/dist/css/components/Pagination/css/__item/pagination__item_size.css +8 -0
- package/dist/css/components/Pagination/css/__item/pagination__item_state_active.css +16 -16
- package/dist/css/components/Radio/Radio.css +44 -5
- package/dist/css/components/Select/Select.css +1 -0
- package/dist/css/components/Select/css/__indicators/select__indicators.css +1 -0
- package/dist/css/components/Swiper/Swiper.css +2 -2
- package/dist/css/styles/fill/fill.css +2 -1
- package/dist/css/styles/fill/fill_active.css +3 -0
- package/dist/css/styles/fill/fill_active_hover.css +7 -0
- package/dist/css/styles/fill/fill_hover.css +5 -9
- package/dist/hoc/urlWithAssetPrefix.js +62 -0
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +27 -0
- package/dist/hooks/useAppearanceConfig.js +3 -0
- package/dist/stories/ChipsOverview.mdx +10 -10
- package/dist/stories/ChipsPlayground.mdx +2 -2
- package/dist/stories/Components.mdx +378 -87
- package/dist/stories/useAppearanceConfig.mdx +83 -0
- package/dist/stories/useDevicePropsGenerator.mdx +6 -8
- package/dist/types/components/Chips/appearance/chipsDisabled.d.ts +2 -3
- package/dist/types/components/Dropdown/appearance/dropdownAccent.d.ts +5 -0
- package/dist/types/components/Dropdown/appearance/dropdownSize.d.ts +9 -0
- package/dist/types/components/Dropdown/appearance/dropdownSurface.d.ts +3 -0
- package/dist/types/components/Dropdown/stories/__mock__/index.d.ts +9 -12
- package/dist/types/components/Icon/Icon.d.ts +6 -2
- package/dist/types/components/Icon/appearance/iconDanger.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconDisabled.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconError.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconInfo.d.ts +0 -1
- package/dist/types/components/Icon/appearance/iconPrimary.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSecondary.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSuccess.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconSurface.d.ts +1 -0
- package/dist/types/components/Icon/appearance/iconWarning.d.ts +1 -0
- package/dist/types/components/Image/Image.d.ts +5 -2
- package/dist/types/components/Label/appearance/labelError.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelGradient.d.ts +8 -0
- package/dist/types/components/Label/appearance/labelPrimary.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelSuccess.d.ts +0 -1
- package/dist/types/components/Label/appearance/labelSurface.d.ts +0 -1
- package/dist/types/components/Logo/Logo.d.ts +6 -2
- package/dist/types/components/Pagination/appearance/paginationAccent.d.ts +22 -1
- package/dist/types/components/Pagination/appearance/paginationSize.d.ts +20 -1
- package/dist/types/components/Pagination/appearance/paginationSurface.d.ts +4 -1
- package/dist/types/components/Radio/Radio.appearance.d.ts +28 -48
- package/dist/types/components/Radio/appearance/radioDefault.d.ts +2 -14
- package/dist/types/components/Radio/appearance/radioDisabled.d.ts +5 -5
- package/dist/types/components/Radio/appearance/radioError.d.ts +6 -5
- package/dist/types/components/Radio/appearance/radioRequire.d.ts +5 -13
- package/dist/types/components/Radio/appearance/radioStyle.d.ts +4 -6
- package/dist/types/components/Radio/appearance/radioSuccess.d.ts +6 -5
- package/dist/types/components/Response/Response.d.ts +6 -2
- package/dist/types/components/Response/Response.interface.d.ts +3 -1
- package/dist/types/components/SVGContent/SVGContent.d.ts +5 -2
- package/dist/types/components/Select/SelectLoadingIndicator.d.ts +2 -1
- package/dist/types/config/forms/datepicker.d.ts +18 -0
- package/dist/types/config/forms/index.d.ts +3 -0
- package/dist/types/config/forms/input.d.ts +14 -0
- package/dist/types/context/UrlAssetPrefix.d.ts +12 -0
- package/dist/types/hoc/urlWithAssetPrefix.d.ts +8 -0
- package/dist/types/hooks/useAppearanceConfig/index.d.ts +1 -0
- package/dist/types/hooks/useAppearanceConfig/useAppearanceConfig.d.ts +7 -0
- package/dist/types/hooks/useDevicePropsGenerator/index.d.ts +1 -0
- package/package.json +22 -17
- package/dist/types/hooks/useDeviceTargetClass.d.ts +0 -5
|
@@ -6,12 +6,12 @@ var clsx = require('clsx');
|
|
|
6
6
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
7
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
8
|
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
9
|
+
var Tooltip = require('./Tooltip_cjs_BBwH8sjA.js');
|
|
9
10
|
var Divider = require('./Divider_cjs_BmCJj3TN.js');
|
|
10
|
-
var Tooltip = require('./Tooltip_cjs_DHduWa-v.js');
|
|
11
11
|
var Text = require('./Text_cjs_C9fOm0nd.js');
|
|
12
12
|
|
|
13
13
|
function Dropdown(props) {
|
|
14
|
-
var className = props.className, appearance = props.appearance, _a = props.animationClose, animationClose = _a === void 0 ? 'dropdown_animation_close' : _a, _b = props.animationOpen, animationOpen = _b === void 0 ? 'dropdown_animation_open' : _b, dropdownList = props.dropdownList, before = props.before, after = props.after, isOpen = props.isOpen, setIsOpen = props.setIsOpen, children = props.children;
|
|
14
|
+
var className = props.className, appearance = props.appearance, _a = props.animationClose, animationClose = _a === void 0 ? 'dropdown_animation_close' : _a, _b = props.animationOpen, animationOpen = _b === void 0 ? 'dropdown_animation_open' : _b, dropdownList = props.dropdownList, before = props.before, after = props.after, isOpen = props.isOpen, isSkeleton = props.isSkeleton, setIsOpen = props.setIsOpen, children = props.children;
|
|
15
15
|
var dropdownRef = React.useRef(null);
|
|
16
16
|
// const [isOpen, setIsOpen] = useState(false)
|
|
17
17
|
var _c = React.useState({
|
|
@@ -64,17 +64,22 @@ function Dropdown(props) {
|
|
|
64
64
|
? "shape-strength_".concat(shapeStrengthClass)
|
|
65
65
|
: shapeClass === 'rounded' && 'shape-strength_default', elevationClass && "elevation_".concat(elevationClass), isOpen ? 'dropdown_state_open' : 'dropdown_state_close', animationState.className), ref: dropdownRef, style: styles, children: [before, (children || dropdownList) && (jsxRuntime.jsxs("div", { className: clsx('dropdown__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)),
|
|
66
66
|
// Add "onAnimationEnd" only for wrapper for ignore dropdown button
|
|
67
|
-
onAnimationEnd: onAnimationEnd, children: [dropdownList === null || dropdownList === void 0 ? void 0 : dropdownList.map(function (item) { return (jsxRuntime.jsx(DropdownItem, { appearance: appearance, label: item.label, badgeValue: item.badgeValue, iconAfter: item.iconAfter, iconBefore: item.iconBefore, iconSrc: item.icon, isActive: item.isActive }, item.key)); }), children] })), after] }));
|
|
67
|
+
onAnimationEnd: onAnimationEnd, children: [dropdownList === null || dropdownList === void 0 ? void 0 : dropdownList.map(function (item) { return (jsxRuntime.jsx(DropdownItem, { appearance: appearance, label: item.label, badgeValue: item.badgeValue, emptyMessage: item.emptyMessage, iconAfter: item.iconAfter, iconBefore: item.iconBefore, iconSrc: item.icon, isActive: item.isActive, isSkeleton: isSkeleton }, item.key)); }), children] })), after] }));
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
var dropdownAppearanceAccent = {
|
|
71
71
|
accentPrimary: {
|
|
72
72
|
fill: 'accentPrimary',
|
|
73
|
-
|
|
73
|
+
fillActive: 'accentPrimaryActive',
|
|
74
|
+
fillActiveHover: 'accentHoverPrimary',
|
|
75
|
+
fillHover: 'accentHoverPrimary',
|
|
74
76
|
labelTextColor: 'accentTextPrimary',
|
|
75
77
|
labelTextColorActive: 'accentTextPrimary',
|
|
76
78
|
labelTextColorActiveHover: 'accentTextPrimary',
|
|
77
79
|
labelTextColorHover: 'accentTextPrimary',
|
|
80
|
+
badgeAppearance: 'surfacePrimary',
|
|
81
|
+
dividerFill: 'surfaceTertiary',
|
|
82
|
+
emptyMessageTextColor: 'accentTextPrimary',
|
|
78
83
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
79
84
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
80
85
|
},
|
|
@@ -90,8 +95,11 @@ var dropdownAppearanceAccent = {
|
|
|
90
95
|
var dropdownAppearanceSize = {
|
|
91
96
|
sizeL: {
|
|
92
97
|
size: 'l',
|
|
93
|
-
labelTextSize: '
|
|
98
|
+
labelTextSize: 'm',
|
|
99
|
+
badgeSize: 'xs',
|
|
100
|
+
badgeTextSize: 'xs',
|
|
94
101
|
dividerSize: 's',
|
|
102
|
+
emptyMessageTextSize: 'm',
|
|
95
103
|
iconAfterFillSize: '24',
|
|
96
104
|
iconAfterSize: '24',
|
|
97
105
|
iconBeforeFillSize: '24',
|
|
@@ -100,7 +108,10 @@ var dropdownAppearanceSize = {
|
|
|
100
108
|
sizeS: {
|
|
101
109
|
size: 's',
|
|
102
110
|
labelTextSize: 's',
|
|
111
|
+
badgeSize: 'xs',
|
|
112
|
+
badgeTextSize: 'xs',
|
|
103
113
|
dividerSize: 's',
|
|
114
|
+
emptyMessageTextSize: 'm',
|
|
104
115
|
iconAfterFillSize: '16',
|
|
105
116
|
iconAfterSize: '16',
|
|
106
117
|
iconBeforeFillSize: '16',
|
|
@@ -109,7 +120,10 @@ var dropdownAppearanceSize = {
|
|
|
109
120
|
sizeXS: {
|
|
110
121
|
size: 'xs',
|
|
111
122
|
labelTextSize: 'xs',
|
|
123
|
+
badgeSize: 'xs',
|
|
124
|
+
badgeTextSize: 'xs',
|
|
112
125
|
dividerSize: 's',
|
|
126
|
+
emptyMessageTextSize: 'xs',
|
|
113
127
|
iconAfterFillSize: '12',
|
|
114
128
|
iconAfterSize: '12',
|
|
115
129
|
iconBeforeFillSize: '12',
|
|
@@ -134,12 +148,15 @@ var dropdownAppearanceStyle = {
|
|
|
134
148
|
var dropdownAppearanceSurface = {
|
|
135
149
|
surfacePrimary: {
|
|
136
150
|
fill: 'surfacePrimary',
|
|
151
|
+
fillActive: 'surfacePrimaryActive',
|
|
137
152
|
fillHover: 'surfaceHover',
|
|
138
153
|
labelTextColor: 'surfaceTextPrimary',
|
|
139
154
|
labelTextColorActive: 'surfaceTextPrimary',
|
|
140
155
|
labelTextColorActiveHover: 'surfaceTextPrimary',
|
|
141
156
|
labelTextColorHover: 'surfaceTextPrimary',
|
|
157
|
+
badgeAppearance: 'accentPrimary',
|
|
142
158
|
dividerFill: 'surfaceTertiary',
|
|
159
|
+
emptyMessageTextColor: 'surfaceTextPrimary',
|
|
143
160
|
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
144
161
|
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
145
162
|
},
|
|
@@ -171,21 +188,21 @@ var dropdownItemConfig = {
|
|
|
171
188
|
},
|
|
172
189
|
};
|
|
173
190
|
function DropdownItem(props) {
|
|
174
|
-
var className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, showDivider = props.showDivider, before = props.before, after = props.after, isActive = props.isActive, isHover = props.isHover, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter, children = props.children;
|
|
191
|
+
var className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, badgeValue = props.badgeValue, emptyMessage = props.emptyMessage, showDivider = props.showDivider, before = props.before, after = props.after, isActive = props.isActive, isHover = props.isHover, isSkeleton = props.isSkeleton, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter, children = props.children;
|
|
175
192
|
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
176
193
|
var _a;
|
|
177
194
|
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = dropdownItemConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
178
195
|
}, {});
|
|
179
196
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
180
|
-
var directionClass = propsGenerator.directionClass, justifyContentClass = propsGenerator.justifyContentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextAlign = propsGenerator.labelTextAlign, labelTextColor = propsGenerator.labelTextColor, labelTextColorActive = propsGenerator.labelTextColorActive, labelTextColorActiveHover = propsGenerator.labelTextColorActiveHover, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, descTextColor = propsGenerator.descTextColor, descTextColorHover = propsGenerator.descTextColorHover, descTextGradient = propsGenerator.descTextGradient, descTextSize = propsGenerator.descTextSize, descTextStyle = propsGenerator.descTextStyle, descTextWeight = propsGenerator.descTextWeight, descTextWrap = propsGenerator.descTextWrap, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerSize = propsGenerator.dividerSize, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeValue = propsGenerator.iconBadgeValue, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
197
|
+
var directionClass = propsGenerator.directionClass, justifyContentClass = propsGenerator.justifyContentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextAlign = propsGenerator.labelTextAlign, labelTextColor = propsGenerator.labelTextColor, labelTextColorActive = propsGenerator.labelTextColorActive, labelTextColorActiveHover = propsGenerator.labelTextColorActiveHover, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, descTextColor = propsGenerator.descTextColor, descTextColorHover = propsGenerator.descTextColorHover, descTextGradient = propsGenerator.descTextGradient, descTextSize = propsGenerator.descTextSize, descTextStyle = propsGenerator.descTextStyle, descTextWeight = propsGenerator.descTextWeight, descTextWrap = propsGenerator.descTextWrap, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerSize = propsGenerator.dividerSize, emptyMessageTextColor = propsGenerator.emptyMessageTextColor, emptyMessageTextColorHover = propsGenerator.emptyMessageTextColorHover, emptyMessageTextSize = propsGenerator.emptyMessageTextSize, emptyMessageTextStyle = propsGenerator.emptyMessageTextStyle, emptyMessageTextWeight = propsGenerator.emptyMessageTextWeight, emptyMessageTextWrap = propsGenerator.emptyMessageTextWrap, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeValue = propsGenerator.iconBadgeValue, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
181
198
|
// @ts-expect-error
|
|
182
199
|
var dropdownItem = useStyles.useStyles(props).styles;
|
|
183
200
|
return (jsxRuntime.jsxs("div", { className: clsx('dropdown__item', isActive && 'dropdown__item_state_active', isHover && 'dropdown__item_state_hover', directionClass && "dropdown__item_direction_".concat(directionClass), className, !isActive
|
|
184
201
|
? fillClass && "fill_".concat(fillClass)
|
|
185
202
|
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
186
203
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
187
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), sizeClass && "dropdown__item_size_".concat(sizeClass), shapeClass && "dropdown__item_shape_".concat(shapeClass), widthClass && "dropdown__item_width_".concat(widthClass), isDisabled && "dropdown__item_state_disabled", onClick && 'cursor_type_pointer', set && "dropdown__item_set_".concat(set), justifyContentClass &&
|
|
188
|
-
"dropdown__item_justify-content_".concat(justifyContentClass)), style: dropdownItem, onClick: onClick, onMouseEnter: onMouseEnter, children: [jsxRuntime.jsx("div", { className: "dropdown__item-wrapper", children: jsxRuntime.jsxs(React.Fragment, { children: [before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: clsx('dropdown__item_before', iconBadgeValue && 'dropdown__item_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), children || (jsxRuntime.jsxs(React.Fragment, { children: [label && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-label", size: labelTextSize, textAlign: labelTextAlign, textColor: !isActive && labelTextColor, textColorActive: "accentTextPrimary", textColorActive: isActive && labelTextColorActive, textColorHover: !isActive && labelTextColorHover, textColorHoverActive: isActive && labelTextColorActiveHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })), desc && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-desc", size: descTextSize, textColor: descTextColor, textColorGradient: descTextGradient, textColorHover: descTextColorHover, textStyle: descTextStyle, textWeight: descTextWeight, textWrap: descTextWrap, isActive: isActive, children: desc }))] })), after, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: clsx('dropdown__item_after', iconBadgeValue && 'dropdown__item_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }) }), showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
204
|
+
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), sizeClass && "dropdown__item_size_".concat(sizeClass), shapeClass && "dropdown__item_shape_".concat(shapeClass), widthClass && "dropdown__item_width_".concat(widthClass), isDisabled && "dropdown__item_state_disabled", onClick && 'cursor_type_pointer', set && "dropdown__item_set_".concat(set), isSkeleton && "dropdown__item_skeleton", justifyContentClass &&
|
|
205
|
+
"dropdown__item_justify-content_".concat(justifyContentClass)), style: dropdownItem, onClick: onClick, onMouseEnter: onMouseEnter, children: [jsxRuntime.jsx("div", { className: "dropdown__item-wrapper", children: jsxRuntime.jsxs(React.Fragment, { children: [before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: clsx('dropdown__item_before', iconBadgeValue && 'dropdown__item_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), children || (jsxRuntime.jsxs(React.Fragment, { children: [label && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-label", size: labelTextSize, textAlign: labelTextAlign, textColor: !isActive && labelTextColor, textColorActive: "accentTextPrimary", textColorActive: isActive && labelTextColorActive, textColorHover: !isActive && labelTextColorHover, textColorHoverActive: isActive && labelTextColorActiveHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })), badgeValue && (jsxRuntime.jsx(Tooltip.Badge, { appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), desc && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item-desc", size: descTextSize, textColor: descTextColor, textColorGradient: descTextGradient, textColorHover: descTextColorHover, textStyle: descTextStyle, textWeight: descTextWeight, textWrap: descTextWrap, isActive: isActive, children: desc })), emptyMessage && (jsxRuntime.jsx(Text.Text, { className: "dropdown__item", size: emptyMessageTextSize, textColor: emptyMessageTextColor, textColorHover: emptyMessageTextColorHover, textStyle: emptyMessageTextStyle, textWeight: emptyMessageTextWeight, textWrap: emptyMessageTextWrap, isActive: isActive, children: emptyMessage }))] })), after, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Tooltip.Icon, { className: clsx('dropdown__item_after', iconBadgeValue && 'dropdown__item_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }) }), showDivider && (jsxRuntime.jsx(Divider.Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
189
206
|
}
|
|
190
207
|
|
|
191
208
|
exports.Dropdown = Dropdown;
|
|
@@ -4,12 +4,12 @@ import clsx from 'clsx';
|
|
|
4
4
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
6
|
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
7
|
+
import { I as Icon, B as Badge } from './Tooltip_es_Y2aoFQW7.js';
|
|
7
8
|
import { D as Divider } from './Divider_es_kY-30pft.js';
|
|
8
|
-
import { I as Icon } from './Tooltip_es_ltCY-w4M.js';
|
|
9
9
|
import { T as Text } from './Text_es_BfLRfj-5.js';
|
|
10
10
|
|
|
11
11
|
function Dropdown(props) {
|
|
12
|
-
var className = props.className, appearance = props.appearance, _a = props.animationClose, animationClose = _a === void 0 ? 'dropdown_animation_close' : _a, _b = props.animationOpen, animationOpen = _b === void 0 ? 'dropdown_animation_open' : _b, dropdownList = props.dropdownList, before = props.before, after = props.after, isOpen = props.isOpen, setIsOpen = props.setIsOpen, children = props.children;
|
|
12
|
+
var className = props.className, appearance = props.appearance, _a = props.animationClose, animationClose = _a === void 0 ? 'dropdown_animation_close' : _a, _b = props.animationOpen, animationOpen = _b === void 0 ? 'dropdown_animation_open' : _b, dropdownList = props.dropdownList, before = props.before, after = props.after, isOpen = props.isOpen, isSkeleton = props.isSkeleton, setIsOpen = props.setIsOpen, children = props.children;
|
|
13
13
|
var dropdownRef = useRef(null);
|
|
14
14
|
// const [isOpen, setIsOpen] = useState(false)
|
|
15
15
|
var _c = useState({
|
|
@@ -62,17 +62,22 @@ function Dropdown(props) {
|
|
|
62
62
|
? "shape-strength_".concat(shapeStrengthClass)
|
|
63
63
|
: shapeClass === 'rounded' && 'shape-strength_default', elevationClass && "elevation_".concat(elevationClass), isOpen ? 'dropdown_state_open' : 'dropdown_state_close', animationState.className), ref: dropdownRef, style: styles, children: [before, (children || dropdownList) && (jsxs("div", { className: clsx('dropdown__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)),
|
|
64
64
|
// Add "onAnimationEnd" only for wrapper for ignore dropdown button
|
|
65
|
-
onAnimationEnd: onAnimationEnd, children: [dropdownList === null || dropdownList === void 0 ? void 0 : dropdownList.map(function (item) { return (jsx(DropdownItem, { appearance: appearance, label: item.label, badgeValue: item.badgeValue, iconAfter: item.iconAfter, iconBefore: item.iconBefore, iconSrc: item.icon, isActive: item.isActive }, item.key)); }), children] })), after] }));
|
|
65
|
+
onAnimationEnd: onAnimationEnd, children: [dropdownList === null || dropdownList === void 0 ? void 0 : dropdownList.map(function (item) { return (jsx(DropdownItem, { appearance: appearance, label: item.label, badgeValue: item.badgeValue, emptyMessage: item.emptyMessage, iconAfter: item.iconAfter, iconBefore: item.iconBefore, iconSrc: item.icon, isActive: item.isActive, isSkeleton: isSkeleton }, item.key)); }), children] })), after] }));
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
var dropdownAppearanceAccent = {
|
|
69
69
|
accentPrimary: {
|
|
70
70
|
fill: 'accentPrimary',
|
|
71
|
-
|
|
71
|
+
fillActive: 'accentPrimaryActive',
|
|
72
|
+
fillActiveHover: 'accentHoverPrimary',
|
|
73
|
+
fillHover: 'accentHoverPrimary',
|
|
72
74
|
labelTextColor: 'accentTextPrimary',
|
|
73
75
|
labelTextColorActive: 'accentTextPrimary',
|
|
74
76
|
labelTextColorActiveHover: 'accentTextPrimary',
|
|
75
77
|
labelTextColorHover: 'accentTextPrimary',
|
|
78
|
+
badgeAppearance: 'surfacePrimary',
|
|
79
|
+
dividerFill: 'surfaceTertiary',
|
|
80
|
+
emptyMessageTextColor: 'accentTextPrimary',
|
|
76
81
|
iconAfterFillIcon: 'accentItemPrimary',
|
|
77
82
|
iconBeforeFillIcon: 'accentItemPrimary',
|
|
78
83
|
},
|
|
@@ -88,8 +93,11 @@ var dropdownAppearanceAccent = {
|
|
|
88
93
|
var dropdownAppearanceSize = {
|
|
89
94
|
sizeL: {
|
|
90
95
|
size: 'l',
|
|
91
|
-
labelTextSize: '
|
|
96
|
+
labelTextSize: 'm',
|
|
97
|
+
badgeSize: 'xs',
|
|
98
|
+
badgeTextSize: 'xs',
|
|
92
99
|
dividerSize: 's',
|
|
100
|
+
emptyMessageTextSize: 'm',
|
|
93
101
|
iconAfterFillSize: '24',
|
|
94
102
|
iconAfterSize: '24',
|
|
95
103
|
iconBeforeFillSize: '24',
|
|
@@ -98,7 +106,10 @@ var dropdownAppearanceSize = {
|
|
|
98
106
|
sizeS: {
|
|
99
107
|
size: 's',
|
|
100
108
|
labelTextSize: 's',
|
|
109
|
+
badgeSize: 'xs',
|
|
110
|
+
badgeTextSize: 'xs',
|
|
101
111
|
dividerSize: 's',
|
|
112
|
+
emptyMessageTextSize: 'm',
|
|
102
113
|
iconAfterFillSize: '16',
|
|
103
114
|
iconAfterSize: '16',
|
|
104
115
|
iconBeforeFillSize: '16',
|
|
@@ -107,7 +118,10 @@ var dropdownAppearanceSize = {
|
|
|
107
118
|
sizeXS: {
|
|
108
119
|
size: 'xs',
|
|
109
120
|
labelTextSize: 'xs',
|
|
121
|
+
badgeSize: 'xs',
|
|
122
|
+
badgeTextSize: 'xs',
|
|
110
123
|
dividerSize: 's',
|
|
124
|
+
emptyMessageTextSize: 'xs',
|
|
111
125
|
iconAfterFillSize: '12',
|
|
112
126
|
iconAfterSize: '12',
|
|
113
127
|
iconBeforeFillSize: '12',
|
|
@@ -132,12 +146,15 @@ var dropdownAppearanceStyle = {
|
|
|
132
146
|
var dropdownAppearanceSurface = {
|
|
133
147
|
surfacePrimary: {
|
|
134
148
|
fill: 'surfacePrimary',
|
|
149
|
+
fillActive: 'surfacePrimaryActive',
|
|
135
150
|
fillHover: 'surfaceHover',
|
|
136
151
|
labelTextColor: 'surfaceTextPrimary',
|
|
137
152
|
labelTextColorActive: 'surfaceTextPrimary',
|
|
138
153
|
labelTextColorActiveHover: 'surfaceTextPrimary',
|
|
139
154
|
labelTextColorHover: 'surfaceTextPrimary',
|
|
155
|
+
badgeAppearance: 'accentPrimary',
|
|
140
156
|
dividerFill: 'surfaceTertiary',
|
|
157
|
+
emptyMessageTextColor: 'surfaceTextPrimary',
|
|
141
158
|
iconAfterFillIcon: 'surfaceItemPrimary',
|
|
142
159
|
iconBeforeFillIcon: 'surfaceItemPrimary',
|
|
143
160
|
},
|
|
@@ -169,21 +186,21 @@ var dropdownItemConfig = {
|
|
|
169
186
|
},
|
|
170
187
|
};
|
|
171
188
|
function DropdownItem(props) {
|
|
172
|
-
var className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, showDivider = props.showDivider, before = props.before, after = props.after, isActive = props.isActive, isHover = props.isHover, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter, children = props.children;
|
|
189
|
+
var className = props.className, appearance = props.appearance, label = props.label, desc = props.desc, isDisabled = props.isDisabled, badgeValue = props.badgeValue, emptyMessage = props.emptyMessage, showDivider = props.showDivider, before = props.before, after = props.after, isActive = props.isActive, isHover = props.isHover, isSkeleton = props.isSkeleton, set = props.set, onClick = props.onClick, onMouseEnter = props.onMouseEnter, children = props.children;
|
|
173
190
|
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
174
191
|
var _a;
|
|
175
192
|
return (__assign(__assign({}, resultConfig), (_a = dropdownItemConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
176
193
|
}, {});
|
|
177
194
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
178
|
-
var directionClass = propsGenerator.directionClass, justifyContentClass = propsGenerator.justifyContentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextAlign = propsGenerator.labelTextAlign, labelTextColor = propsGenerator.labelTextColor, labelTextColorActive = propsGenerator.labelTextColorActive, labelTextColorActiveHover = propsGenerator.labelTextColorActiveHover, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, descTextColor = propsGenerator.descTextColor, descTextColorHover = propsGenerator.descTextColorHover, descTextGradient = propsGenerator.descTextGradient, descTextSize = propsGenerator.descTextSize, descTextStyle = propsGenerator.descTextStyle, descTextWeight = propsGenerator.descTextWeight, descTextWrap = propsGenerator.descTextWrap, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerSize = propsGenerator.dividerSize, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeValue = propsGenerator.iconBadgeValue, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
195
|
+
var directionClass = propsGenerator.directionClass, justifyContentClass = propsGenerator.justifyContentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextAlign = propsGenerator.labelTextAlign, labelTextColor = propsGenerator.labelTextColor, labelTextColorActive = propsGenerator.labelTextColorActive, labelTextColorActiveHover = propsGenerator.labelTextColorActiveHover, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextStyle = propsGenerator.labelTextStyle, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, descTextColor = propsGenerator.descTextColor, descTextColorHover = propsGenerator.descTextColorHover, descTextGradient = propsGenerator.descTextGradient, descTextSize = propsGenerator.descTextSize, descTextStyle = propsGenerator.descTextStyle, descTextWeight = propsGenerator.descTextWeight, descTextWrap = propsGenerator.descTextWrap, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, dividerDirection = propsGenerator.dividerDirection, dividerFill = propsGenerator.dividerFill, dividerSize = propsGenerator.dividerSize, emptyMessageTextColor = propsGenerator.emptyMessageTextColor, emptyMessageTextColorHover = propsGenerator.emptyMessageTextColorHover, emptyMessageTextSize = propsGenerator.emptyMessageTextSize, emptyMessageTextStyle = propsGenerator.emptyMessageTextStyle, emptyMessageTextWeight = propsGenerator.emptyMessageTextWeight, emptyMessageTextWrap = propsGenerator.emptyMessageTextWrap, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeValue = propsGenerator.iconBadgeValue, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
179
196
|
// @ts-expect-error
|
|
180
197
|
var dropdownItem = useStyles(props).styles;
|
|
181
198
|
return (jsxs("div", { className: clsx('dropdown__item', isActive && 'dropdown__item_state_active', isHover && 'dropdown__item_state_hover', directionClass && "dropdown__item_direction_".concat(directionClass), className, !isActive
|
|
182
199
|
? fillClass && "fill_".concat(fillClass)
|
|
183
200
|
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
184
201
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
185
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), sizeClass && "dropdown__item_size_".concat(sizeClass), shapeClass && "dropdown__item_shape_".concat(shapeClass), widthClass && "dropdown__item_width_".concat(widthClass), isDisabled && "dropdown__item_state_disabled", onClick && 'cursor_type_pointer', set && "dropdown__item_set_".concat(set), justifyContentClass &&
|
|
186
|
-
"dropdown__item_justify-content_".concat(justifyContentClass)), style: dropdownItem, onClick: onClick, onMouseEnter: onMouseEnter, children: [jsx("div", { className: "dropdown__item-wrapper", children: jsxs(React.Fragment, { children: [before, (iconBefore || iconBeforeSrc) && (jsx(Icon, { className: clsx('dropdown__item_before', iconBadgeValue && 'dropdown__item_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), children || (jsxs(React.Fragment, { children: [label && (jsx(Text, { className: "dropdown__item-label", size: labelTextSize, textAlign: labelTextAlign, textColor: !isActive && labelTextColor, textColorActive: "accentTextPrimary", textColorActive: isActive && labelTextColorActive, textColorHover: !isActive && labelTextColorHover, textColorHoverActive: isActive && labelTextColorActiveHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })), desc && (jsx(Text, { className: "dropdown__item-desc", size: descTextSize, textColor: descTextColor, textColorGradient: descTextGradient, textColorHover: descTextColorHover, textStyle: descTextStyle, textWeight: descTextWeight, textWrap: descTextWrap, isActive: isActive, children: desc }))] })), after, (iconAfter || iconAfterSrc) && (jsx(Icon, { className: clsx('dropdown__item_after', iconBadgeValue && 'dropdown__item_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }) }), showDivider && (jsx(Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
202
|
+
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), sizeClass && "dropdown__item_size_".concat(sizeClass), shapeClass && "dropdown__item_shape_".concat(shapeClass), widthClass && "dropdown__item_width_".concat(widthClass), isDisabled && "dropdown__item_state_disabled", onClick && 'cursor_type_pointer', set && "dropdown__item_set_".concat(set), isSkeleton && "dropdown__item_skeleton", justifyContentClass &&
|
|
203
|
+
"dropdown__item_justify-content_".concat(justifyContentClass)), style: dropdownItem, onClick: onClick, onMouseEnter: onMouseEnter, children: [jsx("div", { className: "dropdown__item-wrapper", children: jsxs(React.Fragment, { children: [before, (iconBefore || iconBeforeSrc) && (jsx(Icon, { className: clsx('dropdown__item_before', iconBadgeValue && 'dropdown__item_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), children || (jsxs(React.Fragment, { children: [label && (jsx(Text, { className: "dropdown__item-label", size: labelTextSize, textAlign: labelTextAlign, textColor: !isActive && labelTextColor, textColorActive: "accentTextPrimary", textColorActive: isActive && labelTextColorActive, textColorHover: !isActive && labelTextColorHover, textColorHoverActive: isActive && labelTextColorActiveHover, textStyle: labelTextStyle, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })), badgeValue && (jsx(Badge, { appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), desc && (jsx(Text, { className: "dropdown__item-desc", size: descTextSize, textColor: descTextColor, textColorGradient: descTextGradient, textColorHover: descTextColorHover, textStyle: descTextStyle, textWeight: descTextWeight, textWrap: descTextWrap, isActive: isActive, children: desc })), emptyMessage && (jsx(Text, { className: "dropdown__item", size: emptyMessageTextSize, textColor: emptyMessageTextColor, textColorHover: emptyMessageTextColorHover, textStyle: emptyMessageTextStyle, textWeight: emptyMessageTextWeight, textWrap: emptyMessageTextWrap, isActive: isActive, children: emptyMessage }))] })), after, (iconAfter || iconAfterSrc) && (jsx(Icon, { className: clsx('dropdown__item_after', iconBadgeValue && 'dropdown__item_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'dropdown__item_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }) }), showDivider && (jsx(Divider, { width: "fill", direction: dividerDirection, size: dividerSize, fill: dividerFill }))] }));
|
|
187
204
|
}
|
|
188
205
|
|
|
189
206
|
export { Dropdown as D, DropdownItem as a, dropdownItemConfig as b, dropdownItemAppearance as d };
|
|
@@ -3,11 +3,12 @@
|
|
|
3
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
4
4
|
var React = require('react');
|
|
5
5
|
var clsx = require('clsx');
|
|
6
|
+
var urlWithAssetPrefix = require('./cjs/hoc/urlWithAssetPrefix.js');
|
|
6
7
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
8
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
9
|
|
|
9
|
-
function Image(props) {
|
|
10
|
-
var className = props.className, type = props.type, src = props.src, title = props.title,
|
|
10
|
+
var Image = urlWithAssetPrefix.urlWithAssetPrefix(function Image(props) {
|
|
11
|
+
var className = props.className, type = props.type, src = props.src, title = props.title, alt = props.alt, caption = props.caption, imageClassName = props.imageClassName, imageWrapperClassName = props.imageWrapperClassName, mode = props.mode, overlay = props.overlay, placeholderUrl = props.placeholderUrl, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick, onError = props.onError, children = props.children;
|
|
11
12
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props);
|
|
12
13
|
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorImageClass = propsGenerator.borderColorImageClass, cursorClass = propsGenerator.cursorClass, heightClass = propsGenerator.heightClass, horizontalAlignClass = propsGenerator.horizontalAlignClass, imageHeightClass = propsGenerator.imageHeightClass, imageWidthClass = propsGenerator.imageWidthClass, resizeModeClass = propsGenerator.resizeModeClass, shapeClass = propsGenerator.shapeClass, verticalAlignClass = propsGenerator.verticalAlignClass, widthClass = propsGenerator.widthClass;
|
|
13
14
|
var _a = useStyles.useStyles(props), imageStyles = _a.image, styles = _a.styles, wrapperStyles = _a.wrapper;
|
|
@@ -21,7 +22,7 @@ function Image(props) {
|
|
|
21
22
|
}, [onError, placeholderUrl]);
|
|
22
23
|
return (jsxRuntime.jsxs("div", { className: clsx(className, 'image', mode && "image_mode_".concat(mode), type && "image_type_".concat(type), cursorClass && "cursor_".concat(cursorClass), horizontalAlignClass &&
|
|
23
24
|
"image_horizontal-align_".concat(horizontalAlignClass), verticalAlignClass && "image_vertical-align_".concat(verticalAlignClass), shapeClass && "image_shape_".concat(shapeClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), resizeModeClass && "image_resize-mode_".concat(resizeModeClass), widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), isSkeleton && 'image_skeleton'), style: styles, onClick: onClick, children: [before, jsxRuntime.jsxs("div", { className: clsx('image__wrapper', imageWrapperClassName), style: wrapperStyles, children: [jsxRuntime.jsx("img", { className: clsx('image__item', imageWidthClass && "width_".concat(imageWidthClass), imageHeightClass && "height_".concat(imageHeightClass), imageClassName, borderColorClass && "border-color_".concat(borderColorClass), borderColorImageClass &&
|
|
24
|
-
"border-color-image_".concat(borderColorImageClass)), src: src, title: title || alt,
|
|
25
|
-
}
|
|
25
|
+
"border-color-image_".concat(borderColorImageClass)), src: src, title: title || alt, alt: alt || title, style: imageStyles, onError: onErrorImage }), overlay, caption, children] }), after] }));
|
|
26
|
+
});
|
|
26
27
|
|
|
27
28
|
exports.Image = Image;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import clsx from 'clsx';
|
|
4
|
+
import { urlWithAssetPrefix } from './hoc/urlWithAssetPrefix.js';
|
|
4
5
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
6
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
7
|
|
|
7
|
-
function Image(props) {
|
|
8
|
-
var className = props.className, type = props.type, src = props.src, title = props.title,
|
|
8
|
+
var Image = urlWithAssetPrefix(function Image(props) {
|
|
9
|
+
var className = props.className, type = props.type, src = props.src, title = props.title, alt = props.alt, caption = props.caption, imageClassName = props.imageClassName, imageWrapperClassName = props.imageWrapperClassName, mode = props.mode, overlay = props.overlay, placeholderUrl = props.placeholderUrl, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick, onError = props.onError, children = props.children;
|
|
9
10
|
var propsGenerator = useDevicePropsGenerator(props);
|
|
10
11
|
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorImageClass = propsGenerator.borderColorImageClass, cursorClass = propsGenerator.cursorClass, heightClass = propsGenerator.heightClass, horizontalAlignClass = propsGenerator.horizontalAlignClass, imageHeightClass = propsGenerator.imageHeightClass, imageWidthClass = propsGenerator.imageWidthClass, resizeModeClass = propsGenerator.resizeModeClass, shapeClass = propsGenerator.shapeClass, verticalAlignClass = propsGenerator.verticalAlignClass, widthClass = propsGenerator.widthClass;
|
|
11
12
|
var _a = useStyles(props), imageStyles = _a.image, styles = _a.styles, wrapperStyles = _a.wrapper;
|
|
@@ -19,7 +20,7 @@ function Image(props) {
|
|
|
19
20
|
}, [onError, placeholderUrl]);
|
|
20
21
|
return (jsxs("div", { className: clsx(className, 'image', mode && "image_mode_".concat(mode), type && "image_type_".concat(type), cursorClass && "cursor_".concat(cursorClass), horizontalAlignClass &&
|
|
21
22
|
"image_horizontal-align_".concat(horizontalAlignClass), verticalAlignClass && "image_vertical-align_".concat(verticalAlignClass), shapeClass && "image_shape_".concat(shapeClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), resizeModeClass && "image_resize-mode_".concat(resizeModeClass), widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), isSkeleton && 'image_skeleton'), style: styles, onClick: onClick, children: [before, jsxs("div", { className: clsx('image__wrapper', imageWrapperClassName), style: wrapperStyles, children: [jsx("img", { className: clsx('image__item', imageWidthClass && "width_".concat(imageWidthClass), imageHeightClass && "height_".concat(imageHeightClass), imageClassName, borderColorClass && "border-color_".concat(borderColorClass), borderColorImageClass &&
|
|
22
|
-
"border-color-image_".concat(borderColorImageClass)), src: src, title: title || alt,
|
|
23
|
-
}
|
|
23
|
+
"border-color-image_".concat(borderColorImageClass)), src: src, title: title || alt, alt: alt || title, style: imageStyles, onError: onErrorImage }), overlay, caption, children] }), after] }));
|
|
24
|
+
});
|
|
24
25
|
|
|
25
26
|
export { Image as I };
|
|
@@ -6,7 +6,7 @@ var React = require('react');
|
|
|
6
6
|
var clsx = require('clsx');
|
|
7
7
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
8
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
9
|
-
var Tooltip = require('./
|
|
9
|
+
var Tooltip = require('./Tooltip_cjs_BBwH8sjA.js');
|
|
10
10
|
var Text = require('./Text_cjs_C9fOm0nd.js');
|
|
11
11
|
|
|
12
12
|
var labelAppearanceAccent = {
|
|
@@ -74,7 +74,6 @@ var labelAppearanceError = {
|
|
|
74
74
|
},
|
|
75
75
|
errorPrimary: {
|
|
76
76
|
fill: 'errorPrimary',
|
|
77
|
-
fillHover: 'errorPrimaryHover',
|
|
78
77
|
labelTextColor: 'errorTextPrimary',
|
|
79
78
|
borderColor: 'errorBorderSecondary',
|
|
80
79
|
iconAfterFillIcon: 'errorItemPrimary',
|
|
@@ -110,7 +109,6 @@ var labelAppearancePrimary = {
|
|
|
110
109
|
primaryMutedPrimary: {
|
|
111
110
|
fill: 'primaryDisabled',
|
|
112
111
|
labelTextColor: 'primaryTextSecondary',
|
|
113
|
-
labelTextColorHover: 'primaryTextSecondary',
|
|
114
112
|
borderColor: 'primaryBorderTertiary',
|
|
115
113
|
iconAfterFillIcon: 'primaryItemSecondary',
|
|
116
114
|
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
@@ -224,7 +222,6 @@ var labelAppearanceSuccess = {
|
|
|
224
222
|
},
|
|
225
223
|
successPrimary: {
|
|
226
224
|
fill: 'successPrimary',
|
|
227
|
-
fillHover: 'successPrimaryHover',
|
|
228
225
|
labelTextColor: 'successTextPrimary',
|
|
229
226
|
borderColor: 'successBorderSecondary',
|
|
230
227
|
iconAfterFillIcon: 'successItemPrimary',
|
|
@@ -236,7 +233,6 @@ var labelAppearanceSurface = {
|
|
|
236
233
|
surfaceMutedPrimary: {
|
|
237
234
|
fill: 'surfaceSecondary',
|
|
238
235
|
labelTextColor: 'surfaceTextQuaternary',
|
|
239
|
-
labelTextColorHover: 'surfaceTextQuaternary',
|
|
240
236
|
borderColor: 'surfaceBorderQuaternary',
|
|
241
237
|
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
242
238
|
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
@@ -4,7 +4,7 @@ import { useRef, useCallback } from 'react';
|
|
|
4
4
|
import clsx from 'clsx';
|
|
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 './
|
|
7
|
+
import { I as Icon, T as Tooltip } from './Tooltip_es_Y2aoFQW7.js';
|
|
8
8
|
import { T as Text } from './Text_es_BfLRfj-5.js';
|
|
9
9
|
|
|
10
10
|
var labelAppearanceAccent = {
|
|
@@ -72,7 +72,6 @@ var labelAppearanceError = {
|
|
|
72
72
|
},
|
|
73
73
|
errorPrimary: {
|
|
74
74
|
fill: 'errorPrimary',
|
|
75
|
-
fillHover: 'errorPrimaryHover',
|
|
76
75
|
labelTextColor: 'errorTextPrimary',
|
|
77
76
|
borderColor: 'errorBorderSecondary',
|
|
78
77
|
iconAfterFillIcon: 'errorItemPrimary',
|
|
@@ -108,7 +107,6 @@ var labelAppearancePrimary = {
|
|
|
108
107
|
primaryMutedPrimary: {
|
|
109
108
|
fill: 'primaryDisabled',
|
|
110
109
|
labelTextColor: 'primaryTextSecondary',
|
|
111
|
-
labelTextColorHover: 'primaryTextSecondary',
|
|
112
110
|
borderColor: 'primaryBorderTertiary',
|
|
113
111
|
iconAfterFillIcon: 'primaryItemSecondary',
|
|
114
112
|
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
@@ -222,7 +220,6 @@ var labelAppearanceSuccess = {
|
|
|
222
220
|
},
|
|
223
221
|
successPrimary: {
|
|
224
222
|
fill: 'successPrimary',
|
|
225
|
-
fillHover: 'successPrimaryHover',
|
|
226
223
|
labelTextColor: 'successTextPrimary',
|
|
227
224
|
borderColor: 'successBorderSecondary',
|
|
228
225
|
iconAfterFillIcon: 'successItemPrimary',
|
|
@@ -234,7 +231,6 @@ var labelAppearanceSurface = {
|
|
|
234
231
|
surfaceMutedPrimary: {
|
|
235
232
|
fill: 'surfaceSecondary',
|
|
236
233
|
labelTextColor: 'surfaceTextQuaternary',
|
|
237
|
-
labelTextColorHover: 'surfaceTextQuaternary',
|
|
238
234
|
borderColor: 'surfaceBorderQuaternary',
|
|
239
235
|
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
240
236
|
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
@@ -8,6 +8,7 @@ var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDe
|
|
|
8
8
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
9
9
|
var Text = require('./Text_cjs_C9fOm0nd.js');
|
|
10
10
|
var SVG = require('react-inlinesvg');
|
|
11
|
+
var urlWithAssetPrefix = require('./cjs/hoc/urlWithAssetPrefix.js');
|
|
11
12
|
var Link = require('./Link_cjs_DbRGq2Yk.js');
|
|
12
13
|
|
|
13
14
|
var badgeAppearanceAccent = {
|
|
@@ -316,6 +317,7 @@ var iconAppearanceDanger = {
|
|
|
316
317
|
dangerPrimary: {
|
|
317
318
|
fill: 'dangerPrimary',
|
|
318
319
|
fillHover: 'dangerHover',
|
|
320
|
+
borderColor: 'dangerBorderSecondary',
|
|
319
321
|
badgeAppearance: 'surfacePrimary',
|
|
320
322
|
iconFill: 'dangerItemPrimary',
|
|
321
323
|
},
|
|
@@ -328,6 +330,7 @@ var iconAppearanceDisabled = {
|
|
|
328
330
|
},
|
|
329
331
|
disabledPrimary: {
|
|
330
332
|
fill: 'surfaceDisabled',
|
|
333
|
+
borderColor: 'surfaceBorderDisabled',
|
|
331
334
|
badgeAppearance: 'surfacePrimary',
|
|
332
335
|
iconFill: 'surfaceItemQuaternary',
|
|
333
336
|
},
|
|
@@ -343,6 +346,7 @@ var iconAppearanceError = {
|
|
|
343
346
|
errorPrimary: {
|
|
344
347
|
fill: 'errorPrimary',
|
|
345
348
|
fillHover: 'errorHover',
|
|
349
|
+
borderColor: 'errorBorderPrimary',
|
|
346
350
|
badgeAppearance: 'surfacePrimary',
|
|
347
351
|
iconFill: 'errorItemPrimary',
|
|
348
352
|
},
|
|
@@ -356,8 +360,7 @@ var iconAppearanceInfo = {
|
|
|
356
360
|
},
|
|
357
361
|
infoPrimary: {
|
|
358
362
|
fill: 'infoPrimary',
|
|
359
|
-
|
|
360
|
-
borderColor: 'accentBorderPrimary',
|
|
363
|
+
borderColor: 'infoBorderDisabled',
|
|
361
364
|
badgeAppearance: 'surfacePrimary',
|
|
362
365
|
iconFill: 'infoItemPrimary',
|
|
363
366
|
},
|
|
@@ -378,6 +381,7 @@ var iconAppearancePrimary = {
|
|
|
378
381
|
primaryPrimary: {
|
|
379
382
|
fill: 'primaryPrimary',
|
|
380
383
|
fillHover: 'primaryPrimaryHover',
|
|
384
|
+
borderColor: 'primaryBorderQuaternary',
|
|
381
385
|
badgeAppearance: 'surfacePrimary',
|
|
382
386
|
iconFill: 'primaryItemPrimary',
|
|
383
387
|
},
|
|
@@ -391,6 +395,7 @@ var iconAppearanceSecondary = {
|
|
|
391
395
|
secondaryPrimary: {
|
|
392
396
|
fill: 'secondaryPrimary',
|
|
393
397
|
fillHover: 'secondaryPrimaryHover',
|
|
398
|
+
borderColor: 'secondaryBorderQuaternary',
|
|
394
399
|
badgeAppearance: 'surfacePrimary',
|
|
395
400
|
iconFill: 'secondaryItemPrimary',
|
|
396
401
|
},
|
|
@@ -561,6 +566,7 @@ var iconAppearanceSuccess = {
|
|
|
561
566
|
successPrimary: {
|
|
562
567
|
fill: 'successPrimary',
|
|
563
568
|
fillHover: 'successHover',
|
|
569
|
+
borderColor: 'successBorderHover',
|
|
564
570
|
badgeAppearance: 'surfacePrimary',
|
|
565
571
|
iconFill: 'successItemPrimary',
|
|
566
572
|
},
|
|
@@ -570,6 +576,7 @@ var iconAppearanceSurface = {
|
|
|
570
576
|
surfacePrimary: {
|
|
571
577
|
fill: 'surfacePrimary',
|
|
572
578
|
fillHover: 'surfaceSecondary',
|
|
579
|
+
borderColor: 'surfaceBorderTertiary',
|
|
573
580
|
badgeAppearance: 'surfacePrimary',
|
|
574
581
|
iconFill: 'surfaceItemPrimary',
|
|
575
582
|
},
|
|
@@ -603,6 +610,7 @@ var iconAppearanceWarning = {
|
|
|
603
610
|
warningPrimary: {
|
|
604
611
|
fill: 'warningPrimary',
|
|
605
612
|
fillHover: 'warningHover',
|
|
613
|
+
borderColor: 'warningBorderSecondary',
|
|
606
614
|
badgeAppearance: 'surfacePrimary',
|
|
607
615
|
iconFill: 'warningItemPrimary',
|
|
608
616
|
},
|
|
@@ -616,7 +624,7 @@ var iconConfig = {
|
|
|
616
624
|
iconConfig.appearance = appearanceConfig;
|
|
617
625
|
},
|
|
618
626
|
};
|
|
619
|
-
var Icon = React.forwardRef(function Icon(props, ref) {
|
|
627
|
+
var Icon = urlWithAssetPrefix.urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
|
|
620
628
|
// TODO: Tooltip doesn't work that anymore
|
|
621
629
|
// const [isTooltipVisible, setIsTooltipVisible] = useState(false)
|
|
622
630
|
var id = props.id, className = props.className, appearance = props.appearance, width = props.width, height = props.height, isDisabled = props.isDisabled, badgeClass = props.badgeClass, dataTour = props.dataTour, href = props.href, imageSrc = props.imageSrc, link = props.link, linkRel = props.linkRel, linkTarget = props.linkTarget, showTooltip = props.showTooltip, SvgImage = props.SvgImage, before = props.before, after = props.after, isActive = props.isActive, isSkeleton = props.isSkeleton, onClick = props.onClick, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave;
|
|
@@ -650,15 +658,17 @@ var Icon = React.forwardRef(function Icon(props, ref) {
|
|
|
650
658
|
? fillClass && "fill_".concat(fillClass)
|
|
651
659
|
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
652
660
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
653
|
-
: fillActiveHoverClass &&
|
|
661
|
+
: fillActiveHoverClass &&
|
|
662
|
+
"fill_active_hover_".concat(fillActiveHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isActive
|
|
654
663
|
? iconFillClass && "icon_fill_".concat(iconFillClass)
|
|
655
664
|
: iconFillActiveClass && "icon_fill_active_".concat(iconFillActiveClass), !isActive
|
|
656
665
|
? iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass)
|
|
657
666
|
: iconFillActiveHoverClass &&
|
|
658
667
|
"icon_fill_active_hover_".concat(iconFillActiveHoverClass), isDisabled &&
|
|
659
668
|
iconFillDisabledClass &&
|
|
660
|
-
"icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass &&
|
|
661
|
-
});
|
|
669
|
+
"icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass &&
|
|
670
|
+
"border-color_hover_".concat(borderColorHoverClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), badgeValue && 'icon_with-badge', centeringClass && "centering_".concat(centeringClass), onClick && cursorClass && "cursor_".concat(cursorClass), isSkeleton && "icon_skeleton"), "data-tour": dataTour, ref: ref, 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_".concat(iconSizeClass)), href: link || href, LinkComponent: "div", rel: linkRel, target: linkTarget, children: [ImageComponent, badgeValue && (jsxRuntime.jsx(Badge, { className: clsx(badgeClass, 'icon__badge'), appearance: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), showTooltip && (jsxRuntime.jsx(Tooltip, { className: clsx(className, 'icon__tooltip', alignmentClass && "alignment_".concat(alignmentClass)), appearance: tooltipAppearance, title: tooltipTitle, titleSize: tooltipTitleSize, text: tooltipText, textSize: tooltipTextSize }))] }), after] }));
|
|
671
|
+
}));
|
|
662
672
|
var removeFillStroke = function (code) {
|
|
663
673
|
return code
|
|
664
674
|
.replace(/fill=".*?"/g, 'fill=""')
|