@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.
Files changed (172) hide show
  1. package/dist/{Avatar_cjs_BbeDJ-No.js → Avatar_cjs_Bp8wjwGw.js} +8 -10
  2. package/dist/{Avatar_es_B1Ao9Im_.js → Avatar_es_BIKf0hNV.js} +7 -9
  3. package/dist/{Button_cjs_Bzx1GdT5.js → Button_cjs_Chn18eOU.js} +104 -10
  4. package/dist/{Button_es_DhCLxWhq.js → Button_es_XnWb2XF3.js} +103 -9
  5. package/dist/{ChipsGroup_cjs_p99H-9a8.js → ChipsGroup_cjs_Deoz_rju.js} +9 -9
  6. package/dist/{ChipsGroup_es_CWq3TR_1.js → ChipsGroup_es_C1Qi_5A1.js} +8 -8
  7. package/dist/{DatePicker_cjs_Cq8vqj3E.js → DatePicker_cjs_B24qHiks.js} +13 -16
  8. package/dist/{DatePicker_es_DYs71cnU.js → DatePicker_es_BuC8mEcK.js} +10 -13
  9. package/dist/{Divider_cjs_BmCJj3TN.js → Divider_cjs_rxMMBfLC.js} +3 -5
  10. package/dist/{Divider_es_kY-30pft.js → Divider_es_CiRU0sTz.js} +3 -5
  11. package/dist/{DropdownItem_cjs_B1gGciTB.js → DropdownItem_cjs_DuqySfbd.js} +6 -8
  12. package/dist/{DropdownItem_es_JVT4f6Nb.js → DropdownItem_es_BBxfR35q.js} +5 -7
  13. package/dist/{Group_cjs_Cwt0gWk4.js → Group_cjs_CDLfU5D2.js} +5 -8
  14. package/dist/{Group_es_CYW2Hquh.js → Group_es_DSZxyI1e.js} +5 -8
  15. package/dist/{Tooltip_cjs_BBwH8sjA.js → Icon_cjs_DRZih-pc.js} +588 -599
  16. package/dist/{Tooltip_es_Y2aoFQW7.js → Icon_es_k9bHSLyL.js} +588 -599
  17. package/dist/{Input_cjs_CPmXkQGd.js → Input_cjs_BGLd0EQu.js} +3 -5
  18. package/dist/{Input_es_D9Y1Rj5Y.js → Input_es_D2mNCqiH.js} +3 -5
  19. package/dist/{Label_cjs_Mb8j2bLu.js → Label_cjs_D70CHJDE.js} +6 -8
  20. package/dist/{Label_es_CIDBUVgO.js → Label_es_HXrap3A4.js} +5 -7
  21. package/dist/{Link_cjs_DbRGq2Yk.js → Link_cjs_BqT6eVl6.js} +2 -4
  22. package/dist/{Link_es_DxtZLeKY.js → Link_es_BnUIX0QT.js} +2 -4
  23. package/dist/{Loader_cjs_Ca4i0sER.js → Loader_cjs_BShrE-Nb.js} +5 -7
  24. package/dist/{Loader_es_GYOr0UTX.js → Loader_es_BDb87cdb.js} +5 -7
  25. package/dist/{Overlay_cjs_CFOtnzDU.js → Overlay_cjs_BMrkRg7M.js} +3 -5
  26. package/dist/{Overlay_es_DczPjVL9.js → Overlay_es_D_izIIUB.js} +3 -5
  27. package/dist/{Text_cjs_C9fOm0nd.js → Text_cjs_BlNeIm_v.js} +5 -7
  28. package/dist/{Text_es_BfLRfj-5.js → Text_es_Ffjr5J1k.js} +5 -7
  29. package/dist/cjs/components/Accordion.js +7 -9
  30. package/dist/cjs/components/Avatar.js +9 -8
  31. package/dist/cjs/components/AvatarStack.js +8 -10
  32. package/dist/cjs/components/Badge.js +11 -10
  33. package/dist/cjs/components/Breadcrumbs.js +6 -8
  34. package/dist/cjs/components/Button.js +11 -10
  35. package/dist/cjs/components/Cell.js +8 -10
  36. package/dist/cjs/components/Checkbox.js +4 -6
  37. package/dist/cjs/components/Checkmark.js +3 -5
  38. package/dist/cjs/components/Chips.js +4 -4
  39. package/dist/cjs/components/Choice.js +9 -11
  40. package/dist/cjs/components/Code.js +3 -5
  41. package/dist/cjs/components/CookiesWarning.js +12 -14
  42. package/dist/cjs/components/Dadata.js +2 -1
  43. package/dist/cjs/components/DatePeriod.js +12 -15
  44. package/dist/cjs/components/DatePicker.js +9 -8
  45. package/dist/cjs/components/Divider.js +4 -3
  46. package/dist/cjs/components/Drawer.js +13 -15
  47. package/dist/cjs/components/Dropdown.js +6 -5
  48. package/dist/cjs/components/Group.js +3 -2
  49. package/dist/cjs/components/HeroTitle.js +7 -9
  50. package/dist/cjs/components/Icon.js +11 -10
  51. package/dist/cjs/components/Input.js +3 -2
  52. package/dist/cjs/components/InputPassword.js +9 -11
  53. package/dist/cjs/components/Label.js +6 -5
  54. package/dist/cjs/components/Link.js +2 -1
  55. package/dist/cjs/components/List.js +4 -6
  56. package/dist/cjs/components/Loader.js +5 -4
  57. package/dist/cjs/components/Logo.js +4 -6
  58. package/dist/cjs/components/MenuItem.js +31 -10
  59. package/dist/cjs/components/Modal.js +10 -12
  60. package/dist/cjs/components/Notification.js +7 -9
  61. package/dist/cjs/components/Overlay.js +4 -3
  62. package/dist/cjs/components/Pagination.js +10 -12
  63. package/dist/cjs/components/Radio.js +4 -6
  64. package/dist/cjs/components/Response.js +8 -10
  65. package/dist/cjs/components/Search.js +7 -9
  66. package/dist/cjs/components/Segmented.js +12 -14
  67. package/dist/cjs/components/Select.js +15 -22
  68. package/dist/cjs/components/Swiper.js +5 -4
  69. package/dist/cjs/components/Switch.js +4 -6
  70. package/dist/cjs/components/Tab.js +8 -10
  71. package/dist/cjs/components/Text.js +4 -3
  72. package/dist/cjs/components/Textarea.js +3 -5
  73. package/dist/cjs/components/Tile.js +7 -9
  74. package/dist/cjs/components/Title.js +11 -10
  75. package/dist/cjs/components/Tooltip.js +11 -10
  76. package/dist/cjs/components/Warning.js +168 -0
  77. package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +4 -6
  78. package/dist/components/Accordion.js +6 -8
  79. package/dist/components/Avatar.js +9 -8
  80. package/dist/components/AvatarStack.js +8 -10
  81. package/dist/components/Badge.js +8 -7
  82. package/dist/components/Breadcrumbs.js +5 -7
  83. package/dist/components/Button.js +11 -10
  84. package/dist/components/Cell.js +7 -9
  85. package/dist/components/Checkbox.js +4 -6
  86. package/dist/components/Checkmark.js +3 -5
  87. package/dist/components/Chips.js +4 -4
  88. package/dist/components/Choice.js +7 -9
  89. package/dist/components/Code.js +3 -5
  90. package/dist/components/CookiesWarning.js +12 -14
  91. package/dist/components/Dadata.js +2 -1
  92. package/dist/components/DatePeriod.js +12 -15
  93. package/dist/components/DatePicker.js +9 -8
  94. package/dist/components/Divider.js +4 -3
  95. package/dist/components/Drawer.js +12 -14
  96. package/dist/components/Dropdown.js +6 -5
  97. package/dist/components/Group.js +3 -2
  98. package/dist/components/HeroTitle.js +6 -8
  99. package/dist/components/Icon.js +8 -7
  100. package/dist/components/Input.js +3 -2
  101. package/dist/components/InputPassword.js +8 -10
  102. package/dist/components/Label.js +6 -5
  103. package/dist/components/Link.js +2 -1
  104. package/dist/components/List.js +4 -6
  105. package/dist/components/Loader.js +5 -4
  106. package/dist/components/Logo.js +4 -6
  107. package/dist/components/MenuItem.js +29 -8
  108. package/dist/components/Modal.js +9 -11
  109. package/dist/components/Notification.js +6 -8
  110. package/dist/components/Overlay.js +4 -3
  111. package/dist/components/Pagination.js +8 -10
  112. package/dist/components/Radio.js +4 -6
  113. package/dist/components/Response.js +8 -10
  114. package/dist/components/Search.js +5 -7
  115. package/dist/components/Segmented.js +10 -12
  116. package/dist/components/Select.js +11 -18
  117. package/dist/components/Swiper.js +4 -3
  118. package/dist/components/Switch.js +4 -6
  119. package/dist/components/Tab.js +7 -9
  120. package/dist/components/Text.js +4 -3
  121. package/dist/components/Textarea.js +3 -5
  122. package/dist/components/Tile.js +6 -8
  123. package/dist/components/Title.js +8 -7
  124. package/dist/components/Tooltip.js +8 -7
  125. package/dist/components/Warning.js +164 -0
  126. package/dist/css/components/MenuItem/MenuItem.css +2 -2
  127. package/dist/css/components/Warning/Warning.css +52 -0
  128. package/dist/css/mixins/mixin_utils.css +16 -0
  129. package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +4 -6
  130. package/dist/stories/Overview.mdx +6 -6
  131. package/dist/stories/Playground.mdx +5 -5
  132. package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSize.d.ts +7 -7
  133. package/dist/types/components/Button/appearance/buttonAccent.d.ts +11 -0
  134. package/dist/types/components/Button/appearance/buttonDanger.d.ts +11 -0
  135. package/dist/types/components/Button/appearance/buttonError.d.ts +11 -0
  136. package/dist/types/components/Button/appearance/buttonInfo.d.ts +11 -0
  137. package/dist/types/components/Button/appearance/buttonPrimary.d.ts +10 -0
  138. package/dist/types/components/Button/appearance/buttonSecondary.d.ts +10 -0
  139. package/dist/types/components/Button/appearance/buttonSuccess.d.ts +11 -0
  140. package/dist/types/components/Button/appearance/buttonSurface.d.ts +10 -0
  141. package/dist/types/components/Button/appearance/buttonWarning.d.ts +11 -0
  142. package/dist/types/components/Chips/stories/__mock__/index.d.ts +1 -1
  143. package/dist/types/components/Choice/stories/__mock__/index.d.ts +3 -3
  144. package/dist/types/components/CookiesWarning/CookiesWarning.d.ts +1 -0
  145. package/dist/types/components/DatePicker/DatePicker.appearance.d.ts +6 -6
  146. package/dist/types/components/DatePicker/appearance/datePickerSize.d.ts +6 -6
  147. package/dist/types/components/Drawer/appearance/drawerSurface.d.ts +1 -1
  148. package/dist/types/components/Dropdown/stories/__mock__/index.d.ts +6 -6
  149. package/dist/types/components/MenuItem/appearance/menuItemAccent.d.ts +8 -0
  150. package/dist/types/components/MenuItem/appearance/menuItemError.d.ts +7 -0
  151. package/dist/types/components/MenuItem/appearance/menuItemSurface.d.ts +8 -0
  152. package/dist/types/components/Notification/appearance/notificationDefault.d.ts +1 -1
  153. package/dist/types/components/Notification/appearance/notificationError.d.ts +1 -1
  154. package/dist/types/components/Notification/appearance/notificationInfo.d.ts +1 -1
  155. package/dist/types/components/Notification/appearance/notificationSuccess.d.ts +1 -1
  156. package/dist/types/components/Notification/appearance/notificationWarning.d.ts +1 -1
  157. package/dist/types/components/Pagination/appearance/paginationSize.d.ts +16 -16
  158. package/dist/types/components/Search/appearance/searchSize.d.ts +12 -12
  159. package/dist/types/components/Segmented/stories/__mock__/index.d.ts +8 -8
  160. package/dist/types/components/Tab/stories/__mock__/index.d.ts +1 -1
  161. package/dist/types/components/Warning/Warning.appearance.d.ts +101 -0
  162. package/dist/types/components/Warning/Warning.d.ts +4 -0
  163. package/dist/types/components/Warning/Warning.interface.d.ts +41 -0
  164. package/dist/types/components/Warning/appearance/warningAccent.d.ts +23 -0
  165. package/dist/types/components/Warning/appearance/warningError.d.ts +23 -0
  166. package/dist/types/components/Warning/appearance/warningInfo.d.ts +23 -0
  167. package/dist/types/components/Warning/appearance/warningSize.d.ts +11 -0
  168. package/dist/types/components/Warning/appearance/warningStyle.d.ts +14 -0
  169. package/dist/types/components/Warning/appearance/warningWarning.d.ts +23 -0
  170. package/dist/types/components/Warning/index.d.ts +2 -0
  171. package/dist/types/hooks/useAppearanceConfig/useAppearanceConfig.d.ts +1 -3
  172. package/package.json +13 -12
