@itcase/ui 1.8.42 → 1.8.44
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_BbeDJ-No.js → Avatar_cjs_Bp8wjwGw.js} +8 -10
- package/dist/{Avatar_es_B1Ao9Im_.js → Avatar_es_BIKf0hNV.js} +7 -9
- package/dist/{Button_cjs_Bzx1GdT5.js → Button_cjs_Chn18eOU.js} +104 -10
- package/dist/{Button_es_DhCLxWhq.js → Button_es_XnWb2XF3.js} +103 -9
- package/dist/{ChipsGroup_cjs_p99H-9a8.js → ChipsGroup_cjs_Deoz_rju.js} +9 -9
- package/dist/{ChipsGroup_es_CWq3TR_1.js → ChipsGroup_es_C1Qi_5A1.js} +8 -8
- package/dist/{DatePicker_cjs_Cq8vqj3E.js → DatePicker_cjs_B24qHiks.js} +13 -16
- package/dist/{DatePicker_es_DYs71cnU.js → DatePicker_es_BuC8mEcK.js} +10 -13
- package/dist/{Divider_cjs_BmCJj3TN.js → Divider_cjs_rxMMBfLC.js} +3 -5
- package/dist/{Divider_es_kY-30pft.js → Divider_es_CiRU0sTz.js} +3 -5
- package/dist/{DropdownItem_cjs_B1gGciTB.js → DropdownItem_cjs_DuqySfbd.js} +6 -8
- package/dist/{DropdownItem_es_JVT4f6Nb.js → DropdownItem_es_BBxfR35q.js} +5 -7
- package/dist/{Group_cjs_Cwt0gWk4.js → Group_cjs_CDLfU5D2.js} +5 -8
- package/dist/{Group_es_CYW2Hquh.js → Group_es_DSZxyI1e.js} +5 -8
- package/dist/{Tooltip_cjs_BBwH8sjA.js → Icon_cjs_DRZih-pc.js} +588 -599
- package/dist/{Tooltip_es_Y2aoFQW7.js → Icon_es_k9bHSLyL.js} +588 -599
- package/dist/{Input_cjs_CPmXkQGd.js → Input_cjs_BGLd0EQu.js} +3 -5
- package/dist/{Input_es_D9Y1Rj5Y.js → Input_es_D2mNCqiH.js} +3 -5
- package/dist/{Label_cjs_Mb8j2bLu.js → Label_cjs_D70CHJDE.js} +6 -8
- package/dist/{Label_es_CIDBUVgO.js → Label_es_HXrap3A4.js} +5 -7
- package/dist/{Link_cjs_DbRGq2Yk.js → Link_cjs_BqT6eVl6.js} +2 -4
- package/dist/{Link_es_DxtZLeKY.js → Link_es_BnUIX0QT.js} +2 -4
- package/dist/{Loader_cjs_Ca4i0sER.js → Loader_cjs_BShrE-Nb.js} +5 -7
- package/dist/{Loader_es_GYOr0UTX.js → Loader_es_BDb87cdb.js} +5 -7
- package/dist/{Overlay_cjs_CFOtnzDU.js → Overlay_cjs_BMrkRg7M.js} +3 -5
- package/dist/{Overlay_es_DczPjVL9.js → Overlay_es_D_izIIUB.js} +3 -5
- package/dist/{Text_cjs_C9fOm0nd.js → Text_cjs_BlNeIm_v.js} +5 -7
- package/dist/{Text_es_BfLRfj-5.js → Text_es_Ffjr5J1k.js} +5 -7
- package/dist/cjs/components/Accordion.js +7 -9
- package/dist/cjs/components/Avatar.js +9 -8
- package/dist/cjs/components/AvatarStack.js +8 -10
- package/dist/cjs/components/Badge.js +11 -10
- package/dist/cjs/components/Breadcrumbs.js +6 -8
- package/dist/cjs/components/Button.js +11 -10
- package/dist/cjs/components/Cell.js +8 -10
- package/dist/cjs/components/Checkbox.js +4 -6
- package/dist/cjs/components/Checkmark.js +3 -5
- package/dist/cjs/components/Chips.js +4 -4
- package/dist/cjs/components/Choice.js +9 -11
- package/dist/cjs/components/Code.js +3 -5
- package/dist/cjs/components/CookiesWarning.js +12 -14
- package/dist/cjs/components/Dadata.js +2 -1
- package/dist/cjs/components/DatePeriod.js +12 -15
- package/dist/cjs/components/DatePicker.js +9 -8
- package/dist/cjs/components/Divider.js +4 -3
- package/dist/cjs/components/Drawer.js +13 -15
- package/dist/cjs/components/Dropdown.js +6 -5
- package/dist/cjs/components/Group.js +3 -2
- package/dist/cjs/components/HeroTitle.js +7 -9
- package/dist/cjs/components/Icon.js +11 -10
- package/dist/cjs/components/Input.js +3 -2
- package/dist/cjs/components/InputPassword.js +9 -11
- package/dist/cjs/components/Label.js +6 -5
- package/dist/cjs/components/Link.js +2 -1
- package/dist/cjs/components/List.js +4 -6
- package/dist/cjs/components/Loader.js +5 -4
- package/dist/cjs/components/Logo.js +4 -6
- package/dist/cjs/components/MenuItem.js +31 -10
- package/dist/cjs/components/Modal.js +10 -12
- package/dist/cjs/components/Notification.js +7 -9
- package/dist/cjs/components/Overlay.js +4 -3
- package/dist/cjs/components/Pagination.js +10 -12
- package/dist/cjs/components/Radio.js +4 -6
- package/dist/cjs/components/Response.js +8 -10
- package/dist/cjs/components/Search.js +7 -9
- package/dist/cjs/components/Segmented.js +12 -14
- package/dist/cjs/components/Select.js +15 -22
- package/dist/cjs/components/Swiper.js +5 -4
- package/dist/cjs/components/Switch.js +4 -6
- package/dist/cjs/components/Tab.js +8 -10
- package/dist/cjs/components/Text.js +4 -3
- package/dist/cjs/components/Textarea.js +3 -5
- package/dist/cjs/components/Tile.js +7 -9
- package/dist/cjs/components/Title.js +11 -10
- package/dist/cjs/components/Tooltip.js +11 -10
- package/dist/cjs/components/Warning.js +168 -0
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +4 -6
- package/dist/components/Accordion.js +6 -8
- package/dist/components/Avatar.js +9 -8
- package/dist/components/AvatarStack.js +8 -10
- package/dist/components/Badge.js +8 -7
- package/dist/components/Breadcrumbs.js +5 -7
- package/dist/components/Button.js +11 -10
- package/dist/components/Cell.js +7 -9
- package/dist/components/Checkbox.js +4 -6
- package/dist/components/Checkmark.js +3 -5
- package/dist/components/Chips.js +4 -4
- package/dist/components/Choice.js +7 -9
- package/dist/components/Code.js +3 -5
- package/dist/components/CookiesWarning.js +12 -14
- package/dist/components/Dadata.js +2 -1
- package/dist/components/DatePeriod.js +12 -15
- package/dist/components/DatePicker.js +9 -8
- package/dist/components/Divider.js +4 -3
- package/dist/components/Drawer.js +12 -14
- package/dist/components/Dropdown.js +6 -5
- package/dist/components/Group.js +3 -2
- package/dist/components/HeroTitle.js +6 -8
- package/dist/components/Icon.js +8 -7
- package/dist/components/Input.js +3 -2
- package/dist/components/InputPassword.js +8 -10
- package/dist/components/Label.js +6 -5
- package/dist/components/Link.js +2 -1
- package/dist/components/List.js +4 -6
- package/dist/components/Loader.js +5 -4
- package/dist/components/Logo.js +4 -6
- package/dist/components/MenuItem.js +29 -8
- package/dist/components/Modal.js +9 -11
- package/dist/components/Notification.js +6 -8
- package/dist/components/Overlay.js +4 -3
- package/dist/components/Pagination.js +8 -10
- package/dist/components/Radio.js +4 -6
- package/dist/components/Response.js +8 -10
- package/dist/components/Search.js +5 -7
- package/dist/components/Segmented.js +10 -12
- package/dist/components/Select.js +11 -18
- package/dist/components/Swiper.js +4 -3
- package/dist/components/Switch.js +4 -6
- package/dist/components/Tab.js +7 -9
- package/dist/components/Text.js +4 -3
- package/dist/components/Textarea.js +3 -5
- package/dist/components/Tile.js +6 -8
- package/dist/components/Title.js +8 -7
- package/dist/components/Tooltip.js +8 -7
- package/dist/components/Warning.js +164 -0
- package/dist/css/components/MenuItem/MenuItem.css +2 -2
- package/dist/css/components/Warning/Warning.css +52 -0
- package/dist/css/mixins/mixin_utils.css +16 -0
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +4 -6
- package/dist/stories/Overview.mdx +6 -6
- package/dist/stories/Playground.mdx +5 -5
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSize.d.ts +7 -7
- package/dist/types/components/Button/appearance/buttonAccent.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonDanger.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonError.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonInfo.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonPrimary.d.ts +10 -0
- package/dist/types/components/Button/appearance/buttonSecondary.d.ts +10 -0
- package/dist/types/components/Button/appearance/buttonSuccess.d.ts +11 -0
- package/dist/types/components/Button/appearance/buttonSurface.d.ts +10 -0
- package/dist/types/components/Button/appearance/buttonWarning.d.ts +11 -0
- package/dist/types/components/Chips/stories/__mock__/index.d.ts +1 -1
- package/dist/types/components/Choice/stories/__mock__/index.d.ts +3 -3
- package/dist/types/components/CookiesWarning/CookiesWarning.d.ts +1 -0
- package/dist/types/components/DatePicker/DatePicker.appearance.d.ts +6 -6
- package/dist/types/components/DatePicker/appearance/datePickerSize.d.ts +6 -6
- package/dist/types/components/Drawer/appearance/drawerSurface.d.ts +1 -1
- package/dist/types/components/Dropdown/stories/__mock__/index.d.ts +6 -6
- package/dist/types/components/MenuItem/appearance/menuItemAccent.d.ts +8 -0
- package/dist/types/components/MenuItem/appearance/menuItemError.d.ts +7 -0
- package/dist/types/components/MenuItem/appearance/menuItemSurface.d.ts +8 -0
- package/dist/types/components/Notification/appearance/notificationDefault.d.ts +1 -1
- package/dist/types/components/Notification/appearance/notificationError.d.ts +1 -1
- package/dist/types/components/Notification/appearance/notificationInfo.d.ts +1 -1
- package/dist/types/components/Notification/appearance/notificationSuccess.d.ts +1 -1
- package/dist/types/components/Notification/appearance/notificationWarning.d.ts +1 -1
- package/dist/types/components/Pagination/appearance/paginationSize.d.ts +16 -16
- package/dist/types/components/Search/appearance/searchSize.d.ts +12 -12
- package/dist/types/components/Segmented/stories/__mock__/index.d.ts +8 -8
- package/dist/types/components/Tab/stories/__mock__/index.d.ts +1 -1
- package/dist/types/components/Warning/Warning.appearance.d.ts +101 -0
- package/dist/types/components/Warning/Warning.d.ts +4 -0
- package/dist/types/components/Warning/Warning.interface.d.ts +41 -0
- package/dist/types/components/Warning/appearance/warningAccent.d.ts +23 -0
- package/dist/types/components/Warning/appearance/warningError.d.ts +23 -0
- package/dist/types/components/Warning/appearance/warningInfo.d.ts +23 -0
- package/dist/types/components/Warning/appearance/warningSize.d.ts +11 -0
- package/dist/types/components/Warning/appearance/warningStyle.d.ts +14 -0
- package/dist/types/components/Warning/appearance/warningWarning.d.ts +23 -0
- package/dist/types/components/Warning/index.d.ts +2 -0
- package/dist/types/hooks/useAppearanceConfig/useAppearanceConfig.d.ts +1 -3
- package/package.json +13 -12
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
4
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
6
|
+
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
7
7
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
|
-
var
|
|
8
|
+
var Icon = require('./Icon_cjs_DRZih-pc.js');
|
|
9
9
|
var Image = require('./Image_cjs_2zEjohYE.js');
|
|
10
|
-
var Text = require('./
|
|
10
|
+
var Text = require('./Text_cjs_BlNeIm_v.js');
|
|
11
|
+
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
11
12
|
|
|
12
13
|
var avatarAppearanceDefault = {
|
|
13
14
|
surfacePrimary: {
|
|
@@ -138,19 +139,16 @@ var avatarConfig = {
|
|
|
138
139
|
},
|
|
139
140
|
};
|
|
140
141
|
function Avatar(props) {
|
|
141
|
-
var className = props.className, type = props.type, appearance = props.appearance, src = props.src,
|
|
142
|
+
var className = props.className, type = props.type, appearance = props.appearance, src = props.src, _a = props.firstName, firstName = _a === void 0 ? '' : _a, _b = props.secondName, secondName = _b === void 0 ? '' : _b, count = props.count, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick;
|
|
142
143
|
var avatarChars = React.useMemo(function () {
|
|
143
144
|
var firstChar = ((firstName === null || firstName === void 0 ? void 0 : firstName[0]) || '').toUpperCase();
|
|
144
145
|
var secondChar = ((secondName === null || secondName === void 0 ? void 0 : secondName[0]) || '').toUpperCase();
|
|
145
146
|
return "".concat(firstChar).concat(secondChar);
|
|
146
147
|
}, [firstName, secondName]);
|
|
147
|
-
var appearanceConfig =
|
|
148
|
-
var _a;
|
|
149
|
-
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = avatarConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
150
|
-
}, {});
|
|
148
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, avatarConfig);
|
|
151
149
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
152
|
-
var size = propsGenerator.size, fillClass = propsGenerator.fillClass,
|
|
153
|
-
return (jsxRuntime.jsx("div", { className: clsx(className, 'avatar', shapeClass && "avatar_shape_".concat(shapeClass), size && "avatar_size_".concat(sizeClass), type && "avatar_type_".concat(type), (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && "avatar_skeleton", onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxRuntime.jsxs("div", { className: clsx('avatar__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)), children: [before, src ? (jsxRuntime.jsx(Image.Image, { className: "avatar__image", src: src, placeholderUrl: placeholderUrl })) : (jsxRuntime.jsx(Text.Text, { className: "avatar__text", size: textSize, textColor: textColor, textWeight: textWeight, children: avatarChars || count })), (icon || iconSrc) && (jsxRuntime.jsx(
|
|
150
|
+
var size = propsGenerator.size, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, textWeight = propsGenerator.textWeight, badge = propsGenerator.badge, badgeAppearance = propsGenerator.badgeAppearance, badgeAppearanceSize = propsGenerator.badgeAppearanceSize, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, icon = propsGenerator.icon, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, placeholderUrl = propsGenerator.placeholderUrl, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
|
|
151
|
+
return (jsxRuntime.jsx("div", { className: clsx(className, 'avatar', shapeClass && "avatar_shape_".concat(shapeClass), size && "avatar_size_".concat(sizeClass), type && "avatar_type_".concat(type), (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && "avatar_skeleton", onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxRuntime.jsxs("div", { className: clsx('avatar__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)), children: [before, src ? (jsxRuntime.jsx(Image.Image, { className: "avatar__image", 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: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), after] }) }));
|
|
154
152
|
}
|
|
155
153
|
|
|
156
154
|
exports.Avatar = Avatar;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import { useMemo } from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
4
|
+
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
5
5
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
6
|
-
import { I as Icon, B as Badge } from './
|
|
6
|
+
import { I as Icon, B as Badge } from './Icon_es_k9bHSLyL.js';
|
|
7
7
|
import { I as Image } from './Image_es_ChF-63wh.js';
|
|
8
|
-
import { T as Text } from './
|
|
8
|
+
import { T as Text } from './Text_es_Ffjr5J1k.js';
|
|
9
|
+
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
9
10
|
|
|
10
11
|
var avatarAppearanceDefault = {
|
|
11
12
|
surfacePrimary: {
|
|
@@ -136,18 +137,15 @@ var avatarConfig = {
|
|
|
136
137
|
},
|
|
137
138
|
};
|
|
138
139
|
function Avatar(props) {
|
|
139
|
-
var className = props.className, type = props.type, appearance = props.appearance, src = props.src,
|
|
140
|
+
var className = props.className, type = props.type, appearance = props.appearance, src = props.src, _a = props.firstName, firstName = _a === void 0 ? '' : _a, _b = props.secondName, secondName = _b === void 0 ? '' : _b, count = props.count, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick;
|
|
140
141
|
var avatarChars = useMemo(function () {
|
|
141
142
|
var firstChar = ((firstName === null || firstName === void 0 ? void 0 : firstName[0]) || '').toUpperCase();
|
|
142
143
|
var secondChar = ((secondName === null || secondName === void 0 ? void 0 : secondName[0]) || '').toUpperCase();
|
|
143
144
|
return "".concat(firstChar).concat(secondChar);
|
|
144
145
|
}, [firstName, secondName]);
|
|
145
|
-
var appearanceConfig = appearance
|
|
146
|
-
var _a;
|
|
147
|
-
return (__assign(__assign({}, resultConfig), (_a = avatarConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
148
|
-
}, {});
|
|
146
|
+
var appearanceConfig = useAppearanceConfig(appearance, avatarConfig);
|
|
149
147
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
150
|
-
var size = propsGenerator.size, fillClass = propsGenerator.fillClass,
|
|
148
|
+
var size = propsGenerator.size, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, textWeight = propsGenerator.textWeight, badge = propsGenerator.badge, badgeAppearance = propsGenerator.badgeAppearance, badgeAppearanceSize = propsGenerator.badgeAppearanceSize, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, icon = propsGenerator.icon, iconFill = propsGenerator.iconFill, iconFillHover = propsGenerator.iconFillHover, iconFillSize = propsGenerator.iconFillSize, iconItemFill = propsGenerator.iconItemFill, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, placeholderUrl = propsGenerator.placeholderUrl, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
|
|
151
149
|
return (jsx("div", { className: clsx(className, 'avatar', shapeClass && "avatar_shape_".concat(shapeClass), size && "avatar_size_".concat(sizeClass), type && "avatar_type_".concat(type), (badgeValue || badgeAppearance || badgeSize) && 'avatar_status', isSkeleton && "avatar_skeleton", onClick && 'cursor_type_pointer'), onClick: onClick, children: jsxs("div", { className: clsx('avatar__wrapper', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass)), children: [before, src ? (jsx(Image, { className: "avatar__image", 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: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), after] }) }));
|
|
152
150
|
}
|
|
153
151
|
|
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
4
3
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
4
|
var React = require('react');
|
|
6
5
|
var clsx = require('clsx');
|
|
7
|
-
var
|
|
8
|
-
var Link = require('./
|
|
9
|
-
var Loader = require('./
|
|
10
|
-
var Text = require('./
|
|
6
|
+
var Icon = require('./Icon_cjs_DRZih-pc.js');
|
|
7
|
+
var Link = require('./Link_cjs_BqT6eVl6.js');
|
|
8
|
+
var Loader = require('./Loader_cjs_BShrE-Nb.js');
|
|
9
|
+
var Text = require('./Text_cjs_BlNeIm_v.js');
|
|
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');
|
|
13
14
|
|
|
14
15
|
var buttonAppearanceAccent = {
|
|
16
|
+
accentMutedPrimary: {
|
|
17
|
+
fill: 'accentTertiary',
|
|
18
|
+
fillHover: 'accentHoverTertiary',
|
|
19
|
+
labelTextColor: 'accentTextQuaternary',
|
|
20
|
+
labelTextColorHover: 'accentTextQuaternary',
|
|
21
|
+
borderColor: 'accentBorderSecondary',
|
|
22
|
+
iconAfterFillIcon: 'accentItemQuaternary',
|
|
23
|
+
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
24
|
+
iconFillIcon: 'accentItemQuaternary',
|
|
25
|
+
loaderAppearance: 'accentTertiary',
|
|
26
|
+
},
|
|
15
27
|
accentPrimary: {
|
|
16
28
|
fill: 'accentPrimary',
|
|
17
29
|
fillHover: 'accentHoverPrimary',
|
|
@@ -37,6 +49,17 @@ var buttonAppearanceAccent = {
|
|
|
37
49
|
};
|
|
38
50
|
|
|
39
51
|
var buttonAppearanceDanger = {
|
|
52
|
+
dangerMutedPrimary: {
|
|
53
|
+
fill: 'dangerTertiary',
|
|
54
|
+
fillHover: 'dangerHover',
|
|
55
|
+
labelTextColor: 'dangerTextQuaternary',
|
|
56
|
+
labelTextColorHover: 'dangerTextQuaternary',
|
|
57
|
+
borderColor: 'dangerBorderSecondary',
|
|
58
|
+
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
59
|
+
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
60
|
+
iconFillIcon: 'dangerItemQuaternary',
|
|
61
|
+
loaderAppearance: 'dangerTertiary',
|
|
62
|
+
},
|
|
40
63
|
dangerPrimary: {
|
|
41
64
|
fill: 'dangerPrimary',
|
|
42
65
|
fillHover: 'dangerHover',
|
|
@@ -60,6 +83,17 @@ var buttonAppearanceError = {
|
|
|
60
83
|
iconFillIcon: 'errorItemPrimary',
|
|
61
84
|
loaderAppearance: 'errorPrimary',
|
|
62
85
|
},
|
|
86
|
+
errorMutedPrimary: {
|
|
87
|
+
fill: 'errorTertiary',
|
|
88
|
+
fillHover: 'errorHover',
|
|
89
|
+
labelTextColor: 'errorTextQuaternary',
|
|
90
|
+
labelTextColorHover: 'errorTextQuaternary',
|
|
91
|
+
borderColor: 'errorBorderSecondary',
|
|
92
|
+
iconAfterFillIcon: 'errorItemQuaternary',
|
|
93
|
+
iconBeforeFillIcon: 'errorItemQuaternary',
|
|
94
|
+
iconFillIcon: 'errorItemQuaternary',
|
|
95
|
+
loaderAppearance: 'errorTertiary',
|
|
96
|
+
},
|
|
63
97
|
errorPrimary: {
|
|
64
98
|
fill: 'errorPrimary',
|
|
65
99
|
fillHover: 'errorHover',
|
|
@@ -84,6 +118,17 @@ var buttonAppearanceInfo = {
|
|
|
84
118
|
iconFillIcon: 'infoItemPrimary',
|
|
85
119
|
loaderAppearance: 'infoPrimary',
|
|
86
120
|
},
|
|
121
|
+
infoMutedPrimary: {
|
|
122
|
+
fill: 'infoTertiary',
|
|
123
|
+
fillHover: 'infoTertiaryHover',
|
|
124
|
+
labelTextColor: 'infoTextSecondary',
|
|
125
|
+
labelTextColorHover: 'infoTextSecondary',
|
|
126
|
+
borderColor: 'infoBorderSecondary',
|
|
127
|
+
iconAfterFillIcon: 'infoItemSecondary',
|
|
128
|
+
iconBeforeFillIcon: 'infoItemSecondary',
|
|
129
|
+
iconFillIcon: 'infoItemSecondaryPrimary',
|
|
130
|
+
loaderAppearance: 'infoTertiary',
|
|
131
|
+
},
|
|
87
132
|
infoPrimary: {
|
|
88
133
|
fill: 'infoPrimary',
|
|
89
134
|
fillHover: 'infoPrimaryHover',
|
|
@@ -118,6 +163,16 @@ var buttonAppearancePrimary = {
|
|
|
118
163
|
iconFillIcon: 'primaryItemPrimary',
|
|
119
164
|
loaderAppearance: 'primaryPrimary',
|
|
120
165
|
},
|
|
166
|
+
primaryMutedPrimary: {
|
|
167
|
+
fill: 'primaryTertiary',
|
|
168
|
+
fillHover: 'primaryPrimaryHover',
|
|
169
|
+
labelTextColor: 'primaryTextSecondary',
|
|
170
|
+
borderColor: 'primaryBorderTertiary',
|
|
171
|
+
iconAfterFillIcon: 'primaryItemSecondary',
|
|
172
|
+
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
173
|
+
iconFillIcon: 'primaryItemSecondary',
|
|
174
|
+
loaderAppearance: 'primaryTertiary',
|
|
175
|
+
},
|
|
121
176
|
primaryPrimary: {
|
|
122
177
|
fill: 'primaryPrimary',
|
|
123
178
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -139,6 +194,16 @@ var buttonAppearanceSecondary = {
|
|
|
139
194
|
iconFillIcon: 'secondaryItemPrimary',
|
|
140
195
|
loaderAppearance: 'secondaryPrimary',
|
|
141
196
|
},
|
|
197
|
+
secondaryMutedPrimary: {
|
|
198
|
+
fill: 'secondaryTertiary',
|
|
199
|
+
fillHover: 'secondaryPrimaryHover',
|
|
200
|
+
labelTextColor: 'secondaryTextQuaternary',
|
|
201
|
+
borderColor: 'secondaryBorderSecondary',
|
|
202
|
+
iconAfterFillIcon: 'secondaryItemQuaternary',
|
|
203
|
+
iconBeforeFillIcon: 'secondaryItemQuaternary',
|
|
204
|
+
iconFillIcon: 'secondaryItemQuaternary',
|
|
205
|
+
loaderAppearance: 'secondaryPrimary',
|
|
206
|
+
},
|
|
142
207
|
secondaryPrimary: {
|
|
143
208
|
fill: 'secondaryPrimary',
|
|
144
209
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -241,6 +306,17 @@ var buttonAppearanceSuccess = {
|
|
|
241
306
|
iconFillIcon: 'successItemPrimary',
|
|
242
307
|
loaderAppearance: 'successPrimary',
|
|
243
308
|
},
|
|
309
|
+
successMutedPrimary: {
|
|
310
|
+
fill: 'successTertiary',
|
|
311
|
+
fillHover: 'successHover',
|
|
312
|
+
labelTextColor: 'successTextQuaternary',
|
|
313
|
+
labelTextColorHover: 'successTextQuaternary',
|
|
314
|
+
borderColor: 'successBorderQuaternary',
|
|
315
|
+
iconAfterFillIcon: 'successItemQuaternary',
|
|
316
|
+
iconBeforeFillIcon: 'successItemQuaternary',
|
|
317
|
+
iconFillIcon: 'successItemQuaternary',
|
|
318
|
+
loaderAppearance: 'successTertiary',
|
|
319
|
+
},
|
|
244
320
|
successPrimary: {
|
|
245
321
|
fill: 'successPrimary',
|
|
246
322
|
fillHover: 'successHover',
|
|
@@ -254,6 +330,16 @@ var buttonAppearanceSuccess = {
|
|
|
254
330
|
};
|
|
255
331
|
|
|
256
332
|
var buttonAppearanceSurface = {
|
|
333
|
+
surfaceMutedPrimary: {
|
|
334
|
+
fill: 'surfaceTertiary',
|
|
335
|
+
fillHover: 'surfaceTertiary',
|
|
336
|
+
labelTextColor: 'surfaceTextQuaternary',
|
|
337
|
+
borderColor: 'surfaceBorderQuaternary',
|
|
338
|
+
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
339
|
+
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
340
|
+
iconFillIcon: 'surfaceItemQuaternary',
|
|
341
|
+
loaderAppearance: 'surfaceTertiary',
|
|
342
|
+
},
|
|
257
343
|
surfacePrimary: {
|
|
258
344
|
fill: 'surfacePrimary',
|
|
259
345
|
fillHover: 'surfaceSecondary',
|
|
@@ -303,6 +389,17 @@ var buttonAppearanceWarning = {
|
|
|
303
389
|
iconFillIcon: 'warningItemPrimary',
|
|
304
390
|
loaderAppearance: 'warningPrimary',
|
|
305
391
|
},
|
|
392
|
+
warningMutedPrimary: {
|
|
393
|
+
fill: 'warningTertiary',
|
|
394
|
+
fillHover: 'warningBorderHover',
|
|
395
|
+
labelTextColor: 'warningTextSecondary',
|
|
396
|
+
labelTextColorHover: 'warningTextPrimary',
|
|
397
|
+
borderColor: 'warningBorderHover',
|
|
398
|
+
iconAfterFillIcon: 'warningItemSecondary',
|
|
399
|
+
iconBeforeFillIcon: 'warningItemSecondary',
|
|
400
|
+
iconFillIcon: 'warningItemSecondary',
|
|
401
|
+
loaderAppearance: 'warningTertiary',
|
|
402
|
+
},
|
|
306
403
|
warningPrimary: {
|
|
307
404
|
fill: 'warningPrimary',
|
|
308
405
|
fillHover: 'warningHover',
|
|
@@ -325,10 +422,7 @@ var buttonConfig = {
|
|
|
325
422
|
};
|
|
326
423
|
var Button = React.forwardRef(function Button(props, ref) {
|
|
327
424
|
var className = props.className, appearance = props.appearance, label = props.label, isDisabled = props.isDisabled, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, link = props.link, rel = props.rel, target = props.target, before = props.before, after = props.after, _b = props.isLoading, isLoading = _b === void 0 ? false : _b, onClick = props.onClick, onMouseDown = props.onMouseDown, children = props.children;
|
|
328
|
-
var appearanceConfig =
|
|
329
|
-
var _a;
|
|
330
|
-
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = buttonConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
331
|
-
}, {});
|
|
425
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, buttonConfig);
|
|
332
426
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
333
427
|
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextColor = propsGenerator.labelTextColor, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextTruncate = propsGenerator.labelTextTruncate, labelTextWeight = propsGenerator.labelTextWeight, labelTextWidth = propsGenerator.labelTextWidth, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, elevationClass = propsGenerator.elevationClass, icon = propsGenerator.icon, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, iconFill = propsGenerator.iconFill, iconFillIcon = propsGenerator.iconFillIcon, iconFillSize = propsGenerator.iconFillSize, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, loaderAppearance = propsGenerator.loaderAppearance, loaderFill = propsGenerator.loaderFill, loaderItemFill = propsGenerator.loaderItemFill, loaderShapeClass = propsGenerator.loaderShapeClass, loaderSize = propsGenerator.loaderSize, _c = propsGenerator.loaderType, loaderType = _c === void 0 ? 'simple' : _c, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, isSkeleton = propsGenerator.isSkeleton;
|
|
334
428
|
var shapeStrengthClass = propsGenerator.getClassName('shapeStrength', {
|
|
@@ -352,7 +446,7 @@ var Button = React.forwardRef(function Button(props, ref) {
|
|
|
352
446
|
? 'button_type_icon'
|
|
353
447
|
: '', borderWidthClass && "border-width_".concat(borderWidthClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass
|
|
354
448
|
? "shape-strength_".concat(shapeStrengthClass)
|
|
355
|
-
: shapeClass === 'rounded' && 'shape-strength_default', sizeClass && "button_size_".concat(sizeClass), widthClass && "button_width_".concat(widthClass), elevationClass && "elevation_".concat(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-testid": dataTestId && "".concat(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, { className: clsx(className, 'button__loader', loaderShapeClass), type: loaderType, appearance: loaderAppearance, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(
|
|
449
|
+
: shapeClass === 'rounded' && 'shape-strength_default', sizeClass && "button_size_".concat(sizeClass), widthClass && "button_width_".concat(widthClass), elevationClass && "elevation_".concat(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-testid": dataTestId && "".concat(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, { className: clsx(className, 'button__loader', loaderShapeClass), type: loaderType, appearance: loaderAppearance, size: loaderSize, fill: loaderFill, itemFill: loaderItemFill })), before, (iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "button__icon_before", size: iconBeforeSize, fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), (icon || iconSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "button__icon", size: iconSize, fill: iconFill, fillSize: iconFillSize, iconFill: iconFillIcon, 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", size: iconAfterSize, fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter })), Badge, after] }) }));
|
|
356
450
|
});
|
|
357
451
|
|
|
358
452
|
exports.Button = Button;
|
|
@@ -1,15 +1,27 @@
|
|
|
1
|
-
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
2
1
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
3
2
|
import React from 'react';
|
|
4
3
|
import clsx from 'clsx';
|
|
5
|
-
import { I as Icon } from './
|
|
6
|
-
import { a as LinkWrapper } from './
|
|
7
|
-
import { L as Loader } from './
|
|
8
|
-
import { T as Text } from './
|
|
4
|
+
import { I as Icon } from './Icon_es_k9bHSLyL.js';
|
|
5
|
+
import { a as LinkWrapper } from './Link_es_BnUIX0QT.js';
|
|
6
|
+
import { L as Loader } from './Loader_es_BDb87cdb.js';
|
|
7
|
+
import { T as Text } from './Text_es_Ffjr5J1k.js';
|
|
8
|
+
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
9
9
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
10
10
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
11
|
+
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
11
12
|
|
|
12
13
|
var buttonAppearanceAccent = {
|
|
14
|
+
accentMutedPrimary: {
|
|
15
|
+
fill: 'accentTertiary',
|
|
16
|
+
fillHover: 'accentHoverTertiary',
|
|
17
|
+
labelTextColor: 'accentTextQuaternary',
|
|
18
|
+
labelTextColorHover: 'accentTextQuaternary',
|
|
19
|
+
borderColor: 'accentBorderSecondary',
|
|
20
|
+
iconAfterFillIcon: 'accentItemQuaternary',
|
|
21
|
+
iconBeforeFillIcon: 'accentItemQuaternary',
|
|
22
|
+
iconFillIcon: 'accentItemQuaternary',
|
|
23
|
+
loaderAppearance: 'accentTertiary',
|
|
24
|
+
},
|
|
13
25
|
accentPrimary: {
|
|
14
26
|
fill: 'accentPrimary',
|
|
15
27
|
fillHover: 'accentHoverPrimary',
|
|
@@ -35,6 +47,17 @@ var buttonAppearanceAccent = {
|
|
|
35
47
|
};
|
|
36
48
|
|
|
37
49
|
var buttonAppearanceDanger = {
|
|
50
|
+
dangerMutedPrimary: {
|
|
51
|
+
fill: 'dangerTertiary',
|
|
52
|
+
fillHover: 'dangerHover',
|
|
53
|
+
labelTextColor: 'dangerTextQuaternary',
|
|
54
|
+
labelTextColorHover: 'dangerTextQuaternary',
|
|
55
|
+
borderColor: 'dangerBorderSecondary',
|
|
56
|
+
iconAfterFillIcon: 'dangerItemQuaternary',
|
|
57
|
+
iconBeforeFillIcon: 'dangerItemQuaternary',
|
|
58
|
+
iconFillIcon: 'dangerItemQuaternary',
|
|
59
|
+
loaderAppearance: 'dangerTertiary',
|
|
60
|
+
},
|
|
38
61
|
dangerPrimary: {
|
|
39
62
|
fill: 'dangerPrimary',
|
|
40
63
|
fillHover: 'dangerHover',
|
|
@@ -58,6 +81,17 @@ var buttonAppearanceError = {
|
|
|
58
81
|
iconFillIcon: 'errorItemPrimary',
|
|
59
82
|
loaderAppearance: 'errorPrimary',
|
|
60
83
|
},
|
|
84
|
+
errorMutedPrimary: {
|
|
85
|
+
fill: 'errorTertiary',
|
|
86
|
+
fillHover: 'errorHover',
|
|
87
|
+
labelTextColor: 'errorTextQuaternary',
|
|
88
|
+
labelTextColorHover: 'errorTextQuaternary',
|
|
89
|
+
borderColor: 'errorBorderSecondary',
|
|
90
|
+
iconAfterFillIcon: 'errorItemQuaternary',
|
|
91
|
+
iconBeforeFillIcon: 'errorItemQuaternary',
|
|
92
|
+
iconFillIcon: 'errorItemQuaternary',
|
|
93
|
+
loaderAppearance: 'errorTertiary',
|
|
94
|
+
},
|
|
61
95
|
errorPrimary: {
|
|
62
96
|
fill: 'errorPrimary',
|
|
63
97
|
fillHover: 'errorHover',
|
|
@@ -82,6 +116,17 @@ var buttonAppearanceInfo = {
|
|
|
82
116
|
iconFillIcon: 'infoItemPrimary',
|
|
83
117
|
loaderAppearance: 'infoPrimary',
|
|
84
118
|
},
|
|
119
|
+
infoMutedPrimary: {
|
|
120
|
+
fill: 'infoTertiary',
|
|
121
|
+
fillHover: 'infoTertiaryHover',
|
|
122
|
+
labelTextColor: 'infoTextSecondary',
|
|
123
|
+
labelTextColorHover: 'infoTextSecondary',
|
|
124
|
+
borderColor: 'infoBorderSecondary',
|
|
125
|
+
iconAfterFillIcon: 'infoItemSecondary',
|
|
126
|
+
iconBeforeFillIcon: 'infoItemSecondary',
|
|
127
|
+
iconFillIcon: 'infoItemSecondaryPrimary',
|
|
128
|
+
loaderAppearance: 'infoTertiary',
|
|
129
|
+
},
|
|
85
130
|
infoPrimary: {
|
|
86
131
|
fill: 'infoPrimary',
|
|
87
132
|
fillHover: 'infoPrimaryHover',
|
|
@@ -116,6 +161,16 @@ var buttonAppearancePrimary = {
|
|
|
116
161
|
iconFillIcon: 'primaryItemPrimary',
|
|
117
162
|
loaderAppearance: 'primaryPrimary',
|
|
118
163
|
},
|
|
164
|
+
primaryMutedPrimary: {
|
|
165
|
+
fill: 'primaryTertiary',
|
|
166
|
+
fillHover: 'primaryPrimaryHover',
|
|
167
|
+
labelTextColor: 'primaryTextSecondary',
|
|
168
|
+
borderColor: 'primaryBorderTertiary',
|
|
169
|
+
iconAfterFillIcon: 'primaryItemSecondary',
|
|
170
|
+
iconBeforeFillIcon: 'primaryItemSecondary',
|
|
171
|
+
iconFillIcon: 'primaryItemSecondary',
|
|
172
|
+
loaderAppearance: 'primaryTertiary',
|
|
173
|
+
},
|
|
119
174
|
primaryPrimary: {
|
|
120
175
|
fill: 'primaryPrimary',
|
|
121
176
|
fillHover: 'primaryPrimaryHover',
|
|
@@ -137,6 +192,16 @@ var buttonAppearanceSecondary = {
|
|
|
137
192
|
iconFillIcon: 'secondaryItemPrimary',
|
|
138
193
|
loaderAppearance: 'secondaryPrimary',
|
|
139
194
|
},
|
|
195
|
+
secondaryMutedPrimary: {
|
|
196
|
+
fill: 'secondaryTertiary',
|
|
197
|
+
fillHover: 'secondaryPrimaryHover',
|
|
198
|
+
labelTextColor: 'secondaryTextQuaternary',
|
|
199
|
+
borderColor: 'secondaryBorderSecondary',
|
|
200
|
+
iconAfterFillIcon: 'secondaryItemQuaternary',
|
|
201
|
+
iconBeforeFillIcon: 'secondaryItemQuaternary',
|
|
202
|
+
iconFillIcon: 'secondaryItemQuaternary',
|
|
203
|
+
loaderAppearance: 'secondaryPrimary',
|
|
204
|
+
},
|
|
140
205
|
secondaryPrimary: {
|
|
141
206
|
fill: 'secondaryPrimary',
|
|
142
207
|
fillHover: 'secondaryPrimaryHover',
|
|
@@ -239,6 +304,17 @@ var buttonAppearanceSuccess = {
|
|
|
239
304
|
iconFillIcon: 'successItemPrimary',
|
|
240
305
|
loaderAppearance: 'successPrimary',
|
|
241
306
|
},
|
|
307
|
+
successMutedPrimary: {
|
|
308
|
+
fill: 'successTertiary',
|
|
309
|
+
fillHover: 'successHover',
|
|
310
|
+
labelTextColor: 'successTextQuaternary',
|
|
311
|
+
labelTextColorHover: 'successTextQuaternary',
|
|
312
|
+
borderColor: 'successBorderQuaternary',
|
|
313
|
+
iconAfterFillIcon: 'successItemQuaternary',
|
|
314
|
+
iconBeforeFillIcon: 'successItemQuaternary',
|
|
315
|
+
iconFillIcon: 'successItemQuaternary',
|
|
316
|
+
loaderAppearance: 'successTertiary',
|
|
317
|
+
},
|
|
242
318
|
successPrimary: {
|
|
243
319
|
fill: 'successPrimary',
|
|
244
320
|
fillHover: 'successHover',
|
|
@@ -252,6 +328,16 @@ var buttonAppearanceSuccess = {
|
|
|
252
328
|
};
|
|
253
329
|
|
|
254
330
|
var buttonAppearanceSurface = {
|
|
331
|
+
surfaceMutedPrimary: {
|
|
332
|
+
fill: 'surfaceTertiary',
|
|
333
|
+
fillHover: 'surfaceTertiary',
|
|
334
|
+
labelTextColor: 'surfaceTextQuaternary',
|
|
335
|
+
borderColor: 'surfaceBorderQuaternary',
|
|
336
|
+
iconAfterFillIcon: 'surfaceItemQuaternary',
|
|
337
|
+
iconBeforeFillIcon: 'surfaceItemQuaternary',
|
|
338
|
+
iconFillIcon: 'surfaceItemQuaternary',
|
|
339
|
+
loaderAppearance: 'surfaceTertiary',
|
|
340
|
+
},
|
|
255
341
|
surfacePrimary: {
|
|
256
342
|
fill: 'surfacePrimary',
|
|
257
343
|
fillHover: 'surfaceSecondary',
|
|
@@ -301,6 +387,17 @@ var buttonAppearanceWarning = {
|
|
|
301
387
|
iconFillIcon: 'warningItemPrimary',
|
|
302
388
|
loaderAppearance: 'warningPrimary',
|
|
303
389
|
},
|
|
390
|
+
warningMutedPrimary: {
|
|
391
|
+
fill: 'warningTertiary',
|
|
392
|
+
fillHover: 'warningBorderHover',
|
|
393
|
+
labelTextColor: 'warningTextSecondary',
|
|
394
|
+
labelTextColorHover: 'warningTextPrimary',
|
|
395
|
+
borderColor: 'warningBorderHover',
|
|
396
|
+
iconAfterFillIcon: 'warningItemSecondary',
|
|
397
|
+
iconBeforeFillIcon: 'warningItemSecondary',
|
|
398
|
+
iconFillIcon: 'warningItemSecondary',
|
|
399
|
+
loaderAppearance: 'warningTertiary',
|
|
400
|
+
},
|
|
304
401
|
warningPrimary: {
|
|
305
402
|
fill: 'warningPrimary',
|
|
306
403
|
fillHover: 'warningHover',
|
|
@@ -323,10 +420,7 @@ var buttonConfig = {
|
|
|
323
420
|
};
|
|
324
421
|
var Button = React.forwardRef(function Button(props, ref) {
|
|
325
422
|
var className = props.className, appearance = props.appearance, label = props.label, isDisabled = props.isDisabled, Badge = props.Badge, dataTestId = props.dataTestId, dataTour = props.dataTour, href = props.href, _a = props.htmlType, htmlType = _a === void 0 ? 'button' : _a, link = props.link, rel = props.rel, target = props.target, before = props.before, after = props.after, _b = props.isLoading, isLoading = _b === void 0 ? false : _b, onClick = props.onClick, onMouseDown = props.onMouseDown, children = props.children;
|
|
326
|
-
var appearanceConfig = appearance
|
|
327
|
-
var _a;
|
|
328
|
-
return (__assign(__assign({}, resultConfig), (_a = buttonConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
329
|
-
}, {});
|
|
423
|
+
var appearanceConfig = useAppearanceConfig(appearance, buttonConfig);
|
|
330
424
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
331
425
|
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextColor = propsGenerator.labelTextColor, labelTextColorHover = propsGenerator.labelTextColorHover, labelTextSize = propsGenerator.labelTextSize, labelTextTruncate = propsGenerator.labelTextTruncate, labelTextWeight = propsGenerator.labelTextWeight, labelTextWidth = propsGenerator.labelTextWidth, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, elevationClass = propsGenerator.elevationClass, icon = propsGenerator.icon, iconAfter = propsGenerator.iconAfter, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconAfterSrc = propsGenerator.iconAfterSrc, iconBefore = propsGenerator.iconBefore, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, iconBeforeSrc = propsGenerator.iconBeforeSrc, iconFill = propsGenerator.iconFill, iconFillIcon = propsGenerator.iconFillIcon, iconFillSize = propsGenerator.iconFillSize, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, iconSrc = propsGenerator.iconSrc, loaderAppearance = propsGenerator.loaderAppearance, loaderFill = propsGenerator.loaderFill, loaderItemFill = propsGenerator.loaderItemFill, loaderShapeClass = propsGenerator.loaderShapeClass, loaderSize = propsGenerator.loaderSize, _c = propsGenerator.loaderType, loaderType = _c === void 0 ? 'simple' : _c, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass, isSkeleton = propsGenerator.isSkeleton;
|
|
332
426
|
var shapeStrengthClass = propsGenerator.getClassName('shapeStrength', {
|
|
@@ -5,8 +5,8 @@ var clsx = require('clsx');
|
|
|
5
5
|
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
6
6
|
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
7
7
|
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
8
|
-
var
|
|
9
|
-
var Text = require('./
|
|
8
|
+
var Icon = require('./Icon_cjs_DRZih-pc.js');
|
|
9
|
+
var Text = require('./Text_cjs_BlNeIm_v.js');
|
|
10
10
|
var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
11
11
|
|
|
12
12
|
var chipsAppearanceAccent = {
|
|
@@ -78,7 +78,7 @@ var chipsAppearanceError = {
|
|
|
78
78
|
|
|
79
79
|
var chipsAppearanceInfo = {
|
|
80
80
|
infoMutedPrimary: {
|
|
81
|
-
fill: '
|
|
81
|
+
fill: 'infoTertiary',
|
|
82
82
|
labelTextColor: 'infoTextPrimary',
|
|
83
83
|
borderColor: 'infoBorderSecondary',
|
|
84
84
|
iconAfterFillIcon: 'infoItemPrimary',
|
|
@@ -86,10 +86,10 @@ var chipsAppearanceInfo = {
|
|
|
86
86
|
},
|
|
87
87
|
infoPrimary: {
|
|
88
88
|
fill: 'infoPrimary',
|
|
89
|
-
labelTextColor: '
|
|
90
|
-
borderColor: '
|
|
91
|
-
iconAfterFillIcon: '
|
|
92
|
-
iconBeforeFillIcon: '
|
|
89
|
+
labelTextColor: 'infoTextHover',
|
|
90
|
+
borderColor: 'infoBorderHover',
|
|
91
|
+
iconAfterFillIcon: 'infoItemHover',
|
|
92
|
+
iconBeforeFillIcon: 'infoItemHover',
|
|
93
93
|
},
|
|
94
94
|
};
|
|
95
95
|
|
|
@@ -268,7 +268,7 @@ var chipsConfig = {
|
|
|
268
268
|
};
|
|
269
269
|
function Chips(props) {
|
|
270
270
|
var className = props.className, appearance = props.appearance, _a = props.label, label = _a === void 0 ? '' : _a, isDisabled = props.isDisabled, dataTestId = props.dataTestId, dataTour = props.dataTour, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, isActive = props.isActive, isSkeleton = props.isSkeleton, onClick = props.onClick, children = props.children;
|
|
271
|
-
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, chipsConfig, isDisabled)
|
|
271
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, chipsConfig, isDisabled);
|
|
272
272
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
273
273
|
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextActiveColor = propsGenerator.labelTextActiveColor, labelTextActiveHoverColor = propsGenerator.labelTextActiveHoverColor, labelTextColor = propsGenerator.labelTextColor, labelTextHoverColor = propsGenerator.labelTextHoverColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillActiveIcon = propsGenerator.iconAfterFillActiveIcon, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillActiveIcon = propsGenerator.iconBeforeFillActiveIcon, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
|
|
274
274
|
var chipsStyles = useStyles.useStyles(props).styles;
|
|
@@ -276,7 +276,7 @@ function Chips(props) {
|
|
|
276
276
|
? fillClass && "fill_".concat(fillClass)
|
|
277
277
|
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
278
278
|
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
279
|
-
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "chips_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "chips_size_".concat(sizeClass), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), isActive && 'chips_state_active', isDisabled && "chips_state_disabled", cursorClass && "cursor_".concat(cursorClass), onClick && 'cursor_type_pointer', isSkeleton && "chips_skeleton"), "data-testid": dataTestId && "".concat(dataTestId, "Chips"), "data-tour": dataTour, style: chipsStyles, onClick: !isDisabled ? onClick : undefined, children: jsxRuntime.jsxs("div", { className: "chips__inner", children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(
|
|
279
|
+
: fillActiveHoverClass && "fill_active_hover_".concat(fillActiveHoverClass), shapeClass && "chips_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "chips_size_".concat(sizeClass), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), isActive && 'chips_state_active', isDisabled && "chips_state_disabled", cursorClass && "cursor_".concat(cursorClass), onClick && 'cursor_type_pointer', isSkeleton && "chips_skeleton"), "data-testid": dataTestId && "".concat(dataTestId, "Chips"), "data-tour": dataTour, style: chipsStyles, onClick: !isDisabled ? onClick : undefined, children: jsxRuntime.jsxs("div", { className: "chips__inner", children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "chips__icon_before", size: iconBeforeSize, fill: iconBeforeFill, fillSize: iconBeforeFillSize, iconFill: iconBeforeFillIcon, iconFillActive: iconBeforeFillActiveIcon, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore, isActive: isActive })), typeof label === 'string' ? (jsxRuntime.jsx(Text.Text, { className: "chips__label", size: labelTextSize, textColor: labelTextColor, textColorActive: labelTextActiveColor, textColorActiveHover: labelTextActiveHoverColor, textColorHover: labelTextHoverColor, textWeight: labelTextWeight, textWrap: labelTextWrap, isActive: isActive, children: label })) : (jsxRuntime.jsx("div", { className: "chips__label", children: label })), children, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon.Icon, { className: "chips__icon_after", size: iconAfterSize, fill: iconAfterFill, fillSize: iconAfterFillSize, iconFill: iconAfterFillIcon, iconFillActive: iconAfterFillActiveIcon, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter, isActive: isActive })), badgeValue && (jsxRuntime.jsx(Icon.Badge, { className: "chips__badge", appearance: badgeAppearance, size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue }))] }) }));
|
|
280
280
|
}
|
|
281
281
|
|
|
282
282
|
function ChipsGroup(props) {
|
|
@@ -3,8 +3,8 @@ import clsx from 'clsx';
|
|
|
3
3
|
import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from './hooks/useStyles/useStyles.js';
|
|
6
|
-
import { I as Icon, B as Badge } from './
|
|
7
|
-
import { T as Text } from './
|
|
6
|
+
import { I as Icon, B as Badge } from './Icon_es_k9bHSLyL.js';
|
|
7
|
+
import { T as Text } from './Text_es_Ffjr5J1k.js';
|
|
8
8
|
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
9
9
|
|
|
10
10
|
var chipsAppearanceAccent = {
|
|
@@ -76,7 +76,7 @@ var chipsAppearanceError = {
|
|
|
76
76
|
|
|
77
77
|
var chipsAppearanceInfo = {
|
|
78
78
|
infoMutedPrimary: {
|
|
79
|
-
fill: '
|
|
79
|
+
fill: 'infoTertiary',
|
|
80
80
|
labelTextColor: 'infoTextPrimary',
|
|
81
81
|
borderColor: 'infoBorderSecondary',
|
|
82
82
|
iconAfterFillIcon: 'infoItemPrimary',
|
|
@@ -84,10 +84,10 @@ var chipsAppearanceInfo = {
|
|
|
84
84
|
},
|
|
85
85
|
infoPrimary: {
|
|
86
86
|
fill: 'infoPrimary',
|
|
87
|
-
labelTextColor: '
|
|
88
|
-
borderColor: '
|
|
89
|
-
iconAfterFillIcon: '
|
|
90
|
-
iconBeforeFillIcon: '
|
|
87
|
+
labelTextColor: 'infoTextHover',
|
|
88
|
+
borderColor: 'infoBorderHover',
|
|
89
|
+
iconAfterFillIcon: 'infoItemHover',
|
|
90
|
+
iconBeforeFillIcon: 'infoItemHover',
|
|
91
91
|
},
|
|
92
92
|
};
|
|
93
93
|
|
|
@@ -266,7 +266,7 @@ var chipsConfig = {
|
|
|
266
266
|
};
|
|
267
267
|
function Chips(props) {
|
|
268
268
|
var className = props.className, appearance = props.appearance, _a = props.label, label = _a === void 0 ? '' : _a, isDisabled = props.isDisabled, dataTestId = props.dataTestId, dataTour = props.dataTour, iconAfter = props.iconAfter, iconAfterSrc = props.iconAfterSrc, iconBefore = props.iconBefore, iconBeforeSrc = props.iconBeforeSrc, isActive = props.isActive, isSkeleton = props.isSkeleton, onClick = props.onClick, children = props.children;
|
|
269
|
-
var appearanceConfig = useAppearanceConfig(appearance, chipsConfig, isDisabled)
|
|
269
|
+
var appearanceConfig = useAppearanceConfig(appearance, chipsConfig, isDisabled);
|
|
270
270
|
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
271
271
|
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, labelTextActiveColor = propsGenerator.labelTextActiveColor, labelTextActiveHoverColor = propsGenerator.labelTextActiveHoverColor, labelTextColor = propsGenerator.labelTextColor, labelTextHoverColor = propsGenerator.labelTextHoverColor, labelTextSize = propsGenerator.labelTextSize, labelTextWeight = propsGenerator.labelTextWeight, labelTextWrap = propsGenerator.labelTextWrap, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, badgeAppearance = propsGenerator.badgeAppearance, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, iconAfterFill = propsGenerator.iconAfterFill, iconAfterFillActiveIcon = propsGenerator.iconAfterFillActiveIcon, iconAfterFillIcon = propsGenerator.iconAfterFillIcon, iconAfterFillSize = propsGenerator.iconAfterFillSize, iconAfterShape = propsGenerator.iconAfterShape, iconAfterSize = propsGenerator.iconAfterSize, iconBeforeFill = propsGenerator.iconBeforeFill, iconBeforeFillActiveIcon = propsGenerator.iconBeforeFillActiveIcon, iconBeforeFillIcon = propsGenerator.iconBeforeFillIcon, iconBeforeFillSize = propsGenerator.iconBeforeFillSize, iconBeforeShape = propsGenerator.iconBeforeShape, iconBeforeSize = propsGenerator.iconBeforeSize, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
|
|
272
272
|
var chipsStyles = useStyles(props).styles;
|