@itcase/ui 1.2.35 → 1.3.0
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/Badge-B9tt2YPa.js +76 -0
- package/dist/{Badge-MPtjfQS8.js → Badge-DMRagi5O.js} +7 -45
- package/dist/Button-CX3x7Z6Q.js +99 -0
- package/dist/Button-P0c3lMg1.js +103 -0
- package/dist/Divider-DBvDCUqP.js +30 -0
- package/dist/Divider-Goh6mpPK.js +34 -0
- package/dist/DropdownItem-BuMJdUAk.js +92 -0
- package/dist/DropdownItem-DaN20LFe.js +97 -0
- package/dist/Group-B9L2NTgM.js +34 -0
- package/dist/Group-D6CXN4hS.js +38 -0
- package/dist/Icon-CZrDqG76.js +61 -0
- package/dist/Icon-hqYZoh4h.js +65 -0
- package/dist/Image-6dFSePnG.js +17 -0
- package/dist/Image-Dx4AWHLO.js +15 -0
- package/dist/Input-BrV5_NoV.js +95 -0
- package/dist/Input-ffioh1sj.js +100 -0
- package/dist/Label-DQyB2ThM.js +93 -0
- package/dist/Label-HKRKV3mn.js +97 -0
- package/dist/Link-DGj-cNje.js +53 -0
- package/dist/{Link-CeQuavin.js → Link-_A9ZfNln.js} +6 -52
- package/dist/Loader-Dn036JwE.js +56 -0
- package/dist/Loader-K_DJmah6.js +52 -0
- package/dist/MenuItem-Dokk3UXj.js +40 -0
- package/dist/MenuItem-LyqjzhjP.js +44 -0
- package/dist/Overlay-Dy6JQwJn.js +15 -0
- package/dist/Overlay-HlYxCGtp.js +17 -0
- package/dist/Text-Beslj4Ns.js +34 -0
- package/dist/Text-JayJa3hj.js +30 -0
- package/dist/Title-CHgrIarR.js +48 -0
- package/dist/Title-DBaHcpvB.js +52 -0
- package/dist/Tooltip-1Jbub0K6.js +89 -0
- package/dist/Tooltip-CNua1g76.js +93 -0
- package/dist/cjs/components/Accordion.js +13 -65
- package/dist/cjs/components/Avatar.js +13 -28
- package/dist/cjs/components/Badge.js +4 -3
- package/dist/cjs/components/Breadcrumbs.js +16 -48
- package/dist/cjs/components/Button.js +9 -9
- package/dist/cjs/components/Caption.js +5 -14
- package/dist/cjs/components/Card.js +7 -12
- package/dist/cjs/components/Cell.js +11 -61
- package/dist/cjs/components/Checkbox.js +13 -61
- package/dist/cjs/components/Chips.js +9 -55
- package/dist/cjs/components/Choice.js +19 -85
- package/dist/cjs/components/Code.js +8 -80
- package/dist/cjs/components/CookiesWarning.js +13 -22
- package/dist/cjs/components/DadataHintField.js +4 -4
- package/dist/cjs/components/DatePicker.js +19 -23
- package/dist/cjs/components/Divider.js +3 -2
- package/dist/cjs/components/Dot.js +5 -22
- package/dist/cjs/components/Drawer.js +3 -3
- package/dist/cjs/components/Dropdown.js +6 -6
- package/dist/cjs/components/Flex.js +8 -95
- package/dist/cjs/components/Grid.js +12 -125
- package/dist/cjs/components/Group.js +3 -2
- package/dist/cjs/components/HTMLContent.js +5 -74
- package/dist/cjs/components/Icon.js +6 -6
- package/dist/cjs/components/Image.js +3 -2
- package/dist/cjs/components/Input.js +3 -2
- package/dist/cjs/components/InputMask.js +27 -109
- package/dist/cjs/components/InputPassword.js +18 -83
- package/dist/cjs/components/Label.js +6 -5
- package/dist/cjs/components/Link.js +2 -2
- package/dist/cjs/components/List.js +15 -31
- package/dist/cjs/components/Loader.js +4 -3
- package/dist/cjs/components/Logo.js +8 -21
- package/dist/cjs/components/Menu.js +9 -23
- package/dist/cjs/components/MenuItem.js +5 -5
- package/dist/cjs/components/Modal.js +10 -43
- package/dist/cjs/components/ModalSheetBottom.js +4 -15
- package/dist/cjs/components/Notification.js +9 -18
- package/dist/cjs/components/Overlay.js +3 -2
- package/dist/cjs/components/Pagination.js +15 -36
- package/dist/cjs/components/Panel.js +10 -78
- package/dist/cjs/components/Radio.js +15 -61
- package/dist/cjs/components/RangeSlider.js +7 -39
- package/dist/cjs/components/Response.js +20 -65
- package/dist/cjs/components/SVGContent.js +5 -10
- package/dist/cjs/components/ScrollOnDrag.js +5 -35
- package/dist/cjs/components/ScrollToView.js +5 -46
- package/dist/cjs/components/Search.js +18 -81
- package/dist/cjs/components/Segmented.js +10 -53
- package/dist/cjs/components/Select.js +42 -160
- package/dist/cjs/components/SiteMenu.js +12 -15
- package/dist/cjs/components/Swiper.js +9 -22
- package/dist/cjs/components/Switch.js +4 -2
- package/dist/cjs/components/Tab.js +16 -112
- package/dist/cjs/components/Text.js +3 -2
- package/dist/cjs/components/Textarea.js +15 -76
- package/dist/cjs/components/Tile.js +10 -46
- package/dist/cjs/components/Title.js +3 -2
- package/dist/cjs/components/Tooltip.js +5 -4
- package/dist/cjs/components/Video.js +5 -5
- package/dist/cjs/components/Wrapper.js +5 -30
- package/dist/cjs/hooks/useDeviceTargetClassGenerator.interface.js +2 -0
- package/dist/cjs/hooks/useDeviceTargetClassGenerator.js +97 -0
- package/dist/components/Accordion.js +13 -65
- package/dist/components/Avatar.js +13 -28
- package/dist/components/Badge.js +4 -3
- package/dist/components/Breadcrumbs.js +16 -48
- package/dist/components/Button.js +9 -9
- package/dist/components/Caption.js +5 -14
- package/dist/components/Card.js +7 -12
- package/dist/components/Cell.js +11 -61
- package/dist/components/Checkbox.js +13 -61
- package/dist/components/Chips.js +9 -55
- package/dist/components/Choice.js +19 -85
- package/dist/components/Code.js +8 -80
- package/dist/components/CookiesWarning.js +13 -22
- package/dist/components/DadataHintField.js +4 -4
- package/dist/components/DatePicker.js +19 -23
- package/dist/components/Divider.js +3 -2
- package/dist/components/Dot.js +5 -22
- package/dist/components/Drawer.js +3 -3
- package/dist/components/Dropdown.js +6 -6
- package/dist/components/Flex.js +8 -95
- package/dist/components/Grid.js +12 -125
- package/dist/components/Group.js +3 -2
- package/dist/components/HTMLContent.js +5 -74
- package/dist/components/Icon.js +6 -6
- package/dist/components/Image.js +3 -2
- package/dist/components/Input.js +3 -2
- package/dist/components/InputMask.js +28 -110
- package/dist/components/InputPassword.js +18 -83
- package/dist/components/Label.js +6 -5
- package/dist/components/Link.js +2 -2
- package/dist/components/List.js +15 -31
- package/dist/components/Loader.js +4 -3
- package/dist/components/Logo.js +8 -21
- package/dist/components/Menu.js +9 -23
- package/dist/components/MenuItem.js +5 -5
- package/dist/components/Modal.js +10 -43
- package/dist/components/ModalSheetBottom.js +4 -15
- package/dist/components/Notification.js +9 -18
- package/dist/components/Overlay.js +3 -2
- package/dist/components/Pagination.js +15 -36
- package/dist/components/Panel.js +10 -78
- package/dist/components/Radio.js +15 -61
- package/dist/components/RangeSlider.js +7 -39
- package/dist/components/Response.js +20 -65
- package/dist/components/SVGContent.js +5 -10
- package/dist/components/ScrollOnDrag.js +5 -35
- package/dist/components/ScrollToView.js +5 -46
- package/dist/components/Search.js +18 -81
- package/dist/components/Segmented.js +10 -53
- package/dist/components/Select.js +43 -161
- package/dist/components/SiteMenu.js +12 -15
- package/dist/components/Swiper.js +10 -23
- package/dist/components/Switch.js +4 -2
- package/dist/components/Tab.js +16 -112
- package/dist/components/Text.js +3 -2
- package/dist/components/Textarea.js +15 -76
- package/dist/components/Tile.js +10 -46
- package/dist/components/Title.js +3 -2
- package/dist/components/Tooltip.js +5 -4
- package/dist/components/Video.js +5 -5
- package/dist/components/Wrapper.js +5 -30
- package/dist/css/components/Avatar/Avatar.css +7 -6
- package/dist/css/components/Code/Code.css +0 -8
- package/dist/css/components/Code/Code.tokens.css +3 -0
- package/dist/hooks/useDeviceTargetClassGenerator.interface.js +1 -0
- package/dist/hooks/useDeviceTargetClassGenerator.js +95 -0
- package/dist/stories/Appearance.stories.js +2 -3
- package/dist/stories/Badge.stories.js +1 -1
- package/dist/stories/Button.stories.js +1 -2
- package/dist/stories/Group.stories.js +2 -3
- package/dist/stories/Icon.stories.js +2 -4
- package/dist/stories/Size.stories.js +1 -2
- package/dist/stories/State.stories.js +1 -2
- package/dist/stories/Tile.stories.js +1 -2
- package/dist/stories/appearance.mdx +6 -11
- package/dist/types/components/Accordion/Accordion.interface.d.ts +2 -0
- package/dist/types/components/Avatar/Avatar.d.ts +2 -2
- package/dist/types/components/Avatar/Avatar.interface.d.ts +8 -5
- package/dist/types/components/Badge/Badge.d.ts +3 -3
- package/dist/types/components/Badge/Badge.interface.d.ts +10 -7
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/types/components/Breadcrumbs/Breadcrumbs.interface.d.ts +11 -9
- package/dist/types/components/Breadcrumbs/BreadcrumbsItem.d.ts +2 -2
- package/dist/types/components/Button/Button.appearance.d.ts +2 -2
- package/dist/types/components/Button/Button.d.ts +3 -3
- package/dist/types/components/Button/Button.interface.d.ts +18 -15
- package/dist/types/components/Caption/Caption.d.ts +2 -2
- package/dist/types/components/Caption/Caption.interface.d.ts +7 -6
- package/dist/types/components/Card/Card.d.ts +2 -2
- package/dist/types/components/Card/Card.interface.d.ts +11 -10
- package/dist/types/components/Cell/Cell.d.ts +2 -2
- package/dist/types/components/Cell/Cell.interface.d.ts +5 -4
- package/dist/types/components/Checkbox/Checkbox.interface.d.ts +4 -1
- package/dist/types/components/Chips/Chips.interface.d.ts +4 -1
- package/dist/types/components/Choice/Choice.d.ts +2 -2
- package/dist/types/components/Choice/Choice.interface.d.ts +3 -0
- package/dist/types/components/Code/Code.d.ts +2 -2
- package/dist/types/components/Code/Code.interface.d.ts +8 -5
- package/dist/types/components/CookiesWarning/CookiesWarning.d.ts +2 -2
- package/dist/types/components/CookiesWarning/CookiesWarning.interface.d.ts +6 -5
- package/dist/types/components/DadataHintField/DadataHintField.d.ts +2 -2
- package/dist/types/components/DadataHintField/DadataHintField.interface.d.ts +4 -4
- package/dist/types/components/DatePicker/DatePicker.d.ts +3 -3
- package/dist/types/components/DatePicker/DatePicker.interface.d.ts +11 -8
- package/dist/types/components/Divider/Divider.d.ts +2 -2
- package/dist/types/components/Divider/Divider.interface.d.ts +8 -5
- package/dist/types/components/Dot/Dot.d.ts +2 -2
- package/dist/types/components/Dot/Dot.interface.d.ts +4 -3
- package/dist/types/components/Dropdown/Dropdown.d.ts +2 -2
- package/dist/types/components/Dropdown/Dropdown.interface.d.ts +9 -5
- package/dist/types/components/Dropdown/DropdownItem.d.ts +2 -2
- package/dist/types/components/Flex/Flex.d.ts +2 -2
- package/dist/types/components/Flex/Flex.interface.d.ts +5 -3
- package/dist/types/components/Flex/FlexItem.d.ts +2 -2
- package/dist/types/components/Grid/Grid.d.ts +2 -2
- package/dist/types/components/Grid/Grid.interface.d.ts +7 -4
- package/dist/types/components/Grid/GridItem.d.ts +2 -2
- package/dist/types/components/Grid/GridRow.d.ts +2 -2
- package/dist/types/components/Group/Group.d.ts +3 -3
- package/dist/types/components/Group/Group.interface.d.ts +8 -5
- package/dist/types/components/HTMLContent/HTMLContent.d.ts +2 -2
- package/dist/types/components/HTMLContent/HTMLContent.interface.d.ts +3 -2
- package/dist/types/components/Icon/Icon.d.ts +1 -1
- package/dist/types/components/Icon/Icon.interface.d.ts +1 -0
- package/dist/types/components/Image/Image.d.ts +2 -2
- package/dist/types/components/Image/Image.interface.d.ts +3 -2
- package/dist/types/components/Input/Input.d.ts +1 -1
- package/dist/types/components/Input/Input.interface.d.ts +4 -1
- package/dist/types/components/InputMask/Input.d.ts +2 -2
- package/dist/types/components/InputMask/Input.interface.d.ts +10 -7
- package/dist/types/components/InputPassword/InputPassword.d.ts +3 -3
- package/dist/types/components/InputPassword/InputPassword.interface.d.ts +9 -6
- package/dist/types/components/Label/Label.d.ts +3 -3
- package/dist/types/components/Label/Label.interface.d.ts +10 -7
- package/dist/types/components/Link/Link.d.ts +4 -4
- package/dist/types/components/Link/Link.interface.d.ts +7 -6
- package/dist/types/components/List/List.d.ts +2 -2
- package/dist/types/components/List/List.interface.d.ts +5 -3
- package/dist/types/components/List/ListItem.d.ts +2 -2
- package/dist/types/components/Loader/Loader.d.ts +3 -3
- package/dist/types/components/Loader/Loader.interface.d.ts +9 -6
- package/dist/types/components/Logo/Logo.d.ts +3 -3
- package/dist/types/components/Logo/Logo.interface.d.ts +10 -7
- package/dist/types/components/Menu/Menu.d.ts +2 -2
- package/dist/types/components/Menu/Menu.interface.d.ts +3 -2
- package/dist/types/components/MenuItem/MenuItem.d.ts +3 -3
- package/dist/types/components/MenuItem/MenuItem.interface.d.ts +9 -6
- package/dist/types/components/Modal/Modal.d.ts +2 -2
- package/dist/types/components/Modal/Modal.interface.d.ts +8 -5
- package/dist/types/components/Modal/ModalLoader.d.ts +1 -1
- package/dist/types/components/ModalSheetBottom/ModalSheetBottom.d.ts +1 -1
- package/dist/types/components/ModalSheetBottom/ModalSheetBottom.interface.d.ts +3 -0
- package/dist/types/components/Notification/Notification.interface.d.ts +10 -7
- package/dist/types/components/Notification/NotificationItem.d.ts +3 -3
- package/dist/types/components/Notification/NotificationList.d.ts +2 -2
- package/dist/types/components/Overlay/Overlay.d.ts +1 -1
- package/dist/types/components/Overlay/Overlay.interface.d.ts +1 -0
- package/dist/types/components/Pagination/Pagination.d.ts +2 -2
- package/dist/types/components/Pagination/Pagination.interface.d.ts +9 -6
- package/dist/types/components/Panel/Panel.d.ts +3 -3
- package/dist/types/components/Panel/Panel.interface.d.ts +9 -6
- package/dist/types/components/Radio/Radio.d.ts +3 -3
- package/dist/types/components/Radio/Radio.interface.d.ts +13 -10
- package/dist/types/components/RangeSlider/RangeSlider.d.ts +2 -2
- package/dist/types/components/RangeSlider/RangeSlider.interface.d.ts +3 -2
- package/dist/types/components/Response/Response.d.ts +3 -3
- package/dist/types/components/Response/Response.interface.d.ts +11 -8
- package/dist/types/components/SVGContent/SVGContent.d.ts +2 -2
- package/dist/types/components/SVGContent/SVGContent.interface.d.ts +2 -1
- package/dist/types/components/ScrollOnDrag/ScrollOnDrag.d.ts +2 -2
- package/dist/types/components/ScrollOnDrag/ScrollOnDrag.interface.d.ts +3 -2
- package/dist/types/components/Scrollbar/Scrollbar.d.ts +2 -2
- package/dist/types/components/Scrollbar/Scrollbar.interface.d.ts +2 -2
- package/dist/types/components/Search/Search.interface.d.ts +11 -7
- package/dist/types/components/Search/SearchInput.d.ts +3 -3
- package/dist/types/components/Search/SearchResult.d.ts +1 -2
- package/dist/types/components/Segmented/Segmented.d.ts +3 -3
- package/dist/types/components/Segmented/Segmented.interface.d.ts +15 -9
- package/dist/types/components/Select/Select.interface.d.ts +2 -0
- package/dist/types/components/Select/SelectContainer.d.ts +4 -3
- package/dist/types/components/Select/index.d.ts +1 -3
- package/dist/types/components/SiteMenu/SiteMenu.d.ts +2 -2
- package/dist/types/components/SiteMenu/SiteMenu.interface.d.ts +9 -6
- package/dist/types/components/SiteMenu/SiteMenuButton.d.ts +2 -2
- package/dist/types/components/Swiper/Swiper.d.ts +2 -2
- package/dist/types/components/Swiper/Swiper.interface.d.ts +9 -8
- package/dist/types/components/Switch/Switch.d.ts +2 -2
- package/dist/types/components/Switch/Switch.interface.d.ts +4 -4
- package/dist/types/components/Tab/Tab.d.ts +1 -1
- package/dist/types/components/Tab/Tab.interface.d.ts +4 -0
- package/dist/types/components/Tab/TabGroup.d.ts +1 -1
- package/dist/types/components/Text/Text.interface.d.ts +4 -1
- package/dist/types/components/Textarea/Textarea.d.ts +3 -3
- package/dist/types/components/Textarea/Textarea.interface.d.ts +13 -10
- package/dist/types/components/Tile/Tile.d.ts +2 -2
- package/dist/types/components/Tile/Tile.interface.d.ts +8 -5
- package/dist/types/components/Title/Title.d.ts +3 -3
- package/dist/types/components/Title/Title.interface.d.ts +17 -14
- package/dist/types/components/Tooltip/Tooltip.d.ts +3 -3
- package/dist/types/components/Tooltip/Tooltip.interface.d.ts +9 -6
- package/dist/types/components/Video/Video.d.ts +2 -2
- package/dist/types/components/Video/Video.interface.d.ts +1 -1
- package/dist/types/components/Wrapper/Wrapper.d.ts +2 -2
- package/dist/types/components/Wrapper/Wrapper.interface.d.ts +4 -3
- package/dist/types/hooks/useDeviceTargetClassGenerator.d.ts +3 -0
- package/dist/types/hooks/useDeviceTargetClassGenerator.interface.d.ts +20 -0
- package/dist/types/types/componentProps/appearanceKeys.d.ts +1 -1
- package/package.json +5 -4
- package/dist/Badge-BZf2D83-.js +0 -114
- package/dist/Button-BmE4TGuv.js +0 -154
- package/dist/Button-f0zWwezF.js +0 -150
- package/dist/Divider-Bdz66wfW.js +0 -71
- package/dist/Divider-CYvszcff.js +0 -75
- package/dist/DropdownItem-BjtWmVFs.js +0 -182
- package/dist/DropdownItem-DPBYY3cR.js +0 -187
- package/dist/Group-Bf2uSl3S.js +0 -140
- package/dist/Group-D95Sf0X0.js +0 -136
- package/dist/Icon-21rsw8YW.js +0 -119
- package/dist/Icon-gTZ0QO8I.js +0 -123
- package/dist/Image-8t6PvsaZ.js +0 -65
- package/dist/Image-DrUlRMHa.js +0 -67
- package/dist/Input--x3hPBiN.js +0 -188
- package/dist/Input-DG5yWwpp.js +0 -193
- package/dist/Label-Ddjf4F18.js +0 -139
- package/dist/Label-Rq2ptfUd.js +0 -135
- package/dist/Link-CqWzwh8V.js +0 -99
- package/dist/Loader-1ZnukBPK.js +0 -86
- package/dist/Loader-CuxFXcNG.js +0 -82
- package/dist/MenuItem-Buu-c29L.js +0 -101
- package/dist/MenuItem-Cqt0EcgC.js +0 -105
- package/dist/Overlay-CFXouKnl.js +0 -27
- package/dist/Overlay-DO5dnSRE.js +0 -25
- package/dist/Text-C-scXvy7.js +0 -85
- package/dist/Text-DGEJa_FL.js +0 -81
- package/dist/Title-BatSai-G.js +0 -115
- package/dist/Title-Bp-4wxkT.js +0 -111
- package/dist/Tooltip-BsMYxi_I.js +0 -150
- package/dist/Tooltip-CUL79Nsx.js +0 -154
- package/dist/cjs/components/ContextMenu.js +0 -52
- package/dist/cjs/components/LanguageSelector.js +0 -33
- package/dist/cjs/components/Page.js +0 -48
- package/dist/components/ContextMenu.js +0 -49
- package/dist/components/LanguageSelector.js +0 -31
- package/dist/components/Page.js +0 -46
- package/dist/css/components/ContextMenu/ContextMenu.css +0 -38
- package/dist/css/components/ContextMenu/css/__item/context-menu__item.css +0 -9
- package/dist/css/components/Page/Page.css +0 -8
- package/dist/types/components/ContextMenu/ContextMenu.d.ts +0 -3
- package/dist/types/components/ContextMenu/ContextMenu.interface.d.ts +0 -36
- package/dist/types/components/ContextMenu/ContextMenuItem.d.ts +0 -3
- package/dist/types/components/ContextMenu/index.d.ts +0 -3
- package/dist/types/components/LanguageSelector/Label.interface.d.ts +0 -20
- package/dist/types/components/LanguageSelector/LanguageSelector.d.ts +0 -3
- package/dist/types/components/LanguageSelector/index.d.ts +0 -1
- package/dist/types/components/Page/Page.d.ts +0 -3
- package/dist/types/components/Page/Page.interface.d.ts +0 -18
- package/dist/types/components/Page/index.d.ts +0 -1
- package/dist/types/hooks/useDeviceTargetClass.d.ts +0 -1
package/dist/Text-DGEJa_FL.js
DELETED
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import clsx from 'clsx';
|
|
3
|
-
import { useDeviceTargetClass } from './hooks/useDeviceTargetClass.js';
|
|
4
|
-
import { useStyles } from './hooks/useStyles.js';
|
|
5
|
-
|
|
6
|
-
var textAppearance = {
|
|
7
|
-
dev: {
|
|
8
|
-
size: 'm',
|
|
9
|
-
textColor: 'surfaceTextPrimary',
|
|
10
|
-
},
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
var textConfig = {
|
|
14
|
-
appearance: textAppearance,
|
|
15
|
-
setAppearance: function (newComponent) {
|
|
16
|
-
textConfig.appearance = newComponent;
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
function Text(props) {
|
|
20
|
-
var children = props.children, cursor = props.cursor, after = props.after, appearance = props.appearance, before = props.before, className = props.className, dataTestId = props.dataTestId, dataTour = props.dataTour, htmlFor = props.htmlFor, mode = props.mode, _a = props.tag, Tag = _a === void 0 ? 'span' : _a, type = props.type, onClick = props.onClick, onDoubleClick = props.onDoubleClick;
|
|
21
|
-
var cursorClass = useDeviceTargetClass(props, {
|
|
22
|
-
prefix: 'cursor_',
|
|
23
|
-
propsKey: 'cursor',
|
|
24
|
-
});
|
|
25
|
-
var sizeClass = useDeviceTargetClass(props, {
|
|
26
|
-
prefix: 'text_size_',
|
|
27
|
-
propsKey: 'size',
|
|
28
|
-
});
|
|
29
|
-
var weightClass = useDeviceTargetClass(props, {
|
|
30
|
-
prefix: 'text-weight_',
|
|
31
|
-
propsKey: 'textWeight',
|
|
32
|
-
});
|
|
33
|
-
var textColorClass = useDeviceTargetClass(props, {
|
|
34
|
-
prefix: 'text-color_',
|
|
35
|
-
propsKey: 'textColor',
|
|
36
|
-
});
|
|
37
|
-
var textAlignClass = useDeviceTargetClass(props, {
|
|
38
|
-
prefix: 'text-align_',
|
|
39
|
-
propsKey: 'textAlign',
|
|
40
|
-
});
|
|
41
|
-
var textColorActiveClass = useDeviceTargetClass(props, {
|
|
42
|
-
prefix: 'text-color_active_',
|
|
43
|
-
propsKey: 'textColorActive',
|
|
44
|
-
});
|
|
45
|
-
var textColorHoverClass = useDeviceTargetClass(props, {
|
|
46
|
-
prefix: 'text-color_hover_',
|
|
47
|
-
propsKey: 'textColorHover',
|
|
48
|
-
});
|
|
49
|
-
var textGradientClass = useDeviceTargetClass(props, {
|
|
50
|
-
prefix: 'text-gradient_',
|
|
51
|
-
propsKey: 'textColorGradient',
|
|
52
|
-
});
|
|
53
|
-
var textTruncateClass = useDeviceTargetClass(props, {
|
|
54
|
-
prefix: 'text-truncate_',
|
|
55
|
-
propsKey: 'textTruncate',
|
|
56
|
-
});
|
|
57
|
-
var textStyleClass = useDeviceTargetClass(props, {
|
|
58
|
-
prefix: 'text-style_',
|
|
59
|
-
propsKey: 'textStyle',
|
|
60
|
-
});
|
|
61
|
-
var textWrapClass = useDeviceTargetClass(props, {
|
|
62
|
-
prefix: 'word-wrap_',
|
|
63
|
-
propsKey: 'textWrap',
|
|
64
|
-
});
|
|
65
|
-
var widthClass = useDeviceTargetClass(props, {
|
|
66
|
-
prefix: 'width_',
|
|
67
|
-
propsKey: 'width',
|
|
68
|
-
});
|
|
69
|
-
// @ts-expect-error
|
|
70
|
-
var textStyles = useStyles(props).styles;
|
|
71
|
-
var appearanceConfig = appearance && textConfig.appearance && textConfig.appearance[appearance];
|
|
72
|
-
return (jsxs(Tag, { className: clsx(className, 'text', sizeClass ||
|
|
73
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.size) &&
|
|
74
|
-
"text_size_".concat(appearanceConfig.size).replace(/([A-Z])/g, '-$1').toLowerCase()), weightClass, textAlignClass, textColorClass ||
|
|
75
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor) &&
|
|
76
|
-
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase()), textColorActiveClass, textColorHoverClass, textGradientClass, textStyleClass, textWrapClass, textTruncateClass, type && "text_type_".concat(type), mode && "text_mode_".concat(mode), widthClass ||
|
|
77
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.width) &&
|
|
78
|
-
"width_".concat(appearanceConfig.width).replace(/([A-Z])/g, '-$1').toLowerCase()), cursorClass, onClick && (cursor || 'cursor_type_pointer')), "data-test-id": dataTestId, "data-tour": dataTour, htmlFor: htmlFor, style: textStyles, onClick: onClick, onDoubleClick: onDoubleClick, children: [before, children, after] }));
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export { Text as T, textAppearance as a, textConfig as t };
|
package/dist/Title-BatSai-G.js
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var UIContext = require('./cjs/context/UIContext.js');
|
|
7
|
-
var useDeviceTargetClass = require('./cjs/hooks/useDeviceTargetClass.js');
|
|
8
|
-
var useStyles = require('./cjs/hooks/useStyles.js');
|
|
9
|
-
|
|
10
|
-
var titleAppearance = {
|
|
11
|
-
dev: {
|
|
12
|
-
textColor: 'surfaceTextPrimary',
|
|
13
|
-
},
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
var titleConfig = {
|
|
17
|
-
appearance: titleAppearance,
|
|
18
|
-
setAppearance: function (newComponent) {
|
|
19
|
-
titleConfig.appearance = newComponent;
|
|
20
|
-
},
|
|
21
|
-
};
|
|
22
|
-
function Title(props) {
|
|
23
|
-
var children = props.children, after = props.after, afterWrapper = props.afterWrapper, appearance = props.appearance, before = props.before, beforeWrapper = props.beforeWrapper, className = props.className, dataTour = props.dataTour, mode = props.mode, _a = props.size, size = _a === void 0 ? 'h3' : _a, sizeDesktop = props.sizeDesktop, sizeMobile = props.sizeMobile, sizeTablet = props.sizeTablet, _b = props.tag, tag = _b === void 0 ? 'span' : _b, text = props.text, textWrap = props.textWrap, onClick = props.onClick;
|
|
24
|
-
var _c = UIContext.useUserDeviceContext(), isMobile = _c.isMobile, isTablet = _c.isTablet, isDesktop = _c.isDesktop;
|
|
25
|
-
var directionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
26
|
-
prefix: 'title_direction_',
|
|
27
|
-
propsKey: 'direction',
|
|
28
|
-
});
|
|
29
|
-
var directionWrapperClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
30
|
-
prefix: 'title-direction_',
|
|
31
|
-
propsKey: 'wrapperDirection',
|
|
32
|
-
});
|
|
33
|
-
var textColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
34
|
-
prefix: 'text-color_',
|
|
35
|
-
propsKey: 'textColor',
|
|
36
|
-
});
|
|
37
|
-
var textColorActiveClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
38
|
-
prefix: 'text-color_active_',
|
|
39
|
-
propsKey: 'textColorActive',
|
|
40
|
-
});
|
|
41
|
-
var textColorHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
42
|
-
prefix: 'text-color_hover_',
|
|
43
|
-
propsKey: 'textColorHover',
|
|
44
|
-
});
|
|
45
|
-
var svgFillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
46
|
-
prefix: 'svg_fill_',
|
|
47
|
-
propsKey: 'svgFill',
|
|
48
|
-
});
|
|
49
|
-
var svgFillHoverClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
50
|
-
prefix: 'svg_fill_hover_',
|
|
51
|
-
propsKey: 'svgFillHover',
|
|
52
|
-
});
|
|
53
|
-
var textAlignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
54
|
-
prefix: 'text-align_',
|
|
55
|
-
propsKey: 'textAlign',
|
|
56
|
-
});
|
|
57
|
-
var typeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
58
|
-
prefix: 'title_type_',
|
|
59
|
-
propsKey: 'type',
|
|
60
|
-
});
|
|
61
|
-
var fillColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
62
|
-
prefix: 'fill_',
|
|
63
|
-
propsKey: 'fill',
|
|
64
|
-
});
|
|
65
|
-
var textGradientClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
66
|
-
prefix: 'text-gradient_',
|
|
67
|
-
propsKey: 'textColorGradient',
|
|
68
|
-
});
|
|
69
|
-
var textStyleClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
70
|
-
prefix: 'text-style_',
|
|
71
|
-
propsKey: 'textStyle',
|
|
72
|
-
});
|
|
73
|
-
var weightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
74
|
-
prefix: 'text-weight_',
|
|
75
|
-
propsKey: 'textWeight',
|
|
76
|
-
});
|
|
77
|
-
var textTruncateClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
78
|
-
prefix: 'text-truncate_',
|
|
79
|
-
propsKey: 'textTruncate',
|
|
80
|
-
});
|
|
81
|
-
var widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
82
|
-
prefix: 'width_',
|
|
83
|
-
propsKey: 'width',
|
|
84
|
-
});
|
|
85
|
-
var heightClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
86
|
-
prefix: 'height_',
|
|
87
|
-
propsKey: 'height',
|
|
88
|
-
});
|
|
89
|
-
// @ts-expect-error
|
|
90
|
-
var _d = useStyles.useStyles(props), titleStyles = _d.styles, titleWrapperStyles = _d.wrapper;
|
|
91
|
-
var appearanceConfig = appearance && titleConfig.appearance && titleConfig.appearance[appearance];
|
|
92
|
-
// Element type (h1, h2, ..., h6)
|
|
93
|
-
var Tag = React.useMemo(function () {
|
|
94
|
-
if (tag) {
|
|
95
|
-
return tag;
|
|
96
|
-
}
|
|
97
|
-
if (isMobile && sizeMobile) {
|
|
98
|
-
return sizeMobile;
|
|
99
|
-
}
|
|
100
|
-
if (isTablet && sizeTablet) {
|
|
101
|
-
return sizeTablet;
|
|
102
|
-
}
|
|
103
|
-
if (isDesktop && sizeDesktop) {
|
|
104
|
-
return sizeDesktop;
|
|
105
|
-
}
|
|
106
|
-
return size ? size : 'span';
|
|
107
|
-
}, [isMobile, isTablet, isDesktop]);
|
|
108
|
-
return (jsxRuntime.jsxs(Tag, { className: clsx(className, 'title', fillColorClass, svgFillClass, svgFillHoverClass, widthClass, heightClass, size && "title_size_".concat(size), mode && "title_mode_".concat(mode), directionClass, 'text', textColorClass ||
|
|
109
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor) &&
|
|
110
|
-
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase()), textColorActiveClass, textColorHoverClass, typeClass, textGradientClass, textStyleClass, weightClass, textWrap && "word-wrap_".concat(textWrap)), "data-tour": dataTour, style: titleStyles, onClick: onClick, children: [before, jsxRuntime.jsxs("span", { className: clsx(textAlignClass, directionWrapperClass, 'title__wrapper', textTruncateClass), style: titleWrapperStyles, children: [beforeWrapper, children || text, afterWrapper] }), after] }));
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
exports.Title = Title;
|
|
114
|
-
exports.titleAppearance = titleAppearance;
|
|
115
|
-
exports.titleConfig = titleConfig;
|
package/dist/Title-Bp-4wxkT.js
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import { jsxs } from 'react/jsx-runtime';
|
|
2
|
-
import { useMemo } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useUserDeviceContext } from './context/UIContext.js';
|
|
5
|
-
import { useDeviceTargetClass } from './hooks/useDeviceTargetClass.js';
|
|
6
|
-
import { useStyles } from './hooks/useStyles.js';
|
|
7
|
-
|
|
8
|
-
var titleAppearance = {
|
|
9
|
-
dev: {
|
|
10
|
-
textColor: 'surfaceTextPrimary',
|
|
11
|
-
},
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
var titleConfig = {
|
|
15
|
-
appearance: titleAppearance,
|
|
16
|
-
setAppearance: function (newComponent) {
|
|
17
|
-
titleConfig.appearance = newComponent;
|
|
18
|
-
},
|
|
19
|
-
};
|
|
20
|
-
function Title(props) {
|
|
21
|
-
var children = props.children, after = props.after, afterWrapper = props.afterWrapper, appearance = props.appearance, before = props.before, beforeWrapper = props.beforeWrapper, className = props.className, dataTour = props.dataTour, mode = props.mode, _a = props.size, size = _a === void 0 ? 'h3' : _a, sizeDesktop = props.sizeDesktop, sizeMobile = props.sizeMobile, sizeTablet = props.sizeTablet, _b = props.tag, tag = _b === void 0 ? 'span' : _b, text = props.text, textWrap = props.textWrap, onClick = props.onClick;
|
|
22
|
-
var _c = useUserDeviceContext(), isMobile = _c.isMobile, isTablet = _c.isTablet, isDesktop = _c.isDesktop;
|
|
23
|
-
var directionClass = useDeviceTargetClass(props, {
|
|
24
|
-
prefix: 'title_direction_',
|
|
25
|
-
propsKey: 'direction',
|
|
26
|
-
});
|
|
27
|
-
var directionWrapperClass = useDeviceTargetClass(props, {
|
|
28
|
-
prefix: 'title-direction_',
|
|
29
|
-
propsKey: 'wrapperDirection',
|
|
30
|
-
});
|
|
31
|
-
var textColorClass = useDeviceTargetClass(props, {
|
|
32
|
-
prefix: 'text-color_',
|
|
33
|
-
propsKey: 'textColor',
|
|
34
|
-
});
|
|
35
|
-
var textColorActiveClass = useDeviceTargetClass(props, {
|
|
36
|
-
prefix: 'text-color_active_',
|
|
37
|
-
propsKey: 'textColorActive',
|
|
38
|
-
});
|
|
39
|
-
var textColorHoverClass = useDeviceTargetClass(props, {
|
|
40
|
-
prefix: 'text-color_hover_',
|
|
41
|
-
propsKey: 'textColorHover',
|
|
42
|
-
});
|
|
43
|
-
var svgFillClass = useDeviceTargetClass(props, {
|
|
44
|
-
prefix: 'svg_fill_',
|
|
45
|
-
propsKey: 'svgFill',
|
|
46
|
-
});
|
|
47
|
-
var svgFillHoverClass = useDeviceTargetClass(props, {
|
|
48
|
-
prefix: 'svg_fill_hover_',
|
|
49
|
-
propsKey: 'svgFillHover',
|
|
50
|
-
});
|
|
51
|
-
var textAlignClass = useDeviceTargetClass(props, {
|
|
52
|
-
prefix: 'text-align_',
|
|
53
|
-
propsKey: 'textAlign',
|
|
54
|
-
});
|
|
55
|
-
var typeClass = useDeviceTargetClass(props, {
|
|
56
|
-
prefix: 'title_type_',
|
|
57
|
-
propsKey: 'type',
|
|
58
|
-
});
|
|
59
|
-
var fillColorClass = useDeviceTargetClass(props, {
|
|
60
|
-
prefix: 'fill_',
|
|
61
|
-
propsKey: 'fill',
|
|
62
|
-
});
|
|
63
|
-
var textGradientClass = useDeviceTargetClass(props, {
|
|
64
|
-
prefix: 'text-gradient_',
|
|
65
|
-
propsKey: 'textColorGradient',
|
|
66
|
-
});
|
|
67
|
-
var textStyleClass = useDeviceTargetClass(props, {
|
|
68
|
-
prefix: 'text-style_',
|
|
69
|
-
propsKey: 'textStyle',
|
|
70
|
-
});
|
|
71
|
-
var weightClass = useDeviceTargetClass(props, {
|
|
72
|
-
prefix: 'text-weight_',
|
|
73
|
-
propsKey: 'textWeight',
|
|
74
|
-
});
|
|
75
|
-
var textTruncateClass = useDeviceTargetClass(props, {
|
|
76
|
-
prefix: 'text-truncate_',
|
|
77
|
-
propsKey: 'textTruncate',
|
|
78
|
-
});
|
|
79
|
-
var widthClass = useDeviceTargetClass(props, {
|
|
80
|
-
prefix: 'width_',
|
|
81
|
-
propsKey: 'width',
|
|
82
|
-
});
|
|
83
|
-
var heightClass = useDeviceTargetClass(props, {
|
|
84
|
-
prefix: 'height_',
|
|
85
|
-
propsKey: 'height',
|
|
86
|
-
});
|
|
87
|
-
// @ts-expect-error
|
|
88
|
-
var _d = useStyles(props), titleStyles = _d.styles, titleWrapperStyles = _d.wrapper;
|
|
89
|
-
var appearanceConfig = appearance && titleConfig.appearance && titleConfig.appearance[appearance];
|
|
90
|
-
// Element type (h1, h2, ..., h6)
|
|
91
|
-
var Tag = useMemo(function () {
|
|
92
|
-
if (tag) {
|
|
93
|
-
return tag;
|
|
94
|
-
}
|
|
95
|
-
if (isMobile && sizeMobile) {
|
|
96
|
-
return sizeMobile;
|
|
97
|
-
}
|
|
98
|
-
if (isTablet && sizeTablet) {
|
|
99
|
-
return sizeTablet;
|
|
100
|
-
}
|
|
101
|
-
if (isDesktop && sizeDesktop) {
|
|
102
|
-
return sizeDesktop;
|
|
103
|
-
}
|
|
104
|
-
return size ? size : 'span';
|
|
105
|
-
}, [isMobile, isTablet, isDesktop]);
|
|
106
|
-
return (jsxs(Tag, { className: clsx(className, 'title', fillColorClass, svgFillClass, svgFillHoverClass, widthClass, heightClass, size && "title_size_".concat(size), mode && "title_mode_".concat(mode), directionClass, 'text', textColorClass ||
|
|
107
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor) &&
|
|
108
|
-
"text-color_".concat(appearanceConfig.textColor).replace(/([A-Z])/g, '-$1').toLowerCase()), textColorActiveClass, textColorHoverClass, typeClass, textGradientClass, textStyleClass, weightClass, textWrap && "word-wrap_".concat(textWrap)), "data-tour": dataTour, style: titleStyles, onClick: onClick, children: [before, jsxs("span", { className: clsx(textAlignClass, directionWrapperClass, 'title__wrapper', textTruncateClass), style: titleWrapperStyles, children: [beforeWrapper, children || text, afterWrapper] }), after] }));
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
export { Title as T, titleAppearance as a, titleConfig as t };
|
package/dist/Tooltip-BsMYxi_I.js
DELETED
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import React, { useRef, useState, useCallback, useImperativeHandle } from 'react';
|
|
3
|
-
import clsx from 'clsx';
|
|
4
|
-
import { useDeviceTargetClass } from './hooks/useDeviceTargetClass.js';
|
|
5
|
-
import { useStyles } from './hooks/useStyles.js';
|
|
6
|
-
import { T as Text } from './Text-DGEJa_FL.js';
|
|
7
|
-
import { T as Title } from './Title-Bp-4wxkT.js';
|
|
8
|
-
|
|
9
|
-
var tooltipAppearance = {
|
|
10
|
-
surfacePrimary: {
|
|
11
|
-
fill: 'surfacePrimary',
|
|
12
|
-
textColor: 'surfaceTextPrimary',
|
|
13
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
14
|
-
},
|
|
15
|
-
surfaceSecondary: {
|
|
16
|
-
fill: 'surfaceSecondary',
|
|
17
|
-
textColor: 'surfaceTextPrimary',
|
|
18
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
19
|
-
},
|
|
20
|
-
surfaceTertiary: {
|
|
21
|
-
fill: 'surfaceTertiary',
|
|
22
|
-
textColor: 'surfaceTextPrimary',
|
|
23
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
24
|
-
},
|
|
25
|
-
};
|
|
26
|
-
|
|
27
|
-
var tooltipConfig = {
|
|
28
|
-
appearance: tooltipAppearance,
|
|
29
|
-
setAppearance: function (newComponent) {
|
|
30
|
-
tooltipConfig.appearance = newComponent;
|
|
31
|
-
},
|
|
32
|
-
};
|
|
33
|
-
var Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
34
|
-
var children = props.children, after = props.after, appearance = props.appearance, arrowPosition = props.arrowPosition, before = props.before, className = props.className, initialIsVisible = props.initialIsVisible, set = props.set, text = props.text, textColor = props.textColor, textSize = props.textSize, title = props.title, alignPosition = props.alignPosition, titleSize = props.titleSize, titleTextColor = props.titleTextColor, titleTextWeight = props.titleTextWeight, type = props.type, _a = props.openTimeoutDelay, openTimeoutDelay = _a === void 0 ? 500 : _a, _b = props.closeTimeoutDelay, closeTimeoutDelay = _b === void 0 ? 250 : _b;
|
|
35
|
-
var tooltipElementRef = useRef(null);
|
|
36
|
-
var tooltipTimeoutHideRef = useRef(null);
|
|
37
|
-
var tooltipTimeoutShowRef = useRef(null);
|
|
38
|
-
var isTooltipCloseAnimationInProgressRef = useRef(false);
|
|
39
|
-
// TODO: rename to open?
|
|
40
|
-
var _c = useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
|
|
41
|
-
// TODO: or rename to show/hide?
|
|
42
|
-
var openTooltip = useCallback(function () {
|
|
43
|
-
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
44
|
-
if (tooltipTimeoutHideRef.current) {
|
|
45
|
-
clearTimeout(tooltipTimeoutHideRef.current);
|
|
46
|
-
}
|
|
47
|
-
tooltipTimeoutShowRef.current = setTimeout(function () {
|
|
48
|
-
setIsTooltipVisible(true);
|
|
49
|
-
}, openTimeoutDelay);
|
|
50
|
-
}
|
|
51
|
-
}, [openTimeoutDelay]);
|
|
52
|
-
var closeTooltip = useCallback(function () {
|
|
53
|
-
if (tooltipTimeoutShowRef.current) {
|
|
54
|
-
clearTimeout(tooltipTimeoutShowRef.current);
|
|
55
|
-
}
|
|
56
|
-
// Make a small delay to be able to move cursor on the tooltip without
|
|
57
|
-
// triggering a close, because the label and the tooltip have space between
|
|
58
|
-
tooltipTimeoutHideRef.current = setTimeout(function () {
|
|
59
|
-
// @ts-expect-error
|
|
60
|
-
setIsTooltipVisible(function (prevState) {
|
|
61
|
-
var newState = false;
|
|
62
|
-
if (prevState === true) {
|
|
63
|
-
isTooltipCloseAnimationInProgressRef.current = true;
|
|
64
|
-
}
|
|
65
|
-
return newState;
|
|
66
|
-
});
|
|
67
|
-
}, closeTimeoutDelay);
|
|
68
|
-
}, [closeTimeoutDelay]);
|
|
69
|
-
var onAnimationEnd = useCallback(function () {
|
|
70
|
-
isTooltipCloseAnimationInProgressRef.current = false;
|
|
71
|
-
}, []);
|
|
72
|
-
useImperativeHandle(ref, function () { return ({
|
|
73
|
-
get tooltipElement() {
|
|
74
|
-
return tooltipElementRef.current;
|
|
75
|
-
},
|
|
76
|
-
isTooltipVisible: isTooltipVisible,
|
|
77
|
-
closeTooltip: closeTooltip,
|
|
78
|
-
openTooltip: openTooltip,
|
|
79
|
-
}); }, [isTooltipVisible, openTooltip, closeTooltip]);
|
|
80
|
-
/* STYLES */
|
|
81
|
-
var alignDirectionClass = useDeviceTargetClass(props, {
|
|
82
|
-
prefix: 'align_',
|
|
83
|
-
propsKey: 'alignDirection',
|
|
84
|
-
});
|
|
85
|
-
var alignClass = useDeviceTargetClass(props, {
|
|
86
|
-
prefix: 'align_',
|
|
87
|
-
propsKey: 'align',
|
|
88
|
-
});
|
|
89
|
-
var fillClass = useDeviceTargetClass(props, {
|
|
90
|
-
prefix: 'fill_',
|
|
91
|
-
propsKey: 'fill',
|
|
92
|
-
});
|
|
93
|
-
var shapeClass = useDeviceTargetClass(props, {
|
|
94
|
-
prefix: 'tooltip_shape_',
|
|
95
|
-
propsKey: 'shape',
|
|
96
|
-
});
|
|
97
|
-
var sizeClass = useDeviceTargetClass(props, {
|
|
98
|
-
prefix: 'tooltip_size_',
|
|
99
|
-
propsKey: 'size',
|
|
100
|
-
});
|
|
101
|
-
var borderWidthClass = useDeviceTargetClass(props, {
|
|
102
|
-
prefix: 'border-width_',
|
|
103
|
-
propsKey: 'borderWidth',
|
|
104
|
-
});
|
|
105
|
-
var borderColorClass = useDeviceTargetClass(props, {
|
|
106
|
-
prefix: 'border-color_',
|
|
107
|
-
propsKey: 'borderColor',
|
|
108
|
-
});
|
|
109
|
-
var borderTypeClass = useDeviceTargetClass(props, {
|
|
110
|
-
prefix: 'border_type_',
|
|
111
|
-
propsKey: 'borderType',
|
|
112
|
-
});
|
|
113
|
-
var elevationClass = useDeviceTargetClass(props, {
|
|
114
|
-
prefix: 'elevation_',
|
|
115
|
-
propsKey: 'elevation',
|
|
116
|
-
});
|
|
117
|
-
var widthClass = useDeviceTargetClass(props, {
|
|
118
|
-
prefix: 'width_',
|
|
119
|
-
propsKey: 'width',
|
|
120
|
-
});
|
|
121
|
-
var alignmentClass = useDeviceTargetClass(props, {
|
|
122
|
-
prefix: 'alignment_',
|
|
123
|
-
propsKey: 'alignment',
|
|
124
|
-
});
|
|
125
|
-
// @ts-expect-error
|
|
126
|
-
var tooltipStyles = useStyles(props).styles;
|
|
127
|
-
// prettier-ignore
|
|
128
|
-
var appearanceConfig = (appearance && tooltipConfig.appearance && tooltipConfig.appearance[appearance]);
|
|
129
|
-
return (jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible === true && 'tooltip_state_open', isTooltipVisible === false && 'tooltip_state_close', fillClass ||
|
|
130
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
131
|
-
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase()), shapeClass ||
|
|
132
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
133
|
-
"tooltip_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), alignPosition && "tooltip_align-position_".concat(alignPosition), alignDirectionClass ||
|
|
134
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.alignDirection) &&
|
|
135
|
-
"align_".concat(appearanceConfig.alignDirection).replace(/([A-Z])/g, '-$1').toLowerCase()), alignClass ||
|
|
136
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.align) &&
|
|
137
|
-
"align_".concat(appearanceConfig.align).replace(/([A-Z])/g, '-$1').toLowerCase()), alignmentClass ||
|
|
138
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.alignment) &&
|
|
139
|
-
"alignment_".concat(appearanceConfig.alignment).replace(/([A-Z])/g, '-$1').toLowerCase()), borderWidthClass, borderColorClass ||
|
|
140
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
|
|
141
|
-
"border-color_".concat(appearanceConfig.borderColor)
|
|
142
|
-
.replace(/([A-Z])/g, '-$1')
|
|
143
|
-
.toLowerCase()), borderTypeClass, elevationClass ||
|
|
144
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.elevation) &&
|
|
145
|
-
"elevation_".concat(appearanceConfig.elevation).replace(/([A-Z])/g, '-$1').toLowerCase()), sizeClass ||
|
|
146
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.size) &&
|
|
147
|
-
"tooltip_size_".concat(appearanceConfig.size).replace(/([A-Z])/g, '-$1').toLowerCase()), arrowPosition && "tooltip_type_arrow tooltip_arrow_position_".concat(arrowPosition), type && "tooltip_type_".concat(type), set && "tooltip_set_".concat(set), widthClass), ref: tooltipElementRef, style: tooltipStyles, onAnimationEnd: onAnimationEnd, children: [before, jsxs("div", { className: "tooltip__inner", children: [title && (jsx(Title, { className: "tooltip__title", size: titleSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleSize), textColor: titleTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleTextColor), textWeight: titleTextWeight || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleTextWeight), children: title })), text && (jsx(Text, { className: "tooltip__text", size: textSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textSize), textColor: textColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor), children: text })), children] }), after] }));
|
|
148
|
-
});
|
|
149
|
-
|
|
150
|
-
export { Tooltip as T, tooltipAppearance as a, tooltipConfig as t };
|
package/dist/Tooltip-CUL79Nsx.js
DELETED
|
@@ -1,154 +0,0 @@
|
|
|
1
|
-
'use strict';
|
|
2
|
-
|
|
3
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
4
|
-
var React = require('react');
|
|
5
|
-
var clsx = require('clsx');
|
|
6
|
-
var useDeviceTargetClass = require('./cjs/hooks/useDeviceTargetClass.js');
|
|
7
|
-
var useStyles = require('./cjs/hooks/useStyles.js');
|
|
8
|
-
var Text = require('./Text-C-scXvy7.js');
|
|
9
|
-
var Title = require('./Title-BatSai-G.js');
|
|
10
|
-
|
|
11
|
-
var tooltipAppearance = {
|
|
12
|
-
surfacePrimary: {
|
|
13
|
-
fill: 'surfacePrimary',
|
|
14
|
-
textColor: 'surfaceTextPrimary',
|
|
15
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
16
|
-
},
|
|
17
|
-
surfaceSecondary: {
|
|
18
|
-
fill: 'surfaceSecondary',
|
|
19
|
-
textColor: 'surfaceTextPrimary',
|
|
20
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
21
|
-
},
|
|
22
|
-
surfaceTertiary: {
|
|
23
|
-
fill: 'surfaceTertiary',
|
|
24
|
-
textColor: 'surfaceTextPrimary',
|
|
25
|
-
titleTextColor: 'surfaceTextPrimary',
|
|
26
|
-
},
|
|
27
|
-
};
|
|
28
|
-
|
|
29
|
-
var tooltipConfig = {
|
|
30
|
-
appearance: tooltipAppearance,
|
|
31
|
-
setAppearance: function (newComponent) {
|
|
32
|
-
tooltipConfig.appearance = newComponent;
|
|
33
|
-
},
|
|
34
|
-
};
|
|
35
|
-
var Tooltip = React.forwardRef(function Tooltip(props, ref) {
|
|
36
|
-
var children = props.children, after = props.after, appearance = props.appearance, arrowPosition = props.arrowPosition, before = props.before, className = props.className, initialIsVisible = props.initialIsVisible, set = props.set, text = props.text, textColor = props.textColor, textSize = props.textSize, title = props.title, alignPosition = props.alignPosition, titleSize = props.titleSize, titleTextColor = props.titleTextColor, titleTextWeight = props.titleTextWeight, type = props.type, _a = props.openTimeoutDelay, openTimeoutDelay = _a === void 0 ? 500 : _a, _b = props.closeTimeoutDelay, closeTimeoutDelay = _b === void 0 ? 250 : _b;
|
|
37
|
-
var tooltipElementRef = React.useRef(null);
|
|
38
|
-
var tooltipTimeoutHideRef = React.useRef(null);
|
|
39
|
-
var tooltipTimeoutShowRef = React.useRef(null);
|
|
40
|
-
var isTooltipCloseAnimationInProgressRef = React.useRef(false);
|
|
41
|
-
// TODO: rename to open?
|
|
42
|
-
var _c = React.useState(initialIsVisible), isTooltipVisible = _c[0], setIsTooltipVisible = _c[1];
|
|
43
|
-
// TODO: or rename to show/hide?
|
|
44
|
-
var openTooltip = React.useCallback(function () {
|
|
45
|
-
if (!isTooltipCloseAnimationInProgressRef.current) {
|
|
46
|
-
if (tooltipTimeoutHideRef.current) {
|
|
47
|
-
clearTimeout(tooltipTimeoutHideRef.current);
|
|
48
|
-
}
|
|
49
|
-
tooltipTimeoutShowRef.current = setTimeout(function () {
|
|
50
|
-
setIsTooltipVisible(true);
|
|
51
|
-
}, openTimeoutDelay);
|
|
52
|
-
}
|
|
53
|
-
}, [openTimeoutDelay]);
|
|
54
|
-
var closeTooltip = React.useCallback(function () {
|
|
55
|
-
if (tooltipTimeoutShowRef.current) {
|
|
56
|
-
clearTimeout(tooltipTimeoutShowRef.current);
|
|
57
|
-
}
|
|
58
|
-
// Make a small delay to be able to move cursor on the tooltip without
|
|
59
|
-
// triggering a close, because the label and the tooltip have space between
|
|
60
|
-
tooltipTimeoutHideRef.current = setTimeout(function () {
|
|
61
|
-
// @ts-expect-error
|
|
62
|
-
setIsTooltipVisible(function (prevState) {
|
|
63
|
-
var newState = false;
|
|
64
|
-
if (prevState === true) {
|
|
65
|
-
isTooltipCloseAnimationInProgressRef.current = true;
|
|
66
|
-
}
|
|
67
|
-
return newState;
|
|
68
|
-
});
|
|
69
|
-
}, closeTimeoutDelay);
|
|
70
|
-
}, [closeTimeoutDelay]);
|
|
71
|
-
var onAnimationEnd = React.useCallback(function () {
|
|
72
|
-
isTooltipCloseAnimationInProgressRef.current = false;
|
|
73
|
-
}, []);
|
|
74
|
-
React.useImperativeHandle(ref, function () { return ({
|
|
75
|
-
get tooltipElement() {
|
|
76
|
-
return tooltipElementRef.current;
|
|
77
|
-
},
|
|
78
|
-
isTooltipVisible: isTooltipVisible,
|
|
79
|
-
closeTooltip: closeTooltip,
|
|
80
|
-
openTooltip: openTooltip,
|
|
81
|
-
}); }, [isTooltipVisible, openTooltip, closeTooltip]);
|
|
82
|
-
/* STYLES */
|
|
83
|
-
var alignDirectionClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
84
|
-
prefix: 'align_',
|
|
85
|
-
propsKey: 'alignDirection',
|
|
86
|
-
});
|
|
87
|
-
var alignClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
88
|
-
prefix: 'align_',
|
|
89
|
-
propsKey: 'align',
|
|
90
|
-
});
|
|
91
|
-
var fillClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
92
|
-
prefix: 'fill_',
|
|
93
|
-
propsKey: 'fill',
|
|
94
|
-
});
|
|
95
|
-
var shapeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
96
|
-
prefix: 'tooltip_shape_',
|
|
97
|
-
propsKey: 'shape',
|
|
98
|
-
});
|
|
99
|
-
var sizeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
100
|
-
prefix: 'tooltip_size_',
|
|
101
|
-
propsKey: 'size',
|
|
102
|
-
});
|
|
103
|
-
var borderWidthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
104
|
-
prefix: 'border-width_',
|
|
105
|
-
propsKey: 'borderWidth',
|
|
106
|
-
});
|
|
107
|
-
var borderColorClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
108
|
-
prefix: 'border-color_',
|
|
109
|
-
propsKey: 'borderColor',
|
|
110
|
-
});
|
|
111
|
-
var borderTypeClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
112
|
-
prefix: 'border_type_',
|
|
113
|
-
propsKey: 'borderType',
|
|
114
|
-
});
|
|
115
|
-
var elevationClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
116
|
-
prefix: 'elevation_',
|
|
117
|
-
propsKey: 'elevation',
|
|
118
|
-
});
|
|
119
|
-
var widthClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
120
|
-
prefix: 'width_',
|
|
121
|
-
propsKey: 'width',
|
|
122
|
-
});
|
|
123
|
-
var alignmentClass = useDeviceTargetClass.useDeviceTargetClass(props, {
|
|
124
|
-
prefix: 'alignment_',
|
|
125
|
-
propsKey: 'alignment',
|
|
126
|
-
});
|
|
127
|
-
// @ts-expect-error
|
|
128
|
-
var tooltipStyles = useStyles.useStyles(props).styles;
|
|
129
|
-
// prettier-ignore
|
|
130
|
-
var appearanceConfig = (appearance && tooltipConfig.appearance && tooltipConfig.appearance[appearance]);
|
|
131
|
-
return (jsxRuntime.jsxs("div", { className: clsx(className, 'tooltip', isTooltipVisible === true && 'tooltip_state_open', isTooltipVisible === false && 'tooltip_state_close', fillClass ||
|
|
132
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.fill) &&
|
|
133
|
-
"fill_".concat(appearanceConfig.fill).replace(/([A-Z])/g, '-$1').toLowerCase()), shapeClass ||
|
|
134
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.shape) &&
|
|
135
|
-
"tooltip_shape_".concat(appearanceConfig.shape).replace(/([A-Z])/g, '-$1').toLowerCase()), alignPosition && "tooltip_align-position_".concat(alignPosition), alignDirectionClass ||
|
|
136
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.alignDirection) &&
|
|
137
|
-
"align_".concat(appearanceConfig.alignDirection).replace(/([A-Z])/g, '-$1').toLowerCase()), alignClass ||
|
|
138
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.align) &&
|
|
139
|
-
"align_".concat(appearanceConfig.align).replace(/([A-Z])/g, '-$1').toLowerCase()), alignmentClass ||
|
|
140
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.alignment) &&
|
|
141
|
-
"alignment_".concat(appearanceConfig.alignment).replace(/([A-Z])/g, '-$1').toLowerCase()), borderWidthClass, borderColorClass ||
|
|
142
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.borderColor) &&
|
|
143
|
-
"border-color_".concat(appearanceConfig.borderColor)
|
|
144
|
-
.replace(/([A-Z])/g, '-$1')
|
|
145
|
-
.toLowerCase()), borderTypeClass, elevationClass ||
|
|
146
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.elevation) &&
|
|
147
|
-
"elevation_".concat(appearanceConfig.elevation).replace(/([A-Z])/g, '-$1').toLowerCase()), sizeClass ||
|
|
148
|
-
((appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.size) &&
|
|
149
|
-
"tooltip_size_".concat(appearanceConfig.size).replace(/([A-Z])/g, '-$1').toLowerCase()), arrowPosition && "tooltip_type_arrow tooltip_arrow_position_".concat(arrowPosition), type && "tooltip_type_".concat(type), set && "tooltip_set_".concat(set), widthClass), ref: tooltipElementRef, style: tooltipStyles, onAnimationEnd: onAnimationEnd, children: [before, jsxRuntime.jsxs("div", { className: "tooltip__inner", children: [title && (jsxRuntime.jsx(Title.Title, { className: "tooltip__title", size: titleSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleSize), textColor: titleTextColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleTextColor), textWeight: titleTextWeight || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.titleTextWeight), children: title })), text && (jsxRuntime.jsx(Text.Text, { className: "tooltip__text", size: textSize || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textSize), textColor: textColor || (appearanceConfig === null || appearanceConfig === void 0 ? void 0 : appearanceConfig.textColor), children: text })), children] }), after] }));
|
|
150
|
-
});
|
|
151
|
-
|
|
152
|
-
exports.Tooltip = Tooltip;
|
|
153
|
-
exports.tooltipAppearance = tooltipAppearance;
|
|
154
|
-
exports.tooltipConfig = tooltipConfig;
|