@apify/ui-library 1.138.0 → 1.138.1
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/README.md +3 -3
- package/dist/src/components/action_link.d.ts.map +1 -1
- package/dist/src/components/action_link.js +3 -3
- package/dist/src/components/action_link.js.map +1 -1
- package/dist/src/components/actor_template_card.d.ts.map +1 -1
- package/dist/src/components/actor_template_card.js +3 -3
- package/dist/src/components/actor_template_card.js.map +1 -1
- package/dist/src/components/avatar/actor_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/actor_avatar.js +3 -3
- package/dist/src/components/avatar/actor_avatar.js.map +1 -1
- package/dist/src/components/avatar/boring_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/boring_avatar.js +8 -7
- package/dist/src/components/avatar/boring_avatar.js.map +1 -1
- package/dist/src/components/avatar/user_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/user_avatar.js +1 -1
- package/dist/src/components/avatar/user_avatar.js.map +1 -1
- package/dist/src/components/badge.d.ts.map +1 -1
- package/dist/src/components/badge.js +10 -3
- package/dist/src/components/badge.js.map +1 -1
- package/dist/src/components/banner.d.ts.map +1 -1
- package/dist/src/components/banner.js +4 -3
- package/dist/src/components/banner.js.map +1 -1
- package/dist/src/components/blog_article.d.ts.map +1 -1
- package/dist/src/components/blog_article.js +2 -3
- package/dist/src/components/blog_article.js.map +1 -1
- package/dist/src/components/box.d.ts.map +1 -1
- package/dist/src/components/box.js +32 -24
- package/dist/src/components/box.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/src/components/button.d.ts.map +1 -1
- package/dist/src/components/button.js +12 -9
- package/dist/src/components/button.js.map +1 -1
- package/dist/src/components/card_container.d.ts.map +1 -1
- package/dist/src/components/card_container.js +5 -3
- package/dist/src/components/card_container.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.js +1 -1
- package/dist/src/components/checkbox/checkbox.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.style.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.style.js +7 -4
- package/dist/src/components/checkbox/checkbox.style.js.map +1 -1
- package/dist/src/components/chip.d.ts.map +1 -1
- package/dist/src/components/chip.js +1 -1
- package/dist/src/components/chip.js.map +1 -1
- package/dist/src/components/code/action_button.d.ts.map +1 -1
- package/dist/src/components/code/action_button.js +5 -5
- package/dist/src/components/code/action_button.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.js +19 -8
- package/dist/src/components/code/code_block/code_block.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.js +18 -15
- package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.js +10 -8
- package/dist/src/components/code/code_block/code_block_with_tabs.js.map +1 -1
- package/dist/src/components/code/code_block/utils.d.ts.map +1 -1
- package/dist/src/components/code/code_block/utils.js.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.js +2 -2
- package/dist/src/components/code/inline_code/inline_code.js.map +1 -1
- package/dist/src/components/code/one_light_theme.d.ts.map +1 -1
- package/dist/src/components/code/one_light_theme.js +2 -17
- package/dist/src/components/code/one_light_theme.js.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.js +11 -14
- package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
- package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
- package/dist/src/components/code/prism_highlighter.js +35 -27
- package/dist/src/components/code/prism_highlighter.js.map +1 -1
- package/dist/src/components/code/prism_python.js.map +1 -1
- package/dist/src/components/collapsible_card/collapsible_card.d.ts.map +1 -1
- package/dist/src/components/collapsible_card/collapsible_card.js +7 -6
- package/dist/src/components/collapsible_card/collapsible_card.js.map +1 -1
- package/dist/src/components/color_wheel_gradient.d.ts.map +1 -1
- package/dist/src/components/color_wheel_gradient.js +4 -2
- package/dist/src/components/color_wheel_gradient.js.map +1 -1
- package/dist/src/components/floating/floating_component_base.d.ts +1 -1
- package/dist/src/components/floating/floating_component_base.d.ts.map +1 -1
- package/dist/src/components/floating/floating_component_base.js +3 -5
- package/dist/src/components/floating/floating_component_base.js.map +1 -1
- package/dist/src/components/floating/menu.d.ts.map +1 -1
- package/dist/src/components/floating/menu.js +11 -5
- package/dist/src/components/floating/menu.js.map +1 -1
- package/dist/src/components/floating/menu_common.d.ts +4 -4
- package/dist/src/components/floating/menu_common.d.ts.map +1 -1
- package/dist/src/components/floating/menu_common.js +1 -1
- package/dist/src/components/floating/menu_common.js.map +1 -1
- package/dist/src/components/floating/menu_components.d.ts.map +1 -1
- package/dist/src/components/floating/menu_components.js +9 -7
- package/dist/src/components/floating/menu_components.js.map +1 -1
- package/dist/src/components/floating/tooltip.d.ts +2 -2
- package/dist/src/components/floating/tooltip.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip.js +10 -9
- package/dist/src/components/floating/tooltip.js.map +1 -1
- package/dist/src/components/floating/tooltip_content.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip_content.js +3 -3
- package/dist/src/components/floating/tooltip_content.js.map +1 -1
- package/dist/src/components/icon_button.d.ts.map +1 -1
- package/dist/src/components/icon_button.js +10 -8
- package/dist/src/components/icon_button.js.map +1 -1
- package/dist/src/components/image.d.ts.map +1 -1
- package/dist/src/components/image.js +1 -1
- package/dist/src/components/image.js.map +1 -1
- package/dist/src/components/link.d.ts.map +1 -1
- package/dist/src/components/link.js +5 -5
- package/dist/src/components/link.js.map +1 -1
- package/dist/src/components/message.d.ts.map +1 -1
- package/dist/src/components/message.js +21 -21
- package/dist/src/components/message.js.map +1 -1
- package/dist/src/components/rating.d.ts.map +1 -1
- package/dist/src/components/rating.js +5 -6
- package/dist/src/components/rating.js.map +1 -1
- package/dist/src/components/readme_renderer/pythonize_value.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/pythonize_value.js +10 -6
- package/dist/src/components/readme_renderer/pythonize_value.js.map +1 -1
- package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/table_of_contents.js +16 -15
- package/dist/src/components/readme_renderer/table_of_contents.js.map +1 -1
- package/dist/src/components/readme_renderer/utils.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/utils.js +6 -6
- package/dist/src/components/readme_renderer/utils.js.map +1 -1
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/select/select.js +14 -13
- package/dist/src/components/select/select.js.map +1 -1
- package/dist/src/components/shortcut.d.ts +1 -1
- package/dist/src/components/shortcut.d.ts.map +1 -1
- package/dist/src/components/shortcut.js +2 -2
- package/dist/src/components/shortcut.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.js +32 -35
- package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.js +26 -12
- package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
- package/dist/src/components/spinner.d.ts.map +1 -1
- package/dist/src/components/spinner.js +3 -1
- package/dist/src/components/spinner.js.map +1 -1
- package/dist/src/components/store/store_actor_header.d.ts.map +1 -1
- package/dist/src/components/store/store_actor_header.js +1 -1
- package/dist/src/components/store/store_actor_header.js.map +1 -1
- package/dist/src/components/switch/switch.d.ts.map +1 -1
- package/dist/src/components/switch/switch.js +1 -1
- package/dist/src/components/switch/switch.js.map +1 -1
- package/dist/src/components/switch/switch.style.d.ts.map +1 -1
- package/dist/src/components/switch/switch.style.js +5 -3
- package/dist/src/components/switch/switch.style.js.map +1 -1
- package/dist/src/components/table/table.styled.js +3 -3
- package/dist/src/components/table/table.styled.js.map +1 -1
- package/dist/src/components/table/table_error_row.d.ts.map +1 -1
- package/dist/src/components/table/table_error_row.js +1 -1
- package/dist/src/components/table/table_error_row.js.map +1 -1
- package/dist/src/components/table/table_row.d.ts.map +1 -1
- package/dist/src/components/table/table_row.js +1 -1
- package/dist/src/components/table/table_row.js.map +1 -1
- package/dist/src/components/table/table_wrapper.d.ts.map +1 -1
- package/dist/src/components/table/table_wrapper.js +3 -3
- package/dist/src/components/table/table_wrapper.js.map +1 -1
- package/dist/src/components/tabs/tab.d.ts.map +1 -1
- package/dist/src/components/tabs/tab.js +7 -5
- package/dist/src/components/tabs/tab.js.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.js +3 -3
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/src/components/tag.d.ts +1 -1
- package/dist/src/components/tag.d.ts.map +1 -1
- package/dist/src/components/tag.js +1 -1
- package/dist/src/components/tag.js.map +1 -1
- package/dist/src/components/text/heading_content.d.ts.map +1 -1
- package/dist/src/components/text/heading_content.js +1 -1
- package/dist/src/components/text/heading_content.js.map +1 -1
- package/dist/src/components/text/heading_marketing.d.ts.map +1 -1
- package/dist/src/components/text/heading_marketing.js +1 -1
- package/dist/src/components/text/heading_marketing.js.map +1 -1
- package/dist/src/components/text/heading_shared.d.ts.map +1 -1
- package/dist/src/components/text/heading_shared.js +1 -1
- package/dist/src/components/text/heading_shared.js.map +1 -1
- package/dist/src/components/text/index.d.ts +1 -1
- package/dist/src/components/text/index.d.ts.map +1 -1
- package/dist/src/components/text/text_base.d.ts.map +1 -1
- package/dist/src/components/text/text_base.js +16 -12
- package/dist/src/components/text/text_base.js.map +1 -1
- package/dist/src/components/text/text_content.d.ts.map +1 -1
- package/dist/src/components/text/text_content.js +1 -1
- package/dist/src/components/text/text_content.js.map +1 -1
- package/dist/src/components/text/text_marketing.d.ts.map +1 -1
- package/dist/src/components/text/text_marketing.js +1 -1
- package/dist/src/components/text/text_marketing.js.map +1 -1
- package/dist/src/components/text/text_shared.d.ts +1 -1
- package/dist/src/components/text/text_shared.d.ts.map +1 -1
- package/dist/src/components/text/text_shared.js +1 -1
- package/dist/src/components/text/text_shared.js.map +1 -1
- package/dist/src/components/tile/horizontal_tile.d.ts.map +1 -1
- package/dist/src/components/tile/horizontal_tile.js +3 -2
- package/dist/src/components/tile/horizontal_tile.js.map +1 -1
- package/dist/src/components/tile/shared.d.ts +1 -1
- package/dist/src/components/tile/shared.d.ts.map +1 -1
- package/dist/src/components/tile/vertical_tile.d.ts.map +1 -1
- package/dist/src/components/tile/vertical_tile.js +3 -2
- package/dist/src/components/tile/vertical_tile.js.map +1 -1
- package/dist/src/components/to_consolidate/card.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/card.js +20 -15
- package/dist/src/components/to_consolidate/card.js.map +1 -1
- package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/markdown.js +36 -20
- package/dist/src/components/to_consolidate/markdown.js.map +1 -1
- package/dist/src/components/to_consolidate/pagination.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/pagination.js +6 -6
- package/dist/src/components/to_consolidate/pagination.js.map +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.js +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.js.map +1 -1
- package/dist/src/design_system/theme.d.ts.map +1 -1
- package/dist/src/design_system/theme.js +1 -1
- package/dist/src/design_system/theme.js.map +1 -1
- package/dist/src/design_system/typography_theme.d.ts.map +1 -1
- package/dist/src/design_system/typography_theme.js.map +1 -1
- package/dist/src/ui_dependency_provider.d.ts.map +1 -1
- package/dist/src/ui_dependency_provider.js +2 -2
- package/dist/src/ui_dependency_provider.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/src/codemods/generate_typograpy_tokens_files.mjs +23 -28
- package/src/components/action_link.tsx +13 -23
- package/src/components/actor_template_card.stories.tsx +20 -14
- package/src/components/actor_template_card.tsx +4 -21
- package/src/components/avatar/actor_avatar.tsx +3 -4
- package/src/components/avatar/boring_avatar.tsx +134 -167
- package/src/components/avatar/user_avatar.stories.tsx +1 -5
- package/src/components/avatar/user_avatar.tsx +6 -20
- package/src/components/badge.stories.jsx +26 -40
- package/src/components/badge.tsx +37 -26
- package/src/components/banner.stories.tsx +10 -28
- package/src/components/banner.tsx +11 -14
- package/src/components/blog_article.tsx +6 -4
- package/src/components/box.tsx +90 -89
- package/src/components/breadcrumb/breadcrumb.stories.tsx +2 -8
- package/src/components/breadcrumb/breadcrumb.tsx +7 -5
- package/src/components/button.stories.tsx +70 -66
- package/src/components/button.tsx +33 -39
- package/src/components/card_container.stories.tsx +28 -29
- package/src/components/card_container.tsx +15 -10
- package/src/components/checkbox/checkbox.stories.tsx +52 -17
- package/src/components/checkbox/checkbox.style.ts +7 -4
- package/src/components/checkbox/checkbox.tsx +6 -9
- package/src/components/chip.stories.tsx +15 -5
- package/src/components/chip.tsx +26 -16
- package/src/components/code/action_button.tsx +10 -12
- package/src/components/code/code_block/code_block.stories.jsx +7 -25
- package/src/components/code/code_block/code_block.styled.tsx +26 -19
- package/src/components/code/code_block/code_block.tsx +26 -24
- package/src/components/code/code_block/code_block_with_tabs.stories.tsx +12 -18
- package/src/components/code/code_block/code_block_with_tabs.tsx +30 -16
- package/src/components/code/code_block/utils.tsx +23 -15
- package/src/components/code/inline_code/inline_code.stories.tsx +18 -10
- package/src/components/code/inline_code/inline_code.tsx +16 -21
- package/src/components/code/one_light_theme.ts +2 -17
- package/src/components/code/one_line_code/one_line_code.stories.tsx +31 -19
- package/src/components/code/one_line_code/one_line_code.tsx +19 -30
- package/src/components/code/prism_highlighter.tsx +117 -109
- package/src/components/code/prism_python.ts +4 -2
- package/src/components/collapsible_card/collapsible_card.stories.tsx +2 -1
- package/src/components/collapsible_card/collapsible_card.tsx +30 -15
- package/src/components/color_wheel_gradient.tsx +9 -7
- package/src/components/floating/floating_component_base.tsx +16 -9
- package/src/components/floating/menu.tsx +37 -46
- package/src/components/floating/menu_common.tsx +24 -30
- package/src/components/floating/menu_components.tsx +24 -24
- package/src/components/floating/tooltip.stories.jsx +85 -68
- package/src/components/floating/tooltip.tsx +32 -39
- package/src/components/floating/tooltip_content.tsx +8 -16
- package/src/components/icon_button.stories.tsx +176 -188
- package/src/components/icon_button.tsx +72 -58
- package/src/components/image.tsx +5 -11
- package/src/components/link.stories.tsx +4 -2
- package/src/components/link.tsx +70 -70
- package/src/components/message.stories.jsx +35 -33
- package/src/components/message.tsx +45 -45
- package/src/components/rating.tsx +37 -44
- package/src/components/readme_renderer/pythonize_value.ts +19 -7
- package/src/components/readme_renderer/table_of_contents.stories.tsx +40 -15
- package/src/components/readme_renderer/table_of_contents.tsx +87 -85
- package/src/components/readme_renderer/utils.tsx +17 -13
- package/src/components/select/select.stories.tsx +19 -46
- package/src/components/select/select.tsx +103 -101
- package/src/components/shortcut.stories.jsx +23 -14
- package/src/components/shortcut.tsx +2 -13
- package/src/components/simple_markdown/simple_markdown.stories.tsx +5 -10
- package/src/components/simple_markdown/simple_markdown.tsx +152 -55
- package/src/components/simple_markdown/simple_markdown_components.tsx +49 -59
- package/src/components/spinner.stories.tsx +14 -8
- package/src/components/spinner.tsx +5 -3
- package/src/components/store/store_actor_header.stories.tsx +2 -11
- package/src/components/store/store_actor_header.tsx +20 -16
- package/src/components/switch/switch.stories.jsx +4 -12
- package/src/components/switch/switch.style.ts +5 -3
- package/src/components/switch/switch.tsx +3 -13
- package/src/components/table/table.stories.tsx +5 -2
- package/src/components/table/table.styled.ts +3 -3
- package/src/components/table/table_error_row.tsx +5 -1
- package/src/components/table/table_row.tsx +1 -5
- package/src/components/table/table_wrapper.tsx +12 -12
- package/src/components/tabs/tab.stories.tsx +1 -5
- package/src/components/tabs/tab.tsx +33 -13
- package/src/components/tabs/tabs.tsx +14 -18
- package/src/components/tag.stories.jsx +35 -45
- package/src/components/tag.tsx +18 -22
- package/src/components/text/heading_content.stories.tsx +13 -24
- package/src/components/text/heading_content.tsx +3 -7
- package/src/components/text/heading_marketing.stories.tsx +4 -3
- package/src/components/text/heading_marketing.tsx +12 -8
- package/src/components/text/heading_shared.stories.tsx +3 -2
- package/src/components/text/heading_shared.tsx +3 -7
- package/src/components/text/index.ts +1 -3
- package/src/components/text/text_base.tsx +29 -35
- package/src/components/text/text_content.stories.tsx +17 -13
- package/src/components/text/text_content.tsx +20 -23
- package/src/components/text/text_marketing.stories.tsx +4 -3
- package/src/components/text/text_marketing.tsx +20 -23
- package/src/components/text/text_shared.stories.tsx +4 -3
- package/src/components/text/text_shared.tsx +23 -27
- package/src/components/tile/horizontal_tile.stories.tsx +6 -2
- package/src/components/tile/horizontal_tile.tsx +5 -15
- package/src/components/tile/shared.ts +5 -5
- package/src/components/tile/vertical_tile.stories.tsx +10 -18
- package/src/components/tile/vertical_tile.tsx +4 -9
- package/src/components/to_consolidate/card.stories.tsx +3 -1
- package/src/components/to_consolidate/card.tsx +67 -58
- package/src/components/to_consolidate/markdown.tsx +76 -62
- package/src/components/to_consolidate/pagination.tsx +11 -15
- package/src/components/to_consolidate/tab_number_chip.tsx +5 -6
- package/src/design_system/colors/build_color_tokens.js +7 -15
- package/src/design_system/theme.ts +1 -8
- package/src/design_system/tokens/radiuses.stories.tsx +9 -1
- package/src/design_system/tokens/shadows.stories.tsx +3 -1
- package/src/design_system/typography_theme.ts +78 -39
- package/src/ui_dependency_provider.tsx +16 -23
|
@@ -11,24 +11,12 @@ import {
|
|
|
11
11
|
} from '@floating-ui/react';
|
|
12
12
|
import clsx from 'clsx';
|
|
13
13
|
import type React from 'react';
|
|
14
|
-
import {
|
|
15
|
-
useCallback,
|
|
16
|
-
useMemo,
|
|
17
|
-
useRef,
|
|
18
|
-
useState,
|
|
19
|
-
} from 'react';
|
|
14
|
+
import { useCallback, useMemo, useRef, useState } from 'react';
|
|
20
15
|
|
|
21
|
-
import {
|
|
22
|
-
Box,
|
|
23
|
-
type BoxProps,
|
|
24
|
-
} from '../box.js';
|
|
16
|
+
import { Box, type BoxProps } from '../box.js';
|
|
25
17
|
import { Text } from '../text/index.js';
|
|
26
18
|
import { useFloatingMenu } from './menu_common.js';
|
|
27
|
-
import {
|
|
28
|
-
DropdownMenuBaseComponent,
|
|
29
|
-
ListMenuComponent,
|
|
30
|
-
ListMenuItemComponent,
|
|
31
|
-
} from './menu_components.js';
|
|
19
|
+
import { DropdownMenuBaseComponent, ListMenuComponent, ListMenuItemComponent } from './menu_components.js';
|
|
32
20
|
|
|
33
21
|
export const menuClassNames = {
|
|
34
22
|
WRAPPER: 'menu-wrapper',
|
|
@@ -42,28 +30,28 @@ type SelectActionType = 'click' | 'enter' | 'space' | 'type';
|
|
|
42
30
|
// It might be tempting to define label as ReactNode, but we need to have the string value for keyboard navigation
|
|
43
31
|
// More difficult cases can be handled using renderOption prop
|
|
44
32
|
export interface MenuOption {
|
|
45
|
-
label: string
|
|
46
|
-
value: string
|
|
33
|
+
label: string;
|
|
34
|
+
value: string;
|
|
47
35
|
}
|
|
48
36
|
|
|
49
37
|
export interface MenuProps<T = MenuOption> {
|
|
50
|
-
ariaLabel?: string
|
|
51
|
-
options: T[]
|
|
52
|
-
value?: string
|
|
53
|
-
onSelect: (newValue: string, selectedBy: SelectActionType) => void
|
|
54
|
-
onMenuOpen?: (isOpen: boolean) => void
|
|
55
|
-
defaultLabel?: React.ReactNode
|
|
56
|
-
closeOnSelect?: boolean
|
|
57
|
-
renderOption?: (option: T) => React.ReactNode
|
|
58
|
-
placement?: Placement
|
|
38
|
+
ariaLabel?: string;
|
|
39
|
+
options: T[];
|
|
40
|
+
value?: string;
|
|
41
|
+
onSelect: (newValue: string, selectedBy: SelectActionType) => void;
|
|
42
|
+
onMenuOpen?: (isOpen: boolean) => void;
|
|
43
|
+
defaultLabel?: React.ReactNode;
|
|
44
|
+
closeOnSelect?: boolean;
|
|
45
|
+
renderOption?: (option: T) => React.ReactNode;
|
|
46
|
+
placement?: Placement;
|
|
59
47
|
components?: {
|
|
60
|
-
MenuBase?: React.ElementType
|
|
61
|
-
Menu?: React.ElementType
|
|
62
|
-
MenuItem?: React.ElementType
|
|
63
|
-
}
|
|
48
|
+
MenuBase?: React.ElementType;
|
|
49
|
+
Menu?: React.ElementType;
|
|
50
|
+
MenuItem?: React.ElementType;
|
|
51
|
+
};
|
|
64
52
|
}
|
|
65
53
|
|
|
66
|
-
const defaultRenderOption = ({ label }: MenuOption) =>
|
|
54
|
+
const defaultRenderOption = ({ label }: MenuOption) => <Text as="span">{label}</Text>;
|
|
67
55
|
|
|
68
56
|
/**
|
|
69
57
|
* This example is a Select taken from https://floating-ui.com/docs/react-examples
|
|
@@ -84,12 +72,15 @@ export const Menu = <T extends MenuOption>({
|
|
|
84
72
|
...rest
|
|
85
73
|
}: MenuProps<T> & BoxProps) => {
|
|
86
74
|
const [isOpen, setIsOpenState] = useState(false);
|
|
87
|
-
const setIsOpen = useCallback(
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
onMenuOpen
|
|
91
|
-
|
|
92
|
-
|
|
75
|
+
const setIsOpen = useCallback(
|
|
76
|
+
(newIsOpen: boolean) => {
|
|
77
|
+
setIsOpenState(newIsOpen);
|
|
78
|
+
if (onMenuOpen) {
|
|
79
|
+
onMenuOpen(newIsOpen);
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
[onMenuOpen],
|
|
83
|
+
);
|
|
93
84
|
const { refs, floatingStyles, context } = useFloatingMenu({
|
|
94
85
|
isOpen,
|
|
95
86
|
setIsOpen,
|
|
@@ -131,7 +122,13 @@ export const Menu = <T extends MenuOption>({
|
|
|
131
122
|
loop: true,
|
|
132
123
|
});
|
|
133
124
|
|
|
134
|
-
const { getFloatingProps, getItemProps, getReferenceProps } = useInteractions([
|
|
125
|
+
const { getFloatingProps, getItemProps, getReferenceProps } = useInteractions([
|
|
126
|
+
click,
|
|
127
|
+
dismiss,
|
|
128
|
+
role,
|
|
129
|
+
listNav,
|
|
130
|
+
typeahead,
|
|
131
|
+
]);
|
|
135
132
|
|
|
136
133
|
const MenuBaseComponent = components?.MenuBase || DropdownMenuBaseComponent;
|
|
137
134
|
const MenuComponent = components?.Menu || ListMenuComponent;
|
|
@@ -140,10 +137,7 @@ export const Menu = <T extends MenuOption>({
|
|
|
140
137
|
const effectiveRenderOption = renderOption || defaultRenderOption;
|
|
141
138
|
|
|
142
139
|
return (
|
|
143
|
-
<Box
|
|
144
|
-
className={clsx(className, menuClassNames.WRAPPER)}
|
|
145
|
-
{...rest}
|
|
146
|
-
>
|
|
140
|
+
<Box className={clsx(className, menuClassNames.WRAPPER)} {...rest}>
|
|
147
141
|
<MenuBaseComponent
|
|
148
142
|
aria-label={ariaLabel}
|
|
149
143
|
aria-labelledby={ariaLabel ? undefined : 'select-label'}
|
|
@@ -157,10 +151,7 @@ export const Menu = <T extends MenuOption>({
|
|
|
157
151
|
</MenuBaseComponent>
|
|
158
152
|
{isOpen && (
|
|
159
153
|
<FloatingPortal>
|
|
160
|
-
<FloatingFocusManager
|
|
161
|
-
context={context}
|
|
162
|
-
modal={false}
|
|
163
|
-
>
|
|
154
|
+
<FloatingFocusManager context={context} modal={false}>
|
|
164
155
|
<MenuComponent
|
|
165
156
|
ref={refs.setFloating}
|
|
166
157
|
style={floatingStyles}
|
|
@@ -1,36 +1,30 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
} from '@floating-ui/react';
|
|
4
|
-
import {
|
|
5
|
-
autoUpdate,
|
|
6
|
-
offset,
|
|
7
|
-
size,
|
|
8
|
-
useFloating,
|
|
9
|
-
} from '@floating-ui/react';
|
|
1
|
+
import type { Placement } from '@floating-ui/react';
|
|
2
|
+
import { autoUpdate, offset, size, useFloating } from '@floating-ui/react';
|
|
10
3
|
|
|
11
4
|
export const useFloatingMenu = ({
|
|
12
5
|
isOpen,
|
|
13
6
|
setIsOpen,
|
|
14
7
|
placement = 'bottom-start',
|
|
15
8
|
}: {
|
|
16
|
-
isOpen: boolean
|
|
17
|
-
setIsOpen: (newIsOpen: boolean) => void
|
|
18
|
-
placement?: Placement
|
|
19
|
-
}) =>
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
9
|
+
isOpen: boolean;
|
|
10
|
+
setIsOpen: (newIsOpen: boolean) => void;
|
|
11
|
+
placement?: Placement;
|
|
12
|
+
}) =>
|
|
13
|
+
useFloating<Element>({
|
|
14
|
+
placement,
|
|
15
|
+
open: isOpen,
|
|
16
|
+
onOpenChange: setIsOpen,
|
|
17
|
+
whileElementsMounted: autoUpdate,
|
|
18
|
+
middleware: [
|
|
19
|
+
offset(5),
|
|
20
|
+
size({
|
|
21
|
+
apply({ elements, availableHeight }) {
|
|
22
|
+
Object.assign(elements.floating.style, {
|
|
23
|
+
maxHeight: `${availableHeight}px`,
|
|
24
|
+
minHeight: '50px',
|
|
25
|
+
});
|
|
26
|
+
},
|
|
27
|
+
padding: 10,
|
|
28
|
+
}),
|
|
29
|
+
],
|
|
30
|
+
});
|
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type ReferenceType,
|
|
3
|
-
type UseFloatingReturn,
|
|
4
|
-
} from '@floating-ui/react';
|
|
1
|
+
import { type ReferenceType, type UseFloatingReturn } from '@floating-ui/react';
|
|
5
2
|
import { forwardRef } from 'react';
|
|
6
3
|
import styled, { css } from 'styled-components';
|
|
7
4
|
|
|
@@ -34,8 +31,8 @@ export const ListMenuComponent = styled(Box).attrs({
|
|
|
34
31
|
`;
|
|
35
32
|
|
|
36
33
|
interface SelectableListMenuItemProps {
|
|
37
|
-
$isActive?: boolean
|
|
38
|
-
$isSelected?: boolean
|
|
34
|
+
$isActive?: boolean;
|
|
35
|
+
$isSelected?: boolean;
|
|
39
36
|
}
|
|
40
37
|
|
|
41
38
|
/**
|
|
@@ -49,14 +46,18 @@ export const ListMenuItemComponent = styled(Box).attrs({
|
|
|
49
46
|
cursor: pointer;
|
|
50
47
|
white-space: nowrap;
|
|
51
48
|
|
|
52
|
-
${({ $isActive }) =>
|
|
53
|
-
|
|
54
|
-
|
|
49
|
+
${({ $isActive }) =>
|
|
50
|
+
$isActive &&
|
|
51
|
+
css`
|
|
52
|
+
background-color: ${theme.color.neutral.hover};
|
|
53
|
+
`}
|
|
55
54
|
|
|
56
|
-
${({ $isSelected }) =>
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
${({ $isSelected }) =>
|
|
56
|
+
$isSelected &&
|
|
57
|
+
css`
|
|
58
|
+
background-color: ${theme.color.neutral.backgroundSubtle};
|
|
59
|
+
color: ${theme.color.primary.text};
|
|
60
|
+
`}
|
|
60
61
|
`;
|
|
61
62
|
|
|
62
63
|
/**
|
|
@@ -86,14 +87,13 @@ type DropdownMenuBaseComponentProps = {
|
|
|
86
87
|
/**
|
|
87
88
|
* Menu base component WITH dropdown icon
|
|
88
89
|
*/
|
|
89
|
-
export const DropdownMenuBaseComponent = forwardRef<HTMLElement, DropdownMenuBaseComponentProps>(
|
|
90
|
-
children,
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
});
|
|
90
|
+
export const DropdownMenuBaseComponent = forwardRef<HTMLElement, DropdownMenuBaseComponentProps>(
|
|
91
|
+
({ children, ...props }, ref) => {
|
|
92
|
+
return (
|
|
93
|
+
<PlainMenuBaseComponent {...props} ref={ref}>
|
|
94
|
+
{children}
|
|
95
|
+
<ChevronDownIcon size="16" color={theme.color.neutral.icon} />
|
|
96
|
+
</PlainMenuBaseComponent>
|
|
97
|
+
);
|
|
98
|
+
},
|
|
99
|
+
);
|
|
@@ -6,11 +6,14 @@ import { Tooltip } from './tooltip.tsx';
|
|
|
6
6
|
|
|
7
7
|
const Child = () => <div style={{ padding: '8px', border: '1px solid black', borderRadius: '4px' }}>Hover me</div>;
|
|
8
8
|
|
|
9
|
-
const longText =
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
<
|
|
13
|
-
|
|
9
|
+
const longText =
|
|
10
|
+
'This is a tooltip with a longer text. This is a tooltip with a longer text. This is a tooltip with a longer text.';
|
|
11
|
+
const longTextWithLinks = (
|
|
12
|
+
<div style={{ display: 'inline' }}>
|
|
13
|
+
This is a tooltip with a longer text. This is a tooltip with a longer text. This is a tooltip with a longer text
|
|
14
|
+
and finally we have a <a href="https://www.example.com">link</a>.
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
14
17
|
|
|
15
18
|
export default {
|
|
16
19
|
title: 'UI-Library/Tooltip',
|
|
@@ -43,77 +46,91 @@ const DefaultStoryWrapper = styled.div`
|
|
|
43
46
|
`;
|
|
44
47
|
|
|
45
48
|
export const Default = (args) => {
|
|
46
|
-
return (
|
|
47
|
-
<
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
<
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
<
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
<
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
49
|
+
return (
|
|
50
|
+
<DefaultStoryWrapper>
|
|
51
|
+
<div>
|
|
52
|
+
<Tooltip {...args} />
|
|
53
|
+
Default
|
|
54
|
+
</div>
|
|
55
|
+
<div>
|
|
56
|
+
<Tooltip shortcuts={['Ctrl / ⌘', 'F']} {...args} />
|
|
57
|
+
With shortcuts
|
|
58
|
+
</div>
|
|
59
|
+
<div>
|
|
60
|
+
<Tooltip subtleText="This is some subtle text" {...args} />
|
|
61
|
+
With subtleText
|
|
62
|
+
</div>
|
|
63
|
+
<div>
|
|
64
|
+
<Tooltip imageUrl="https://picsum.photos/id/1/1024" {...args} />
|
|
65
|
+
With image
|
|
66
|
+
</div>
|
|
67
|
+
<div>
|
|
68
|
+
<Tooltip
|
|
69
|
+
persistent={{ isOpenOverride: true }}
|
|
70
|
+
shortcuts={['Ctrl / ⌘', 'F']}
|
|
71
|
+
content={longText}
|
|
72
|
+
textAlign="center"
|
|
73
|
+
>
|
|
74
|
+
<Child />
|
|
75
|
+
</Tooltip>
|
|
76
|
+
With shortcuts and long centered text
|
|
77
|
+
</div>
|
|
78
|
+
<div>
|
|
79
|
+
<Tooltip
|
|
80
|
+
persistent={{ isOpenOverride: true }}
|
|
81
|
+
shortcuts={['Ctrl / ⌘', 'F']}
|
|
82
|
+
imageUrl="https://picsum.photos/id/1/1024"
|
|
83
|
+
subtleText="This is some subtle text"
|
|
84
|
+
placement={FLOATING_PLACEMENT.BOTTOM}
|
|
85
|
+
content={longTextWithLinks}
|
|
86
|
+
>
|
|
87
|
+
<Child />
|
|
88
|
+
</Tooltip>
|
|
89
|
+
With everything
|
|
90
|
+
</div>
|
|
91
|
+
</DefaultStoryWrapper>
|
|
84
92
|
);
|
|
85
93
|
};
|
|
86
94
|
|
|
87
95
|
export const Sizes = () => {
|
|
88
|
-
return (
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
96
|
+
return (
|
|
97
|
+
<DefaultStoryWrapper>
|
|
98
|
+
<div>
|
|
99
|
+
Xsmall:
|
|
100
|
+
<Tooltip size="xsmall" content={longText}>
|
|
101
|
+
<Child />
|
|
102
|
+
</Tooltip>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
Small (default):
|
|
106
|
+
<Tooltip size="small" content={longText}>
|
|
107
|
+
<Child />
|
|
108
|
+
</Tooltip>
|
|
109
|
+
</div>
|
|
110
|
+
<div>
|
|
111
|
+
Medium:
|
|
112
|
+
<Tooltip size="medium" content={longText}>
|
|
113
|
+
<Child />
|
|
114
|
+
</Tooltip>
|
|
115
|
+
</div>
|
|
116
|
+
<div>
|
|
117
|
+
Large:
|
|
118
|
+
<Tooltip size="large" content={longText}>
|
|
119
|
+
<Child />
|
|
120
|
+
</Tooltip>
|
|
121
|
+
</div>
|
|
122
|
+
<div>
|
|
123
|
+
Xlarge:
|
|
124
|
+
<Tooltip size="xlarge" content={longText}>
|
|
125
|
+
<Child />
|
|
126
|
+
</Tooltip>
|
|
127
|
+
</div>
|
|
128
|
+
</DefaultStoryWrapper>
|
|
110
129
|
);
|
|
111
130
|
};
|
|
112
131
|
|
|
113
132
|
export const Playground = (args) => {
|
|
114
|
-
return
|
|
115
|
-
<Tooltip {...args}/>
|
|
116
|
-
);
|
|
133
|
+
return <Tooltip {...args} />;
|
|
117
134
|
};
|
|
118
135
|
Playground.argTypes = {
|
|
119
136
|
content: { control: 'text' },
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
useFloating,
|
|
3
|
-
useHover,
|
|
4
|
-
useInteractions,
|
|
5
|
-
} from '@floating-ui/react';
|
|
1
|
+
import { useFloating, useHover, useInteractions } from '@floating-ui/react';
|
|
6
2
|
import { type ComponentType, type ElementType, forwardRef, type ReactNode, useState } from 'react';
|
|
7
3
|
import styled, { css } from 'styled-components';
|
|
8
4
|
|
|
@@ -16,17 +12,17 @@ export const TOOLTIP_TEXT_ALIGNS = {
|
|
|
16
12
|
CENTER: 'center',
|
|
17
13
|
} as const;
|
|
18
14
|
|
|
19
|
-
export type TooltipTextAlign = typeof TOOLTIP_TEXT_ALIGNS[keyof typeof TOOLTIP_TEXT_ALIGNS];
|
|
15
|
+
export type TooltipTextAlign = (typeof TOOLTIP_TEXT_ALIGNS)[keyof typeof TOOLTIP_TEXT_ALIGNS];
|
|
20
16
|
|
|
21
17
|
export const TOOLTIP_SIZES = {
|
|
22
18
|
XSMALL: 'xsmall',
|
|
23
19
|
SMALL: 'small',
|
|
24
20
|
MEDIUM: 'medium',
|
|
25
|
-
LARGE: 'large'
|
|
26
|
-
XLARGE: 'xlarge'
|
|
21
|
+
LARGE: 'large' /* Previously WIDE */,
|
|
22
|
+
XLARGE: 'xlarge' /* Previously WIDER */,
|
|
27
23
|
} as const;
|
|
28
24
|
|
|
29
|
-
export type TooltipSize = typeof TOOLTIP_SIZES[keyof typeof TOOLTIP_SIZES];
|
|
25
|
+
export type TooltipSize = (typeof TOOLTIP_SIZES)[keyof typeof TOOLTIP_SIZES];
|
|
30
26
|
|
|
31
27
|
export interface TooltipProps extends Omit<FloatingComponentBaseProps, 'isOpen' | 'size'> {
|
|
32
28
|
as?: ElementType;
|
|
@@ -60,10 +56,12 @@ const StyledFloatingComponentBase = styled(FloatingComponentBase)<{ $isDarkTheme
|
|
|
60
56
|
}
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
${({ $isDarkTheme }) =>
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
${({ $isDarkTheme }) =>
|
|
60
|
+
$isDarkTheme &&
|
|
61
|
+
css`
|
|
62
|
+
box-shadow: ${theme.shadow.shadow2};
|
|
63
|
+
border: 1px solid ${theme.color.neutral.smallTooltipBorder};
|
|
64
|
+
`}
|
|
67
65
|
`;
|
|
68
66
|
|
|
69
67
|
/**
|
|
@@ -103,42 +101,37 @@ export const Tooltip = ({
|
|
|
103
101
|
const tooltipProps = {
|
|
104
102
|
isOpen: open,
|
|
105
103
|
...rest,
|
|
106
|
-
content:
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
content: (
|
|
105
|
+
<TooltipContent
|
|
106
|
+
content={tooltipSafeHtml(rest.content)}
|
|
107
|
+
shortcuts={shortcuts}
|
|
108
|
+
imageUrl={imageUrl}
|
|
109
|
+
subtleText={subtleText}
|
|
110
|
+
size={size}
|
|
111
|
+
textAlign={textAlign}
|
|
112
|
+
/>
|
|
113
|
+
),
|
|
114
114
|
};
|
|
115
115
|
|
|
116
116
|
return (
|
|
117
|
-
<TooltipFocusArea
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
ref={refs.setReference}
|
|
121
|
-
{...getReferenceProps()}
|
|
122
|
-
>
|
|
123
|
-
<div
|
|
124
|
-
ref={refs.setFloating}
|
|
125
|
-
{...getFloatingProps()}
|
|
126
|
-
>
|
|
127
|
-
<StyledFloatingComponentBase
|
|
128
|
-
{...tooltipProps}
|
|
129
|
-
$isDarkTheme={uiTheme === 'DARK'}
|
|
130
|
-
/>
|
|
117
|
+
<TooltipFocusArea as={as} className={className} ref={refs.setReference} {...getReferenceProps()}>
|
|
118
|
+
<div ref={refs.setFloating} {...getFloatingProps()}>
|
|
119
|
+
<StyledFloatingComponentBase {...tooltipProps} $isDarkTheme={uiTheme === 'DARK'} />
|
|
131
120
|
</div>
|
|
132
121
|
</TooltipFocusArea>
|
|
133
122
|
);
|
|
134
123
|
};
|
|
135
124
|
|
|
136
|
-
export function withTooltip<TProps extends Record<string, unknown> = Record<string, unknown>>(
|
|
125
|
+
export function withTooltip<TProps extends Record<string, unknown> = Record<string, unknown>>(
|
|
126
|
+
Component: ComponentType<TProps>,
|
|
127
|
+
) {
|
|
137
128
|
const Enhanced = forwardRef<HTMLElement, TProps & WithTooltipProps>(({ tooltipProps, ...rest }, ref) => {
|
|
138
129
|
if (!tooltipProps) return <Component {...(rest as unknown as TProps)} ref={ref} />;
|
|
139
|
-
return
|
|
140
|
-
<
|
|
141
|
-
|
|
130
|
+
return (
|
|
131
|
+
<Tooltip {...tooltipProps}>
|
|
132
|
+
<Component {...(rest as unknown as TProps)} ref={ref} />
|
|
133
|
+
</Tooltip>
|
|
134
|
+
);
|
|
142
135
|
});
|
|
143
136
|
|
|
144
137
|
Enhanced.displayName = `WithTooltip:${Component.displayName || Component.name}`;
|
|
@@ -22,7 +22,7 @@ const TOOLTIP_CLASSNAMES = {
|
|
|
22
22
|
SHORTCUT_CONTAINER: 'Tooltip-shortcutContainer',
|
|
23
23
|
} as const;
|
|
24
24
|
|
|
25
|
-
const StyledContent = styled.div<{ $size: TooltipSize
|
|
25
|
+
const StyledContent = styled.div<{ $size: TooltipSize; $textAlign: TooltipTextAlign }>`
|
|
26
26
|
display: flex;
|
|
27
27
|
flex-direction: column;
|
|
28
28
|
gap: ${theme.space.space8};
|
|
@@ -45,13 +45,13 @@ const StyledContent = styled.div<{ $size: TooltipSize, $textAlign: TooltipTextAl
|
|
|
45
45
|
align-items: ${({ $textAlign }) => ($textAlign === 'center' ? 'center' : 'flex-start')};
|
|
46
46
|
|
|
47
47
|
/* When there is no child with subtleText class */
|
|
48
|
-
&:not(:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT})){
|
|
48
|
+
&:not(:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT})) {
|
|
49
49
|
flex-direction: row;
|
|
50
50
|
flex-wrap: wrap;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/* When there is a child with subtleText class */
|
|
54
|
-
&:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT}){
|
|
54
|
+
&:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT}) {
|
|
55
55
|
text-align: left;
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -81,24 +81,16 @@ export const TooltipContent = ({
|
|
|
81
81
|
}: ContentProps) => {
|
|
82
82
|
return (
|
|
83
83
|
<StyledContent $size={size} $textAlign={textAlign}>
|
|
84
|
-
{imageUrl &&
|
|
85
|
-
<img
|
|
86
|
-
src={imageUrl}
|
|
87
|
-
alt=""
|
|
88
|
-
className={TOOLTIP_CLASSNAMES.IMAGE}
|
|
89
|
-
/>
|
|
90
|
-
)}
|
|
84
|
+
{imageUrl && <img src={imageUrl} alt="" className={TOOLTIP_CLASSNAMES.IMAGE} />}
|
|
91
85
|
<div className={TOOLTIP_CLASSNAMES.TEXT_CONTENT}>
|
|
92
86
|
{content}
|
|
93
|
-
{subtleText &&
|
|
94
|
-
<div className={TOOLTIP_CLASSNAMES.SUBTLE_TEXT}>
|
|
95
|
-
{subtleText}
|
|
96
|
-
</div>
|
|
97
|
-
)}
|
|
87
|
+
{subtleText && <div className={TOOLTIP_CLASSNAMES.SUBTLE_TEXT}>{subtleText}</div>}
|
|
98
88
|
{shortcuts.length > 0 && (
|
|
99
89
|
<div className={TOOLTIP_CLASSNAMES.SHORTCUT_CONTAINER}>
|
|
100
90
|
{shortcuts.map((shortcut, index) => (
|
|
101
|
-
<Shortcut key={`${shortcut}-${index}`} dark>
|
|
91
|
+
<Shortcut key={`${shortcut}-${index}`} dark>
|
|
92
|
+
{shortcut}
|
|
93
|
+
</Shortcut>
|
|
102
94
|
))}
|
|
103
95
|
</div>
|
|
104
96
|
)}
|