@itcase/ui 1.8.13 → 1.8.17
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/{Button_cjs_Bb9svkwu.js → Button_cjs_DjCsrrlr.js} +20 -39
- package/dist/{Button_es_Cd4sw9Q5.js → Button_es_CHDT0-8K.js} +20 -39
- package/dist/ChipsGroup_cjs_CTpMiyQb.js +164 -0
- package/dist/ChipsGroup_es_CP_xm25C.js +159 -0
- package/dist/DatePicker_cjs_DPtOL1eW.js +201 -0
- package/dist/DatePicker_es_DCuzMD0T.js +197 -0
- package/dist/Divider_cjs_DzFVtGkF.js +155 -0
- package/dist/Divider_es_BdU9qjKa.js +151 -0
- package/dist/{DropdownItem_cjs_TdJHpFgg.js → DropdownItem_cjs_DW0UXopm.js} +67 -3
- package/dist/{DropdownItem_es_CdYP5BQN.js → DropdownItem_es_vuNthDPa.js} +67 -3
- package/dist/{Label_cjs_CbcENlSZ.js → Label_cjs_mw4pHZR1.js} +29 -30
- package/dist/{Label_es_BCpDqP3q.js → Label_es_CiPEDFcR.js} +29 -30
- package/dist/{Loader_cjs_D753D3li.js → Loader_cjs_DZbIy6Ko.js} +1 -1
- package/dist/{Loader_es_BE4nyzXi.js → Loader_es_SHdP0IkA.js} +1 -1
- package/dist/Overlay_cjs_BdAm_zrO.js +229 -0
- package/dist/Overlay_es_cI_-_xUO.js +225 -0
- package/dist/{Text_cjs_D4xG0cKD.js → Text_cjs_iL1l_7V1.js} +31 -5
- package/dist/{Text_es_FJGduy7Z.js → Text_es_D012qJ8s.js} +31 -5
- package/dist/Tooltip_cjs_BKOjNMkt.js +676 -0
- package/dist/Tooltip_es_C7zstTA2.js +663 -0
- package/dist/cjs/components/Accordion.js +105 -12
- package/dist/cjs/components/Avatar.js +208 -10
- package/dist/cjs/components/Badge.js +6 -9
- package/dist/cjs/components/Breadcrumbs.js +205 -25
- package/dist/cjs/components/Button.js +5 -7
- package/dist/cjs/components/Cell.js +202 -8
- package/dist/cjs/components/Checkbox.js +1 -1
- package/dist/cjs/components/Chips.js +13 -132
- package/dist/cjs/components/Choice.js +5 -7
- package/dist/cjs/components/Code.js +116 -3
- package/dist/cjs/components/CookiesWarning.js +8 -10
- package/dist/cjs/components/DatePeriod.js +65 -0
- package/dist/cjs/components/DatePicker.js +20 -197
- package/dist/cjs/components/Divider.js +1 -1
- package/dist/cjs/components/Dropdown.js +3 -3
- package/dist/cjs/components/HeroTitle.js +26 -3
- package/dist/cjs/components/Icon.js +6 -8
- package/dist/cjs/components/InputPassword.js +4 -6
- package/dist/cjs/components/Label.js +5 -4
- package/dist/cjs/components/List.js +209 -3
- package/dist/cjs/components/Loader.js +2 -2
- package/dist/cjs/components/MenuItem.js +139 -6
- package/dist/cjs/components/Modal.js +7 -5
- package/dist/cjs/components/Notification.js +104 -27
- package/dist/cjs/components/Overlay.js +1 -1
- package/dist/cjs/components/Pagination.js +7 -9
- package/dist/cjs/components/Panel.js +1 -1
- package/dist/cjs/components/Radio.js +1 -1
- package/dist/cjs/components/Response.js +4 -6
- package/dist/cjs/components/Search.js +4 -6
- package/dist/cjs/components/Segmented.js +102 -10
- package/dist/cjs/components/Select.js +8 -11
- package/dist/cjs/components/Swiper.js +5 -2
- package/dist/cjs/components/Switch.js +1 -1
- package/dist/cjs/components/Tab.js +4 -7
- package/dist/cjs/components/Text.js +1 -1
- package/dist/cjs/components/Tile.js +3 -6
- package/dist/cjs/components/Title.js +7 -4
- package/dist/cjs/components/Tooltip.js +4 -3
- package/dist/components/Accordion.js +105 -11
- package/dist/components/Avatar.js +208 -10
- package/dist/components/Badge.js +3 -6
- package/dist/components/Breadcrumbs.js +206 -27
- package/dist/components/Button.js +5 -7
- package/dist/components/Cell.js +201 -7
- package/dist/components/Checkbox.js +1 -1
- package/dist/components/Chips.js +9 -133
- package/dist/components/Choice.js +3 -5
- package/dist/components/Code.js +116 -3
- package/dist/components/CookiesWarning.js +8 -10
- package/dist/components/DatePeriod.js +61 -0
- package/dist/components/DatePicker.js +17 -198
- package/dist/components/Divider.js +1 -1
- package/dist/components/Dropdown.js +3 -3
- package/dist/components/HeroTitle.js +26 -3
- package/dist/components/Icon.js +3 -5
- package/dist/components/InputPassword.js +3 -5
- package/dist/components/Label.js +5 -4
- package/dist/components/List.js +209 -3
- package/dist/components/Loader.js +2 -2
- package/dist/components/MenuItem.js +139 -6
- package/dist/components/Modal.js +6 -4
- package/dist/components/Notification.js +104 -27
- package/dist/components/Overlay.js +1 -1
- package/dist/components/Pagination.js +4 -6
- package/dist/components/Panel.js +1 -1
- package/dist/components/Radio.js +1 -1
- package/dist/components/Response.js +4 -6
- package/dist/components/Search.js +2 -4
- package/dist/components/Segmented.js +102 -10
- package/dist/components/Select.js +4 -7
- package/dist/components/Swiper.js +4 -1
- package/dist/components/Switch.js +1 -1
- package/dist/components/Tab.js +3 -6
- package/dist/components/Text.js +1 -1
- package/dist/components/Tile.js +2 -5
- package/dist/components/Title.js +4 -1
- package/dist/components/Tooltip.js +4 -3
- package/dist/css/components/Badge/Badge.css +4 -4
- package/dist/css/components/Chips/Chips.css +10 -6
- package/dist/css/components/DatePeriod/DatePeriod.css +105 -0
- package/dist/css/components/Group/Group.css +3 -0
- package/dist/css/components/Icon/Icon.css +78 -22
- package/dist/css/components/Segmented/Segmented.css +3 -6
- package/dist/css/components/Title/Title.css +11 -5
- package/dist/css/styles/border/border.css +14 -0
- package/dist/css/styles/fill/fill.css +2 -1
- package/dist/css/styles/text-color/text-color.css +2 -1
- package/dist/stories/BreadcrumbsItem.mdx +1 -1
- package/dist/stories/Plsyground.mdx +1 -3
- package/dist/stories/Text.mdx +1 -1
- package/dist/types/components/Accordion/Accordion.appearance.d.ts +1 -2
- package/dist/types/components/Accordion/appearance/accordionSize.d.ts +59 -0
- package/dist/types/components/Accordion/appearance/accordionStyle.d.ts +16 -0
- package/dist/types/components/Accordion/appearance/accordionSurface.d.ts +26 -0
- package/dist/types/components/Accordion/index.d.ts +2 -2
- package/dist/types/components/Avatar/appearance/avatarAccent.d.ts +19 -0
- package/dist/types/components/Avatar/appearance/avatarDanger.d.ts +7 -0
- package/dist/types/components/Avatar/appearance/avatarError.d.ts +9 -0
- package/dist/types/components/Avatar/appearance/avatarInfo.d.ts +17 -0
- package/dist/types/components/Avatar/appearance/avatarPrimary.d.ts +8 -0
- package/dist/types/components/Avatar/appearance/avatarSecondary.d.ts +8 -0
- package/dist/types/components/Avatar/appearance/avatarSize.d.ts +75 -0
- package/dist/types/components/Avatar/appearance/avatarStyle.d.ts +16 -0
- package/dist/types/components/Avatar/appearance/avatarSuccess.d.ts +9 -0
- package/dist/types/components/Avatar/appearance/avatarSurface.d.ts +25 -0
- package/dist/types/components/Avatar/appearance/avatarWarning.d.ts +9 -0
- package/dist/types/components/Badge/appearance/badgeAccent.d.ts +7 -0
- package/dist/types/components/Badge/appearance/badgeSurface.d.ts +0 -4
- package/dist/types/components/Breadcrumbs/Breadcrumbs.appearance.d.ts +2 -0
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +3 -2
- package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +22 -1
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsAccent.d.ts +19 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsDanger.d.ts +7 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsError.d.ts +9 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsInfo.d.ts +17 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsPrimary.d.ts +8 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSecondary.d.ts +8 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSize.d.ts +52 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsStyle.d.ts +16 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSuccess.d.ts +9 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsSurface.d.ts +23 -0
- package/dist/types/components/Breadcrumbs/appearance/breadcrumbsWarning.d.ts +9 -0
- package/dist/types/components/Breadcrumbs/index.d.ts +1 -0
- package/dist/types/components/Button/appearance/buttonAccent.d.ts +0 -16
- package/dist/types/components/Button/appearance/buttonStyle.d.ts +7 -7
- package/dist/types/components/Button/appearance/buttonSurface.d.ts +6 -5
- package/dist/types/components/Cell/appearance/cellAccent.d.ts +21 -0
- package/dist/types/components/Cell/appearance/cellDanger.d.ts +7 -0
- package/dist/types/components/Cell/appearance/cellError.d.ts +11 -0
- package/dist/types/components/Cell/appearance/cellInfo.d.ts +21 -0
- package/dist/types/components/Cell/appearance/cellPrimary.d.ts +8 -0
- package/dist/types/components/Cell/appearance/cellSecondary.d.ts +8 -0
- package/dist/types/components/Cell/appearance/cellSize.d.ts +59 -0
- package/dist/types/components/Cell/appearance/cellStyle.d.ts +16 -0
- package/dist/types/components/Cell/appearance/cellSuccess.d.ts +11 -0
- package/dist/types/components/Cell/appearance/cellSurface.d.ts +25 -0
- package/dist/types/components/Cell/appearance/cellWarning.d.ts +11 -0
- package/dist/types/components/Chips/ChipsGroup.d.ts +2 -0
- package/dist/types/components/Chips/appearance/chipsSize.d.ts +4 -0
- package/dist/types/components/Chips/appearance/chipsStyle.d.ts +15 -1
- package/dist/types/components/Chips/appearance/chipsSurface.d.ts +2 -0
- package/dist/types/components/Chips/index.d.ts +1 -0
- package/dist/types/components/Code/Code.appearance.d.ts +1 -1
- package/dist/types/components/Code/appearance/codeDefault.d.ts +18 -0
- package/dist/types/components/Code/appearance/codeDisabled.d.ts +20 -0
- package/dist/types/components/Code/appearance/codeError.d.ts +11 -0
- package/dist/types/components/Code/appearance/codeRequire.d.ts +20 -0
- package/dist/types/components/Code/appearance/codeSize.d.ts +19 -0
- package/dist/types/components/Code/appearance/codeStyle.d.ts +16 -0
- package/dist/types/components/Code/appearance/codeSuccess.d.ts +11 -0
- package/dist/types/components/CookiesWarning/CookiesWarning.d.ts +1 -1
- package/dist/types/components/DatePeriod/DatePeriod.appearance.d.ts +2 -0
- package/dist/types/components/DatePeriod/DatePeriod.d.ts +4 -0
- package/dist/types/components/DatePeriod/DatePeriod.interface.d.ts +45 -0
- package/dist/types/components/DatePeriod/index.d.ts +2 -0
- package/dist/types/components/DatePicker/DatePicker.appearance.d.ts +3 -0
- package/dist/types/components/DatePicker/appearance/datePickerSize.d.ts +3 -0
- package/dist/types/components/Divider/Divider.appearance.d.ts +2 -2
- package/dist/types/components/Divider/Divider.interface.d.ts +3 -3
- package/dist/types/components/Divider/appearance/dividerAccent.d.ts +21 -0
- package/dist/types/components/Divider/appearance/dividerError.d.ts +11 -0
- package/dist/types/components/Divider/appearance/dividerPrimary.d.ts +8 -0
- package/dist/types/components/Divider/appearance/dividerSecondary.d.ts +8 -0
- package/dist/types/components/Divider/appearance/dividerSize.d.ts +12 -0
- package/dist/types/components/Divider/appearance/dividerStyle.d.ts +16 -0
- package/dist/types/components/Divider/appearance/dividerSuccess.d.ts +11 -0
- package/dist/types/components/Divider/appearance/dividerSurface.d.ts +25 -0
- package/dist/types/components/Divider/appearance/dividerWarning.d.ts +11 -0
- package/dist/types/components/Dropdown/appearance/dropdownAccent.d.ts +21 -0
- package/dist/types/components/Dropdown/appearance/dropdownSize.d.ts +27 -0
- package/dist/types/components/Dropdown/appearance/dropdownStyle.d.ts +16 -0
- package/dist/types/components/HeroTitle/HeroTitle.appearance.d.ts +2 -2
- package/dist/types/components/HeroTitle/HeroTitle.interface.d.ts +8 -8
- package/dist/types/components/HeroTitle/appearance/heroTitleSize.d.ts +27 -0
- package/dist/types/components/Icon/appearance/iconAccent.d.ts +34 -0
- package/dist/types/components/Icon/appearance/iconDanger.d.ts +11 -0
- package/dist/types/components/Icon/appearance/iconError.d.ts +11 -0
- package/dist/types/components/Icon/appearance/iconInfo.d.ts +21 -0
- package/dist/types/components/Icon/appearance/iconPrimary.d.ts +8 -0
- package/dist/types/components/Icon/appearance/iconSecondary.d.ts +8 -0
- package/dist/types/components/Icon/appearance/iconSize.d.ts +115 -0
- package/dist/types/components/Icon/appearance/iconStyle.d.ts +16 -0
- package/dist/types/components/Icon/appearance/iconSuccess.d.ts +11 -0
- package/dist/types/components/Icon/appearance/iconSurface.d.ts +27 -0
- package/dist/types/components/Icon/appearance/iconWarning.d.ts +11 -0
- package/dist/types/components/Label/appearance/labelDanger.d.ts +0 -2
- package/dist/types/components/Label/appearance/labelError.d.ts +6 -2
- package/dist/types/components/Label/appearance/labelGradient.d.ts +0 -2
- package/dist/types/components/Label/appearance/labelInfo.d.ts +2 -6
- package/dist/types/components/Label/appearance/labelSize.d.ts +0 -7
- package/dist/types/components/Label/appearance/labelStyle.d.ts +7 -7
- package/dist/types/components/Label/appearance/labelSuccess.d.ts +6 -2
- package/dist/types/components/Label/appearance/labelWarning.d.ts +6 -2
- package/dist/types/components/List/List.appearance.d.ts +2 -0
- package/dist/types/components/List/List.interface.d.ts +22 -1
- package/dist/types/components/List/appearance/listAccent.d.ts +21 -0
- package/dist/types/components/List/appearance/listDanger.d.ts +7 -0
- package/dist/types/components/List/appearance/listError.d.ts +11 -0
- package/dist/types/components/List/appearance/listInfo.d.ts +21 -0
- package/dist/types/components/List/appearance/listPrimary.d.ts +8 -0
- package/dist/types/components/List/appearance/listSecondary.d.ts +8 -0
- package/dist/types/components/List/appearance/listSize.d.ts +59 -0
- package/dist/types/components/List/appearance/listStyle.d.ts +16 -0
- package/dist/types/components/List/appearance/listSuccess.d.ts +11 -0
- package/dist/types/components/List/appearance/listSurface.d.ts +25 -0
- package/dist/types/components/List/appearance/listWarning.d.ts +11 -0
- package/dist/types/components/MenuItem/appearance/menuItemAccent.d.ts +21 -0
- package/dist/types/components/MenuItem/appearance/menuItemError.d.ts +11 -0
- package/dist/types/components/MenuItem/appearance/menuItemPrimary.d.ts +8 -0
- package/dist/types/components/MenuItem/appearance/menuItemSize.d.ts +59 -0
- package/dist/types/components/MenuItem/appearance/menuItemStyle.d.ts +16 -0
- package/dist/types/components/MenuItem/appearance/menuItemSurface.d.ts +25 -0
- package/dist/types/components/Notification/appearance/notificationItemError.d.ts +11 -0
- package/dist/types/components/Notification/appearance/notificationItemSize.d.ts +59 -0
- package/dist/types/components/Notification/appearance/notificationItemStyle.d.ts +16 -0
- package/dist/types/components/Notification/appearance/notificationItemSuccess.d.ts +11 -0
- package/dist/types/components/Notification/appearance/notificationItemWarning.d.ts +11 -0
- package/dist/types/components/Overlay/appearance/overlayAccent.d.ts +21 -0
- package/dist/types/components/Overlay/appearance/overlayDanger.d.ts +7 -0
- package/dist/types/components/Overlay/appearance/overlayError.d.ts +11 -0
- package/dist/types/components/Overlay/appearance/overlayInfo.d.ts +21 -0
- package/dist/types/components/Overlay/appearance/overlayPrimary.d.ts +8 -0
- package/dist/types/components/Overlay/appearance/overlaySecondary.d.ts +8 -0
- package/dist/types/components/Overlay/appearance/overlaySize.d.ts +59 -0
- package/dist/types/components/Overlay/appearance/overlayStyle.d.ts +16 -0
- package/dist/types/components/Overlay/appearance/overlaySuccess.d.ts +11 -0
- package/dist/types/components/Overlay/appearance/overlaySurface.d.ts +25 -0
- package/dist/types/components/Overlay/appearance/overlayWarning.d.ts +11 -0
- package/dist/types/components/Pagination/appearance/paginationAccent.d.ts +21 -0
- package/dist/types/components/Pagination/appearance/paginationDanger.d.ts +7 -0
- package/dist/types/components/Pagination/appearance/paginationError.d.ts +11 -0
- package/dist/types/components/Pagination/appearance/paginationInfo.d.ts +21 -0
- package/dist/types/components/Pagination/appearance/paginationPrimary.d.ts +8 -0
- package/dist/types/components/Pagination/appearance/paginationSecondary.d.ts +8 -0
- package/dist/types/components/Pagination/appearance/paginationSize.d.ts +59 -0
- package/dist/types/components/Pagination/appearance/paginationStyle.d.ts +16 -0
- package/dist/types/components/Pagination/appearance/paginationSuccess.d.ts +11 -0
- package/dist/types/components/Pagination/appearance/paginationWarning.d.ts +11 -0
- package/dist/types/components/Radio/appearance/radioDefault.d.ts +18 -0
- package/dist/types/components/Radio/appearance/radioError.d.ts +11 -0
- package/dist/types/components/Radio/appearance/radioRequire.d.ts +20 -0
- package/dist/types/components/Radio/appearance/radioSize.d.ts +27 -0
- package/dist/types/components/Radio/appearance/radioStyle.d.ts +16 -0
- package/dist/types/components/Radio/appearance/radioSuccess.d.ts +11 -0
- package/dist/types/components/Segmented/appearance/segmentedAccent.d.ts +19 -0
- package/dist/types/components/Segmented/appearance/segmentedDisabled.d.ts +18 -0
- package/dist/types/components/Segmented/appearance/segmentedError.d.ts +9 -0
- package/dist/types/components/Segmented/appearance/segmentedFalse.d.ts +4 -0
- package/dist/types/components/Segmented/appearance/segmentedSize.d.ts +10 -2
- package/dist/types/components/Segmented/appearance/segmentedStyle.d.ts +16 -0
- package/dist/types/components/Segmented/appearance/segmentedSuccess.d.ts +9 -0
- package/dist/types/components/Segmented/appearance/segmentedWarning.d.ts +9 -0
- package/dist/types/components/Text/Text.appearance.d.ts +2 -2
- package/dist/types/components/Text/Text.interface.d.ts +3 -3
- package/dist/types/components/Text/appearance/textSize.d.ts +31 -0
- package/package.json +5 -5
- package/dist/Badge_cjs_CeqDdbMs.js +0 -227
- package/dist/Badge_es_uDX0eyDM.js +0 -223
- package/dist/Divider_cjs_DakITdTv.js +0 -34
- package/dist/Divider_es_CWsDM2Rm.js +0 -30
- package/dist/Icon_cjs_BaWMPaAR.js +0 -67
- package/dist/Icon_es_B0sySEUu.js +0 -63
- package/dist/Overlay_cjs_BTSfcGrM.js +0 -33
- package/dist/Overlay_es_CR7d-ISF.js +0 -29
- package/dist/Title_cjs_ByPcFb15.js +0 -44
- package/dist/Title_es_eejUqSJf.js +0 -40
- package/dist/Tooltip_cjs_CY4HOzhz.js +0 -97
- package/dist/Tooltip_es_B9hN4Zlm.js +0 -93
- package/dist/stories/Divider.mdx +0 -35
- package/dist/stories/Icon.mdx +0 -15
- package/dist/stories/Loader.mdx +0 -11
- package/dist/stories/Segmented.mdx +0 -11
|
@@ -0,0 +1,663 @@
|
|
|
1
|
+
import { _ as __assign } from './tslib.es6_es_Bwu1Cn-t.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
3
|
+
import React, { useMemo, useRef, useState, useCallback, useImperativeHandle } from 'react';
|
|
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_D012qJ8s.js';
|
|
8
|
+
import SVG from 'react-inlinesvg';
|
|
9
|
+
import { a as LinkWrapper } from './Link_es_DkW06IM-.js';
|
|
10
|
+
|
|
11
|
+
var badgeAppearanceAccent = {
|
|
12
|
+
accent: {
|
|
13
|
+
fill: 'accentPrimary',
|
|
14
|
+
borderColor: 'accentBorderTertiary',
|
|
15
|
+
textColor: 'accentTextPrimary',
|
|
16
|
+
dotFill: 'accentItemPrimary',
|
|
17
|
+
iconFill: 'accentItemPrimary',
|
|
18
|
+
},
|
|
19
|
+
accentPrimary: {
|
|
20
|
+
dotFill: 'accentItemPrimary',
|
|
21
|
+
fill: 'accentPrimary',
|
|
22
|
+
borderColor: 'accentBorderTertiary',
|
|
23
|
+
textColor: 'accentTextPrimary',
|
|
24
|
+
iconFill: 'accentItemPrimary',
|
|
25
|
+
},
|
|
26
|
+
accentQuaternary: {
|
|
27
|
+
dotFill: 'accentItemPrimary',
|
|
28
|
+
},
|
|
29
|
+
accentSecondary: {
|
|
30
|
+
dotFill: 'accentItemPrimary',
|
|
31
|
+
},
|
|
32
|
+
accentTertiary: {
|
|
33
|
+
dotFill: 'accentItemPrimary',
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
var badgeAppearanceDanger = {
|
|
38
|
+
danger: {
|
|
39
|
+
fill: 'dangerPrimary',
|
|
40
|
+
fillHover: 'dangerPrimary',
|
|
41
|
+
borderColor: 'dangerBorderPrimary',
|
|
42
|
+
textColor: 'dangerTextSecondary',
|
|
43
|
+
dotFill: 'dangerItemPrimary',
|
|
44
|
+
iconFill: 'dangerItemPrimary',
|
|
45
|
+
},
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
var badgeAppearanceError = {
|
|
49
|
+
error: {
|
|
50
|
+
fill: 'errorPrimary',
|
|
51
|
+
fillHover: 'errorPrimaryHover',
|
|
52
|
+
labelTextColor: 'errorTextPrimary',
|
|
53
|
+
labelTextColorHover: 'errorTextPrimary',
|
|
54
|
+
iconFill: 'errorItemPrimary',
|
|
55
|
+
loaderFill: 'errorPrimary',
|
|
56
|
+
loaderItemFill: 'errorItemPrimary',
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
var badgeAppearanceInfo = {
|
|
61
|
+
info: {
|
|
62
|
+
fill: 'infoPrimary',
|
|
63
|
+
fillHover: 'infoPrimaryHover',
|
|
64
|
+
borderColor: 'infoBorderSecondary',
|
|
65
|
+
textColor: 'infoTextPrimary',
|
|
66
|
+
dotFill: 'infoItemPrimary',
|
|
67
|
+
iconFill: 'infoItemPrimary',
|
|
68
|
+
},
|
|
69
|
+
infoSecondary: {
|
|
70
|
+
fill: 'infoSecondary',
|
|
71
|
+
fillHover: 'infoSecondaryHover',
|
|
72
|
+
borderColor: 'infoBorderSecondary',
|
|
73
|
+
textColor: 'infoTextSecondary',
|
|
74
|
+
dotFill: 'infoItemSecondary',
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
var badgeAppearancePrimary = {
|
|
79
|
+
primary: {
|
|
80
|
+
fill: 'primaryPrimary',
|
|
81
|
+
fillHover: 'primaryPrimaryHover',
|
|
82
|
+
borderColor: 'primaryBorderSecondary',
|
|
83
|
+
textColor: 'primaryTextPrimary',
|
|
84
|
+
dotFill: 'primaryItemPrimary',
|
|
85
|
+
iconFill: 'primaryItemPrimary',
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
var badgeAppearanceSecondary = {
|
|
90
|
+
secondary: {
|
|
91
|
+
fill: 'secondaryPrimary',
|
|
92
|
+
fillHover: 'secondaryPrimaryHover',
|
|
93
|
+
borderColor: 'secondaryBorderSecondary',
|
|
94
|
+
textColor: 'secondaryTextPrimary',
|
|
95
|
+
dotFill: 'secondaryItemPrimary',
|
|
96
|
+
iconFill: 'secondaryItemPrimary',
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
var badgeAppearanceSize = {
|
|
101
|
+
sizeXXL: {
|
|
102
|
+
size: 'xxl',
|
|
103
|
+
textSize: 'xl',
|
|
104
|
+
iconSize: 24,
|
|
105
|
+
},
|
|
106
|
+
sizeXL: {
|
|
107
|
+
size: 'xl',
|
|
108
|
+
textSize: 'l',
|
|
109
|
+
},
|
|
110
|
+
sizeL: {
|
|
111
|
+
size: 'l',
|
|
112
|
+
textSize: 'l',
|
|
113
|
+
},
|
|
114
|
+
sizeM: {
|
|
115
|
+
size: 'm',
|
|
116
|
+
textSize: 'm',
|
|
117
|
+
},
|
|
118
|
+
sizeS: {
|
|
119
|
+
size: 's',
|
|
120
|
+
textSize: 's',
|
|
121
|
+
},
|
|
122
|
+
sizeXS: {
|
|
123
|
+
size: 'xs',
|
|
124
|
+
textSize: 'xs',
|
|
125
|
+
},
|
|
126
|
+
sizeXXS: {
|
|
127
|
+
size: 'xxs',
|
|
128
|
+
textSize: 'xs',
|
|
129
|
+
},
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
var badgeAppearanceStyle = {
|
|
133
|
+
full: {
|
|
134
|
+
borderColor: null,
|
|
135
|
+
},
|
|
136
|
+
ghost: {
|
|
137
|
+
fill: null,
|
|
138
|
+
borderColor: null,
|
|
139
|
+
},
|
|
140
|
+
outlined: {
|
|
141
|
+
fill: null,
|
|
142
|
+
},
|
|
143
|
+
solid: {
|
|
144
|
+
borderColor: null,
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
|
|
148
|
+
var badgeAppearanceSuccess = {
|
|
149
|
+
success: {
|
|
150
|
+
fill: 'successPrimary',
|
|
151
|
+
fillHover: 'successPrimaryHover',
|
|
152
|
+
borderColor: 'successBorderPrimary',
|
|
153
|
+
textColor: 'successTextPrimary',
|
|
154
|
+
dotFill: 'successItemPrimary',
|
|
155
|
+
iconFill: 'successItemPrimary',
|
|
156
|
+
},
|
|
157
|
+
};
|
|
158
|
+
|
|
159
|
+
var badgeAppearanceSurface = {
|
|
160
|
+
surfacePrimary: {
|
|
161
|
+
fill: 'surfacePrimary',
|
|
162
|
+
borderColor: 'surfaceBorderTertiary',
|
|
163
|
+
textColor: 'surfaceTextPrimary',
|
|
164
|
+
dotFill: 'surfaceItemPrimary',
|
|
165
|
+
iconFill: 'surfaceItemPrimary',
|
|
166
|
+
},
|
|
167
|
+
surfaceQuaternary: {
|
|
168
|
+
fill: 'accentPrimary',
|
|
169
|
+
borderColor: 'surfaceBorderPrimary',
|
|
170
|
+
textColor: 'surfaceTextInverse',
|
|
171
|
+
},
|
|
172
|
+
surfaceSecondary: {
|
|
173
|
+
fill: 'surfaceSecondary',
|
|
174
|
+
borderColor: 'surfaceBorderSecondary',
|
|
175
|
+
textColor: 'surfaceTextPrimary',
|
|
176
|
+
},
|
|
177
|
+
surfaceTertiary: {
|
|
178
|
+
fill: 'surfaceTertiary',
|
|
179
|
+
borderColor: 'surfaceBorderTertiary',
|
|
180
|
+
textColor: 'surfaceTextPrimary',
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
var badgeAppearanceWarning = {
|
|
185
|
+
warning: {
|
|
186
|
+
fill: 'warningPrimary',
|
|
187
|
+
fillHover: 'warningPrimary',
|
|
188
|
+
borderColor: 'warningBorderPrimary',
|
|
189
|
+
textColor: 'warningTextSecondary',
|
|
190
|
+
dotFill: 'warningItemPrimary',
|
|
191
|
+
iconFill: 'warningItemPrimary',
|
|
192
|
+
},
|
|
193
|
+
};
|
|
194
|
+
|
|
195
|
+
var badgeAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, badgeAppearanceSize), badgeAppearanceStyle), badgeAppearanceAccent), badgeAppearanceDanger), badgeAppearanceError), badgeAppearanceInfo), badgeAppearancePrimary), badgeAppearanceSecondary), badgeAppearanceSuccess), badgeAppearanceSurface), badgeAppearanceWarning);
|
|
196
|
+
|
|
197
|
+
var badgeConfig = {
|
|
198
|
+
appearance: badgeAppearance,
|
|
199
|
+
setAppearance: function (appearanceConfig) {
|
|
200
|
+
badgeConfig.appearance = appearanceConfig;
|
|
201
|
+
},
|
|
202
|
+
};
|
|
203
|
+
function Badge(props) {
|
|
204
|
+
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;
|
|
205
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
206
|
+
var _a;
|
|
207
|
+
return (__assign(__assign({}, resultConfig), (_a = badgeConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
208
|
+
}, {});
|
|
209
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
210
|
+
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, _a = propsGenerator.shapeClass, shapeClass = _a === void 0 ? 'rounded' : _a, _b = propsGenerator.sizeClass, sizeClass = _b === void 0 ? 'm' : _b;
|
|
211
|
+
// @ts-expect-error
|
|
212
|
+
var badgeStyles = useStyles(props).styles;
|
|
213
|
+
var badgeTypeClass = value
|
|
214
|
+
? icon
|
|
215
|
+
? dot
|
|
216
|
+
? 'badge_type_dot-icon-counter'
|
|
217
|
+
: 'badge_type_icon-counter'
|
|
218
|
+
: 'badge_type_counter'
|
|
219
|
+
: icon
|
|
220
|
+
? 'badge_type_icon'
|
|
221
|
+
: dot
|
|
222
|
+
? 'badge_type_dot'
|
|
223
|
+
: 'badge_type_fill';
|
|
224
|
+
return (jsxs("div", { className: clsx(className, 'badge', borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass && "border-color_hover_".concat(borderColorHoverClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), positionClass && "position_".concat(positionClass), sizeClass && "badge_size_".concat(sizeClass), shapeClass && "badge_shape_".concat(shapeClass), badgeTypeClass, isSkeleton && 'badge_skeleton'), style: badgeStyles, children: [dot && (jsx("div", { className: clsx('badge__dot', dotFillClass && "svg_fill_".concat(dotFillClass)), children: jsx("svg", { width: "6", height: "6", viewBox: "0 0 6 6", xmlns: "http://www.w3.org/2000/svg", children: jsx("rect", { width: "6", height: "6", rx: "50" }) }) })), icon && (jsx(Icon, { className: "badge__icon", size: iconSize, iconFill: iconFill, imageSrc: iconSrc, shape: iconShape, SvgImage: icon })), children ||
|
|
225
|
+
(value && (jsx(Text, { className: "badge__value", size: textSize, textColor: textColor, children: value })))] }));
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
var iconAppearanceAccent = {
|
|
229
|
+
accent: {
|
|
230
|
+
fill: 'accentPrimary',
|
|
231
|
+
fillHover: 'accentHover',
|
|
232
|
+
labelTextColor: 'accentTextPrimary',
|
|
233
|
+
labelTextColorHover: 'accentTextPrimary',
|
|
234
|
+
borderColor: 'accentBorderPrimary',
|
|
235
|
+
iconAfterFillIcon: 'accentItemPrimary',
|
|
236
|
+
iconBeforeFillIcon: 'accentItemPrimary',
|
|
237
|
+
loaderFill: 'accentPrimary',
|
|
238
|
+
loaderItemFill: 'accentItemPrimary',
|
|
239
|
+
},
|
|
240
|
+
accentPrimary: {
|
|
241
|
+
fill: 'accentPrimary',
|
|
242
|
+
fillHover: 'accentHover',
|
|
243
|
+
labelTextColor: 'accentTextPrimary',
|
|
244
|
+
labelTextColorHover: 'accentTextPrimary',
|
|
245
|
+
borderColor: 'accentBorderPrimary',
|
|
246
|
+
iconAfterFillIcon: 'accentItemPrimary',
|
|
247
|
+
iconBeforeFillIcon: 'accentItemPrimary',
|
|
248
|
+
loaderFill: 'accentPrimary',
|
|
249
|
+
loaderItemFill: 'accentItemPrimary',
|
|
250
|
+
},
|
|
251
|
+
accentSecondary: {
|
|
252
|
+
fill: 'accentPrimary',
|
|
253
|
+
fillHover: 'accentHover',
|
|
254
|
+
labelTextColor: 'accentTextSecondary',
|
|
255
|
+
labelTextColorHover: 'accentTextSecondary',
|
|
256
|
+
borderColor: 'accentBorderPrimary',
|
|
257
|
+
loaderFill: 'accentPrimary',
|
|
258
|
+
loaderItemFill: 'accentItemPrimary',
|
|
259
|
+
}
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
var iconAppearanceDanger = {
|
|
263
|
+
danger: {
|
|
264
|
+
fill: 'dangerPrimary',
|
|
265
|
+
fillHover: 'dangerHover',
|
|
266
|
+
labelTextColor: 'dangerTextSecondary',
|
|
267
|
+
labelTextColorHover: 'dangerTextSecondary',
|
|
268
|
+
loaderFill: 'dangerPrimary',
|
|
269
|
+
loaderItemFill: 'dangerItemPrimary',
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
var iconAppearanceError = {
|
|
274
|
+
error: {
|
|
275
|
+
fill: 'errorPrimary',
|
|
276
|
+
fillHover: 'errorHover',
|
|
277
|
+
labelTextColor: 'errorTextPrimary',
|
|
278
|
+
labelTextColorHover: 'errorTextPrimary',
|
|
279
|
+
loaderFill: 'errorPrimary',
|
|
280
|
+
loaderItemFill: 'errorItemPrimary',
|
|
281
|
+
},
|
|
282
|
+
};
|
|
283
|
+
|
|
284
|
+
var iconAppearanceInfo = {
|
|
285
|
+
info: {
|
|
286
|
+
fill: 'accentPrimary',
|
|
287
|
+
fillHover: 'accentPrimaryHover',
|
|
288
|
+
labelTextColor: 'accentTextPrimary',
|
|
289
|
+
labelTextColorHover: 'accentTextPrimary',
|
|
290
|
+
borderColor: 'accentBorderPrimary',
|
|
291
|
+
loaderFill: 'accentPrimary',
|
|
292
|
+
loaderItemFill: 'accentItemPrimary',
|
|
293
|
+
},
|
|
294
|
+
infoSecondary: {
|
|
295
|
+
fill: 'accentPrimary',
|
|
296
|
+
fillHover: 'accentPrimaryHover',
|
|
297
|
+
labelTextColor: 'accentTextSecondary',
|
|
298
|
+
labelTextColorHover: 'accentTextSecondary',
|
|
299
|
+
borderColor: 'accentBorderPrimary',
|
|
300
|
+
loaderFill: 'accentPrimary',
|
|
301
|
+
loaderItemFill: 'accentItemPrimary',
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
var iconAppearancePrimary = {
|
|
306
|
+
primary: {
|
|
307
|
+
fill: 'primaryPrimary',
|
|
308
|
+
fillHover: 'primaryPrimaryHover',
|
|
309
|
+
labelTextColor: 'primaryTextPrimary',
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
var iconAppearanceSecondary = {
|
|
314
|
+
secondary: {
|
|
315
|
+
fill: 'secondaryPrimary',
|
|
316
|
+
fillHover: 'secondaryPrimaryHover',
|
|
317
|
+
labelTextColor: 'secondaryTextPrimary',
|
|
318
|
+
},
|
|
319
|
+
};
|
|
320
|
+
|
|
321
|
+
var iconAppearanceSize = {
|
|
322
|
+
size40_40: {
|
|
323
|
+
fillSize: '40',
|
|
324
|
+
iconSize: '40',
|
|
325
|
+
},
|
|
326
|
+
size40_32: {
|
|
327
|
+
fillSize: '40',
|
|
328
|
+
iconSize: '32',
|
|
329
|
+
},
|
|
330
|
+
size40_24: {
|
|
331
|
+
fillSize: '40',
|
|
332
|
+
iconSize: '24',
|
|
333
|
+
},
|
|
334
|
+
size40_20: {
|
|
335
|
+
fillSize: '40',
|
|
336
|
+
iconSize: '20',
|
|
337
|
+
},
|
|
338
|
+
size40_16: {
|
|
339
|
+
fillSize: '40',
|
|
340
|
+
iconSize: '16',
|
|
341
|
+
},
|
|
342
|
+
size40_14: {
|
|
343
|
+
fillSize: '40',
|
|
344
|
+
iconSize: '14',
|
|
345
|
+
},
|
|
346
|
+
size40_12: {
|
|
347
|
+
fillSize: '40',
|
|
348
|
+
iconSize: '12',
|
|
349
|
+
},
|
|
350
|
+
size32_32: {
|
|
351
|
+
fillSize: '32',
|
|
352
|
+
iconSize: '32',
|
|
353
|
+
},
|
|
354
|
+
size32_24: {
|
|
355
|
+
fillSize: '32',
|
|
356
|
+
iconSize: '24',
|
|
357
|
+
},
|
|
358
|
+
size32_20: {
|
|
359
|
+
fillSize: '32',
|
|
360
|
+
iconSize: '20',
|
|
361
|
+
},
|
|
362
|
+
size32_16: {
|
|
363
|
+
fillSize: '32',
|
|
364
|
+
iconSize: '16',
|
|
365
|
+
},
|
|
366
|
+
size32_14: {
|
|
367
|
+
fillSize: '32',
|
|
368
|
+
iconSize: '14',
|
|
369
|
+
},
|
|
370
|
+
size32_12: {
|
|
371
|
+
fillSize: '32',
|
|
372
|
+
iconSize: '12',
|
|
373
|
+
},
|
|
374
|
+
size24_24: {
|
|
375
|
+
fillSize: '24',
|
|
376
|
+
iconSize: '24',
|
|
377
|
+
},
|
|
378
|
+
size24_20: {
|
|
379
|
+
fillSize: '24',
|
|
380
|
+
iconSize: '20',
|
|
381
|
+
},
|
|
382
|
+
size24_16: {
|
|
383
|
+
fillSize: '24',
|
|
384
|
+
iconSize: '16',
|
|
385
|
+
},
|
|
386
|
+
size24_14: {
|
|
387
|
+
fillSize: '24',
|
|
388
|
+
iconSize: '14',
|
|
389
|
+
},
|
|
390
|
+
size24_12: {
|
|
391
|
+
fillSize: '24',
|
|
392
|
+
iconSize: '12',
|
|
393
|
+
},
|
|
394
|
+
size20_20: {
|
|
395
|
+
fillSize: '20',
|
|
396
|
+
iconSize: '20',
|
|
397
|
+
},
|
|
398
|
+
size20_16: {
|
|
399
|
+
fillSize: '20',
|
|
400
|
+
iconSize: '16',
|
|
401
|
+
},
|
|
402
|
+
size20_14: {
|
|
403
|
+
fillSize: '20',
|
|
404
|
+
iconSize: '14',
|
|
405
|
+
},
|
|
406
|
+
size20_12: {
|
|
407
|
+
fillSize: '20',
|
|
408
|
+
iconSize: '12',
|
|
409
|
+
},
|
|
410
|
+
size16_16: {
|
|
411
|
+
fillSize: '16',
|
|
412
|
+
iconSize: '16',
|
|
413
|
+
},
|
|
414
|
+
size16_14: {
|
|
415
|
+
fillSize: '16',
|
|
416
|
+
iconSize: '14',
|
|
417
|
+
},
|
|
418
|
+
size16_12: {
|
|
419
|
+
fillSize: '16',
|
|
420
|
+
iconSize: '12',
|
|
421
|
+
},
|
|
422
|
+
size14_14: {
|
|
423
|
+
fillSize: '14',
|
|
424
|
+
iconSize: '14',
|
|
425
|
+
},
|
|
426
|
+
size14_12: {
|
|
427
|
+
fillSize: '14',
|
|
428
|
+
iconSize: '12',
|
|
429
|
+
},
|
|
430
|
+
size12_12: {
|
|
431
|
+
fillSize: '12',
|
|
432
|
+
iconSize: '12',
|
|
433
|
+
},
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
var iconAppearanceStyle = {
|
|
437
|
+
full: {},
|
|
438
|
+
ghost: {
|
|
439
|
+
fill: 'none',
|
|
440
|
+
fillHover: 'none',
|
|
441
|
+
borderColor: '0',
|
|
442
|
+
},
|
|
443
|
+
outlined: {
|
|
444
|
+
fill: 'none',
|
|
445
|
+
fillHover: 'none',
|
|
446
|
+
},
|
|
447
|
+
solid: {
|
|
448
|
+
borderColor: '0',
|
|
449
|
+
},
|
|
450
|
+
};
|
|
451
|
+
|
|
452
|
+
var iconAppearanceSuccess = {
|
|
453
|
+
success: {
|
|
454
|
+
fill: 'successPrimary',
|
|
455
|
+
fillHover: 'successHover',
|
|
456
|
+
labelTextColor: 'successTextSecondary',
|
|
457
|
+
labelTextColorHover: 'successTextSecondary',
|
|
458
|
+
loaderFill: 'successPrimary',
|
|
459
|
+
loaderItemFill: 'successItemPrimary',
|
|
460
|
+
},
|
|
461
|
+
};
|
|
462
|
+
|
|
463
|
+
var iconAppearanceSurface = {
|
|
464
|
+
surfacePrimary: {
|
|
465
|
+
fill: 'surfacePrimary',
|
|
466
|
+
fillHover: 'surfaceSecondary',
|
|
467
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
468
|
+
iconFillIcon: 'surfaceItemPrimary',
|
|
469
|
+
},
|
|
470
|
+
surfaceSecondary: {
|
|
471
|
+
fill: 'surfaceSecondary',
|
|
472
|
+
fillHover: 'surfaceSecondaryHover',
|
|
473
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
474
|
+
loaderFill: 'surfaceSecondary',
|
|
475
|
+
loaderItemFill: 'surfaceItemPrimary',
|
|
476
|
+
},
|
|
477
|
+
surfaceTertiary: {
|
|
478
|
+
fill: 'surfaceTertiary',
|
|
479
|
+
fillHover: 'surfaceTertiaryHover',
|
|
480
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
481
|
+
},
|
|
482
|
+
surfaceQuaternary: {
|
|
483
|
+
fill: 'surfaceQuaternary',
|
|
484
|
+
fillHover: 'surfaceHover',
|
|
485
|
+
labelTextColor: 'surfaceTextPrimary',
|
|
486
|
+
labelTextColorHover: 'surfaceTextHover',
|
|
487
|
+
},
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
var iconAppearanceWarning = {
|
|
491
|
+
warning: {
|
|
492
|
+
fill: 'warningPrimary',
|
|
493
|
+
fillHover: 'warningHover',
|
|
494
|
+
labelTextColor: 'warningTextSecondary',
|
|
495
|
+
labelTextColorHover: 'warningTextSecondary',
|
|
496
|
+
loaderFill: 'warningPrimary',
|
|
497
|
+
loaderItemFill: 'warningItemPrimary',
|
|
498
|
+
},
|
|
499
|
+
};
|
|
500
|
+
|
|
501
|
+
var iconAppearance = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, iconAppearanceSize), iconAppearanceStyle), iconAppearanceAccent), iconAppearanceDanger), iconAppearanceError), iconAppearanceInfo), iconAppearancePrimary), iconAppearanceSecondary), iconAppearanceSuccess), iconAppearanceSurface), iconAppearanceWarning);
|
|
502
|
+
|
|
503
|
+
var iconConfig = {
|
|
504
|
+
appearance: iconAppearance,
|
|
505
|
+
setAppearance: function (appearanceConfig) {
|
|
506
|
+
iconConfig.appearance = appearanceConfig;
|
|
507
|
+
},
|
|
508
|
+
};
|
|
509
|
+
var Icon = React.forwardRef(function Icon(props, ref) {
|
|
510
|
+
// TODO: Tooltip doesn't work that anymore
|
|
511
|
+
// const [isTooltipVisible, setIsTooltipVisible] = useState(false)
|
|
512
|
+
var id = props.id, className = props.className, appearance = props.appearance, badgeClass = props.badgeClass, width = props.width, height = props.height, 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, onClick = props.onClick, onMouseEnter = props.onMouseEnter, onMouseLeave = props.onMouseLeave;
|
|
513
|
+
var ImageComponent = useMemo(function () {
|
|
514
|
+
if (SvgImage) {
|
|
515
|
+
var sizes = {};
|
|
516
|
+
if (width) {
|
|
517
|
+
sizes.width = width;
|
|
518
|
+
}
|
|
519
|
+
if (height) {
|
|
520
|
+
sizes.height = height;
|
|
521
|
+
}
|
|
522
|
+
return jsx(SvgImage, __assign({}, sizes));
|
|
523
|
+
}
|
|
524
|
+
if (imageSrc) {
|
|
525
|
+
if (imageSrc.endsWith('.svg')) {
|
|
526
|
+
return jsx(SVG, { src: imageSrc, preProcessor: removeFillStroke });
|
|
527
|
+
}
|
|
528
|
+
return jsx("img", { src: imageSrc });
|
|
529
|
+
}
|
|
530
|
+
return null;
|
|
531
|
+
}, [SvgImage, width, height, imageSrc]);
|
|
532
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
533
|
+
var _a;
|
|
534
|
+
return (__assign(__assign({}, resultConfig), (_a = iconConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
535
|
+
}, {});
|
|
536
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
537
|
+
var alignmentClass = propsGenerator.alignmentClass, 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, badgeShape = propsGenerator.badgeShape, badgeSize = propsGenerator.badgeSize, badgeTextColor = propsGenerator.badgeTextColor, badgeTextSize = propsGenerator.badgeTextSize, badgeValue = propsGenerator.badgeValue, cursorClass = propsGenerator.cursorClass, 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;
|
|
538
|
+
// @ts-expect-error
|
|
539
|
+
var iconStyles = useStyles(props).styles;
|
|
540
|
+
return (jsxs("div", { id: id, className: clsx(className, 'icon', fillClass && "fill_".concat(fillClass), fillHoverClass && "fill_hover_".concat(fillHoverClass), fillSizeClass && "icon_fill_size_".concat(fillSizeClass), fillDisabledClass && "fill_disabled_".concat(fillDisabledClass), iconFillClass && "icon_fill_".concat(iconFillClass), iconFillHoverClass && "icon_fill_hover_".concat(iconFillHoverClass), iconFillDisabledClass && "icon_fill_disabled_".concat(iconFillDisabledClass), shapeClass && "icon_shape_".concat(shapeClass), borderColorClass && "border-color_".concat(borderColorClass), borderColorHoverClass && "border-color_hover_".concat(borderColorHoverClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderTypeClass && "border_type_".concat(borderTypeClass), badgeValue && 'icon_with-badge', onClick && cursorClass && "cursor_".concat(cursorClass)), "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)), DefaultComponent: "div", href: link || href, rel: linkRel, target: linkTarget, children: [ImageComponent, badgeValue && (jsx(Badge, { className: clsx(badgeClass, 'icon__badge'), appearance: badgeAppearance, 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] }));
|
|
541
|
+
});
|
|
542
|
+
var removeFillStroke = function (code) {
|
|
543
|
+
return code
|
|
544
|
+
.replace(/fill=".*?"/g, 'fill=""')
|
|
545
|
+
.replace(/stroke=".*?"/g, 'stroke=""');
|
|
546
|
+
};
|
|
547
|
+
|
|
548
|
+
var titleAppearance = {
|
|
549
|
+
dev: {
|
|
550
|
+
textColor: 'surfaceTextPrimary',
|
|
551
|
+
},
|
|
552
|
+
};
|
|
553
|
+
|
|
554
|
+
var titleConfig = {
|
|
555
|
+
appearance: titleAppearance,
|
|
556
|
+
setAppearance: function (appearanceConfig) {
|
|
557
|
+
titleConfig.appearance = appearanceConfig;
|
|
558
|
+
},
|
|
559
|
+
};
|
|
560
|
+
function Title(props) {
|
|
561
|
+
var className = props.className, appearance = props.appearance, text = props.text, afterWrapper = props.afterWrapper; props.badgeClass; var 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;
|
|
562
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
563
|
+
var _a;
|
|
564
|
+
return (__assign(__assign({}, resultConfig), (_a = titleConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
565
|
+
}, {});
|
|
566
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
567
|
+
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, 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, iconBadgeAppearance = propsGenerator.iconBadgeAppearance, iconBadgeSize = propsGenerator.iconBadgeSize, iconBadgeTextColor = propsGenerator.iconBadgeTextColor, iconBadgeTextSize = propsGenerator.iconBadgeTextSize, iconBadgeShape = propsGenerator.iconBadgeShape, iconBadgeValue = propsGenerator.iconBadgeValue, typeClass = propsGenerator.typeClass, widthClass = propsGenerator.widthClass, wrapperDirectionClass = propsGenerator.wrapperDirectionClass;
|
|
568
|
+
// @ts-expect-error
|
|
569
|
+
var _b = useStyles(props), titleStyles = _b.styles, titleWrapperStyles = _b.wrapper;
|
|
570
|
+
// Element type (h1, h2, ..., h6)
|
|
571
|
+
var Tag = useMemo(function () {
|
|
572
|
+
if (tag) {
|
|
573
|
+
return tag;
|
|
574
|
+
}
|
|
575
|
+
return size ? size : 'span';
|
|
576
|
+
}, [tag, size]);
|
|
577
|
+
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), 'text', textColorClass && "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] }));
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
var tooltipAppearance = {
|
|
581
|
+
surfacePrimary: {
|
|
582
|
+
fill: 'surfacePrimary',
|
|
583
|
+
titleTextColor: 'surfaceTextPrimary',
|
|
584
|
+
textColor: 'surfaceTextPrimary',
|
|
585
|
+
},
|
|
586
|
+
surfaceSecondary: {
|
|
587
|
+
fill: 'surfaceSecondary',
|
|
588
|
+
titleTextColor: 'surfaceTextPrimary',
|
|
589
|
+
textColor: 'surfaceTextPrimary',
|
|
590
|
+
},
|
|
591
|
+
surfaceTertiary: {
|
|
592
|
+
fill: 'surfaceTertiary',
|
|
593
|
+
titleTextColor: 'surfaceTextPrimary',
|
|
594
|
+
textColor: 'surfaceTextPrimary',
|
|
595
|
+
},
|
|
596
|
+
};
|
|
597
|
+
|
|
598
|
+
var tooltipConfig = {
|
|
599
|
+
appearance: tooltipAppearance,
|
|
600
|
+
setAppearance: function (appearanceConfig) {
|
|
601
|
+
tooltipConfig.appearance = appearanceConfig;
|
|
602
|
+
},
|
|
603
|
+
};
|
|
604
|
+
var Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
605
|
+
var className = props.className, type = props.type, appearance = props.appearance, alignPosition = props.alignPosition, initialIsVisible = props.initialIsVisible, title = props.title, text = props.text, arrowPosition = props.arrowPosition, before = props.before, after = props.after, _a = props.openTimeoutDelay, openTimeoutDelay = _a === void 0 ? 500 : _a, _b = props.closeTimeoutDelay, closeTimeoutDelay = _b === void 0 ? 250 : _b, set = props.set, children = props.children;
|
|
606
|
+
var tooltipElementRef = useRef(null);
|
|
607
|
+
var tooltipTimeoutHideRef = useRef(null);
|
|
608
|
+
var tooltipTimeoutShowRef = useRef(null);
|
|
609
|
+
var isTooltipCloseAnimationInProgressRef = useRef(false);
|
|
610
|
+
// TODO: rename to open?
|
|
611
|
+
var _c = useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
|
|
612
|
+
// TODO: or rename to show/hide?
|
|
613
|
+
var openTooltip = useCallback(function () {
|
|
614
|
+
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
615
|
+
if (tooltipTimeoutHideRef.current) {
|
|
616
|
+
clearTimeout(tooltipTimeoutHideRef.current);
|
|
617
|
+
}
|
|
618
|
+
tooltipTimeoutShowRef.current = setTimeout(function () {
|
|
619
|
+
setIsTooltipVisible(true);
|
|
620
|
+
}, openTimeoutDelay);
|
|
621
|
+
}
|
|
622
|
+
}, [openTimeoutDelay]);
|
|
623
|
+
var closeTooltip = useCallback(function () {
|
|
624
|
+
if (tooltipTimeoutShowRef.current) {
|
|
625
|
+
clearTimeout(tooltipTimeoutShowRef.current);
|
|
626
|
+
}
|
|
627
|
+
// Make a small delay to be able to move cursor on the tooltip without
|
|
628
|
+
// triggering a close, because the label and the tooltip have space between
|
|
629
|
+
tooltipTimeoutHideRef.current = setTimeout(function () {
|
|
630
|
+
// @ts-expect-error
|
|
631
|
+
setIsTooltipVisible(function (prevState) {
|
|
632
|
+
var newState = false;
|
|
633
|
+
if (prevState === true) {
|
|
634
|
+
isTooltipCloseAnimationInProgressRef.current = true;
|
|
635
|
+
}
|
|
636
|
+
return newState;
|
|
637
|
+
});
|
|
638
|
+
}, closeTimeoutDelay);
|
|
639
|
+
}, [closeTimeoutDelay]);
|
|
640
|
+
var onAnimationEnd = useCallback(function () {
|
|
641
|
+
isTooltipCloseAnimationInProgressRef.current = false;
|
|
642
|
+
}, []);
|
|
643
|
+
useImperativeHandle(ref, function () { return ({
|
|
644
|
+
get tooltipElement() {
|
|
645
|
+
return tooltipElementRef.current;
|
|
646
|
+
},
|
|
647
|
+
openTooltip: openTooltip,
|
|
648
|
+
closeTooltip: closeTooltip,
|
|
649
|
+
isTooltipVisible: isTooltipVisible,
|
|
650
|
+
}); }, [isTooltipVisible, openTooltip, closeTooltip]);
|
|
651
|
+
var appearanceConfig = appearance === null || appearance === void 0 ? void 0 : appearance.split(' ').reduce(function (resultConfig, appearanceKey) {
|
|
652
|
+
var _a;
|
|
653
|
+
return (__assign(__assign({}, resultConfig), (_a = tooltipConfig.appearance) === null || _a === void 0 ? void 0 : _a[appearanceKey]));
|
|
654
|
+
}, {});
|
|
655
|
+
var propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
656
|
+
var alignClass = propsGenerator.alignClass, alignDirectionClass = propsGenerator.alignDirectionClass, alignmentClass = propsGenerator.alignmentClass, 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, elevationClass = propsGenerator.elevationClass, shapeClass = propsGenerator.shapeClass, sizeClass = propsGenerator.sizeClass, widthClass = propsGenerator.widthClass;
|
|
657
|
+
// @ts-expect-error
|
|
658
|
+
var tooltipStyles = useStyles(props).styles;
|
|
659
|
+
return (jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible === true && 'tooltip_state_open', isTooltipVisible === false && '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), alignmentClass && "alignment_".concat(alignmentClass), borderWidthClass && "border-width_".concat(borderWidthClass), borderColorClass && "border-color_".concat(borderColorClass), borderTypeClass && "border_type_".concat(borderTypeClass), elevationClass && "elevation_".concat(elevationClass), sizeClass && "tooltip_size_".concat(sizeClass), arrowPosition &&
|
|
660
|
+
"tooltip_type_arrow tooltip_arrow_position_".concat(arrowPosition), type && "tooltip_type_".concat(type), set && "tooltip_set_".concat(set), widthClass && "width_".concat(widthClass)), ref: tooltipElementRef, style: tooltipStyles, onAnimationEnd: onAnimationEnd, children: [before, jsxs("div", { className: "tooltip__inner", children: [title && (jsx(Title, { className: "tooltip__title", size: titleSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title })), text && (jsx(Text, { className: "tooltip__text", size: textSize, textColor: textColor, children: text })), children] }), after] }));
|
|
661
|
+
});
|
|
662
|
+
|
|
663
|
+
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 };
|