@@ -2,12 +2,13 @@ import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
2
2
  import { jsxs, jsx } from 'react/jsx-runtime';
3
3
  import React, { useMemo, useRef, useState, useCallback, useImperativeHandle } from 'react';
4
4
  import clsx from 'clsx';
5
- import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
6
- import { useStyles } from './hooks/useStyles/useStyles.js';
7
- import { T as Text } from './Text_es_BfLRfj-5.js';
8
5
  import SVG from 'react-inlinesvg';
9
6
  import { urlWithAssetPrefix } from './hoc/urlWithAssetPrefix.js';
10
- import { a as LinkWrapper } from './Link_es_DxtZLeKY.js';
7
+ import { useAppearanceConfig } from './hooks/useAppearanceConfig/useAppearanceConfig.js';
8
+ import { useDevicePropsGenerator } from './hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
9
+ import { useStyles } from './hooks/useStyles/useStyles.js';
10
+ import { a as LinkWrapper } from './Link_es_BnUIX0QT.js';
11
+ import { T as Text } from './Text_es_Ffjr5J1k.js';
11
12
 
12
13
  var badgeAppearanceAccent = {
13
14
  accent: {
@@ -261,10 +262,7 @@ var badgeConfig = {
261
262
  };
262
263
  function Badge(props) {
263
264
  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;
264
- var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
265
- var _a;
266
- return (__assign(__assign({}, resultConfig), (_a = badgeConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
267
- }, {});
265
+ var appearanceConfig = useAppearanceConfig(appearance, badgeConfig);
268
266
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
269
267
  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;
270
268
  // @ts-expect-error
@@ -284,265 +282,326 @@ function Badge(props) {
284
282
  (value && (jsx(Text, { className: "badge__value", size: textSize, textColor: textColor, children: value })))] }));
285
283
  }
286
284
 
