@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
|
@@ -4,12 +4,13 @@ var tslib_es6 = require('./tslib.es6_cjs_CCZ3TN_7.js');
|
|
|
4
4
|
var jsxRuntime = require('react/jsx-runtime');
|
|
5
5
|
var React = require('react');
|
|
6
6
|
var clsx = require('clsx');
|
|
7
|
-
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
8
|
-
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
9
|
-
var Text = require('./Text_cjs_C9fOm0nd.js');
|
|
10
7
|
var SVG = require('react-inlinesvg');
|
|
11
8
|
var urlWithAssetPrefix = require('./cjs/hoc/urlWithAssetPrefix.js');
|
|
12
|
-
var
|
|
9
|
+
var useAppearanceConfig = require('./cjs/hooks/useAppearanceConfig/useAppearanceConfig.js');
|
|
10
|
+
var useDevicePropsGenerator = require('./cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js');
|
|
11
|
+
var useStyles = require('./cjs/hooks/useStyles/useStyles.js');
|
|
12
|
+
var Link = require('./Link_cjs_BqT6eVl6.js');
|
|
13
|
+
var Text = require('./Text_cjs_BlNeIm_v.js');
|
|
13
14
|
|
|
14
15
|
var badgeAppearanceAccent = {
|
|
15
16
|
accent: {
|
|
@@ -263,10 +264,7 @@ var badgeConfig = {
|
|
|
263
264
|
};
|
|
264
265
|
function Badge(props) {
|
|
265
266
|
var className = props.className, appearance = props.appearance, dot = props.dot, icon = props.icon, iconSrc = props.iconSrc, value = props.value, isSkeleton = props.isSkeleton, children = props.children;
|
|
266
|
-
var appearanceConfig =
|
|
267
|
-
var _a;
|
|
268
|
-
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = badgeConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
269
|
-
}, {});
|
|
267
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, badgeConfig);
|
|
270
268
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
271
269
|
var fillClass = propsGenerator.fillClass, fillHoverClass = propsGenerator.fillHoverClass, borderColorClass = propsGenerator.borderColorClass, borderColorHoverClass = propsGenerator.borderColorHoverClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, dotFillClass = propsGenerator.dotFillClass, iconFill = propsGenerator.iconFill, iconShape = propsGenerator.iconShape, iconSize = propsGenerator.iconSize, positionClass = propsGenerator.positionClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass;
|
|
272
270
|
// @ts-expect-error
|
|
@@ -286,265 +284,326 @@ function Badge(props) {
|
|
|
286
284
|
(value && (jsxRuntime.jsx(Text.Text, { className: "badge__value", size: textSize, textColor: textColor, children: value })))] }));
|
|
287
285
|
}
|
|
288
286
|
|
|
289
|
-
var
|
|
287
|
+
var titleAppearanceAccent = {
|
|
290
288
|
accent: {
|
|
291
289
|
fill: 'accentPrimary',
|
|
292
|
-
fillHover: '
|
|
293
|
-
borderColor: 'accentBorderPrimary',
|
|
294
|
-
badgeAppearance: 'surfacePrimary',
|
|
295
|
-
iconFill: 'accentItemPrimary',
|
|
290
|
+
fillHover: 'accentPrimaryHover',
|
|
296
291
|
},
|
|
297
292
|
accentPrimary: {
|
|
298
293
|
fill: 'accentPrimary',
|
|
299
|
-
fillHover: '
|
|
294
|
+
fillHover: 'accentPrimaryHover',
|
|
300
295
|
borderColor: 'accentBorderPrimary',
|
|
301
|
-
badgeAppearance: 'surfacePrimary',
|
|
302
|
-
iconFill: 'accentItemPrimary',
|
|
303
296
|
},
|
|
304
297
|
accentSecondary: {
|
|
305
298
|
fill: 'accentPrimary',
|
|
306
|
-
fillHover: '
|
|
299
|
+
fillHover: 'accentPrimaryHover',
|
|
300
|
+
labelTextColor: 'accentTextSecondary',
|
|
301
|
+
labelTextColorHover: 'accentTextSecondary',
|
|
307
302
|
borderColor: 'accentBorderPrimary',
|
|
308
|
-
|
|
303
|
+
loaderItemFill: 'accentItemPrimary',
|
|
309
304
|
},
|
|
310
305
|
};
|
|
311
306
|
|
|
312
|
-
var
|
|
307
|
+
var titleAppearanceDanger = {
|
|
313
308
|
danger: {
|
|
314
309
|
fill: 'dangerPrimary',
|
|
315
|
-
fillHover: '
|
|
316
|
-
},
|
|
317
|
-
dangerPrimary: {
|
|
318
|
-
fill: 'dangerPrimary',
|
|
319
|
-
fillHover: 'dangerHover',
|
|
320
|
-
borderColor: 'dangerBorderSecondary',
|
|
321
|
-
badgeAppearance: 'surfacePrimary',
|
|
322
|
-
iconFill: 'dangerItemPrimary',
|
|
310
|
+
fillHover: 'dangerPrimaryHover',
|
|
323
311
|
},
|
|
324
312
|
};
|
|
325
313
|
|
|
326
|
-
var
|
|
327
|
-
danger: {
|
|
328
|
-
fill: 'dangerPrimary',
|
|
329
|
-
fillHover: 'dangerHover',
|
|
330
|
-
},
|
|
314
|
+
var titleAppearanceDisabled = {
|
|
331
315
|
disabledPrimary: {
|
|
332
|
-
fill: '
|
|
333
|
-
borderColor: '
|
|
334
|
-
|
|
335
|
-
|
|
316
|
+
fill: 'surfaceFillDisabled',
|
|
317
|
+
borderColor: 'errorBorderQuaternary',
|
|
318
|
+
borderHover: 'errorBorderQuaternary',
|
|
319
|
+
textColor: 'surfaceTextQuaternary',
|
|
320
|
+
iconBeforeFill: 'errorItemQuaternary',
|
|
321
|
+
iconClearFill: 'errorItemPrimary',
|
|
322
|
+
placeholderTextColor: 'surfaceTextQuaternary',
|
|
323
|
+
},
|
|
324
|
+
disabledSecondary: {
|
|
325
|
+
fill: 'surfaceSecondary',
|
|
326
|
+
borderColor: 'surfaceBorderTertiary',
|
|
327
|
+
borderHover: 'surfaceBorderQuaternary',
|
|
328
|
+
iconBeforeFill: 'surfaceItemQuaternary',
|
|
329
|
+
iconClearFill: 'surfaceItemPrimary',
|
|
330
|
+
placeholderTextColor: 'surfaceTextSecondary',
|
|
336
331
|
},
|
|
337
332
|
};
|
|
338
333
|
|
|
339
|
-
var
|
|
334
|
+
var titleAppearanceError = {
|
|
340
335
|
error: {
|
|
341
336
|
fill: 'errorPrimary',
|
|
342
|
-
fillHover: '
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
fill: 'errorPrimary',
|
|
348
|
-
fillHover: 'errorHover',
|
|
349
|
-
borderColor: 'errorBorderPrimary',
|
|
350
|
-
badgeAppearance: 'surfacePrimary',
|
|
351
|
-
iconFill: 'errorItemPrimary',
|
|
337
|
+
fillHover: 'errorPrimaryHover',
|
|
338
|
+
labelTextColor: 'errorTextPrimary',
|
|
339
|
+
labelTextColorHover: 'errorTextPrimary',
|
|
340
|
+
loaderFill: 'errorPrimary',
|
|
341
|
+
loaderItemFill: 'errorItemPrimary',
|
|
352
342
|
},
|
|
353
343
|
};
|
|
354
344
|
|
|
355
|
-
var
|
|
345
|
+
var titleAppearanceInfo = {
|
|
356
346
|
info: {
|
|
357
347
|
fill: 'accentPrimary',
|
|
358
348
|
fillHover: 'accentPrimaryHover',
|
|
349
|
+
labelTextColor: 'accentTextPrimary',
|
|
350
|
+
labelTextColorHover: 'accentTextPrimary',
|
|
359
351
|
borderColor: 'accentBorderPrimary',
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
fill: 'infoPrimary',
|
|
363
|
-
borderColor: 'infoBorderDisabled',
|
|
364
|
-
badgeAppearance: 'surfacePrimary',
|
|
365
|
-
iconFill: 'infoItemPrimary',
|
|
352
|
+
loaderFill: 'accentPrimary',
|
|
353
|
+
loaderItemFill: 'accentItemPrimary',
|
|
366
354
|
},
|
|
367
355
|
infoSecondary: {
|
|
368
356
|
fill: 'accentPrimary',
|
|
369
357
|
fillHover: 'accentPrimaryHover',
|
|
358
|
+
labelTextColor: 'accentTextSecondary',
|
|
359
|
+
labelTextColorHover: 'accentTextSecondary',
|
|
370
360
|
borderColor: 'accentBorderPrimary',
|
|
361
|
+
loaderFill: 'accentPrimary',
|
|
362
|
+
loaderItemFill: 'accentItemPrimary',
|
|
371
363
|
},
|
|
372
364
|
};
|
|
373
365
|
|
|
374
|
-
var
|
|
366
|
+
var titleAppearancePrimary = {
|
|
375
367
|
primary: {
|
|
376
368
|
fill: 'primaryPrimary',
|
|
377
369
|
fillHover: 'primaryPrimaryHover',
|
|
378
|
-
|
|
379
|
-
iconFill: 'primaryItemPrimary',
|
|
370
|
+
labelTextColor: 'primaryTextPrimary',
|
|
380
371
|
},
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
var titleAppearanceRequire = {
|
|
375
|
+
requirePrimary: {
|
|
376
|
+
fill: 'warningTertiary',
|
|
377
|
+
borderColor: 'warningBorderQuaternary',
|
|
378
|
+
borderHover: 'warningBorderQuaternary',
|
|
379
|
+
textColor: 'surfaceTextPrimary',
|
|
380
|
+
iconBeforeFill: 'warningItemQuaternary',
|
|
381
|
+
iconClearFill: 'warningItemPrimary',
|
|
382
|
+
placeholderTextColor: 'surfaceTextQuaternary',
|
|
383
|
+
},
|
|
384
|
+
requireSecondary: {
|
|
385
|
+
fill: 'surfaceSecondary',
|
|
386
|
+
borderColor: 'surfaceBorderTertiary',
|
|
387
|
+
borderHover: 'surfaceBorderQuaternary',
|
|
388
|
+
iconBeforeFill: 'surfaceItemQuaternary',
|
|
389
|
+
iconClearFill: 'surfaceItemPrimary',
|
|
390
|
+
placeholderTextColor: 'surfaceTextSecondary',
|
|
387
391
|
},
|
|
388
392
|
};
|
|
389
393
|
|
|
390
|
-
var
|
|
394
|
+
var titleAppearanceSecondary = {
|
|
391
395
|
secondary: {
|
|
392
396
|
fill: 'secondaryPrimary',
|
|
393
397
|
fillHover: 'secondaryPrimaryHover',
|
|
394
|
-
|
|
395
|
-
secondaryPrimary: {
|
|
396
|
-
fill: 'secondaryPrimary',
|
|
397
|
-
fillHover: 'secondaryPrimaryHover',
|
|
398
|
-
borderColor: 'secondaryBorderQuaternary',
|
|
399
|
-
badgeAppearance: 'surfacePrimary',
|
|
400
|
-
iconFill: 'secondaryItemPrimary',
|
|
398
|
+
labelTextColor: 'secondaryTextPrimary',
|
|
401
399
|
},
|
|
402
400
|
};
|
|
403
401
|
|
|
404
|
-
var
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
413
|
-
iconSize: '12',
|
|
402
|
+
var titleAppearanceSize = {
|
|
403
|
+
sizeXXL: {
|
|
404
|
+
size: 'xxl',
|
|
405
|
+
labelTextSize: 'xxl',
|
|
406
|
+
iconAfterFillSize: '24',
|
|
407
|
+
iconAfterSize: '24',
|
|
408
|
+
iconBeforeFillSize: '24',
|
|
409
|
+
iconBeforeSize: '24',
|
|
414
410
|
},
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
411
|
+
sizeXL: {
|
|
412
|
+
size: 'xl',
|
|
413
|
+
labelTextSize: 'l',
|
|
414
|
+
iconAfterFillSize: '24',
|
|
415
|
+
iconAfterSize: '24',
|
|
416
|
+
iconBeforeFillSize: '24',
|
|
417
|
+
iconBeforeSize: '24',
|
|
419
418
|
},
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
419
|
+
sizeL: {
|
|
420
|
+
size: 'l',
|
|
421
|
+
labelTextSize: 'l',
|
|
422
|
+
iconAfterFillSize: '24',
|
|
423
|
+
iconAfterSize: '24',
|
|
424
|
+
iconBeforeFillSize: '24',
|
|
425
|
+
iconBeforeSize: '24',
|
|
424
426
|
},
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
427
|
+
sizeM: {
|
|
428
|
+
size: 'm',
|
|
429
|
+
labelTextSize: 'm',
|
|
430
|
+
iconAfterFillSize: '24',
|
|
431
|
+
iconAfterSize: '24',
|
|
432
|
+
iconBeforeFillSize: '24',
|
|
433
|
+
iconBeforeSize: '24',
|
|
429
434
|
},
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
435
|
+
sizeS: {
|
|
436
|
+
size: 's',
|
|
437
|
+
labelTextSize: 's',
|
|
438
|
+
iconAfterFillSize: '20',
|
|
439
|
+
iconAfterSize: '20',
|
|
440
|
+
iconBeforeFillSize: '20',
|
|
441
|
+
iconBeforeSize: '20',
|
|
434
442
|
},
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
443
|
+
sizeXS: {
|
|
444
|
+
size: 'xs',
|
|
445
|
+
labelTextSize: 'xs',
|
|
446
|
+
iconAfterFillSize: '16',
|
|
447
|
+
iconAfterSize: '16',
|
|
448
|
+
iconBeforeFillSize: '16',
|
|
449
|
+
iconBeforeSize: '16',
|
|
439
450
|
},
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
451
|
+
sizeXXS: {
|
|
452
|
+
size: 'xxs',
|
|
453
|
+
labelTextSize: 'xs',
|
|
454
|
+
iconAfterFillSize: '14',
|
|
455
|
+
iconAfterSize: '14',
|
|
456
|
+
iconBeforeFillSize: '14',
|
|
457
|
+
iconBeforeSize: '14',
|
|
444
458
|
},
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
459
|
+
};
|
|
460
|
+
|
|
461
|
+
var titleAppearanceStyle = {
|
|
462
|
+
full: {
|
|
463
|
+
borderColor: '0',
|
|
449
464
|
},
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
iconSize: '20',
|
|
465
|
+
ghost: {
|
|
466
|
+
fill: 'none',
|
|
467
|
+
borderColor: '0',
|
|
454
468
|
},
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
458
|
-
iconSize: '12',
|
|
469
|
+
outlined: {
|
|
470
|
+
fill: 'none',
|
|
459
471
|
},
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
463
|
-
iconSize: '14',
|
|
472
|
+
solid: {
|
|
473
|
+
borderColor: '0',
|
|
464
474
|
},
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
475
|
+
};
|
|
476
|
+
|
|
477
|
+
var titleAppearanceSuccess = {
|
|
478
|
+
success: {
|
|
479
|
+
fill: 'successPrimary',
|
|
480
|
+
fillHover: 'successPrimaryHover',
|
|
481
|
+
labelTextColor: 'successTextSecondary',
|
|
482
|
+
labelTextColorHover: 'successTextSecondary',
|
|
483
|
+
loaderFill: 'successPrimary',
|
|
484
|
+
loaderItemFill: 'successItemPrimary',
|
|
469
485
|
},
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
478
|
-
iconSize: '24',
|
|
479
|
-
},
|
|
480
|
-
size32_12: {
|
|
481
|
-
fillSize: '32',
|
|
482
|
-
badgeAppearanceSize: 'sizeXXS',
|
|
483
|
-
iconSize: '12',
|
|
486
|
+
};
|
|
487
|
+
|
|
488
|
+
var titleAppearanceSurface = {
|
|
489
|
+
surfacePrimary: {
|
|
490
|
+
fill: 'surfacePrimary',
|
|
491
|
+
fillHover: 'surfacePrimaryHover',
|
|
492
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
484
493
|
},
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
494
|
+
surfaceQuaternary: {
|
|
495
|
+
fill: 'surfaceQuaternary',
|
|
496
|
+
fillHover: 'surfaceQuaternaryHover',
|
|
497
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
489
498
|
},
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
499
|
+
surfaceSecondary: {
|
|
500
|
+
fill: 'surfaceSecondary',
|
|
501
|
+
fillHover: 'surfaceSecondaryHover',
|
|
502
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
503
|
+
loaderFill: 'surfaceSecondary',
|
|
504
|
+
loaderItemFill: 'surfaceItemPrimary',
|
|
494
505
|
},
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
506
|
+
surfaceTertiary: {
|
|
507
|
+
fill: 'surfaceTertiary',
|
|
508
|
+
fillHover: 'surfaceTertiaryHover',
|
|
509
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
499
510
|
},
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
511
|
+
};
|
|
512
|
+
|
|
513
|
+
var titleAppearanceWarning = {
|
|
514
|
+
warning: {
|
|
515
|
+
fill: 'warningPrimary',
|
|
516
|
+
fillHover: 'warningPrimaryHover',
|
|
517
|
+
labelTextColor: 'warningTextSecondary',
|
|
518
|
+
labelTextColorHover: 'warningTextSecondary',
|
|
519
|
+
loaderFill: 'warningPrimary',
|
|
520
|
+
loaderItemFill: 'warningItemPrimary',
|
|
504
521
|
},
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
522
|
+
};
|
|
523
|
+
|
|
524
|
+
var titleAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, titleAppearanceSize), titleAppearanceDisabled), titleAppearanceRequire), titleAppearanceStyle), titleAppearanceAccent), titleAppearanceDanger), titleAppearanceError), titleAppearanceInfo), titleAppearancePrimary), titleAppearanceSecondary), titleAppearanceSuccess), titleAppearanceSurface), titleAppearanceWarning);
|
|
525
|
+
|
|
526
|
+
var titleConfig = {
|
|
527
|
+
appearance: titleAppearance,
|
|
528
|
+
setAppearance: function (appearanceConfig) {
|
|
529
|
+
titleConfig.appearance = appearanceConfig;
|
|
509
530
|
},
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
531
|
+
};
|
|
532
|
+
function Title(props) {
|
|
533
|
+
var className = props.className, appearance = props.appearance, text = props.text, afterWrapper = props.afterWrapper, beforeWrapper = props.beforeWrapper, dataTour = props.dataTour, _a = props.tag, tag = _a === void 0 ? 'span' : _a, before = props.before, after = props.after, isSkeleton = props.isSkeleton, onClick = props.onClick, children = props.children;
|
|
534
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, titleConfig);
|
|
535
|
+
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
536
|
+
var directionClass = propsGenerator.directionClass, size = propsGenerator.size, fillClass = propsGenerator.fillClass, textAlignClass = propsGenerator.textAlignClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorGradientClass = propsGenerator.textColorGradientClass, textColorHoverClass = propsGenerator.textColorHoverClass, textStyleClass = propsGenerator.textStyleClass, textTruncateClass = propsGenerator.textTruncateClass, textWeightClass = propsGenerator.textWeightClass, textWrap = propsGenerator.textWrap, dataTestId = propsGenerator.dataTestId, heightClass = propsGenerator.heightClass, 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, svgFillClass = propsGenerator.svgFillClass, svgFillHoverClass = propsGenerator.svgFillHoverClass, typeClass = propsGenerator.typeClass, widthClass = propsGenerator.widthClass, wrapperDirectionClass = propsGenerator.wrapperDirectionClass;
|
|
537
|
+
// @ts-expect-error
|
|
538
|
+
var _b = useStyles.useStyles(props), titleStyles = _b.styles, titleWrapperStyles = _b.wrapper;
|
|
539
|
+
// Element type (h1, h2, ..., h6)
|
|
540
|
+
var Tag = React.useMemo(function () {
|
|
541
|
+
if (tag) {
|
|
542
|
+
return tag;
|
|
543
|
+
}
|
|
544
|
+
return size ? size : 'span';
|
|
545
|
+
}, [tag, size]);
|
|
546
|
+
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'title', fillClass && "fill_".concat(fillClass), svgFillClass && "svg_fill_".concat(svgFillClass), svgFillHoverClass && "svg_fill_hover_".concat(svgFillHoverClass), widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), size && "title_size_".concat(size), directionClass && "title_direction_".concat(directionClass), textColorClass && "text text-color_".concat(textColorClass), textColorActiveClass && "text-color_active_".concat(textColorActiveClass), textColorHoverClass && "text-color_hover_".concat(textColorHoverClass), typeClass && "title_type_".concat(typeClass), textColorGradientClass && "text-gradient_".concat(textColorGradientClass), textStyleClass && "text-style_".concat(textStyleClass), textWeightClass && "text-weight_".concat(textWeightClass), textWrap && "word-wrap_".concat(textWrap), iconBadgeValue && 'title_badge', isSkeleton && 'title_skeleton'), "data-testid": dataTestId, "data-tour": dataTour, style: titleStyles, onClick: onClick, children: [before, jsxRuntime.jsxs("span", { className: clsx(textAlignClass && "text-align_".concat(textAlignClass), wrapperDirectionClass && "title_direction_".concat(wrapperDirectionClass), 'title__wrapper', textTruncateClass && "text-truncate_".concat(textTruncateClass)), style: titleWrapperStyles, children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_before', iconBadgeValue && 'title__icon_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), beforeWrapper, children || text, afterWrapper, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_after', iconBadgeValue && 'title__icon_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }), after] }));
|
|
547
|
+
}
|
|
548
|
+
|
|
549
|
+
var tooltipAppearanceDefault = {
|
|
550
|
+
defaultPrimary: {
|
|
551
|
+
fill: 'surfacePrimary',
|
|
552
|
+
fillHover: 'surfacePrimaryHover',
|
|
553
|
+
titleTextColor: 'surfaceTextPrimary',
|
|
554
|
+
borderColor: 'surfaceBorderPrimary',
|
|
555
|
+
textColor: 'surfaceTextPrimary',
|
|
514
556
|
},
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
557
|
+
};
|
|
558
|
+
|
|
559
|
+
var tooltipAppearanceDisabled = {
|
|
560
|
+
disabledPrimary: {
|
|
561
|
+
fill: 'surfaceDisabled',
|
|
562
|
+
fillHover: 'surfaceDisabledHover',
|
|
563
|
+
titleTextColor: 'surfaceTextPrimary',
|
|
564
|
+
textColor: 'surfaceTextPrimary',
|
|
519
565
|
},
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
var tooltipAppearanceError = {
|
|
569
|
+
errorPrimary: {
|
|
570
|
+
fill: 'errorPrimary',
|
|
571
|
+
fillHover: 'errorPrimaryHover',
|
|
572
|
+
titleTextColor: 'errorTextPrimary',
|
|
573
|
+
borderColor: 'errorBorderPrimary',
|
|
574
|
+
textColor: 'errorTextPrimary',
|
|
524
575
|
},
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
576
|
+
};
|
|
577
|
+
|
|
578
|
+
var tooltipAppearanceRequire = {
|
|
579
|
+
requirePrimary: {
|
|
580
|
+
fill: 'warningPrimary',
|
|
581
|
+
fillHover: 'warningPrimaryHover',
|
|
582
|
+
titleTextColor: 'warningTextPrimary',
|
|
583
|
+
borderColor: 'warningBorderPrimary',
|
|
584
|
+
textColor: 'warningTextPrimary',
|
|
529
585
|
},
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
var tooltipAppearanceSize = {
|
|
589
|
+
sizeL: {
|
|
590
|
+
size: 'l',
|
|
591
|
+
titleSize: 'h5',
|
|
592
|
+
textSize: 's',
|
|
534
593
|
},
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
594
|
+
sizeM: {
|
|
595
|
+
size: 'm',
|
|
596
|
+
titleSize: 'h5',
|
|
597
|
+
textSize: 's',
|
|
539
598
|
},
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
599
|
+
sizeS: {
|
|
600
|
+
size: 's',
|
|
601
|
+
titleSize: 'h5',
|
|
602
|
+
textSize: 's',
|
|
544
603
|
},
|
|
545
604
|
};
|
|
546
605
|
|
|
547
|
-
var
|
|
606
|
+
var tooltipAppearanceStyle = {
|
|
548
607
|
solid: {
|
|
549
608
|
borderColor: 'none',
|
|
550
609
|
},
|
|
@@ -558,446 +617,340 @@ var iconAppearanceStyle = {
|
|
|
558
617
|
},
|
|
559
618
|
};
|
|
560
619
|
|
|
561
|
-
var
|
|
562
|
-
success: {
|
|
563
|
-
fill: 'successPrimary',
|
|
564
|
-
fillHover: 'successHover',
|
|
565
|
-
},
|
|
620
|
+
var tooltipAppearanceSuccess = {
|
|
566
621
|
successPrimary: {
|
|
567
622
|
fill: 'successPrimary',
|
|
568
|
-
fillHover: '
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
},
|
|
573
|
-
};
|
|
574
|
-
|
|
575
|
-
var iconAppearanceSurface = {
|
|
576
|
-
surfacePrimary: {
|
|
577
|
-
fill: 'surfacePrimary',
|
|
578
|
-
fillHover: 'surfaceSecondary',
|
|
579
|
-
borderColor: 'surfaceBorderTertiary',
|
|
580
|
-
badgeAppearance: 'surfacePrimary',
|
|
581
|
-
iconFill: 'surfaceItemPrimary',
|
|
582
|
-
},
|
|
583
|
-
surfaceSecondary: {
|
|
584
|
-
fill: 'surfaceSecondary',
|
|
585
|
-
fillHover: 'surfaceSecondaryHover',
|
|
586
|
-
badgeAppearance: 'accentPrimary',
|
|
587
|
-
iconFill: 'surfaceItemPrimary',
|
|
588
|
-
},
|
|
589
|
-
surfaceTertiary: {
|
|
590
|
-
fill: 'surfaceTertiary',
|
|
591
|
-
fillHover: 'surfaceTertiaryHover',
|
|
592
|
-
badgeAppearance: 'accentPrimary',
|
|
593
|
-
iconFill: 'surfaceItemPrimary',
|
|
594
|
-
},
|
|
595
|
-
surfaceQuaternary: {
|
|
596
|
-
fill: 'surfaceQuaternary',
|
|
597
|
-
fillHover: 'surfaceHover',
|
|
598
|
-
badgeAppearance: 'accentPrimary',
|
|
599
|
-
iconFill: 'surfaceItemPrimary',
|
|
600
|
-
},
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
var iconAppearanceWarning = {
|
|
604
|
-
warning: {
|
|
605
|
-
fill: 'warningPrimary',
|
|
606
|
-
fillHover: 'warningHover',
|
|
607
|
-
badgeAppearance: 'surfacePrimary',
|
|
608
|
-
iconFill: 'warningItemPrimary',
|
|
609
|
-
},
|
|
610
|
-
warningPrimary: {
|
|
611
|
-
fill: 'warningPrimary',
|
|
612
|
-
fillHover: 'warningHover',
|
|
613
|
-
borderColor: 'warningBorderSecondary',
|
|
614
|
-
badgeAppearance: 'surfacePrimary',
|
|
615
|
-
iconFill: 'warningItemPrimary',
|
|
623
|
+
fillHover: 'successPrimaryHover',
|
|
624
|
+
titleTextColor: 'successTextPrimary',
|
|
625
|
+
borderColor: 'successBorderPrimary',
|
|
626
|
+
textColor: 'successTextPrimary',
|
|
616
627
|
},
|
|
617
628
|
};
|
|
618
629
|
|
|
619
|
-
var
|
|
630
|
+
var tooltipAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, tooltipAppearanceDefault), tooltipAppearanceSize), tooltipAppearanceDisabled), tooltipAppearanceRequire), tooltipAppearanceStyle), tooltipAppearanceError), tooltipAppearanceSuccess);
|
|
620
631
|
|
|
621
|
-
var
|
|
622
|
-
appearance:
|
|
632
|
+
var tooltipConfig = {
|
|
633
|
+
appearance: tooltipAppearance,
|
|
623
634
|
setAppearance: function (appearanceConfig) {
|
|
624
|
-
|
|
635
|
+
tooltipConfig.appearance = appearanceConfig;
|
|
625
636
|
},
|
|
626
637
|
};
|
|
627
|
-
var
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
var
|
|
631
|
-
var
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
638
|
+
var Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
639
|
+
var className = props.className, appearance = props.appearance, initialIsVisible = props.initialIsVisible, title = props.title, text = props.text, before = props.before, after = props.after, _a = props.openTimeoutDelay, openTimeoutDelay = _a === void 0 ? 500 : _a, _b = props.closeTimeoutDelay, closeTimeoutDelay = _b === void 0 ? 250 : _b, isSkeleton = props.isSkeleton, children = props.children;
|
|
640
|
+
var tooltipElementRef = React.useRef(null);
|
|
641
|
+
var tooltipTimeoutHideRef = React.useRef(null);
|
|
642
|
+
var tooltipTimeoutShowRef = React.useRef(null);
|
|
643
|
+
var isTooltipCloseAnimationInProgressRef = React.useRef(false);
|
|
644
|
+
// TODO: rename to open?
|
|
645
|
+
var _c = React.useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
|
|
646
|
+
// TODO: or rename to show/hide?
|
|
647
|
+
var openTooltip = React.useCallback(function () {
|
|
648
|
+
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
649
|
+
if (tooltipTimeoutHideRef.current) {
|
|
650
|
+
clearTimeout(tooltipTimeoutHideRef.current);
|
|
636
651
|
}
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
}
|
|
640
|
-
return jsxRuntime.jsx(SvgImage, tslib_es6.__assign({}, sizes));
|
|
652
|
+
tooltipTimeoutShowRef.current = setTimeout(function () {
|
|
653
|
+
setIsTooltipVisible(true);
|
|
654
|
+
}, openTimeoutDelay);
|
|
641
655
|
}
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
return jsxRuntime.jsx("img", { src: imageSrc });
|
|
656
|
+
}, [openTimeoutDelay]);
|
|
657
|
+
var closeTooltip = React.useCallback(function () {
|
|
658
|
+
if (tooltipTimeoutShowRef.current) {
|
|
659
|
+
clearTimeout(tooltipTimeoutShowRef.current);
|
|
647
660
|
}
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
661
|
+
// Make a small delay to be able to move cursor on the tooltip without
|
|
662
|
+
// triggering a close, because the label and the tooltip have space between
|
|
663
|
+
tooltipTimeoutHideRef.current = setTimeout(function () {
|
|
664
|
+
// @ts-expect-error
|
|
665
|
+
setIsTooltipVisible(function (prevState) {
|
|
666
|
+
var newState = false;
|
|
667
|
+
if (prevState === true) {
|
|
668
|
+
isTooltipCloseAnimationInProgressRef.current = true;
|
|
669
|
+
}
|
|
670
|
+
return newState;
|
|
671
|
+
});
|
|
672
|
+
}, closeTimeoutDelay);
|
|
673
|
+
}, [closeTimeoutDelay]);
|
|
674
|
+
var onAnimationEnd = React.useCallback(function () {
|
|
675
|
+
isTooltipCloseAnimationInProgressRef.current = false;
|
|
676
|
+
}, []);
|
|
677
|
+
React.useImperativeHandle(ref, function () { return ({
|
|
678
|
+
get tooltipElement() {
|
|
679
|
+
return tooltipElementRef.current;
|
|
680
|
+
},
|
|
681
|
+
openTooltip: openTooltip,
|
|
682
|
+
closeTooltip: closeTooltip,
|
|
683
|
+
isTooltipVisible: isTooltipVisible,
|
|
684
|
+
}); }, [isTooltipVisible, openTooltip, closeTooltip]);
|
|
685
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, tooltipConfig);
|
|
654
686
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
655
|
-
var
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
"fill_active_hover_".concat(fillActiveHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isActive
|
|
663
|
-
? iconFillClass && "icon_fill_".concat(iconFillClass)
|
|
664
|
-
: iconFillActiveClass && "icon_fill_active_".concat(iconFillActiveClass), !isActive
|
|
665
|
-
? iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass)
|
|
666
|
-
: iconFillActiveHoverClass &&
|
|
667
|
-
"icon_fill_active_hover_".concat(iconFillActiveHoverClass), isDisabled &&
|
|
668
|
-
iconFillDisabledClass &&
|
|
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
|
-
}));
|
|
672
|
-
var removeFillStroke = function (code) {
|
|
673
|
-
return code
|
|
674
|
-
.replace(/fill=".*?"/g, 'fill=""')
|
|
675
|
-
.replace(/stroke=".*?"/g, 'stroke=""');
|
|
676
|
-
};
|
|
687
|
+
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, alignmentClass = propsGenerator.alignmentClass, alignPosition = propsGenerator.alignPosition, fillClass = propsGenerator.fillClass, titleSize = propsGenerator.titleSize, titleTextColor = propsGenerator.titleTextColor, titleTextWeight = propsGenerator.titleTextWeight, borderColorClass = propsGenerator.borderColorClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, textWeight = propsGenerator.textWeight, arrowPosition = propsGenerator.arrowPosition, centeringClass = propsGenerator.centeringClass, elevationClass = propsGenerator.elevationClass, shapeClass = propsGenerator.shapeClass, shapeStrengthClass = propsGenerator.shapeStrengthClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
688
|
+
// @ts-expect-error
|
|
689
|
+
var tooltipStyles = useStyles.useStyles(props).styles;
|
|
690
|
+
return (jsxRuntime.jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible ? 'tooltip_state_open' : 'tooltip_state_close', fillClass && "fill_".concat(fillClass), shapeClass && "tooltip_shape_".concat(shapeClass), alignPosition && "tooltip_align-position_".concat(alignPosition), alignDirectionClass && "align_".concat(alignDirectionClass), alignClass && "align_".concat(alignClass), elevationClass && "elevation_".concat(elevationClass), centeringClass && "centering_".concat(centeringClass), shapeClass && "shape_".concat(shapeClass), shapeStrengthClass
|
|
691
|
+
? "shape-strength_".concat(shapeStrengthClass)
|
|
692
|
+
: shapeClass === 'rounded' && 'shape-strength_default', alignmentClass && "alignment_".concat(alignmentClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), sizeClass && "tooltip_size_".concat(sizeClass), isSkeleton && 'tooltip_skeleton', widthClass && "width_".concat(widthClass)), ref: tooltipElementRef, style: tooltipStyles, onAnimationEnd: onAnimationEnd, children: [jsxRuntime.jsx("div", { className: clsx('tooltip__arrow', arrowPosition && "tooltip__arrow_position_".concat(arrowPosition), fillClass && "fill_".concat(fillClass)), children: "\u00A0" }), before, jsxRuntime.jsxs("div", { className: "tooltip__inner", children: [title && (jsxRuntime.jsx(Title, { className: "tooltip__title text", size: titleSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "tooltip__text", size: textSize, textColor: textColor, textWeight: textWeight, children: text })), children] }), after] }));
|
|
693
|
+
});
|
|
677
694
|
|
|
678
|
-
var
|
|
695
|
+
var iconAppearanceAccent = {
|
|
679
696
|
accent: {
|
|
680
697
|
fill: 'accentPrimary',
|
|
681
|
-
fillHover: '
|
|
698
|
+
fillHover: 'accentHover',
|
|
699
|
+
borderColor: 'accentBorderPrimary',
|
|
700
|
+
badgeAppearance: 'surfacePrimary',
|
|
701
|
+
iconFill: 'accentItemPrimary',
|
|
682
702
|
},
|
|
683
703
|
accentPrimary: {
|
|
684
704
|
fill: 'accentPrimary',
|
|
685
|
-
fillHover: '
|
|
705
|
+
fillHover: 'accentHover',
|
|
686
706
|
borderColor: 'accentBorderPrimary',
|
|
707
|
+
badgeAppearance: 'surfacePrimary',
|
|
708
|
+
iconFill: 'accentItemPrimary',
|
|
687
709
|
},
|
|
688
710
|
accentSecondary: {
|
|
689
711
|
fill: 'accentPrimary',
|
|
690
|
-
fillHover: '
|
|
691
|
-
labelTextColor: 'accentTextSecondary',
|
|
692
|
-
labelTextColorHover: 'accentTextSecondary',
|
|
712
|
+
fillHover: 'accentHover',
|
|
693
713
|
borderColor: 'accentBorderPrimary',
|
|
694
|
-
|
|
714
|
+
iconFill: 'accentItemPrimary',
|
|
695
715
|
},
|
|
696
716
|
};
|
|
697
717
|
|
|
698
|
-
var
|
|
718
|
+
var iconAppearanceDanger = {
|
|
699
719
|
danger: {
|
|
700
720
|
fill: 'dangerPrimary',
|
|
701
|
-
fillHover: '
|
|
721
|
+
fillHover: 'dangerHover',
|
|
722
|
+
},
|
|
723
|
+
dangerPrimary: {
|
|
724
|
+
fill: 'dangerPrimary',
|
|
725
|
+
fillHover: 'dangerHover',
|
|
726
|
+
borderColor: 'dangerBorderSecondary',
|
|
727
|
+
badgeAppearance: 'surfacePrimary',
|
|
728
|
+
iconFill: 'dangerItemPrimary',
|
|
702
729
|
},
|
|
703
730
|
};
|
|
704
731
|
|
|
705
|
-
var
|
|
706
|
-
|
|
707
|
-
fill: '
|
|
708
|
-
|
|
709
|
-
borderHover: 'errorBorderQuaternary',
|
|
710
|
-
textColor: 'surfaceTextQuaternary',
|
|
711
|
-
iconBeforeFill: 'errorItemQuaternary',
|
|
712
|
-
iconClearFill: 'errorItemPrimary',
|
|
713
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
732
|
+
var iconAppearanceDisabled = {
|
|
733
|
+
danger: {
|
|
734
|
+
fill: 'dangerPrimary',
|
|
735
|
+
fillHover: 'dangerHover',
|
|
714
736
|
},
|
|
715
|
-
|
|
716
|
-
fill: '
|
|
717
|
-
borderColor: '
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
iconClearFill: 'surfaceItemPrimary',
|
|
721
|
-
placeholderTextColor: 'surfaceTextSecondary',
|
|
737
|
+
disabledPrimary: {
|
|
738
|
+
fill: 'surfaceDisabled',
|
|
739
|
+
borderColor: 'surfaceBorderDisabled',
|
|
740
|
+
badgeAppearance: 'surfacePrimary',
|
|
741
|
+
iconFill: 'surfaceItemQuaternary',
|
|
722
742
|
},
|
|
723
743
|
};
|
|
724
744
|
|
|
725
|
-
var
|
|
745
|
+
var iconAppearanceError = {
|
|
726
746
|
error: {
|
|
727
747
|
fill: 'errorPrimary',
|
|
728
|
-
fillHover: '
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
748
|
+
fillHover: 'errorHover',
|
|
749
|
+
badgeAppearance: 'surfacePrimary',
|
|
750
|
+
iconFill: 'errorItemPrimary',
|
|
751
|
+
},
|
|
752
|
+
errorPrimary: {
|
|
753
|
+
fill: 'errorPrimary',
|
|
754
|
+
fillHover: 'errorHover',
|
|
755
|
+
borderColor: 'errorBorderPrimary',
|
|
756
|
+
badgeAppearance: 'surfacePrimary',
|
|
757
|
+
iconFill: 'errorItemPrimary',
|
|
733
758
|
},
|
|
734
759
|
};
|
|
735
760
|
|
|
736
|
-
var
|
|
761
|
+
var iconAppearanceInfo = {
|
|
737
762
|
info: {
|
|
738
763
|
fill: 'accentPrimary',
|
|
739
764
|
fillHover: 'accentPrimaryHover',
|
|
740
|
-
labelTextColor: 'accentTextPrimary',
|
|
741
|
-
labelTextColorHover: 'accentTextPrimary',
|
|
742
765
|
borderColor: 'accentBorderPrimary',
|
|
743
|
-
|
|
744
|
-
|
|
766
|
+
},
|
|
767
|
+
infoPrimary: {
|
|
768
|
+
fill: 'infoPrimary',
|
|
769
|
+
borderColor: 'infoBorderDisabled',
|
|
770
|
+
badgeAppearance: 'surfacePrimary',
|
|
771
|
+
iconFill: 'infoItemPrimary',
|
|
745
772
|
},
|
|
746
773
|
infoSecondary: {
|
|
747
774
|
fill: 'accentPrimary',
|
|
748
775
|
fillHover: 'accentPrimaryHover',
|
|
749
|
-
labelTextColor: 'accentTextSecondary',
|
|
750
|
-
labelTextColorHover: 'accentTextSecondary',
|
|
751
776
|
borderColor: 'accentBorderPrimary',
|
|
752
|
-
loaderFill: 'accentPrimary',
|
|
753
|
-
loaderItemFill: 'accentItemPrimary',
|
|
754
777
|
},
|
|
755
778
|
};
|
|
756
779
|
|
|
757
|
-
var
|
|
780
|
+
var iconAppearancePrimary = {
|
|
758
781
|
primary: {
|
|
759
782
|
fill: 'primaryPrimary',
|
|
760
783
|
fillHover: 'primaryPrimaryHover',
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
};
|
|
764
|
-
|
|
765
|
-
var titleAppearanceRequire = {
|
|
766
|
-
requirePrimary: {
|
|
767
|
-
fill: 'warningTertiary',
|
|
768
|
-
borderColor: 'warningBorderQuaternary',
|
|
769
|
-
borderHover: 'warningBorderQuaternary',
|
|
770
|
-
textColor: 'surfaceTextPrimary',
|
|
771
|
-
iconBeforeFill: 'warningItemQuaternary',
|
|
772
|
-
iconClearFill: 'warningItemPrimary',
|
|
773
|
-
placeholderTextColor: 'surfaceTextQuaternary',
|
|
784
|
+
badgeAppearance: 'surfacePrimary',
|
|
785
|
+
iconFill: 'primaryItemPrimary',
|
|
774
786
|
},
|
|
775
|
-
|
|
776
|
-
fill: '
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
placeholderTextColor: 'surfaceTextSecondary',
|
|
787
|
+
primaryPrimary: {
|
|
788
|
+
fill: 'primaryPrimary',
|
|
789
|
+
fillHover: 'primaryPrimaryHover',
|
|
790
|
+
borderColor: 'primaryBorderQuaternary',
|
|
791
|
+
badgeAppearance: 'surfacePrimary',
|
|
792
|
+
iconFill: 'primaryItemPrimary',
|
|
782
793
|
},
|
|
783
794
|
};
|
|
784
795
|
|
|
785
|
-
var
|
|
796
|
+
var iconAppearanceSecondary = {
|
|
786
797
|
secondary: {
|
|
787
798
|
fill: 'secondaryPrimary',
|
|
788
799
|
fillHover: 'secondaryPrimaryHover',
|
|
789
|
-
|
|
800
|
+
},
|
|
801
|
+
secondaryPrimary: {
|
|
802
|
+
fill: 'secondaryPrimary',
|
|
803
|
+
fillHover: 'secondaryPrimaryHover',
|
|
804
|
+
borderColor: 'secondaryBorderQuaternary',
|
|
805
|
+
badgeAppearance: 'surfacePrimary',
|
|
806
|
+
iconFill: 'secondaryItemPrimary',
|
|
790
807
|
},
|
|
791
808
|
};
|
|
792
809
|
|
|
793
|
-
var
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
iconAfterSize: '24',
|
|
799
|
-
iconBeforeFillSize: '24',
|
|
800
|
-
iconBeforeSize: '24',
|
|
810
|
+
var iconAppearanceSize = {
|
|
811
|
+
size12_12: {
|
|
812
|
+
fillSize: '12',
|
|
813
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
814
|
+
iconSize: '12',
|
|
801
815
|
},
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
iconAfterSize: '24',
|
|
807
|
-
iconBeforeFillSize: '24',
|
|
808
|
-
iconBeforeSize: '24',
|
|
816
|
+
size14_12: {
|
|
817
|
+
fillSize: '14',
|
|
818
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
819
|
+
iconSize: '12',
|
|
809
820
|
},
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
iconAfterSize: '24',
|
|
815
|
-
iconBeforeFillSize: '24',
|
|
816
|
-
iconBeforeSize: '24',
|
|
821
|
+
size14_14: {
|
|
822
|
+
fillSize: '14',
|
|
823
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
824
|
+
iconSize: '14',
|
|
817
825
|
},
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
iconAfterSize: '24',
|
|
823
|
-
iconBeforeFillSize: '24',
|
|
824
|
-
iconBeforeSize: '24',
|
|
826
|
+
size16_12: {
|
|
827
|
+
fillSize: '16',
|
|
828
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
829
|
+
iconSize: '12',
|
|
825
830
|
},
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
iconAfterSize: '20',
|
|
831
|
-
iconBeforeFillSize: '20',
|
|
832
|
-
iconBeforeSize: '20',
|
|
831
|
+
size16_14: {
|
|
832
|
+
fillSize: '16',
|
|
833
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
834
|
+
iconSize: '14',
|
|
833
835
|
},
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
iconAfterSize: '16',
|
|
839
|
-
iconBeforeFillSize: '16',
|
|
840
|
-
iconBeforeSize: '16',
|
|
836
|
+
size16_16: {
|
|
837
|
+
fillSize: '16',
|
|
838
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
839
|
+
iconSize: '16',
|
|
841
840
|
},
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
iconAfterSize: '14',
|
|
847
|
-
iconBeforeFillSize: '14',
|
|
848
|
-
iconBeforeSize: '14',
|
|
841
|
+
size20_12: {
|
|
842
|
+
fillSize: '20',
|
|
843
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
844
|
+
iconSize: '12',
|
|
849
845
|
},
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
borderColor: '0',
|
|
846
|
+
size20_14: {
|
|
847
|
+
fillSize: '20',
|
|
848
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
849
|
+
iconSize: '14',
|
|
855
850
|
},
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
851
|
+
size20_16: {
|
|
852
|
+
fillSize: '20',
|
|
853
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
854
|
+
iconSize: '16',
|
|
859
855
|
},
|
|
860
|
-
|
|
861
|
-
|
|
856
|
+
size20_20: {
|
|
857
|
+
fillSize: '20',
|
|
858
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
859
|
+
iconSize: '20',
|
|
862
860
|
},
|
|
863
|
-
|
|
864
|
-
|
|
861
|
+
size24_12: {
|
|
862
|
+
fillSize: '24',
|
|
863
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
864
|
+
iconSize: '12',
|
|
865
865
|
},
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
fill: 'successPrimary',
|
|
871
|
-
fillHover: 'successPrimaryHover',
|
|
872
|
-
labelTextColor: 'successTextSecondary',
|
|
873
|
-
labelTextColorHover: 'successTextSecondary',
|
|
874
|
-
loaderFill: 'successPrimary',
|
|
875
|
-
loaderItemFill: 'successItemPrimary',
|
|
866
|
+
size24_14: {
|
|
867
|
+
fillSize: '24',
|
|
868
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
869
|
+
iconSize: '14',
|
|
876
870
|
},
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
fill: 'surfacePrimary',
|
|
882
|
-
fillHover: 'surfacePrimaryHover',
|
|
883
|
-
labelTextColor: 'surfaceTextPrimary',
|
|
871
|
+
size24_16: {
|
|
872
|
+
fillSize: '24',
|
|
873
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
874
|
+
iconSize: '16',
|
|
884
875
|
},
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
876
|
+
size24_20: {
|
|
877
|
+
fillSize: '24',
|
|
878
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
879
|
+
iconSize: '20',
|
|
889
880
|
},
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
loaderFill: 'surfaceSecondary',
|
|
895
|
-
loaderItemFill: 'surfaceItemPrimary',
|
|
881
|
+
size24_24: {
|
|
882
|
+
fillSize: '24',
|
|
883
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
884
|
+
iconSize: '24',
|
|
896
885
|
},
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
886
|
+
size32_12: {
|
|
887
|
+
fillSize: '32',
|
|
888
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
889
|
+
iconSize: '12',
|
|
901
890
|
},
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
fill: 'warningPrimary',
|
|
907
|
-
fillHover: 'warningPrimaryHover',
|
|
908
|
-
labelTextColor: 'warningTextSecondary',
|
|
909
|
-
labelTextColorHover: 'warningTextSecondary',
|
|
910
|
-
loaderFill: 'warningPrimary',
|
|
911
|
-
loaderItemFill: 'warningItemPrimary',
|
|
891
|
+
size32_14: {
|
|
892
|
+
fillSize: '32',
|
|
893
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
894
|
+
iconSize: '14',
|
|
912
895
|
},
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
var titleConfig = {
|
|
918
|
-
appearance: titleAppearance,
|
|
919
|
-
setAppearance: function (appearanceConfig) {
|
|
920
|
-
titleConfig.appearance = appearanceConfig;
|
|
896
|
+
size32_16: {
|
|
897
|
+
fillSize: '32',
|
|
898
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
899
|
+
iconSize: '16',
|
|
921
900
|
},
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
var _a;
|
|
927
|
-
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = titleConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
928
|
-
}, {});
|
|
929
|
-
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
930
|
-
var directionClass = propsGenerator.directionClass, size = propsGenerator.size, fillClass = propsGenerator.fillClass, textAlignClass = propsGenerator.textAlignClass, textColorActiveClass = propsGenerator.textColorActiveClass, textColorClass = propsGenerator.textColorClass, textColorGradientClass = propsGenerator.textColorGradientClass, textColorHoverClass = propsGenerator.textColorHoverClass, textStyleClass = propsGenerator.textStyleClass, textTruncateClass = propsGenerator.textTruncateClass, textWeightClass = propsGenerator.textWeightClass, textWrap = propsGenerator.textWrap, dataTestId = propsGenerator.dataTestId, heightClass = propsGenerator.heightClass, 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, svgFillClass = propsGenerator.svgFillClass, svgFillHoverClass = propsGenerator.svgFillHoverClass, typeClass = propsGenerator.typeClass, widthClass = propsGenerator.widthClass, wrapperDirectionClass = propsGenerator.wrapperDirectionClass;
|
|
931
|
-
// @ts-expect-error
|
|
932
|
-
var _b = useStyles.useStyles(props), titleStyles = _b.styles, titleWrapperStyles = _b.wrapper;
|
|
933
|
-
// Element type (h1, h2, ..., h6)
|
|
934
|
-
var Tag = React.useMemo(function () {
|
|
935
|
-
if (tag) {
|
|
936
|
-
return tag;
|
|
937
|
-
}
|
|
938
|
-
return size ? size : 'span';
|
|
939
|
-
}, [tag, size]);
|
|
940
|
-
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'title', fillClass && "fill_".concat(fillClass), svgFillClass && "svg_fill_".concat(svgFillClass), svgFillHoverClass && "svg_fill_hover_".concat(svgFillHoverClass), widthClass && "width_".concat(widthClass), heightClass && "height_".concat(heightClass), size && "title_size_".concat(size), directionClass && "title_direction_".concat(directionClass), textColorClass && "text text-color_".concat(textColorClass), textColorActiveClass && "text-color_active_".concat(textColorActiveClass), textColorHoverClass && "text-color_hover_".concat(textColorHoverClass), typeClass && "title_type_".concat(typeClass), textColorGradientClass && "text-gradient_".concat(textColorGradientClass), textStyleClass && "text-style_".concat(textStyleClass), textWeightClass && "text-weight_".concat(textWeightClass), textWrap && "word-wrap_".concat(textWrap), iconBadgeValue && 'title_badge', isSkeleton && 'title_skeleton'), "data-testid": dataTestId, "data-tour": dataTour, style: titleStyles, onClick: onClick, children: [before, jsxRuntime.jsxs("span", { className: clsx(textAlignClass && "text-align_".concat(textAlignClass), wrapperDirectionClass && "title_direction_".concat(wrapperDirectionClass), 'title__wrapper', textTruncateClass && "text-truncate_".concat(textTruncateClass)), style: titleWrapperStyles, children: [(iconBefore || iconBeforeSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_before', iconBadgeValue && 'title__icon_before-badge'), fill: iconBeforeFill, fillSize: iconBeforeFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_before_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconBeforeFillIcon, iconSize: iconBeforeSize, imageSrc: iconBeforeSrc, shape: iconBeforeShape, SvgImage: iconBefore })), beforeWrapper, children || text, afterWrapper, (iconAfter || iconAfterSrc) && (jsxRuntime.jsx(Icon, { className: clsx('title__icon_after', iconBadgeValue && 'title__icon_after-badge'), fill: iconAfterFill, fillSize: iconAfterFillSize, badgeAppearance: iconBadgeAppearance, badgeClass: 'title__icon_after_badge', badgeShape: iconBadgeShape, badgeSize: iconBadgeSize, badgeTextColor: iconBadgeTextColor, badgeTextSize: iconBadgeTextSize, badgeValue: iconBadgeValue, iconFill: iconAfterFillIcon, iconSize: iconAfterSize, imageSrc: iconAfterSrc, shape: iconAfterShape, SvgImage: iconAfter }))] }), after] }));
|
|
941
|
-
}
|
|
942
|
-
|
|
943
|
-
var tooltipAppearanceDefault = {
|
|
944
|
-
defaultPrimary: {
|
|
945
|
-
fill: 'surfacePrimary',
|
|
946
|
-
fillHover: 'surfacePrimaryHover',
|
|
947
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
948
|
-
borderColor: 'surfaceBorderPrimary',
|
|
949
|
-
textColor: 'surfaceTextPrimary',
|
|
901
|
+
size32_20: {
|
|
902
|
+
fillSize: '32',
|
|
903
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
904
|
+
iconSize: '20',
|
|
950
905
|
},
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
fill: 'surfaceDisabled',
|
|
956
|
-
fillHover: 'surfaceDisabledHover',
|
|
957
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
958
|
-
textColor: 'surfaceTextPrimary',
|
|
906
|
+
size32_24: {
|
|
907
|
+
fillSize: '32',
|
|
908
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
909
|
+
iconSize: '24',
|
|
959
910
|
},
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
fill: 'errorPrimary',
|
|
965
|
-
fillHover: 'errorPrimaryHover',
|
|
966
|
-
titleTextColor: 'errorTextPrimary',
|
|
967
|
-
borderColor: 'errorBorderPrimary',
|
|
968
|
-
textColor: 'errorTextPrimary',
|
|
911
|
+
size32_32: {
|
|
912
|
+
fillSize: '32',
|
|
913
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
914
|
+
iconSize: '32',
|
|
969
915
|
},
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
fill: 'warningPrimary',
|
|
975
|
-
fillHover: 'warningPrimaryHover',
|
|
976
|
-
titleTextColor: 'warningTextPrimary',
|
|
977
|
-
borderColor: 'warningBorderPrimary',
|
|
978
|
-
textColor: 'warningTextPrimary',
|
|
916
|
+
size40_12: {
|
|
917
|
+
fillSize: '40',
|
|
918
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
919
|
+
iconSize: '12',
|
|
979
920
|
},
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
size: 'l',
|
|
985
|
-
titleSize: 'h5',
|
|
986
|
-
textSize: 's',
|
|
921
|
+
size40_14: {
|
|
922
|
+
fillSize: '40',
|
|
923
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
924
|
+
iconSize: '14',
|
|
987
925
|
},
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
926
|
+
size40_16: {
|
|
927
|
+
fillSize: '40',
|
|
928
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
929
|
+
iconSize: '16',
|
|
992
930
|
},
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
931
|
+
size40_20: {
|
|
932
|
+
fillSize: '40',
|
|
933
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
934
|
+
iconSize: '20',
|
|
935
|
+
},
|
|
936
|
+
size40_24: {
|
|
937
|
+
fillSize: '40',
|
|
938
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
939
|
+
iconSize: '24',
|
|
940
|
+
},
|
|
941
|
+
size40_32: {
|
|
942
|
+
fillSize: '40',
|
|
943
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
944
|
+
iconSize: '32',
|
|
945
|
+
},
|
|
946
|
+
size40_40: {
|
|
947
|
+
fillSize: '40',
|
|
948
|
+
badgeAppearanceSize: 'sizeXXS',
|
|
949
|
+
iconSize: '40',
|
|
997
950
|
},
|
|
998
951
|
};
|
|
999
952
|
|
|
1000
|
-
var
|
|
953
|
+
var iconAppearanceStyle = {
|
|
1001
954
|
solid: {
|
|
1002
955
|
borderColor: 'none',
|
|
1003
956
|
},
|
|
@@ -1011,83 +964,119 @@ var tooltipAppearanceStyle = {
|
|
|
1011
964
|
},
|
|
1012
965
|
};
|
|
1013
966
|
|
|
1014
|
-
var
|
|
967
|
+
var iconAppearanceSuccess = {
|
|
968
|
+
success: {
|
|
969
|
+
fill: 'successPrimary',
|
|
970
|
+
fillHover: 'successHover',
|
|
971
|
+
},
|
|
1015
972
|
successPrimary: {
|
|
1016
973
|
fill: 'successPrimary',
|
|
1017
|
-
fillHover: '
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
974
|
+
fillHover: 'successHover',
|
|
975
|
+
borderColor: 'successBorderHover',
|
|
976
|
+
badgeAppearance: 'surfacePrimary',
|
|
977
|
+
iconFill: 'successItemPrimary',
|
|
1021
978
|
},
|
|
1022
979
|
};
|
|
1023
980
|
|
|
1024
|
-
var
|
|
981
|
+
var iconAppearanceSurface = {
|
|
982
|
+
surfacePrimary: {
|
|
983
|
+
fill: 'surfacePrimary',
|
|
984
|
+
fillHover: 'surfaceSecondary',
|
|
985
|
+
borderColor: 'surfaceBorderTertiary',
|
|
986
|
+
badgeAppearance: 'surfacePrimary',
|
|
987
|
+
iconFill: 'surfaceItemPrimary',
|
|
988
|
+
},
|
|
989
|
+
surfaceSecondary: {
|
|
990
|
+
fill: 'surfaceSecondary',
|
|
991
|
+
fillHover: 'surfaceSecondaryHover',
|
|
992
|
+
badgeAppearance: 'accentPrimary',
|
|
993
|
+
iconFill: 'surfaceItemPrimary',
|
|
994
|
+
},
|
|
995
|
+
surfaceTertiary: {
|
|
996
|
+
fill: 'surfaceTertiary',
|
|
997
|
+
fillHover: 'surfaceTertiaryHover',
|
|
998
|
+
badgeAppearance: 'accentPrimary',
|
|
999
|
+
iconFill: 'surfaceItemPrimary',
|
|
1000
|
+
},
|
|
1001
|
+
surfaceQuaternary: {
|
|
1002
|
+
fill: 'surfaceQuaternary',
|
|
1003
|
+
fillHover: 'surfaceHover',
|
|
1004
|
+
badgeAppearance: 'accentPrimary',
|
|
1005
|
+
iconFill: 'surfaceItemPrimary',
|
|
1006
|
+
},
|
|
1007
|
+
};
|
|
1025
1008
|
|
|
1026
|
-
var
|
|
1027
|
-
|
|
1009
|
+
var iconAppearanceWarning = {
|
|
1010
|
+
warning: {
|
|
1011
|
+
fill: 'warningPrimary',
|
|
1012
|
+
fillHover: 'warningHover',
|
|
1013
|
+
badgeAppearance: 'surfacePrimary',
|
|
1014
|
+
iconFill: 'warningItemPrimary',
|
|
1015
|
+
},
|
|
1016
|
+
warningPrimary: {
|
|
1017
|
+
fill: 'warningPrimary',
|
|
1018
|
+
fillHover: 'warningHover',
|
|
1019
|
+
borderColor: 'warningBorderSecondary',
|
|
1020
|
+
badgeAppearance: 'surfacePrimary',
|
|
1021
|
+
iconFill: 'warningItemPrimary',
|
|
1022
|
+
},
|
|
1023
|
+
};
|
|
1024
|
+
|
|
1025
|
+
var iconAppearance = tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign(tslib_es6.__assign({}, iconAppearanceDisabled), iconAppearanceSize), iconAppearanceStyle), iconAppearanceAccent), iconAppearanceDanger), iconAppearanceError), iconAppearanceInfo), iconAppearancePrimary), iconAppearanceSecondary), iconAppearanceSuccess), iconAppearanceSurface), iconAppearanceWarning);
|
|
1026
|
+
|
|
1027
|
+
var iconConfig = {
|
|
1028
|
+
appearance: iconAppearance,
|
|
1028
1029
|
setAppearance: function (appearanceConfig) {
|
|
1029
|
-
|
|
1030
|
+
iconConfig.appearance = appearanceConfig;
|
|
1030
1031
|
},
|
|
1031
1032
|
};
|
|
1032
|
-
var
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
var
|
|
1036
|
-
var
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
var openTooltip = React.useCallback(function () {
|
|
1042
|
-
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
1043
|
-
if (tooltipTimeoutHideRef.current) {
|
|
1044
|
-
clearTimeout(tooltipTimeoutHideRef.current);
|
|
1033
|
+
var Icon = urlWithAssetPrefix.urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
|
|
1034
|
+
// TODO: Tooltip doesn't work that anymore
|
|
1035
|
+
// const [isTooltipVisible, setIsTooltipVisible] = useState(false)
|
|
1036
|
+
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;
|
|
1037
|
+
var ImageComponent = React.useMemo(function () {
|
|
1038
|
+
if (SvgImage) {
|
|
1039
|
+
var sizes = {};
|
|
1040
|
+
if (width) {
|
|
1041
|
+
sizes.width = width;
|
|
1045
1042
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
}
|
|
1043
|
+
if (height) {
|
|
1044
|
+
sizes.height = height;
|
|
1045
|
+
}
|
|
1046
|
+
return jsxRuntime.jsx(SvgImage, tslib_es6.__assign({}, sizes));
|
|
1049
1047
|
}
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1048
|
+
if (imageSrc) {
|
|
1049
|
+
if (imageSrc.endsWith('.svg')) {
|
|
1050
|
+
return jsxRuntime.jsx(SVG, { src: imageSrc, preProcessor: removeFillStroke });
|
|
1051
|
+
}
|
|
1052
|
+
return jsxRuntime.jsx("img", { src: imageSrc });
|
|
1054
1053
|
}
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
// @ts-expect-error
|
|
1059
|
-
setIsTooltipVisible(function (prevState) {
|
|
1060
|
-
var newState = false;
|
|
1061
|
-
if (prevState === true) {
|
|
1062
|
-
isTooltipCloseAnimationInProgressRef.current = true;
|
|
1063
|
-
}
|
|
1064
|
-
return newState;
|
|
1065
|
-
});
|
|
1066
|
-
}, closeTimeoutDelay);
|
|
1067
|
-
}, [closeTimeoutDelay]);
|
|
1068
|
-
var onAnimationEnd = React.useCallback(function () {
|
|
1069
|
-
isTooltipCloseAnimationInProgressRef.current = false;
|
|
1070
|
-
}, []);
|
|
1071
|
-
React.useImperativeHandle(ref, function () { return ({
|
|
1072
|
-
get tooltipElement() {
|
|
1073
|
-
return tooltipElementRef.current;
|
|
1074
|
-
},
|
|
1075
|
-
openTooltip: openTooltip,
|
|
1076
|
-
closeTooltip: closeTooltip,
|
|
1077
|
-
isTooltipVisible: isTooltipVisible,
|
|
1078
|
-
}); }, [isTooltipVisible, openTooltip, closeTooltip]);
|
|
1079
|
-
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
1080
|
-
var _a;
|
|
1081
|
-
return (tslib_es6.__assign(tslib_es6.__assign({}, resultConfig), (_a = tooltipConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
1082
|
-
}, {});
|
|
1054
|
+
return null;
|
|
1055
|
+
}, [SvgImage, width, height, imageSrc]);
|
|
1056
|
+
var appearanceConfig = useAppearanceConfig.useAppearanceConfig(appearance, iconConfig);
|
|
1083
1057
|
var propsGenerator = useDevicePropsGenerator.useDevicePropsGenerator(props, appearanceConfig);
|
|
1084
|
-
var
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1058
|
+
var alignmentClass = propsGenerator.alignmentClass, fillActiveClass = propsGenerator.fillActiveClass, fillActiveHoverClass = propsGenerator.fillActiveHoverClass, fillClass = propsGenerator.fillClass, fillDisabledClass = propsGenerator.fillDisabledClass, fillHoverClass = propsGenerator.fillHoverClass, fillSizeClass = propsGenerator.fillSizeClass, borderColorClass = propsGenerator.borderColorClass, borderColorHoverClass = propsGenerator.borderColorHoverClass, borderTypeClass = propsGenerator.borderTypeClass, borderWidthClass = propsGenerator.borderWidthClass, iconFillDisabledClass = propsGenerator.iconFillDisabledClass, badgeAppearance = propsGenerator.badgeAppearance, badgeAppearanceSize = propsGenerator.badgeAppearanceSize, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, centeringClass = propsGenerator.centeringClass, cursorClass = propsGenerator.cursorClass, iconFillActiveClass = propsGenerator.iconFillActiveClass, iconFillActiveHoverClass = propsGenerator.iconFillActiveHoverClass, iconFillClass = propsGenerator.iconFillClass, iconFillHoverClass = propsGenerator.iconFillHoverClass, iconSizeClass = propsGenerator.iconSizeClass, shapeClass = propsGenerator.shapeClass, tooltipAppearance = propsGenerator.tooltipAppearance, tooltipText = propsGenerator.tooltipText, tooltipTextSize = propsGenerator.tooltipTextSize, tooltipTitle = propsGenerator.tooltipTitle, tooltipTitleSize = propsGenerator.tooltipTitleSize;
|
|
1059
|
+
var iconStyles = useStyles.useStyles(props).styles;
|
|
1060
|
+
return (jsxRuntime.jsxs("div", { id: id, className: clsx(className, 'icon', !isActive
|
|
1061
|
+
? fillClass && "fill_".concat(fillClass)
|
|
1062
|
+
: fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
|
|
1063
|
+
? fillHoverClass && "fill_hover_".concat(fillHoverClass)
|
|
1064
|
+
: fillActiveHoverClass &&
|
|
1065
|
+
"fill_active_hover_".concat(fillActiveHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isActive
|
|
1066
|
+
? iconFillClass && "icon_fill_".concat(iconFillClass)
|
|
1067
|
+
: iconFillActiveClass && "icon_fill_active_".concat(iconFillActiveClass), !isActive
|
|
1068
|
+
? iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass)
|
|
1069
|
+
: iconFillActiveHoverClass &&
|
|
1070
|
+
"icon_fill_active_hover_".concat(iconFillActiveHoverClass), isDisabled &&
|
|
1071
|
+
iconFillDisabledClass &&
|
|
1072
|
+
"icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass &&
|
|
1073
|
+
"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] }));
|
|
1074
|
+
}));
|
|
1075
|
+
var removeFillStroke = function (code) {
|
|
1076
|
+
return code
|
|
1077
|
+
.replace(/fill=".*?"/g, 'fill=""')
|
|
1078
|
+
.replace(/stroke=".*?"/g, 'stroke=""');
|
|
1079
|
+
};
|
|
1091
1080
|
|
|
1092
1081
|
exports.Badge = Badge;
|
|
1093
1082
|
exports.Icon = Icon;
|