@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
|
@@ -3,16 +3,9 @@ import type { Meta } from '@storybook/react-vite';
|
|
|
3
3
|
import { action } from 'storybook/actions';
|
|
4
4
|
import styled from 'styled-components';
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
BellIcon,
|
|
8
|
-
DeleteIcon, PeopleIcon,
|
|
9
|
-
} from '@apify/ui-icons';
|
|
6
|
+
import { BellIcon, DeleteIcon, PeopleIcon } from '@apify/ui-icons';
|
|
10
7
|
|
|
11
|
-
import {
|
|
12
|
-
ICON_BUTTON_VARIANTS,
|
|
13
|
-
IconButton,
|
|
14
|
-
type IconButtonProps,
|
|
15
|
-
} from './icon_button.js';
|
|
8
|
+
import { ICON_BUTTON_VARIANTS, IconButton, type IconButtonProps } from './icon_button.js';
|
|
16
9
|
|
|
17
10
|
export default {
|
|
18
11
|
title: 'UI-Library/IconButton',
|
|
@@ -36,171 +29,173 @@ const Table = styled.table`
|
|
|
36
29
|
`;
|
|
37
30
|
|
|
38
31
|
export const Default = (props: IconButtonProps<'button'>) => {
|
|
39
|
-
return (
|
|
40
|
-
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
<
|
|
46
|
-
|
|
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
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
<
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
<
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
<
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
<
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
<
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
<
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
<
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
<
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
<
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
<
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
32
|
+
return (
|
|
33
|
+
<>
|
|
34
|
+
<Table>
|
|
35
|
+
<tbody>
|
|
36
|
+
{Object.values(ICON_BUTTON_VARIANTS).map((variant) => (
|
|
37
|
+
<tr key={variant}>
|
|
38
|
+
<td>
|
|
39
|
+
<IconButton
|
|
40
|
+
{...props}
|
|
41
|
+
variant={variant}
|
|
42
|
+
Icon={DeleteIcon}
|
|
43
|
+
size="extraLarge"
|
|
44
|
+
title="Delete example"
|
|
45
|
+
/>
|
|
46
|
+
</td>
|
|
47
|
+
<td>
|
|
48
|
+
<IconButton
|
|
49
|
+
{...props}
|
|
50
|
+
variant={variant}
|
|
51
|
+
Icon={DeleteIcon}
|
|
52
|
+
size="large"
|
|
53
|
+
title="Delete example"
|
|
54
|
+
/>
|
|
55
|
+
</td>
|
|
56
|
+
<td>
|
|
57
|
+
<IconButton
|
|
58
|
+
{...props}
|
|
59
|
+
variant={variant}
|
|
60
|
+
Icon={DeleteIcon}
|
|
61
|
+
size="medium"
|
|
62
|
+
title="Delete example"
|
|
63
|
+
/>
|
|
64
|
+
</td>
|
|
65
|
+
<td>
|
|
66
|
+
<IconButton
|
|
67
|
+
{...props}
|
|
68
|
+
variant={variant}
|
|
69
|
+
Icon={DeleteIcon}
|
|
70
|
+
size="small"
|
|
71
|
+
title="Delete example"
|
|
72
|
+
/>
|
|
73
|
+
</td>
|
|
74
|
+
<td>
|
|
75
|
+
<IconButton
|
|
76
|
+
{...props}
|
|
77
|
+
variant={variant}
|
|
78
|
+
Icon={DeleteIcon}
|
|
79
|
+
size="extraSmall"
|
|
80
|
+
title="Delete example"
|
|
81
|
+
/>
|
|
82
|
+
</td>
|
|
83
|
+
<td>
|
|
84
|
+
<IconButton
|
|
85
|
+
{...props}
|
|
86
|
+
variant={variant}
|
|
87
|
+
Icon={DeleteIcon}
|
|
88
|
+
disabled
|
|
89
|
+
size="extraLarge"
|
|
90
|
+
title="Disabled delete example"
|
|
91
|
+
/>
|
|
92
|
+
</td>
|
|
93
|
+
<td>
|
|
94
|
+
<IconButton
|
|
95
|
+
{...props}
|
|
96
|
+
variant={variant}
|
|
97
|
+
Icon={DeleteIcon}
|
|
98
|
+
disabled
|
|
99
|
+
size="large"
|
|
100
|
+
title="Disabled delete example"
|
|
101
|
+
/>
|
|
102
|
+
</td>
|
|
103
|
+
<td>
|
|
104
|
+
<IconButton
|
|
105
|
+
{...props}
|
|
106
|
+
variant={variant}
|
|
107
|
+
Icon={DeleteIcon}
|
|
108
|
+
disabled
|
|
109
|
+
size="medium"
|
|
110
|
+
title="Disabled delete example"
|
|
111
|
+
/>
|
|
112
|
+
</td>
|
|
113
|
+
<td>
|
|
114
|
+
<IconButton
|
|
115
|
+
{...props}
|
|
116
|
+
variant={variant}
|
|
117
|
+
Icon={DeleteIcon}
|
|
118
|
+
disabled
|
|
119
|
+
size="small"
|
|
120
|
+
title="Disabled delete example"
|
|
121
|
+
/>
|
|
122
|
+
</td>
|
|
123
|
+
<td>
|
|
124
|
+
<IconButton
|
|
125
|
+
{...props}
|
|
126
|
+
variant={variant}
|
|
127
|
+
Icon={DeleteIcon}
|
|
128
|
+
disabled
|
|
129
|
+
size="extraSmall"
|
|
130
|
+
title="Disabled delete example"
|
|
131
|
+
/>
|
|
132
|
+
</td>
|
|
133
|
+
<td>
|
|
134
|
+
<IconButton
|
|
135
|
+
{...props}
|
|
136
|
+
variant={variant}
|
|
137
|
+
Icon={DeleteIcon}
|
|
138
|
+
isLoading
|
|
139
|
+
size="extraLarge"
|
|
140
|
+
title="Loading delete example"
|
|
141
|
+
/>
|
|
142
|
+
</td>
|
|
143
|
+
<td>
|
|
144
|
+
<IconButton
|
|
145
|
+
{...props}
|
|
146
|
+
variant={variant}
|
|
147
|
+
Icon={DeleteIcon}
|
|
148
|
+
isLoading
|
|
149
|
+
size="extraLarge"
|
|
150
|
+
title="Loading delete example"
|
|
151
|
+
/>
|
|
152
|
+
</td>
|
|
153
|
+
<td>
|
|
154
|
+
<IconButton
|
|
155
|
+
{...props}
|
|
156
|
+
variant={variant}
|
|
157
|
+
Icon={DeleteIcon}
|
|
158
|
+
isLoading
|
|
159
|
+
size="large"
|
|
160
|
+
title="Loading delete example"
|
|
161
|
+
/>
|
|
162
|
+
</td>
|
|
163
|
+
<td>
|
|
164
|
+
<IconButton
|
|
165
|
+
{...props}
|
|
166
|
+
variant={variant}
|
|
167
|
+
Icon={DeleteIcon}
|
|
168
|
+
isLoading
|
|
169
|
+
size="medium"
|
|
170
|
+
title="Loading delete example"
|
|
171
|
+
/>
|
|
172
|
+
</td>
|
|
173
|
+
<td>
|
|
174
|
+
<IconButton
|
|
175
|
+
{...props}
|
|
176
|
+
variant={variant}
|
|
177
|
+
Icon={DeleteIcon}
|
|
178
|
+
isLoading
|
|
179
|
+
size="small"
|
|
180
|
+
title="Loading delete example"
|
|
181
|
+
/>
|
|
182
|
+
</td>
|
|
183
|
+
<td>
|
|
184
|
+
<IconButton
|
|
185
|
+
{...props}
|
|
186
|
+
variant={variant}
|
|
187
|
+
Icon={DeleteIcon}
|
|
188
|
+
isLoading
|
|
189
|
+
size="extraSmall"
|
|
190
|
+
title="Loading delete example"
|
|
191
|
+
/>
|
|
192
|
+
</td>
|
|
193
|
+
</tr>
|
|
194
|
+
))}
|
|
195
|
+
</tbody>
|
|
196
|
+
</Table>
|
|
197
|
+
</>
|
|
198
|
+
);
|
|
204
199
|
};
|
|
205
200
|
|
|
206
201
|
const StyledPlayground = styled.div`
|
|
@@ -210,20 +205,13 @@ const StyledPlayground = styled.div`
|
|
|
210
205
|
`;
|
|
211
206
|
|
|
212
207
|
export const Playground = (props: IconButtonProps<'button'>) => {
|
|
213
|
-
return (
|
|
214
|
-
<
|
|
215
|
-
{...props}
|
|
216
|
-
Icon={
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
Icon={DeleteIcon}
|
|
221
|
-
/>
|
|
222
|
-
<IconButton
|
|
223
|
-
{...props}
|
|
224
|
-
Icon={BellIcon}
|
|
225
|
-
/>
|
|
226
|
-
</StyledPlayground>);
|
|
208
|
+
return (
|
|
209
|
+
<StyledPlayground>
|
|
210
|
+
<IconButton {...props} Icon={PeopleIcon} />
|
|
211
|
+
<IconButton {...props} Icon={DeleteIcon} />
|
|
212
|
+
<IconButton {...props} Icon={BellIcon} />
|
|
213
|
+
</StyledPlayground>
|
|
214
|
+
);
|
|
227
215
|
};
|
|
228
216
|
|
|
229
217
|
Playground.args = {
|
|
@@ -7,7 +7,13 @@ import type { ValueOf } from '@apify-packages/types';
|
|
|
7
7
|
|
|
8
8
|
import { theme } from '../design_system/theme.js';
|
|
9
9
|
import type { RegularBoxProps } from './box.js';
|
|
10
|
-
import {
|
|
10
|
+
import {
|
|
11
|
+
Button,
|
|
12
|
+
BUTTON_SIZE_VARIANTS_CSS,
|
|
13
|
+
type ButtonSize,
|
|
14
|
+
type RegularButtonProps,
|
|
15
|
+
type TransientButtonProps,
|
|
16
|
+
} from './button.js';
|
|
11
17
|
import { Tooltip } from './floating/tooltip.js';
|
|
12
18
|
import { Link, type RegularLinkProps } from './link.js';
|
|
13
19
|
import { InlineSpinner, spinnerClassNames } from './spinner.js';
|
|
@@ -142,12 +148,13 @@ const getIconButtonColorStyles = (variant: ICON_BUTTON_VARIANTS) => {
|
|
|
142
148
|
|
|
143
149
|
&:hover {
|
|
144
150
|
${backgroundHoverGradient
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
+
? css`
|
|
152
|
+
background-image: ${backgroundHoverGradient};
|
|
153
|
+
background-color: ${backgroundColor};
|
|
154
|
+
`
|
|
155
|
+
: css`
|
|
156
|
+
background-color: ${backgroundHoverColor};
|
|
157
|
+
`}
|
|
151
158
|
border-color: ${borderHoverColor || borderColor};
|
|
152
159
|
color: ${iconColor};
|
|
153
160
|
}
|
|
@@ -172,12 +179,12 @@ const getIconButtonColorStyles = (variant: ICON_BUTTON_VARIANTS) => {
|
|
|
172
179
|
`;
|
|
173
180
|
};
|
|
174
181
|
|
|
175
|
-
const StyledButton = styled(Button)
|
|
182
|
+
const StyledButton = styled(Button)<{ $variant: ICON_BUTTON_VARIANTS; $size: ButtonSize }>`
|
|
176
183
|
${({ $variant }) => getIconButtonColorStyles($variant)}
|
|
177
184
|
|
|
178
185
|
/* Override default button styles */
|
|
179
186
|
box-sizing: border-box;
|
|
180
|
-
width: ${({ $size }) =>
|
|
187
|
+
width: ${({ $size }) => BUTTON_SIZE_VARIANTS_CSS[$size].size}px;
|
|
181
188
|
padding: 0;
|
|
182
189
|
|
|
183
190
|
.${spinnerClassNames.SPINNER} .path {
|
|
@@ -197,59 +204,66 @@ type IconButtonNodePropsMap = {
|
|
|
197
204
|
};
|
|
198
205
|
};
|
|
199
206
|
|
|
200
|
-
export type IconButtonProps<T extends IconButtonNodeType> = RegularBoxProps &
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
207
|
+
export type IconButtonProps<T extends IconButtonNodeType> = RegularBoxProps &
|
|
208
|
+
Pick<TransientButtonProps, 'size'> & {
|
|
209
|
+
as?: T;
|
|
210
|
+
variant?: ICON_BUTTON_VARIANTS;
|
|
211
|
+
Icon: IconComponent;
|
|
212
|
+
disabled?: boolean;
|
|
213
|
+
isLoading?: boolean;
|
|
214
|
+
title?: string;
|
|
215
|
+
tooltipProps?: unknown;
|
|
216
|
+
} & Omit<IconButtonNodePropsMap[T]['props'], 'size' | 'variant'>;
|
|
209
217
|
|
|
210
218
|
/**
|
|
211
219
|
* Simplified button component that displays an icon.
|
|
212
220
|
* Has a tooltip and a loading state.
|
|
213
221
|
*/
|
|
214
|
-
export const IconButton = forwardRef(
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
}
|
|
222
|
+
export const IconButton = forwardRef(
|
|
223
|
+
<T extends IconButtonNodeType>(
|
|
224
|
+
{
|
|
225
|
+
variant = ICON_BUTTON_VARIANTS.DEFAULT,
|
|
226
|
+
size = 'medium',
|
|
227
|
+
as = 'button' as T,
|
|
228
|
+
title,
|
|
229
|
+
disabled = false,
|
|
230
|
+
isLoading = false,
|
|
231
|
+
Icon,
|
|
232
|
+
tooltipProps,
|
|
233
|
+
...passThroughProps
|
|
234
|
+
}: IconButtonProps<T>,
|
|
235
|
+
ref: React.Ref<IconButtonNodePropsMap[T]['element']>,
|
|
236
|
+
) => {
|
|
237
|
+
const otherProps = { ...passThroughProps, size };
|
|
238
|
+
|
|
239
|
+
const component: React.ElementType = as === 'a' ? Link : as;
|
|
240
|
+
const { iconSize, spinnerSize } = iconButtonSizeConfig[size];
|
|
241
|
+
|
|
242
|
+
const button = (
|
|
243
|
+
<StyledButton
|
|
244
|
+
forwardedAs={component}
|
|
245
|
+
ref={ref}
|
|
246
|
+
disabled={disabled || isLoading}
|
|
247
|
+
type="button"
|
|
248
|
+
aria-label={title}
|
|
249
|
+
LeftIcon={isLoading ? () => <InlineSpinner size={spinnerSize} /> : () => <Icon size={iconSize} />}
|
|
250
|
+
// We apply our own styles to the button, so we need to override the default variant
|
|
251
|
+
variant="tertiary"
|
|
252
|
+
$size={size}
|
|
253
|
+
$variant={variant}
|
|
254
|
+
{...otherProps}
|
|
255
|
+
/>
|
|
256
|
+
);
|
|
257
|
+
|
|
258
|
+
return title ? (
|
|
259
|
+
// @ts-expect-error tooltip is not migrated to TS yet
|
|
260
|
+
<Tooltip content={title} {...tooltipProps}>
|
|
261
|
+
{button}
|
|
262
|
+
</Tooltip>
|
|
263
|
+
) : (
|
|
264
|
+
button
|
|
265
|
+
);
|
|
266
|
+
},
|
|
267
|
+
);
|
|
254
268
|
|
|
255
269
|
IconButton.displayName = 'IconButton';
|
package/src/components/image.tsx
CHANGED
|
@@ -5,20 +5,14 @@ import { useSharedUiDependencies } from '../ui_dependency_provider.js';
|
|
|
5
5
|
import { Box, type BoxProps } from './box.js';
|
|
6
6
|
|
|
7
7
|
type ImageProps = {
|
|
8
|
-
src: string
|
|
9
|
-
alt?: string
|
|
10
|
-
width?: number
|
|
11
|
-
height?: number
|
|
8
|
+
src: string;
|
|
9
|
+
alt?: string;
|
|
10
|
+
width?: number;
|
|
11
|
+
height?: number;
|
|
12
12
|
loading?: 'eager' | 'lazy' | undefined;
|
|
13
13
|
} & ImageProxyOptions;
|
|
14
14
|
|
|
15
15
|
export const Image = forwardRef<HTMLImageElement, ImageProps & Omit<BoxProps, 'as'>>((props, ref) => {
|
|
16
16
|
const { InternalImage } = useSharedUiDependencies();
|
|
17
|
-
return
|
|
18
|
-
<Box
|
|
19
|
-
ref={ref}
|
|
20
|
-
{...props}
|
|
21
|
-
as={InternalImage}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
17
|
+
return <Box ref={ref} {...props} as={InternalImage} />;
|
|
24
18
|
});
|
|
@@ -4,7 +4,8 @@ import type { ElementType } from 'react';
|
|
|
4
4
|
import { Link, type LinkProps } from './link.js';
|
|
5
5
|
|
|
6
6
|
// eslint-disable-next-line @stylistic/max-len
|
|
7
|
-
const longText =
|
|
7
|
+
const longText =
|
|
8
|
+
'This is a very long link text that might wrap to multiple lines depending on the container width. It is used to test how the Link component handles overflow and wrapping in different scenarios.';
|
|
8
9
|
|
|
9
10
|
// Mock the UI dependencies provider for Storybook
|
|
10
11
|
const MockUIProvider = ({ children }: { children: React.ReactNode }) => {
|
|
@@ -34,7 +35,8 @@ export default {
|
|
|
34
35
|
argTypes: {
|
|
35
36
|
to: {
|
|
36
37
|
control: 'text',
|
|
37
|
-
description:
|
|
38
|
+
description:
|
|
39
|
+
'The destination URL or path object. Can be internal (/path) or external (https://example.com)',
|
|
38
40
|
},
|
|
39
41
|
hideExternalIcon: {
|
|
40
42
|
control: 'boolean',
|