287
- var iconAppearanceAccent = {
285
+ var titleAppearanceAccent = {
288
286
  accent: {
289
287
  fill: 'accentPrimary',
290
- fillHover: 'accentHover',
291
- borderColor: 'accentBorderPrimary',
292
- badgeAppearance: 'surfacePrimary',
293
- iconFill: 'accentItemPrimary',
288
+ fillHover: 'accentPrimaryHover',
294
289
  },
295
290
  accentPrimary: {
296
291
  fill: 'accentPrimary',
297
- fillHover: 'accentHover',
292
+ fillHover: 'accentPrimaryHover',
298
293
  borderColor: 'accentBorderPrimary',
299
- badgeAppearance: 'surfacePrimary',
300
- iconFill: 'accentItemPrimary',
301
294
  },
302
295
  accentSecondary: {
303
296
  fill: 'accentPrimary',
304
- fillHover: 'accentHover',
297
+ fillHover: 'accentPrimaryHover',
298
+ labelTextColor: 'accentTextSecondary',
299
+ labelTextColorHover: 'accentTextSecondary',
305
300
  borderColor: 'accentBorderPrimary',
306
- iconFill: 'accentItemPrimary',
301
+ loaderItemFill: 'accentItemPrimary',
307
302
  },
308
303
  };
309
304
 
310
- var iconAppearanceDanger = {
305
+ var titleAppearanceDanger = {
311
306
  danger: {
312
307
  fill: 'dangerPrimary',
313
- fillHover: 'dangerHover',
314
- },
315
- dangerPrimary: {
316
- fill: 'dangerPrimary',
317
- fillHover: 'dangerHover',
318
- borderColor: 'dangerBorderSecondary',
319
- badgeAppearance: 'surfacePrimary',
320
- iconFill: 'dangerItemPrimary',
308
+ fillHover: 'dangerPrimaryHover',
321
309
  },
322
310
  };
323
311
 
324
- var iconAppearanceDisabled = {
325
- danger: {
326
- fill: 'dangerPrimary',
327
- fillHover: 'dangerHover',
328
- },
312
+ var titleAppearanceDisabled = {
329
313
  disabledPrimary: {
330
- fill: 'surfaceDisabled',
331
- borderColor: 'surfaceBorderDisabled',
332
- badgeAppearance: 'surfacePrimary',
333
- iconFill: 'surfaceItemQuaternary',
314
+ fill: 'surfaceFillDisabled',
315
+ borderColor: 'errorBorderQuaternary',
316
+ borderHover: 'errorBorderQuaternary',
317
+ textColor: 'surfaceTextQuaternary',
318
+ iconBeforeFill: 'errorItemQuaternary',
319
+ iconClearFill: 'errorItemPrimary',
320
+ placeholderTextColor: 'surfaceTextQuaternary',
321
+ },
322
+ disabledSecondary: {
323
+ fill: 'surfaceSecondary',
324
+ borderColor: 'surfaceBorderTertiary',
325
+ borderHover: 'surfaceBorderQuaternary',
326
+ iconBeforeFill: 'surfaceItemQuaternary',
327
+ iconClearFill: 'surfaceItemPrimary',
328
+ placeholderTextColor: 'surfaceTextSecondary',
334
329
  },
335
330
  };
336
331
 
337
- var iconAppearanceError = {
332
+ var titleAppearanceError = {
338
333
  error: {
339
334
  fill: 'errorPrimary',
340
- fillHover: 'errorHover',
341
- badgeAppearance: 'surfacePrimary',
342
- iconFill: 'errorItemPrimary',
343
- },
344
- errorPrimary: {
345
- fill: 'errorPrimary',
346
- fillHover: 'errorHover',
347
- borderColor: 'errorBorderPrimary',
348
- badgeAppearance: 'surfacePrimary',
349
- iconFill: 'errorItemPrimary',
335
+ fillHover: 'errorPrimaryHover',
336
+ labelTextColor: 'errorTextPrimary',
337
+ labelTextColorHover: 'errorTextPrimary',
338
+ loaderFill: 'errorPrimary',
339
+ loaderItemFill: 'errorItemPrimary',
350
340
  },
351
341
  };
352
342
 
353
- var iconAppearanceInfo = {
343
+ var titleAppearanceInfo = {
354
344
  info: {
355
345
  fill: 'accentPrimary',
356
346
  fillHover: 'accentPrimaryHover',
347
+ labelTextColor: 'accentTextPrimary',
348
+ labelTextColorHover: 'accentTextPrimary',
357
349
  borderColor: 'accentBorderPrimary',
358
- },
359
- infoPrimary: {
360
- fill: 'infoPrimary',
361
- borderColor: 'infoBorderDisabled',
362
- badgeAppearance: 'surfacePrimary',
363
- iconFill: 'infoItemPrimary',
350
+ loaderFill: 'accentPrimary',
351
+ loaderItemFill: 'accentItemPrimary',
364
352
  },
365
353
  infoSecondary: {
366
354
  fill: 'accentPrimary',
367
355
  fillHover: 'accentPrimaryHover',
356
+ labelTextColor: 'accentTextSecondary',
357
+ labelTextColorHover: 'accentTextSecondary',
368
358
  borderColor: 'accentBorderPrimary',
359
+ loaderFill: 'accentPrimary',
360
+ loaderItemFill: 'accentItemPrimary',
369
361
  },
370
362
  };
371
363
 
372
- var iconAppearancePrimary = {
364
+ var titleAppearancePrimary = {
373
365
  primary: {
374
366
  fill: 'primaryPrimary',
375
367
  fillHover: 'primaryPrimaryHover',
376
- badgeAppearance: 'surfacePrimary',
377
- iconFill: 'primaryItemPrimary',
368
+ labelTextColor: 'primaryTextPrimary',
378
369
  },
379
- primaryPrimary: {
380
- fill: 'primaryPrimary',
381
- fillHover: 'primaryPrimaryHover',
382
- borderColor: 'primaryBorderQuaternary',
383
- badgeAppearance: 'surfacePrimary',
384
- iconFill: 'primaryItemPrimary',
370
+ };
371
+
372
+ var titleAppearanceRequire = {
373
+ requirePrimary: {
374
+ fill: 'warningTertiary',
375
+ borderColor: 'warningBorderQuaternary',
376
+ borderHover: 'warningBorderQuaternary',
377
+ textColor: 'surfaceTextPrimary',
378
+ iconBeforeFill: 'warningItemQuaternary',
379
+ iconClearFill: 'warningItemPrimary',
380
+ placeholderTextColor: 'surfaceTextQuaternary',
381
+ },
382
+ requireSecondary: {
383
+ fill: 'surfaceSecondary',
384
+ borderColor: 'surfaceBorderTertiary',
385
+ borderHover: 'surfaceBorderQuaternary',
386
+ iconBeforeFill: 'surfaceItemQuaternary',
387
+ iconClearFill: 'surfaceItemPrimary',
388
+ placeholderTextColor: 'surfaceTextSecondary',
385
389
  },
386
390
  };
387
391
 
388
- var iconAppearanceSecondary = {
392
+ var titleAppearanceSecondary = {
389
393
  secondary: {
390
394
  fill: 'secondaryPrimary',
391
395
  fillHover: 'secondaryPrimaryHover',
392
- },
393
- secondaryPrimary: {
394
- fill: 'secondaryPrimary',
395
- fillHover: 'secondaryPrimaryHover',
396
- borderColor: 'secondaryBorderQuaternary',
397
- badgeAppearance: 'surfacePrimary',
398
- iconFill: 'secondaryItemPrimary',
396
+ labelTextColor: 'secondaryTextPrimary',
399
397
  },
400
398
  };
401
399
 
402
- var iconAppearanceSize = {
403
- size12_12: {
404
- fillSize: '12',
405
- badgeAppearanceSize: 'sizeXXS',
406
- iconSize: '12',
407
- },
408
- size14_12: {
409
- fillSize: '14',
410
- badgeAppearanceSize: 'sizeXXS',
411
- iconSize: '12',
400
+ var titleAppearanceSize = {
401
+ sizeXXL: {
402
+ size: 'xxl',
403
+ labelTextSize: 'xxl',
404
+ iconAfterFillSize: '24',
405
+ iconAfterSize: '24',
406
+ iconBeforeFillSize: '24',
407
+ iconBeforeSize: '24',
412
408
  },
413
- size14_14: {
414
- fillSize: '14',
415
- badgeAppearanceSize: 'sizeXXS',
416
- iconSize: '14',
409
+ sizeXL: {
410
+ size: 'xl',
411
+ labelTextSize: 'l',
412
+ iconAfterFillSize: '24',
413
+ iconAfterSize: '24',
414
+ iconBeforeFillSize: '24',
415
+ iconBeforeSize: '24',
417
416
  },
418
- size16_12: {
419
- fillSize: '16',
420
- badgeAppearanceSize: 'sizeXXS',
421
- iconSize: '12',
417
+ sizeL: {
418
+ size: 'l',
419
+ labelTextSize: 'l',
420
+ iconAfterFillSize: '24',
421
+ iconAfterSize: '24',
422
+ iconBeforeFillSize: '24',
423
+ iconBeforeSize: '24',
422
424
  },
423
- size16_14: {
424
- fillSize: '16',
425
- badgeAppearanceSize: 'sizeXXS',
426
- iconSize: '14',
425
+ sizeM: {
426
+ size: 'm',
427
+ labelTextSize: 'm',
428
+ iconAfterFillSize: '24',
429
+ iconAfterSize: '24',
430
+ iconBeforeFillSize: '24',
431
+ iconBeforeSize: '24',
427
432
  },
428
- size16_16: {
429
- fillSize: '16',
430
- badgeAppearanceSize: 'sizeXXS',
431
- iconSize: '16',
433
+ sizeS: {
434
+ size: 's',
435
+ labelTextSize: 's',
436
+ iconAfterFillSize: '20',
437
+ iconAfterSize: '20',
438
+ iconBeforeFillSize: '20',
439
+ iconBeforeSize: '20',
432
440
  },
433
- size20_12: {
434
- fillSize: '20',
435
- badgeAppearanceSize: 'sizeXXS',
436
- iconSize: '12',
441
+ sizeXS: {
442
+ size: 'xs',
443
+ labelTextSize: 'xs',
444
+ iconAfterFillSize: '16',
445
+ iconAfterSize: '16',
446
+ iconBeforeFillSize: '16',
447
+ iconBeforeSize: '16',
437
448
  },
438
- size20_14: {
439
- fillSize: '20',
440
- badgeAppearanceSize: 'sizeXXS',
441
- iconSize: '14',
449
+ sizeXXS: {
450
+ size: 'xxs',
451
+ labelTextSize: 'xs',
452
+ iconAfterFillSize: '14',
453
+ iconAfterSize: '14',
454
+ iconBeforeFillSize: '14',
455
+ iconBeforeSize: '14',
442
456
  },
443
- size20_16: {
444
- fillSize: '20',
445
- badgeAppearanceSize: 'sizeXXS',
446
- iconSize: '16',
457
+ };
458
+
459
+ var titleAppearanceStyle = {
460
+ full: {
461
+ borderColor: '0',
447
462
  },
448
- size20_20: {
449
- fillSize: '20',
450
- badgeAppearanceSize: 'sizeXXS',
451
- iconSize: '20',
463
+ ghost: {
464
+ fill: 'none',
465
+ borderColor: '0',
452
466
  },
453
- size24_12: {
454
- fillSize: '24',
455
- badgeAppearanceSize: 'sizeXXS',
456
- iconSize: '12',
467
+ outlined: {
468
+ fill: 'none',
457
469
  },
458
- size24_14: {
459
- fillSize: '24',
460
- badgeAppearanceSize: 'sizeXXS',
461
- iconSize: '14',
470
+ solid: {
471
+ borderColor: '0',
462
472
  },
463
- size24_16: {
464
- fillSize: '24',
465
- badgeAppearanceSize: 'sizeXXS',
466
- iconSize: '16',
473
+ };
474
+
475
+ var titleAppearanceSuccess = {
476
+ success: {
477
+ fill: 'successPrimary',
478
+ fillHover: 'successPrimaryHover',
479
+ labelTextColor: 'successTextSecondary',
480
+ labelTextColorHover: 'successTextSecondary',
481
+ loaderFill: 'successPrimary',
482
+ loaderItemFill: 'successItemPrimary',
467
483
  },
468
- size24_20: {
469
- fillSize: '24',
470
- badgeAppearanceSize: 'sizeXXS',
471
- iconSize: '20',
472
- },
473
- size24_24: {
474
- fillSize: '24',
475
- badgeAppearanceSize: 'sizeXXS',
476
- iconSize: '24',
477
- },
478
- size32_12: {
479
- fillSize: '32',
480
- badgeAppearanceSize: 'sizeXXS',
481
- iconSize: '12',
484
+ };
485
+
486
+ var titleAppearanceSurface = {
487
+ surfacePrimary: {
488
+ fill: 'surfacePrimary',
489
+ fillHover: 'surfacePrimaryHover',
490
+ labelTextColor: 'surfaceTextPrimary',
482
491
  },
483
- size32_14: {
484
- fillSize: '32',
485
- badgeAppearanceSize: 'sizeXXS',
486
- iconSize: '14',
492
+ surfaceQuaternary: {
493
+ fill: 'surfaceQuaternary',
494
+ fillHover: 'surfaceQuaternaryHover',
495
+ labelTextColor: 'surfaceTextPrimary',
487
496
  },
488
- size32_16: {
489
- fillSize: '32',
490
- badgeAppearanceSize: 'sizeXXS',
491
- iconSize: '16',
497
+ surfaceSecondary: {
498
+ fill: 'surfaceSecondary',
499
+ fillHover: 'surfaceSecondaryHover',
500
+ labelTextColor: 'surfaceTextPrimary',
501
+ loaderFill: 'surfaceSecondary',
502
+ loaderItemFill: 'surfaceItemPrimary',
492
503
  },
493
- size32_20: {
494
- fillSize: '32',
495
- badgeAppearanceSize: 'sizeXXS',
496
- iconSize: '20',
504
+ surfaceTertiary: {
505
+ fill: 'surfaceTertiary',
506
+ fillHover: 'surfaceTertiaryHover',
507
+ labelTextColor: 'surfaceTextPrimary',
497
508
  },
498
- size32_24: {
499
- fillSize: '32',
500
- badgeAppearanceSize: 'sizeXXS',
501
- iconSize: '24',
509
+ };
510
+
511
+ var titleAppearanceWarning = {
512
+ warning: {
513
+ fill: 'warningPrimary',
514
+ fillHover: 'warningPrimaryHover',
515
+ labelTextColor: 'warningTextSecondary',
516
+ labelTextColorHover: 'warningTextSecondary',
517
+ loaderFill: 'warningPrimary',
518
+ loaderItemFill: 'warningItemPrimary',
502
519
  },
503
- size32_32: {
504
- fillSize: '32',
505
- badgeAppearanceSize: 'sizeXXS',
506
- iconSize: '32',
520
+ };
521
+
522
+ var titleAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, titleAppearanceSize), titleAppearanceDisabled), titleAppearanceRequire), titleAppearanceStyle), titleAppearanceAccent), titleAppearanceDanger), titleAppearanceError), titleAppearanceInfo), titleAppearancePrimary), titleAppearanceSecondary), titleAppearanceSuccess), titleAppearanceSurface), titleAppearanceWarning);
523
+
524
+ var titleConfig = {
525
+ appearance: titleAppearance,
526
+ setAppearance: function (appearanceConfig) {
527
+ titleConfig.appearance = appearanceConfig;
507
528
  },
508
- size40_12: {
509
- fillSize: '40',
510
- badgeAppearanceSize: 'sizeXXS',
511
- iconSize: '12',
529
+ };
530
+ function Title(props) {
531
+ 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;
532
+ var appearanceConfig = useAppearanceConfig(appearance, titleConfig);
533
+ var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
534
+ 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;
535
+ // @ts-expect-error
536
+ var _b = useStyles(props), titleStyles = _b.styles, titleWrapperStyles = _b.wrapper;
537
+ // Element type (h1, h2, ..., h6)
538
+ var Tag = useMemo(function () {
539
+ if (tag) {
540
+ return tag;
541
+ }
542
+ return size ? size : 'span';
543
+ }, [tag, size]);
544
+ return (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, 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) && (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) && (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] }));
545
+ }
546
+
547
+ var tooltipAppearanceDefault = {
548
+ defaultPrimary: {
549
+ fill: 'surfacePrimary',
550
+ fillHover: 'surfacePrimaryHover',
551
+ titleTextColor: 'surfaceTextPrimary',
552
+ borderColor: 'surfaceBorderPrimary',
553
+ textColor: 'surfaceTextPrimary',
512
554
  },
513
- size40_14: {
514
- fillSize: '40',
515
- badgeAppearanceSize: 'sizeXXS',
516
- iconSize: '14',
555
+ };
556
+
557
+ var tooltipAppearanceDisabled = {
558
+ disabledPrimary: {
559
+ fill: 'surfaceDisabled',
560
+ fillHover: 'surfaceDisabledHover',
561
+ titleTextColor: 'surfaceTextPrimary',
562
+ textColor: 'surfaceTextPrimary',
517
563
  },
518
- size40_16: {
519
- fillSize: '40',
520
- badgeAppearanceSize: 'sizeXXS',
521
- iconSize: '16',
564
+ };
565
+
566
+ var tooltipAppearanceError = {
567
+ errorPrimary: {
568
+ fill: 'errorPrimary',
569
+ fillHover: 'errorPrimaryHover',
570
+ titleTextColor: 'errorTextPrimary',
571
+ borderColor: 'errorBorderPrimary',
572
+ textColor: 'errorTextPrimary',
522
573
  },
523
- size40_20: {
524
- fillSize: '40',
525
- badgeAppearanceSize: 'sizeXXS',
526
- iconSize: '20',
574
+ };
575
+
576
+ var tooltipAppearanceRequire = {
577
+ requirePrimary: {
578
+ fill: 'warningPrimary',
579
+ fillHover: 'warningPrimaryHover',
580
+ titleTextColor: 'warningTextPrimary',
581
+ borderColor: 'warningBorderPrimary',
582
+ textColor: 'warningTextPrimary',
527
583
  },
528
- size40_24: {
529
- fillSize: '40',
530
- badgeAppearanceSize: 'sizeXXS',
531
- iconSize: '24',
584
+ };
585
+
586
+ var tooltipAppearanceSize = {
587
+ sizeL: {
588
+ size: 'l',
589
+ titleSize: 'h5',
590
+ textSize: 's',
532
591
  },
533
- size40_32: {
534
- fillSize: '40',
535
- badgeAppearanceSize: 'sizeXXS',
536
- iconSize: '32',
592
+ sizeM: {
593
+ size: 'm',
594
+ titleSize: 'h5',
595
+ textSize: 's',
537
596
  },
538
- size40_40: {
539
- fillSize: '40',
540
- badgeAppearanceSize: 'sizeXXS',
541
- iconSize: '40',
597
+ sizeS: {
598
+ size: 's',
599
+ titleSize: 'h5',
600
+ textSize: 's',
542
601
  },
543
602
  };
544
603
 
545
- var iconAppearanceStyle = {
604
+ var tooltipAppearanceStyle = {
546
605
  solid: {
547
606
  borderColor: 'none',
548
607
  },
@@ -556,446 +615,340 @@ var iconAppearanceStyle = {
556
615
  },
557
616
  };
558
617
 
559
- var iconAppearanceSuccess = {
560
- success: {
561
- fill: 'successPrimary',
562
- fillHover: 'successHover',
563
- },
618
+ var tooltipAppearanceSuccess = {
564
619
  successPrimary: {
565
620
  fill: 'successPrimary',
566
- fillHover: 'successHover',
567
- borderColor: 'successBorderHover',
568
- badgeAppearance: 'surfacePrimary',
569
- iconFill: 'successItemPrimary',
570
- },
571
- };
572
-
573
- var iconAppearanceSurface = {
574
- surfacePrimary: {
575
- fill: 'surfacePrimary',
576
- fillHover: 'surfaceSecondary',
577
- borderColor: 'surfaceBorderTertiary',
578
- badgeAppearance: 'surfacePrimary',
579
- iconFill: 'surfaceItemPrimary',
580
- },
581
- surfaceSecondary: {
582
- fill: 'surfaceSecondary',
583
- fillHover: 'surfaceSecondaryHover',
584
- badgeAppearance: 'accentPrimary',
585
- iconFill: 'surfaceItemPrimary',
586
- },
587
- surfaceTertiary: {
588
- fill: 'surfaceTertiary',
589
- fillHover: 'surfaceTertiaryHover',
590
- badgeAppearance: 'accentPrimary',
591
- iconFill: 'surfaceItemPrimary',
592
- },
593
- surfaceQuaternary: {
594
- fill: 'surfaceQuaternary',
595
- fillHover: 'surfaceHover',
596
- badgeAppearance: 'accentPrimary',
597
- iconFill: 'surfaceItemPrimary',
598
- },
599
- };
600
-
601
- var iconAppearanceWarning = {
602
- warning: {
603
- fill: 'warningPrimary',
604
- fillHover: 'warningHover',
605
- badgeAppearance: 'surfacePrimary',
606
- iconFill: 'warningItemPrimary',
607
- },
608
- warningPrimary: {
609
- fill: 'warningPrimary',
610
- fillHover: 'warningHover',
611
- borderColor: 'warningBorderSecondary',
612
- badgeAppearance: 'surfacePrimary',
613
- iconFill: 'warningItemPrimary',
621
+ fillHover: 'successPrimaryHover',
622
+ titleTextColor: 'successTextPrimary',
623
+ borderColor: 'successBorderPrimary',
624
+ textColor: 'successTextPrimary',
614
625
  },
615
626
  };
616
627
 
617
- var iconAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, iconAppearanceDisabled), iconAppearanceSize), iconAppearanceStyle), iconAppearanceAccent), iconAppearanceDanger), iconAppearanceError), iconAppearanceInfo), iconAppearancePrimary), iconAppearanceSecondary), iconAppearanceSuccess), iconAppearanceSurface), iconAppearanceWarning);
628
+ var tooltipAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, tooltipAppearanceDefault), tooltipAppearanceSize), tooltipAppearanceDisabled), tooltipAppearanceRequire), tooltipAppearanceStyle), tooltipAppearanceError), tooltipAppearanceSuccess);
618
629
 
619
- var iconConfig = {
620
- appearance: iconAppearance,
630
+ var tooltipConfig = {
631
+ appearance: tooltipAppearance,
621
632
  setAppearance: function (appearanceConfig) {
622
- iconConfig.appearance = appearanceConfig;
633
+ tooltipConfig.appearance = appearanceConfig;
623
634
  },
624
635
  };
625
- var Icon = urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
626
- // TODO: Tooltip doesn't work that anymore
627
- // const [isTooltipVisible, setIsTooltipVisible] = useState(false)
628
- 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;
629
- var ImageComponent = useMemo(function () {
630
- if (SvgImage) {
631
- var sizes = {};
632
- if (width) {
633
- sizes.width = width;
636
+ var Tooltip = React.forwardRef(function Tooltip(props, ref) {
637
+ 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;
638
+ var tooltipElementRef = useRef(null);
639
+ var tooltipTimeoutHideRef = useRef(null);
640
+ var tooltipTimeoutShowRef = useRef(null);
641
+ var isTooltipCloseAnimationInProgressRef = useRef(false);
642
+ // TODO: rename to open?
643
+ var _c = useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
644
+ // TODO: or rename to show/hide?
645
+ var openTooltip = useCallback(function () {
646
+ if (!isTooltipCloseAnimationInProgressRef.current) {
647
+ if (tooltipTimeoutHideRef.current) {
648
+ clearTimeout(tooltipTimeoutHideRef.current);
634
649
  }
635
- if (height) {
636
- sizes.height = height;
637
- }
638
- return jsx(SvgImage, __assign({}, sizes));
650
+ tooltipTimeoutShowRef.current = setTimeout(function () {
651
+ setIsTooltipVisible(true);
652
+ }, openTimeoutDelay);
639
653
  }
640
- if (imageSrc) {
641
- if (imageSrc.endsWith('.svg')) {
642
- return jsx(SVG, { src: imageSrc, preProcessor: removeFillStroke });
643
- }
644
- return jsx("img", { src: imageSrc });
654
+ }, [openTimeoutDelay]);
655
+ var closeTooltip = useCallback(function () {
656
+ if (tooltipTimeoutShowRef.current) {
657
+ clearTimeout(tooltipTimeoutShowRef.current);
645
658
  }
646
- return null;
647
- }, [SvgImage, width, height, imageSrc]);
648
- var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
649
- var _a;
650
- return (__assign(__assign({}, resultConfig), (_a = iconConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
651
- }, {});
659
+ // Make a small delay to be able to move cursor on the tooltip without
660
+ // triggering a close, because the label and the tooltip have space between
661
+ tooltipTimeoutHideRef.current = setTimeout(function () {
662
+ // @ts-expect-error
663
+ setIsTooltipVisible(function (prevState) {
664
+ var newState = false;
665
+ if (prevState === true) {
666
+ isTooltipCloseAnimationInProgressRef.current = true;
667
+ }
668
+ return newState;
669
+ });
670
+ }, closeTimeoutDelay);
671
+ }, [closeTimeoutDelay]);
672
+ var onAnimationEnd = useCallback(function () {
673
+ isTooltipCloseAnimationInProgressRef.current = false;
674
+ }, []);
675
+ useImperativeHandle(ref, function () { return ({
676
+ get tooltipElement() {
677
+ return tooltipElementRef.current;
678
+ },
679
+ openTooltip: openTooltip,
680
+ closeTooltip: closeTooltip,
681
+ isTooltipVisible: isTooltipVisible,
682
+ }); }, [isTooltipVisible, openTooltip, closeTooltip]);
683
+ var appearanceConfig = useAppearanceConfig(appearance, tooltipConfig);
652
684
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
653
- 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;
654
- var iconStyles = useStyles(props).styles;
655
- return (jsxs("div", { id: id, className: clsx(className, 'icon', !isActive
656
- ? fillClass && "fill_".concat(fillClass)
657
- : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
658
- ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
659
- : fillActiveHoverClass &&
660
- "fill_active_hover_".concat(fillActiveHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isActive
661
- ? iconFillClass && "icon_fill_".concat(iconFillClass)
662
- : iconFillActiveClass && "icon_fill_active_".concat(iconFillActiveClass), !isActive
663
- ? iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass)
664
- : iconFillActiveHoverClass &&
665
- "icon_fill_active_hover_".concat(iconFillActiveHoverClass), isDisabled &&
666
- iconFillDisabledClass &&
667
- "icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass &&
668
- "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, jsxs(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 && (jsx(Badge, { className: clsx(badgeClass, 'icon__badge'), appearance: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), showTooltip && (jsx(Tooltip, { className: clsx(className, 'icon__tooltip', alignmentClass && "alignment_".concat(alignmentClass)), appearance: tooltipAppearance, title: tooltipTitle, titleSize: tooltipTitleSize, text: tooltipText, textSize: tooltipTextSize }))] }), after] }));
669
- }));
670
- var removeFillStroke = function (code) {
671
- return code
672
- .replace(/fill=".*?"/g, 'fill=""')
673
- .replace(/stroke=".*?"/g, 'stroke=""');
674
- };
685
+ 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;
686
+ // @ts-expect-error
687
+ var tooltipStyles = useStyles(props).styles;
688
+ return (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
689
+ ? "shape-strength_".concat(shapeStrengthClass)
690
+ : 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: [jsx("div", { className: clsx('tooltip__arrow', arrowPosition && "tooltip__arrow_position_".concat(arrowPosition), fillClass && "fill_".concat(fillClass)), children: "\u00A0" }), before, jsxs("div", { className: "tooltip__inner", children: [title && (jsx(Title, { className: "tooltip__title text", size: titleSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title })), text && (jsx(Text, { className: "tooltip__text", size: textSize, textColor: textColor, textWeight: textWeight, children: text })), children] }), after] }));
691
+ });
675
692
 
676
- var titleAppearanceAccent = {
693
+ var iconAppearanceAccent = {
677
694
  accent: {
678
695
  fill: 'accentPrimary',
679
- fillHover: 'accentPrimaryHover',
696
+ fillHover: 'accentHover',
697
+ borderColor: 'accentBorderPrimary',
698
+ badgeAppearance: 'surfacePrimary',
699
+ iconFill: 'accentItemPrimary',
680
700
  },
681
701
  accentPrimary: {
682
702
  fill: 'accentPrimary',
683
- fillHover: 'accentPrimaryHover',
703
+ fillHover: 'accentHover',
684
704
  borderColor: 'accentBorderPrimary',
705
+ badgeAppearance: 'surfacePrimary',
706
+ iconFill: 'accentItemPrimary',
685
707
  },
686
708
  accentSecondary: {
687
709
  fill: 'accentPrimary',
688
- fillHover: 'accentPrimaryHover',
689
- labelTextColor: 'accentTextSecondary',
690
- labelTextColorHover: 'accentTextSecondary',
710
+ fillHover: 'accentHover',
691
711
  borderColor: 'accentBorderPrimary',
692
- loaderItemFill: 'accentItemPrimary',
712
+ iconFill: 'accentItemPrimary',
693
713
  },
694
714
  };
695
715
 
696
- var titleAppearanceDanger = {
716
+ var iconAppearanceDanger = {
697
717
  danger: {
698
718
  fill: 'dangerPrimary',
699
- fillHover: 'dangerPrimaryHover',
719
+ fillHover: 'dangerHover',
720
+ },
721
+ dangerPrimary: {
722
+ fill: 'dangerPrimary',
723
+ fillHover: 'dangerHover',
724
+ borderColor: 'dangerBorderSecondary',
725
+ badgeAppearance: 'surfacePrimary',
726
+ iconFill: 'dangerItemPrimary',
700
727
  },
701
728
  };
702
729
 
703
- var titleAppearanceDisabled = {
704
- disabledPrimary: {
705
- fill: 'surfaceFillDisabled',
706
- borderColor: 'errorBorderQuaternary',
707
- borderHover: 'errorBorderQuaternary',
708
- textColor: 'surfaceTextQuaternary',
709
- iconBeforeFill: 'errorItemQuaternary',
710
- iconClearFill: 'errorItemPrimary',
711
- placeholderTextColor: 'surfaceTextQuaternary',
730
+ var iconAppearanceDisabled = {
731
+ danger: {
732
+ fill: 'dangerPrimary',
733
+ fillHover: 'dangerHover',
712
734
  },
713
- disabledSecondary: {
714
- fill: 'surfaceSecondary',
715
- borderColor: 'surfaceBorderTertiary',
716
- borderHover: 'surfaceBorderQuaternary',
717
- iconBeforeFill: 'surfaceItemQuaternary',
718
- iconClearFill: 'surfaceItemPrimary',
719
- placeholderTextColor: 'surfaceTextSecondary',
735
+ disabledPrimary: {
736
+ fill: 'surfaceDisabled',
737
+ borderColor: 'surfaceBorderDisabled',
738
+ badgeAppearance: 'surfacePrimary',
739
+ iconFill: 'surfaceItemQuaternary',
720
740
  },
721
741
  };
722
742
 
723
- var titleAppearanceError = {
743
+ var iconAppearanceError = {
724
744
  error: {
725
745
  fill: 'errorPrimary',
726
- fillHover: 'errorPrimaryHover',
727
- labelTextColor: 'errorTextPrimary',
728
- labelTextColorHover: 'errorTextPrimary',
729
- loaderFill: 'errorPrimary',
730
- loaderItemFill: 'errorItemPrimary',
746
+ fillHover: 'errorHover',
747
+ badgeAppearance: 'surfacePrimary',
748
+ iconFill: 'errorItemPrimary',
749
+ },
750
+ errorPrimary: {
751
+ fill: 'errorPrimary',
752
+ fillHover: 'errorHover',
753
+ borderColor: 'errorBorderPrimary',
754
+ badgeAppearance: 'surfacePrimary',
755
+ iconFill: 'errorItemPrimary',
731
756
  },
732
757
  };
733
758
 
734
- var titleAppearanceInfo = {
759
+ var iconAppearanceInfo = {
735
760
  info: {
736
761
  fill: 'accentPrimary',
737
762
  fillHover: 'accentPrimaryHover',
738
- labelTextColor: 'accentTextPrimary',
739
- labelTextColorHover: 'accentTextPrimary',
740
763
  borderColor: 'accentBorderPrimary',
741
- loaderFill: 'accentPrimary',
742
- loaderItemFill: 'accentItemPrimary',
764
+ },
765
+ infoPrimary: {
766
+ fill: 'infoPrimary',
767
+ borderColor: 'infoBorderDisabled',
768
+ badgeAppearance: 'surfacePrimary',
769
+ iconFill: 'infoItemPrimary',
743
770
  },
744
771
  infoSecondary: {
745
772
  fill: 'accentPrimary',
746
773
  fillHover: 'accentPrimaryHover',
747
- labelTextColor: 'accentTextSecondary',
748
- labelTextColorHover: 'accentTextSecondary',
749
774
  borderColor: 'accentBorderPrimary',
750
- loaderFill: 'accentPrimary',
751
- loaderItemFill: 'accentItemPrimary',
752
775
  },
753
776
  };
754
777
 
755
- var titleAppearancePrimary = {
778
+ var iconAppearancePrimary = {
756
779
  primary: {
757
780
  fill: 'primaryPrimary',
758
781
  fillHover: 'primaryPrimaryHover',
759
- labelTextColor: 'primaryTextPrimary',
760
- },
761
- };
762
-
763
- var titleAppearanceRequire = {
764
- requirePrimary: {
765
- fill: 'warningTertiary',
766
- borderColor: 'warningBorderQuaternary',
767
- borderHover: 'warningBorderQuaternary',
768
- textColor: 'surfaceTextPrimary',
769
- iconBeforeFill: 'warningItemQuaternary',
770
- iconClearFill: 'warningItemPrimary',
771
- placeholderTextColor: 'surfaceTextQuaternary',
782
+ badgeAppearance: 'surfacePrimary',
783
+ iconFill: 'primaryItemPrimary',
772
784
  },
773
- requireSecondary: {
774
- fill: 'surfaceSecondary',
775
- borderColor: 'surfaceBorderTertiary',
776
- borderHover: 'surfaceBorderQuaternary',
777
- iconBeforeFill: 'surfaceItemQuaternary',
778
- iconClearFill: 'surfaceItemPrimary',
779
- placeholderTextColor: 'surfaceTextSecondary',
785
+ primaryPrimary: {
786
+ fill: 'primaryPrimary',
787
+ fillHover: 'primaryPrimaryHover',
788
+ borderColor: 'primaryBorderQuaternary',
789
+ badgeAppearance: 'surfacePrimary',
790
+ iconFill: 'primaryItemPrimary',
780
791
  },
781
792
  };
782
793
 
783
- var titleAppearanceSecondary = {
794
+ var iconAppearanceSecondary = {
784
795
  secondary: {
785
796
  fill: 'secondaryPrimary',
786
797
  fillHover: 'secondaryPrimaryHover',
787
- labelTextColor: 'secondaryTextPrimary',
798
+ },
799
+ secondaryPrimary: {
800
+ fill: 'secondaryPrimary',
801
+ fillHover: 'secondaryPrimaryHover',
802
+ borderColor: 'secondaryBorderQuaternary',
803
+ badgeAppearance: 'surfacePrimary',
804
+ iconFill: 'secondaryItemPrimary',
788
805
  },
789
806
  };
790
807
 
791
- var titleAppearanceSize = {
792
- sizeXXL: {
793
- size: 'xxl',
794
- labelTextSize: 'xxl',
795
- iconAfterFillSize: '24',
796
- iconAfterSize: '24',
797
- iconBeforeFillSize: '24',
798
- iconBeforeSize: '24',
808
+ var iconAppearanceSize = {
809
+ size12_12: {
810
+ fillSize: '12',
811
+ badgeAppearanceSize: 'sizeXXS',
812
+ iconSize: '12',
799
813
  },
800
- sizeXL: {
801
- size: 'xl',
802
- labelTextSize: 'l',
803
- iconAfterFillSize: '24',
804
- iconAfterSize: '24',
805
- iconBeforeFillSize: '24',
806
- iconBeforeSize: '24',
814
+ size14_12: {
815
+ fillSize: '14',
816
+ badgeAppearanceSize: 'sizeXXS',
817
+ iconSize: '12',
807
818
  },
808
- sizeL: {
809
- size: 'l',
810
- labelTextSize: 'l',
811
- iconAfterFillSize: '24',
812
- iconAfterSize: '24',
813
- iconBeforeFillSize: '24',
814
- iconBeforeSize: '24',
819
+ size14_14: {
820
+ fillSize: '14',
821
+ badgeAppearanceSize: 'sizeXXS',
822
+ iconSize: '14',
815
823
  },
816
- sizeM: {
817
- size: 'm',
818
- labelTextSize: 'm',
819
- iconAfterFillSize: '24',
820
- iconAfterSize: '24',
821
- iconBeforeFillSize: '24',
822
- iconBeforeSize: '24',
824
+ size16_12: {
825
+ fillSize: '16',
826
+ badgeAppearanceSize: 'sizeXXS',
827
+ iconSize: '12',
823
828
  },
824
- sizeS: {
825
- size: 's',
826
- labelTextSize: 's',
827
- iconAfterFillSize: '20',
828
- iconAfterSize: '20',
829
- iconBeforeFillSize: '20',
830
- iconBeforeSize: '20',
829
+ size16_14: {
830
+ fillSize: '16',
831
+ badgeAppearanceSize: 'sizeXXS',
832
+ iconSize: '14',
831
833
  },
832
- sizeXS: {
833
- size: 'xs',
834
- labelTextSize: 'xs',
835
- iconAfterFillSize: '16',
836
- iconAfterSize: '16',
837
- iconBeforeFillSize: '16',
838
- iconBeforeSize: '16',
834
+ size16_16: {
835
+ fillSize: '16',
836
+ badgeAppearanceSize: 'sizeXXS',
837
+ iconSize: '16',
839
838
  },
840
- sizeXXS: {
841
- size: 'xxs',
842
- labelTextSize: 'xs',
843
- iconAfterFillSize: '14',
844
- iconAfterSize: '14',
845
- iconBeforeFillSize: '14',
846
- iconBeforeSize: '14',
839
+ size20_12: {
840
+ fillSize: '20',
841
+ badgeAppearanceSize: 'sizeXXS',
842
+ iconSize: '12',
847
843
  },
848
- };
849
-
850
- var titleAppearanceStyle = {
851
- full: {
852
- borderColor: '0',
844
+ size20_14: {
845
+ fillSize: '20',
846
+ badgeAppearanceSize: 'sizeXXS',
847
+ iconSize: '14',
853
848
  },
854
- ghost: {
855
- fill: 'none',
856
- borderColor: '0',
849
+ size20_16: {
850
+ fillSize: '20',
851
+ badgeAppearanceSize: 'sizeXXS',
852
+ iconSize: '16',
857
853
  },
858
- outlined: {
859
- fill: 'none',
854
+ size20_20: {
855
+ fillSize: '20',
856
+ badgeAppearanceSize: 'sizeXXS',
857
+ iconSize: '20',
860
858
  },
861
- solid: {
862
- borderColor: '0',
859
+ size24_12: {
860
+ fillSize: '24',
861
+ badgeAppearanceSize: 'sizeXXS',
862
+ iconSize: '12',
863
863
  },
864
- };
865
-
866
- var titleAppearanceSuccess = {
867
- success: {
868
- fill: 'successPrimary',
869
- fillHover: 'successPrimaryHover',
870
- labelTextColor: 'successTextSecondary',
871
- labelTextColorHover: 'successTextSecondary',
872
- loaderFill: 'successPrimary',
873
- loaderItemFill: 'successItemPrimary',
864
+ size24_14: {
865
+ fillSize: '24',
866
+ badgeAppearanceSize: 'sizeXXS',
867
+ iconSize: '14',
874
868
  },
875
- };
876
-
877
- var titleAppearanceSurface = {
878
- surfacePrimary: {
879
- fill: 'surfacePrimary',
880
- fillHover: 'surfacePrimaryHover',
881
- labelTextColor: 'surfaceTextPrimary',
869
+ size24_16: {
870
+ fillSize: '24',
871
+ badgeAppearanceSize: 'sizeXXS',
872
+ iconSize: '16',
882
873
  },
883
- surfaceQuaternary: {
884
- fill: 'surfaceQuaternary',
885
- fillHover: 'surfaceQuaternaryHover',
886
- labelTextColor: 'surfaceTextPrimary',
874
+ size24_20: {
875
+ fillSize: '24',
876
+ badgeAppearanceSize: 'sizeXXS',
877
+ iconSize: '20',
887
878
  },
888
- surfaceSecondary: {
889
- fill: 'surfaceSecondary',
890
- fillHover: 'surfaceSecondaryHover',
891
- labelTextColor: 'surfaceTextPrimary',
892
- loaderFill: 'surfaceSecondary',
893
- loaderItemFill: 'surfaceItemPrimary',
879
+ size24_24: {
880
+ fillSize: '24',
881
+ badgeAppearanceSize: 'sizeXXS',
882
+ iconSize: '24',
894
883
  },
895
- surfaceTertiary: {
896
- fill: 'surfaceTertiary',
897
- fillHover: 'surfaceTertiaryHover',
898
- labelTextColor: 'surfaceTextPrimary',
884
+ size32_12: {
885
+ fillSize: '32',
886
+ badgeAppearanceSize: 'sizeXXS',
887
+ iconSize: '12',
899
888
  },
900
- };
901
-
902
- var titleAppearanceWarning = {
903
- warning: {
904
- fill: 'warningPrimary',
905
- fillHover: 'warningPrimaryHover',
906
- labelTextColor: 'warningTextSecondary',
907
- labelTextColorHover: 'warningTextSecondary',
908
- loaderFill: 'warningPrimary',
909
- loaderItemFill: 'warningItemPrimary',
889
+ size32_14: {
890
+ fillSize: '32',
891
+ badgeAppearanceSize: 'sizeXXS',
892
+ iconSize: '14',
910
893
  },
911
- };
912
-
913
- var titleAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, titleAppearanceSize), titleAppearanceDisabled), titleAppearanceRequire), titleAppearanceStyle), titleAppearanceAccent), titleAppearanceDanger), titleAppearanceError), titleAppearanceInfo), titleAppearancePrimary), titleAppearanceSecondary), titleAppearanceSuccess), titleAppearanceSurface), titleAppearanceWarning);
914
-
915
- var titleConfig = {
916
- appearance: titleAppearance,
917
- setAppearance: function (appearanceConfig) {
918
- titleConfig.appearance = appearanceConfig;
894
+ size32_16: {
895
+ fillSize: '32',
896
+ badgeAppearanceSize: 'sizeXXS',
897
+ iconSize: '16',
919
898
  },
920
- };
921
- function Title(props) {
922
- 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;
923
- var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
924
- var _a;
925
- return (__assign(__assign({}, resultConfig), (_a = titleConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
926
- }, {});
927
- var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
928
- 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;
929
- // @ts-expect-error
930
- var _b = useStyles(props), titleStyles = _b.styles, titleWrapperStyles = _b.wrapper;
931
- // Element type (h1, h2, ..., h6)
932
- var Tag = useMemo(function () {
933
- if (tag) {
934
- return tag;
935
- }
936
- return size ? size : 'span';
937
- }, [tag, size]);
938
- return (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, 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) && (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) && (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] }));
939
- }
940
-
941
- var tooltipAppearanceDefault = {
942
- defaultPrimary: {
943
- fill: 'surfacePrimary',
944
- fillHover: 'surfacePrimaryHover',
945
- titleTextColor: 'surfaceTextPrimary',
946
- borderColor: 'surfaceBorderPrimary',
947
- textColor: 'surfaceTextPrimary',
899
+ size32_20: {
900
+ fillSize: '32',
901
+ badgeAppearanceSize: 'sizeXXS',
902
+ iconSize: '20',
948
903
  },
949
- };
950
-
951
- var tooltipAppearanceDisabled = {
952
- disabledPrimary: {
953
- fill: 'surfaceDisabled',
954
- fillHover: 'surfaceDisabledHover',
955
- titleTextColor: 'surfaceTextPrimary',
956
- textColor: 'surfaceTextPrimary',
904
+ size32_24: {
905
+ fillSize: '32',
906
+ badgeAppearanceSize: 'sizeXXS',
907
+ iconSize: '24',
957
908
  },
958
- };
959
-
960
- var tooltipAppearanceError = {
961
- errorPrimary: {
962
- fill: 'errorPrimary',
963
- fillHover: 'errorPrimaryHover',
964
- titleTextColor: 'errorTextPrimary',
965
- borderColor: 'errorBorderPrimary',
966
- textColor: 'errorTextPrimary',
909
+ size32_32: {
910
+ fillSize: '32',
911
+ badgeAppearanceSize: 'sizeXXS',
912
+ iconSize: '32',
967
913
  },
968
- };
969
-
970
- var tooltipAppearanceRequire = {
971
- requirePrimary: {
972
- fill: 'warningPrimary',
973
- fillHover: 'warningPrimaryHover',
974
- titleTextColor: 'warningTextPrimary',
975
- borderColor: 'warningBorderPrimary',
976
- textColor: 'warningTextPrimary',
914
+ size40_12: {
915
+ fillSize: '40',
916
+ badgeAppearanceSize: 'sizeXXS',
917
+ iconSize: '12',
977
918
  },
978
- };
979
-
980
- var tooltipAppearanceSize = {
981
- sizeL: {
982
- size: 'l',
983
- titleSize: 'h5',
984
- textSize: 's',
919
+ size40_14: {
920
+ fillSize: '40',
921
+ badgeAppearanceSize: 'sizeXXS',
922
+ iconSize: '14',
985
923
  },
986
- sizeM: {
987
- size: 'm',
988
- titleSize: 'h5',
989
- textSize: 's',
924
+ size40_16: {
925
+ fillSize: '40',
926
+ badgeAppearanceSize: 'sizeXXS',
927
+ iconSize: '16',
990
928
  },
991
- sizeS: {
992
- size: 's',
993
- titleSize: 'h5',
994
- textSize: 's',
929
+ size40_20: {
930
+ fillSize: '40',
931
+ badgeAppearanceSize: 'sizeXXS',
932
+ iconSize: '20',
933
+ },
934
+ size40_24: {
935
+ fillSize: '40',
936
+ badgeAppearanceSize: 'sizeXXS',
937
+ iconSize: '24',
938
+ },
939
+ size40_32: {
940
+ fillSize: '40',
941
+ badgeAppearanceSize: 'sizeXXS',
942
+ iconSize: '32',
943
+ },
944
+ size40_40: {
945
+ fillSize: '40',
946
+ badgeAppearanceSize: 'sizeXXS',
947
+ iconSize: '40',
995
948
  },
996
949
  };
997
950
 
998
- var tooltipAppearanceStyle = {
951
+ var iconAppearanceStyle = {
999
952
  solid: {
1000
953
  borderColor: 'none',
1001
954
  },
@@ -1009,82 +962,118 @@ var tooltipAppearanceStyle = {
1009
962
  },
1010
963
  };
1011
964
 
1012
- var tooltipAppearanceSuccess = {
965
+ var iconAppearanceSuccess = {
966
+ success: {
967
+ fill: 'successPrimary',
968
+ fillHover: 'successHover',
969
+ },
1013
970
  successPrimary: {
1014
971
  fill: 'successPrimary',
1015
- fillHover: 'successPrimaryHover',
1016
- titleTextColor: 'successTextPrimary',
1017
- borderColor: 'successBorderPrimary',
1018
- textColor: 'successTextPrimary',
972
+ fillHover: 'successHover',
973
+ borderColor: 'successBorderHover',
974
+ badgeAppearance: 'surfacePrimary',
975
+ iconFill: 'successItemPrimary',
1019
976
  },
1020
977
  };
1021
978
 
1022
- var tooltipAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign({}, tooltipAppearanceDefault), tooltipAppearanceSize), tooltipAppearanceDisabled), tooltipAppearanceRequire), tooltipAppearanceStyle), tooltipAppearanceError), tooltipAppearanceSuccess);
979
+ var iconAppearanceSurface = {
980
+ surfacePrimary: {
981
+ fill: 'surfacePrimary',
982
+ fillHover: 'surfaceSecondary',
983
+ borderColor: 'surfaceBorderTertiary',
984
+ badgeAppearance: 'surfacePrimary',
985
+ iconFill: 'surfaceItemPrimary',
986
+ },
987
+ surfaceSecondary: {
988
+ fill: 'surfaceSecondary',
989
+ fillHover: 'surfaceSecondaryHover',
990
+ badgeAppearance: 'accentPrimary',
991
+ iconFill: 'surfaceItemPrimary',
992
+ },
993
+ surfaceTertiary: {
994
+ fill: 'surfaceTertiary',
995
+ fillHover: 'surfaceTertiaryHover',
996
+ badgeAppearance: 'accentPrimary',
997
+ iconFill: 'surfaceItemPrimary',
998
+ },
999
+ surfaceQuaternary: {
1000
+ fill: 'surfaceQuaternary',
1001
+ fillHover: 'surfaceHover',
1002
+ badgeAppearance: 'accentPrimary',
1003
+ iconFill: 'surfaceItemPrimary',
1004
+ },
1005
+ };
1023
1006
 
1024
- var tooltipConfig = {
1025
- appearance: tooltipAppearance,
1007
+ var iconAppearanceWarning = {
1008
+ warning: {
1009
+ fill: 'warningPrimary',
1010
+ fillHover: 'warningHover',
1011
+ badgeAppearance: 'surfacePrimary',
1012
+ iconFill: 'warningItemPrimary',
1013
+ },
1014
+ warningPrimary: {
1015
+ fill: 'warningPrimary',
1016
+ fillHover: 'warningHover',
1017
+ borderColor: 'warningBorderSecondary',
1018
+ badgeAppearance: 'surfacePrimary',
1019
+ iconFill: 'warningItemPrimary',
1020
+ },
1021
+ };
1022
+
1023
+ var iconAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, iconAppearanceDisabled), iconAppearanceSize), iconAppearanceStyle), iconAppearanceAccent), iconAppearanceDanger), iconAppearanceError), iconAppearanceInfo), iconAppearancePrimary), iconAppearanceSecondary), iconAppearanceSuccess), iconAppearanceSurface), iconAppearanceWarning);
1024
+
1025
+ var iconConfig = {
1026
+ appearance: iconAppearance,
1026
1027
  setAppearance: function (appearanceConfig) {
1027
- tooltipConfig.appearance = appearanceConfig;
1028
+ iconConfig.appearance = appearanceConfig;
1028
1029
  },
1029
1030
  };
1030
- var Tooltip = React.forwardRef(function Tooltip(props, ref) {
1031
- 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;
1032
- var tooltipElementRef = useRef(null);
1033
- var tooltipTimeoutHideRef = useRef(null);
1034
- var tooltipTimeoutShowRef = useRef(null);
1035
- var isTooltipCloseAnimationInProgressRef = useRef(false);
1036
- // TODO: rename to open?
1037
- var _c = useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
1038
- // TODO: or rename to show/hide?
1039
- var openTooltip = useCallback(function () {
1040
- if (!isTooltipCloseAnimationInProgressRef.current) {
1041
- if (tooltipTimeoutHideRef.current) {
1042
- clearTimeout(tooltipTimeoutHideRef.current);
1031
+ var Icon = urlWithAssetPrefix(React.forwardRef(function Icon(props, ref) {
1032
+ // TODO: Tooltip doesn't work that anymore
1033
+ // const [isTooltipVisible, setIsTooltipVisible] = useState(false)
1034
+ 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;
1035
+ var ImageComponent = useMemo(function () {
1036
+ if (SvgImage) {
1037
+ var sizes = {};
1038
+ if (width) {
1039
+ sizes.width = width;
1043
1040
  }
1044
- tooltipTimeoutShowRef.current = setTimeout(function () {
1045
- setIsTooltipVisible(true);
1046
- }, openTimeoutDelay);
1041
+ if (height) {
1042
+ sizes.height = height;
1043
+ }
1044
+ return jsx(SvgImage, __assign({}, sizes));
1047
1045
  }
1048
- }, [openTimeoutDelay]);
1049
- var closeTooltip = useCallback(function () {
1050
- if (tooltipTimeoutShowRef.current) {
1051
- clearTimeout(tooltipTimeoutShowRef.current);
1046
+ if (imageSrc) {
1047
+ if (imageSrc.endsWith('.svg')) {
1048
+ return jsx(SVG, { src: imageSrc, preProcessor: removeFillStroke });
1049
+ }
1050
+ return jsx("img", { src: imageSrc });
1052
1051
  }
1053
- // Make a small delay to be able to move cursor on the tooltip without
1054
- // triggering a close, because the label and the tooltip have space between
1055
- tooltipTimeoutHideRef.current = setTimeout(function () {
1056
- // @ts-expect-error
1057
- setIsTooltipVisible(function (prevState) {
1058
- var newState = false;
1059
- if (prevState === true) {
1060
- isTooltipCloseAnimationInProgressRef.current = true;
1061
- }
1062
- return newState;
1063
- });
1064
- }, closeTimeoutDelay);
1065
- }, [closeTimeoutDelay]);
1066
- var onAnimationEnd = useCallback(function () {
1067
- isTooltipCloseAnimationInProgressRef.current = false;
1068
- }, []);
1069
- useImperativeHandle(ref, function () { return ({
1070
- get tooltipElement() {
1071
- return tooltipElementRef.current;
1072
- },
1073
- openTooltip: openTooltip,
1074
- closeTooltip: closeTooltip,
1075
- isTooltipVisible: isTooltipVisible,
1076
- }); }, [isTooltipVisible, openTooltip, closeTooltip]);
1077
- var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
1078
- var _a;
1079
- return (__assign(__assign({}, resultConfig), (_a = tooltipConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
1080
- }, {});
1052
+ return null;
1053
+ }, [SvgImage, width, height, imageSrc]);
1054
+ var appearanceConfig = useAppearanceConfig(appearance, iconConfig);
1081
1055
  var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
1082
- var alignClass = propsGenerator.alignClass, centeringClass = propsGenerator.centeringClass, 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, shapeStrengthClass = propsGenerator.shapeStrengthClass, textColor = propsGenerator.textColor, textSize = propsGenerator.textSize, textWeight = propsGenerator.textWeight, arrowPosition = propsGenerator.arrowPosition, elevationClass = propsGenerator.elevationClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
1083
- // @ts-expect-error
1084
- var tooltipStyles = useStyles(props).styles;
1085
- return (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
1086
- ? "shape-strength_".concat(shapeStrengthClass)
1087
- : 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: [jsx("div", { className: clsx('tooltip__arrow', arrowPosition && "tooltip__arrow_position_".concat(arrowPosition), fillClass && "fill_".concat(fillClass)), children: "\u00A0" }), before, jsxs("div", { className: "tooltip__inner", children: [title && (jsx(Title, { className: "tooltip__title text", size: titleSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title })), text && (jsx(Text, { className: "tooltip__text", size: textSize, textColor: textColor, textWeight: textWeight, children: text })), children] }), after] }));
1088
- });
1056
+ 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;
1057
+ var iconStyles = useStyles(props).styles;
1058
+ return (jsxs("div", { id: id, className: clsx(className, 'icon', !isActive
1059
+ ? fillClass && "fill_".concat(fillClass)
1060
+ : fillActiveClass && "fill_active_".concat(fillActiveClass), !isActive
1061
+ ? fillHoverClass && "fill_hover_".concat(fillHoverClass)
1062
+ : fillActiveHoverClass &&
1063
+ "fill_active_hover_".concat(fillActiveHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), !isActive
1064
+ ? iconFillClass && "icon_fill_".concat(iconFillClass)
1065
+ : iconFillActiveClass && "icon_fill_active_".concat(iconFillActiveClass), !isActive
1066
+ ? iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass)
1067
+ : iconFillActiveHoverClass &&
1068
+ "icon_fill_active_hover_".concat(iconFillActiveHoverClass), isDisabled &&
1069
+ iconFillDisabledClass &&
1070
+ "icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass &&
1071
+ "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, jsxs(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 && (jsx(Badge, { className: clsx(badgeClass, 'icon__badge'), appearance: "".concat(badgeAppearance, " ").concat(badgeAppearanceSize), size: badgeSize, textColor: badgeTextColor, textSize: badgeTextSize, shape: badgeShape, value: badgeValue })), showTooltip && (jsx(Tooltip, { className: clsx(className, 'icon__tooltip', alignmentClass && "alignment_".concat(alignmentClass)), appearance: tooltipAppearance, title: tooltipTitle, titleSize: tooltipTitleSize, text: tooltipText, textSize: tooltipTextSize }))] }), after] }));
1072
+ }));
1073
+ var removeFillStroke = function (code) {
1074
+ return code
1075
+ .replace(/fill=".*?"/g, 'fill=""')
1076
+ .replace(/stroke=".*?"/g, 'stroke=""');
1077
+ };
1089
1078
 
1090
1079
  export { Badge as B, Icon as I, Tooltip as T, tooltipAppearance as a, Title as b, titleConfig as c, titleAppearance as d, iconAppearance as e, badgeAppearance as f, badgeConfig as g, iconConfig as i, tooltipConfig as t };