@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
|
@@ -16,12 +16,7 @@ import { Image } from '../image.js';
|
|
|
16
16
|
import { isUrlExternal } from '../link.js';
|
|
17
17
|
import { cleanMarkdown } from '../readme_renderer/utils.js';
|
|
18
18
|
import { Heading, HeadingContent, Text, TextContent } from '../text/index.js';
|
|
19
|
-
import {
|
|
20
|
-
MarkdownBlockQuote,
|
|
21
|
-
MarkdownCode,
|
|
22
|
-
MarkdownLink,
|
|
23
|
-
MarkdownTable,
|
|
24
|
-
} from './simple_markdown_components.js';
|
|
19
|
+
import { MarkdownBlockQuote, MarkdownCode, MarkdownLink, MarkdownTable } from './simple_markdown_components.js';
|
|
25
20
|
|
|
26
21
|
export type SimpleMarkdownComponents = Components;
|
|
27
22
|
|
|
@@ -66,8 +61,8 @@ const StyledMarkdownWrapper = styled(Box)`
|
|
|
66
61
|
word-break: break-word;
|
|
67
62
|
|
|
68
63
|
@font-face {
|
|
69
|
-
font-family:
|
|
70
|
-
src: local(
|
|
64
|
+
font-family: 'ellipsis-font';
|
|
65
|
+
src: local('Courier');
|
|
71
66
|
unicode-range: U+2026;
|
|
72
67
|
size-adjust: 0%;
|
|
73
68
|
}
|
|
@@ -97,9 +92,7 @@ const unwrapUnsupportedElement = (node: Element): (Element | TextNode)[] => {
|
|
|
97
92
|
});
|
|
98
93
|
};
|
|
99
94
|
|
|
100
|
-
const getUnsupportedRehypeTagsSanitationPlugIn = (
|
|
101
|
-
allowedElements: string[],
|
|
102
|
-
) => () => (tree: Root) => {
|
|
95
|
+
const getUnsupportedRehypeTagsSanitationPlugIn = (allowedElements: string[]) => () => (tree: Root) => {
|
|
103
96
|
visit(tree, 'element', (node, index, parent) => {
|
|
104
97
|
if (!allowedElements.includes(node.tagName) && parent && typeof index === 'number') {
|
|
105
98
|
// Replace unsupported element with its valid children
|
|
@@ -135,44 +128,148 @@ export const defaultRemarkPlugins = [remarkGfm];
|
|
|
135
128
|
|
|
136
129
|
// TODO: Add Image component
|
|
137
130
|
const regularMarkdownSizeComponents: Components = {
|
|
138
|
-
h1: ({ children }) =>
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
131
|
+
h1: ({ children }) => (
|
|
132
|
+
<HeadingContent mb="space16" type="heading1">
|
|
133
|
+
{children}
|
|
134
|
+
</HeadingContent>
|
|
135
|
+
),
|
|
136
|
+
h2: ({ children }) => (
|
|
137
|
+
<HeadingContent mb="space16" type="heading2">
|
|
138
|
+
{children}
|
|
139
|
+
</HeadingContent>
|
|
140
|
+
),
|
|
141
|
+
h3: ({ children }) => (
|
|
142
|
+
<HeadingContent mb="space16" type="heading3">
|
|
143
|
+
{children}
|
|
144
|
+
</HeadingContent>
|
|
145
|
+
),
|
|
146
|
+
h4: ({ children }) => (
|
|
147
|
+
<HeadingContent mb="space16" type="heading4">
|
|
148
|
+
{children}
|
|
149
|
+
</HeadingContent>
|
|
150
|
+
),
|
|
151
|
+
h5: ({ children }) => (
|
|
152
|
+
<HeadingContent mb="space16" type="heading5">
|
|
153
|
+
{children}
|
|
154
|
+
</HeadingContent>
|
|
155
|
+
),
|
|
156
|
+
h6: ({ children }) => (
|
|
157
|
+
<HeadingContent mb="space16" type="heading6">
|
|
158
|
+
{children}
|
|
159
|
+
</HeadingContent>
|
|
160
|
+
),
|
|
161
|
+
p: ({ children }) => <TextContent my="space16">{children}</TextContent>,
|
|
162
|
+
strong: ({ children }) => (
|
|
163
|
+
<TextContent as="strong" weight="bold">
|
|
164
|
+
{children}
|
|
165
|
+
</TextContent>
|
|
166
|
+
),
|
|
167
|
+
b: ({ children }) => (
|
|
168
|
+
<TextContent as="b" weight="bold">
|
|
169
|
+
{children}
|
|
170
|
+
</TextContent>
|
|
171
|
+
),
|
|
172
|
+
th: ({ children }) => (
|
|
173
|
+
<TextContent as="th" weight="bold">
|
|
174
|
+
{children}
|
|
175
|
+
</TextContent>
|
|
176
|
+
),
|
|
148
177
|
blockquote: ({ children }) => <MarkdownBlockQuote>{children}</MarkdownBlockQuote>,
|
|
149
178
|
table: ({ children }) => <MarkdownTable>{children}</MarkdownTable>,
|
|
150
|
-
ul: ({ children }) =>
|
|
151
|
-
|
|
152
|
-
|
|
179
|
+
ul: ({ children }) => (
|
|
180
|
+
<Box as="ul" pl="space32">
|
|
181
|
+
{children}
|
|
182
|
+
</Box>
|
|
183
|
+
),
|
|
184
|
+
ol: ({ children, start }) => (
|
|
185
|
+
<TextContent as="ol" pl="space32" start={start}>
|
|
186
|
+
{children}
|
|
187
|
+
</TextContent>
|
|
188
|
+
),
|
|
189
|
+
li: ({ children }) => (
|
|
190
|
+
<TextContent as="li" mt="space4">
|
|
191
|
+
{children}
|
|
192
|
+
</TextContent>
|
|
193
|
+
),
|
|
153
194
|
a: ({ children, href }) => <MarkdownLink to={href}>{children}</MarkdownLink>,
|
|
154
|
-
code: ({ children, node }) =>
|
|
195
|
+
code: ({ children, node }) => (
|
|
196
|
+
<MarkdownCode node={node} size="regular">
|
|
197
|
+
{children}
|
|
198
|
+
</MarkdownCode>
|
|
199
|
+
),
|
|
155
200
|
img: ({ src, alt, height, width }) => <MarkdownImage src={src} alt={alt} height={height} width={width} />,
|
|
156
201
|
};
|
|
157
202
|
|
|
158
203
|
const smallMarkdownSizeComponents: Components = {
|
|
159
|
-
h1: ({ children }) =>
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
204
|
+
h1: ({ children }) => (
|
|
205
|
+
<Heading mb="space16" type="title2xl">
|
|
206
|
+
{children}
|
|
207
|
+
</Heading>
|
|
208
|
+
),
|
|
209
|
+
h2: ({ children }) => (
|
|
210
|
+
<Heading mb="space16" type="titleXl">
|
|
211
|
+
{children}
|
|
212
|
+
</Heading>
|
|
213
|
+
),
|
|
214
|
+
h3: ({ children }) => (
|
|
215
|
+
<Heading mb="space16" type="titleL">
|
|
216
|
+
{children}
|
|
217
|
+
</Heading>
|
|
218
|
+
),
|
|
219
|
+
h4: ({ children }) => (
|
|
220
|
+
<Heading mb="space16" type="titleM">
|
|
221
|
+
{children}
|
|
222
|
+
</Heading>
|
|
223
|
+
),
|
|
224
|
+
h5: ({ children }) => (
|
|
225
|
+
<Heading mb="space16" type="titleS">
|
|
226
|
+
{children}
|
|
227
|
+
</Heading>
|
|
228
|
+
),
|
|
229
|
+
h6: ({ children }) => (
|
|
230
|
+
<Heading mb="space16" type="titleXs">
|
|
231
|
+
{children}
|
|
232
|
+
</Heading>
|
|
233
|
+
),
|
|
234
|
+
p: ({ children }) => <Text my="space16">{children}</Text>,
|
|
235
|
+
strong: ({ children }) => (
|
|
236
|
+
<Text as="strong" weight="bold">
|
|
237
|
+
{children}
|
|
238
|
+
</Text>
|
|
239
|
+
),
|
|
240
|
+
b: ({ children }) => (
|
|
241
|
+
<Text as="b" weight="bold">
|
|
242
|
+
{children}
|
|
243
|
+
</Text>
|
|
244
|
+
),
|
|
245
|
+
th: ({ children }) => (
|
|
246
|
+
<Text as="th" weight="bold">
|
|
247
|
+
{children}
|
|
248
|
+
</Text>
|
|
249
|
+
),
|
|
169
250
|
blockquote: ({ children }) => <MarkdownBlockQuote>{children}</MarkdownBlockQuote>,
|
|
170
251
|
table: ({ children }) => <MarkdownTable>{children}</MarkdownTable>,
|
|
171
|
-
ul: ({ children }) =>
|
|
172
|
-
|
|
173
|
-
|
|
252
|
+
ul: ({ children }) => (
|
|
253
|
+
<Box as="ul" pl="space32">
|
|
254
|
+
{children}
|
|
255
|
+
</Box>
|
|
256
|
+
),
|
|
257
|
+
ol: ({ children, start }) => (
|
|
258
|
+
<Text as="ol" pl="space32" start={start}>
|
|
259
|
+
{children}
|
|
260
|
+
</Text>
|
|
261
|
+
),
|
|
262
|
+
li: ({ children }) => (
|
|
263
|
+
<Text as="li" mt="space4">
|
|
264
|
+
{children}
|
|
265
|
+
</Text>
|
|
266
|
+
),
|
|
174
267
|
a: ({ children, href }) => <MarkdownLink to={href}>{children}</MarkdownLink>,
|
|
175
|
-
code: ({ children, node }) =>
|
|
268
|
+
code: ({ children, node }) => (
|
|
269
|
+
<MarkdownCode node={node} size="small">
|
|
270
|
+
{children}
|
|
271
|
+
</MarkdownCode>
|
|
272
|
+
),
|
|
176
273
|
img: ({ src, alt, height, width }) => <MarkdownImage src={src} alt={alt} height={height} width={width} />,
|
|
177
274
|
};
|
|
178
275
|
|
|
@@ -182,27 +279,30 @@ export type SimpleMarkdownProps = Omit<ReactMarkdownOptions, 'urlTransform' | 'c
|
|
|
182
279
|
/**
|
|
183
280
|
* @deprecated use urlTransform instead
|
|
184
281
|
*/
|
|
185
|
-
transformLinkUri?: UrlTransform
|
|
282
|
+
transformLinkUri?: UrlTransform;
|
|
186
283
|
/**
|
|
187
284
|
* @deprecated use urlTransform instead
|
|
188
285
|
*/
|
|
189
|
-
transformImageUri?: UrlTransform
|
|
190
|
-
size?: MarkdownSize
|
|
191
|
-
children: string
|
|
192
|
-
className?: string
|
|
286
|
+
transformImageUri?: UrlTransform;
|
|
287
|
+
size?: MarkdownSize;
|
|
288
|
+
children: string;
|
|
289
|
+
className?: string;
|
|
193
290
|
};
|
|
194
291
|
|
|
195
292
|
export const useDefaultUrlTransform = () => {
|
|
196
293
|
const { windowLocationHost } = useSharedUiDependencies();
|
|
197
294
|
|
|
198
|
-
return useCallback(
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
295
|
+
return useCallback(
|
|
296
|
+
(url: string) => {
|
|
297
|
+
if (!isUrlExternal(url, windowLocationHost)) {
|
|
298
|
+
// We want to make sure internal links will be relative links without https://host at the beginning because Link doesn't work with these
|
|
299
|
+
return url.replace(/^(https?:\/\/)?(www\.)?[^/]+/, '') || '/';
|
|
300
|
+
}
|
|
203
301
|
|
|
204
|
-
|
|
205
|
-
|
|
302
|
+
return url;
|
|
303
|
+
},
|
|
304
|
+
[windowLocationHost],
|
|
305
|
+
);
|
|
206
306
|
};
|
|
207
307
|
|
|
208
308
|
export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
|
|
@@ -234,10 +334,7 @@ export const SimpleMarkdown: React.FC<SimpleMarkdownProps> = ({
|
|
|
234
334
|
getUnsupportedRehypeTagsSanitationPlugIn(effectiveAllowedElements.current as string[]),
|
|
235
335
|
];
|
|
236
336
|
|
|
237
|
-
return [
|
|
238
|
-
...plugins,
|
|
239
|
-
rehypeSanitize,
|
|
240
|
-
];
|
|
337
|
+
return [...plugins, rehypeSanitize];
|
|
241
338
|
}, [rehypePlugins]);
|
|
242
339
|
|
|
243
340
|
return (
|
|
@@ -23,19 +23,11 @@ const simpleMarkdownClassNames = {
|
|
|
23
23
|
HEADING_ICON_LINK: 'headingIconLink',
|
|
24
24
|
} as const;
|
|
25
25
|
|
|
26
|
-
export const MarkdownPlainHeading: React.FC<HeadingSharedProps> = ({
|
|
27
|
-
children,
|
|
28
|
-
...rest
|
|
29
|
-
}) => {
|
|
26
|
+
export const MarkdownPlainHeading: React.FC<HeadingSharedProps> = ({ children, ...rest }) => {
|
|
30
27
|
const id = slugifyHeadingChildren(children);
|
|
31
28
|
|
|
32
29
|
return (
|
|
33
|
-
<Heading
|
|
34
|
-
mt='space32'
|
|
35
|
-
mb='space16'
|
|
36
|
-
id={id}
|
|
37
|
-
{...rest}
|
|
38
|
-
>
|
|
30
|
+
<Heading mt="space32" mb="space16" id={id} {...rest}>
|
|
39
31
|
{children}
|
|
40
32
|
</Heading>
|
|
41
33
|
);
|
|
@@ -67,10 +59,7 @@ const StyledMarkdownHeading = styled(Box)`
|
|
|
67
59
|
* Use `MarkdownPlainHeading` if you want to render simple heading instead
|
|
68
60
|
*/
|
|
69
61
|
// TODO: This should be used for readmes
|
|
70
|
-
export const MarkdownHeadingWrapper: React.FC<HeadingSharedProps> = ({
|
|
71
|
-
children,
|
|
72
|
-
...rest
|
|
73
|
-
}) => {
|
|
62
|
+
export const MarkdownHeadingWrapper: React.FC<HeadingSharedProps> = ({ children, ...rest }) => {
|
|
74
63
|
const id = slugifyHeadingChildren(children);
|
|
75
64
|
|
|
76
65
|
const { isCopied, copyToClipboard } = useCopyToClipboard();
|
|
@@ -82,28 +71,13 @@ export const MarkdownHeadingWrapper: React.FC<HeadingSharedProps> = ({
|
|
|
82
71
|
}
|
|
83
72
|
|
|
84
73
|
return (
|
|
85
|
-
<StyledMarkdownHeading
|
|
86
|
-
mt='space32'
|
|
87
|
-
mb='space16'
|
|
88
|
-
id={id}
|
|
89
|
-
{...rest}
|
|
90
|
-
>
|
|
74
|
+
<StyledMarkdownHeading mt="space32" mb="space16" id={id} {...rest}>
|
|
91
75
|
{children}
|
|
92
|
-
<Link
|
|
93
|
-
className={simpleMarkdownClassNames.HEADING_ICON_LINK}
|
|
94
|
-
onClick={handleClick}
|
|
95
|
-
to={`#${id}`}
|
|
96
|
-
>
|
|
76
|
+
<Link className={simpleMarkdownClassNames.HEADING_ICON_LINK} onClick={handleClick} to={`#${id}`}>
|
|
97
77
|
{isCopied ? (
|
|
98
|
-
<CheckIcon
|
|
99
|
-
size="16"
|
|
100
|
-
color={theme.color.success.action}
|
|
101
|
-
/>
|
|
78
|
+
<CheckIcon size="16" color={theme.color.success.action} />
|
|
102
79
|
) : (
|
|
103
|
-
<LinkIcon
|
|
104
|
-
size="16"
|
|
105
|
-
color={theme.color.primary.text}
|
|
106
|
-
/>
|
|
80
|
+
<LinkIcon size="16" color={theme.color.primary.text} />
|
|
107
81
|
)}
|
|
108
82
|
</Link>
|
|
109
83
|
</StyledMarkdownHeading>
|
|
@@ -113,32 +87,36 @@ export const MarkdownHeadingWrapper: React.FC<HeadingSharedProps> = ({
|
|
|
113
87
|
const StyledInlineCode = styled(InlineCode)`
|
|
114
88
|
/* If code is rendered within heading, it should inherit its font styles */
|
|
115
89
|
/* TODO: Look at implementation of InlineCode - maybe we can live without it */
|
|
116
|
-
h1 & code,
|
|
90
|
+
h1 & code,
|
|
91
|
+
h2 & code,
|
|
92
|
+
h3 & code,
|
|
93
|
+
h4 & code,
|
|
94
|
+
h5 & code {
|
|
117
95
|
font-size: inherit !important;
|
|
118
96
|
line-height: inherit !important;
|
|
119
97
|
}
|
|
120
98
|
|
|
121
|
-
b & code,
|
|
99
|
+
b & code,
|
|
100
|
+
strong & code {
|
|
122
101
|
font-weight: inherit !important;
|
|
123
102
|
}
|
|
124
103
|
`;
|
|
125
104
|
|
|
126
105
|
type MarkdownCodeProps = {
|
|
127
|
-
size: SharedTextSize
|
|
128
|
-
className?: string
|
|
129
|
-
children: React.ReactNode
|
|
106
|
+
size: SharedTextSize;
|
|
107
|
+
className?: string;
|
|
108
|
+
children: React.ReactNode;
|
|
130
109
|
} & MarkdownComponentExtraProps;
|
|
131
110
|
|
|
132
|
-
export const MarkdownCode: React.FC<MarkdownCodeProps> = ({
|
|
133
|
-
className,
|
|
134
|
-
children,
|
|
135
|
-
size,
|
|
136
|
-
node,
|
|
137
|
-
}) => {
|
|
111
|
+
export const MarkdownCode: React.FC<MarkdownCodeProps> = ({ className, children, size, node }) => {
|
|
138
112
|
const isInline = node?.position?.start?.line === node?.position?.end?.line;
|
|
139
113
|
|
|
140
114
|
if (isInline) {
|
|
141
|
-
return
|
|
115
|
+
return (
|
|
116
|
+
<StyledInlineCode size={size} className={className}>
|
|
117
|
+
{children}
|
|
118
|
+
</StyledInlineCode>
|
|
119
|
+
);
|
|
142
120
|
}
|
|
143
121
|
|
|
144
122
|
const code = String(children).replace(/\n$/, '').trim();
|
|
@@ -148,11 +126,7 @@ export const MarkdownCode: React.FC<MarkdownCodeProps> = ({
|
|
|
148
126
|
|
|
149
127
|
if (isOneLineCode) {
|
|
150
128
|
return (
|
|
151
|
-
<OneLineCode
|
|
152
|
-
language={language}
|
|
153
|
-
size={size}
|
|
154
|
-
fullWidth
|
|
155
|
-
>
|
|
129
|
+
<OneLineCode language={language} size={size} fullWidth>
|
|
156
130
|
{code}
|
|
157
131
|
</OneLineCode>
|
|
158
132
|
);
|
|
@@ -171,7 +145,8 @@ export const MarkdownCode: React.FC<MarkdownCodeProps> = ({
|
|
|
171
145
|
);
|
|
172
146
|
};
|
|
173
147
|
|
|
174
|
-
const youtubeRegex =
|
|
148
|
+
const youtubeRegex =
|
|
149
|
+
/^(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube(?:-nocookie)?\.com|youtu\.be)\/(?:watch\?v=|embed\/|v\/)?([a-zA-Z0-9\-_]+)(?:\S*)?$/;
|
|
175
150
|
const vimeoRegex = /^((?:https?:\/\/)?(?:player\.)?vimeo\.com(?:\/video)?\/(\d+))$/;
|
|
176
151
|
|
|
177
152
|
const getVideoSrc = (link: string) => {
|
|
@@ -181,7 +156,10 @@ const getVideoSrc = (link: string) => {
|
|
|
181
156
|
if (youtubeLink) {
|
|
182
157
|
// add rel=0 to disable related videos from other channels at the end of the video
|
|
183
158
|
// add enablejsapi=1 to enable tracking videos via API through Google Analytics
|
|
184
|
-
src = qs.stringifyUrl({
|
|
159
|
+
src = qs.stringifyUrl({
|
|
160
|
+
url: `https://www.youtube.com/embed/${youtubeLink[1]}`,
|
|
161
|
+
query: { rel: 0, enablejsapi: 1 },
|
|
162
|
+
});
|
|
185
163
|
}
|
|
186
164
|
if (vimeoLink) src = `https://player.vimeo.com/video/${vimeoLink[2]}`;
|
|
187
165
|
|
|
@@ -227,7 +205,11 @@ const MarkdownVideo = ({ src }: MarkdownVideoProps) => {
|
|
|
227
205
|
const StyledMarkdownLink = styled(Link)`
|
|
228
206
|
overflow-wrap: break-word;
|
|
229
207
|
|
|
230
|
-
h1 &,
|
|
208
|
+
h1 &,
|
|
209
|
+
h2 &,
|
|
210
|
+
h3 &,
|
|
211
|
+
h4 &,
|
|
212
|
+
h5 & {
|
|
231
213
|
overflow-wrap: normal;
|
|
232
214
|
}
|
|
233
215
|
|
|
@@ -244,10 +226,12 @@ export const MarkdownLink: React.FC<WithOptional<LinkProps, 'to'>> = ({
|
|
|
244
226
|
className,
|
|
245
227
|
hideExternalIcon = true,
|
|
246
228
|
}) => {
|
|
247
|
-
return
|
|
248
|
-
<StyledMarkdownLink to={to} hideExternalIcon={hideExternalIcon} rel={rel} className={className}>
|
|
229
|
+
return to && typeof to === 'string' ? (
|
|
230
|
+
<StyledMarkdownLink to={to} hideExternalIcon={hideExternalIcon} rel={rel} className={className}>
|
|
231
|
+
{children}
|
|
232
|
+
</StyledMarkdownLink>
|
|
249
233
|
) : (
|
|
250
|
-
|
|
234
|
+
<span>{children}</span> // Invalid links can be rendered as a regular span instead
|
|
251
235
|
);
|
|
252
236
|
};
|
|
253
237
|
|
|
@@ -271,14 +255,16 @@ export const MarkdownTable = styled.table`
|
|
|
271
255
|
overflow: auto;
|
|
272
256
|
border-collapse: collapse;
|
|
273
257
|
|
|
274
|
-
td,
|
|
258
|
+
td,
|
|
259
|
+
th {
|
|
275
260
|
border: 1px solid ${theme.color.neutral.border};
|
|
276
261
|
padding: ${theme.space.space16};
|
|
277
262
|
text-align: left;
|
|
278
263
|
}
|
|
279
264
|
|
|
280
265
|
tr:nth-child(even):not([class]) {
|
|
281
|
-
> th,
|
|
266
|
+
> th,
|
|
267
|
+
> td {
|
|
282
268
|
background-color: inherit;
|
|
283
269
|
}
|
|
284
270
|
}
|
|
@@ -317,5 +303,9 @@ export function MarkdownParagraphContent({
|
|
|
317
303
|
if (videoSrc) return <MarkdownVideo src={videoSrc} />;
|
|
318
304
|
|
|
319
305
|
// Render the children as a paragraph
|
|
320
|
-
return
|
|
306
|
+
return (
|
|
307
|
+
<TextContent my="space16" {...textProps}>
|
|
308
|
+
{children}
|
|
309
|
+
</TextContent>
|
|
310
|
+
);
|
|
321
311
|
}
|
|
@@ -15,13 +15,15 @@ export const Standalone = Template.bind({});
|
|
|
15
15
|
|
|
16
16
|
export const WithinContainer = (args: SpinnerProps) => {
|
|
17
17
|
return (
|
|
18
|
-
<div
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
18
|
+
<div
|
|
19
|
+
style={{
|
|
20
|
+
minWidth: '100px',
|
|
21
|
+
minHeight: '200px',
|
|
22
|
+
border: 'solid 1px lightgray',
|
|
23
|
+
borderRadius: '1rem',
|
|
24
|
+
position: 'relative',
|
|
25
|
+
}}
|
|
26
|
+
>
|
|
25
27
|
<Spinner {...args} />
|
|
26
28
|
</div>
|
|
27
29
|
);
|
|
@@ -31,7 +33,11 @@ export const Inline = () => {
|
|
|
31
33
|
const elements: React.ElementType[] = ['h1', 'h2', 'h3', 'p'];
|
|
32
34
|
return (
|
|
33
35
|
<div style={{ width: '100%' }}>
|
|
34
|
-
{elements.map((Element) =>
|
|
36
|
+
{elements.map((Element) => (
|
|
37
|
+
<Element key={Element}>
|
|
38
|
+
{Element}: There was a <InlineSpinner /> in New Orleans.
|
|
39
|
+
</Element>
|
|
40
|
+
))}
|
|
35
41
|
</div>
|
|
36
42
|
);
|
|
37
43
|
};
|
|
@@ -33,8 +33,8 @@ export type SpinnerProps = {
|
|
|
33
33
|
as?: React.ElementType;
|
|
34
34
|
className?: string;
|
|
35
35
|
style?: React.CSSProperties;
|
|
36
|
-
small?: boolean
|
|
37
|
-
loadingReason?: string
|
|
36
|
+
small?: boolean;
|
|
37
|
+
loadingReason?: string;
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
type SpinnerWrapperProps = WithTransientProps<Pick<SpinnerProps, 'small'>>;
|
|
@@ -58,7 +58,9 @@ const SpinnerWrapper = styled.span<SpinnerWrapperProps>`
|
|
|
58
58
|
& .path {
|
|
59
59
|
transform-origin: center;
|
|
60
60
|
stroke: ${theme.color.primary.text};
|
|
61
|
-
animation:
|
|
61
|
+
animation:
|
|
62
|
+
${dash} 1.5s ease-in-out infinite,
|
|
63
|
+
${rotate} 2s linear infinite;
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
`;
|
|
@@ -78,20 +78,11 @@ export const Variants: Story = {
|
|
|
78
78
|
<div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: '16px', alignItems: 'center' }}>
|
|
79
79
|
<div>
|
|
80
80
|
<h4>Basic</h4>
|
|
81
|
-
<StoreActorHeader
|
|
82
|
-
name="web-scraper"
|
|
83
|
-
title="Web Scraper"
|
|
84
|
-
username="apify"
|
|
85
|
-
/>
|
|
81
|
+
<StoreActorHeader name="web-scraper" title="Web Scraper" username="apify" />
|
|
86
82
|
</div>
|
|
87
83
|
<div>
|
|
88
84
|
<h4>Basic</h4>
|
|
89
|
-
<StoreActorHeader
|
|
90
|
-
compact
|
|
91
|
-
name="web-scraper"
|
|
92
|
-
title="Web Scraper"
|
|
93
|
-
username="apify"
|
|
94
|
-
/>
|
|
85
|
+
<StoreActorHeader compact name="web-scraper" title="Web Scraper" username="apify" />
|
|
95
86
|
</div>
|
|
96
87
|
<div>
|
|
97
88
|
<h4>With Picture</h4>
|
|
@@ -71,13 +71,13 @@ const ActorTitleWrapper = styled(Box)`
|
|
|
71
71
|
`;
|
|
72
72
|
|
|
73
73
|
export type StoreActorHeaderProps = {
|
|
74
|
-
name: string
|
|
75
|
-
title: string
|
|
76
|
-
pictureUrl?: string | null
|
|
77
|
-
username: string
|
|
78
|
-
isUnderMaintenance?: boolean
|
|
79
|
-
hasRisingStarBadge?: boolean
|
|
80
|
-
avatarSize?: number
|
|
74
|
+
name: string;
|
|
75
|
+
title: string;
|
|
76
|
+
pictureUrl?: string | null;
|
|
77
|
+
username: string;
|
|
78
|
+
isUnderMaintenance?: boolean;
|
|
79
|
+
hasRisingStarBadge?: boolean;
|
|
80
|
+
avatarSize?: number;
|
|
81
81
|
compact?: boolean;
|
|
82
82
|
};
|
|
83
83
|
|
|
@@ -101,21 +101,25 @@ export const StoreActorHeader: React.FC<StoreActorHeaderProps & BoxProps> = ({
|
|
|
101
101
|
name={title}
|
|
102
102
|
borderRadius={compact ? theme.radius.radius4 : theme.radius.radius8}
|
|
103
103
|
/>
|
|
104
|
-
{!compact && hasRisingStarBadge &&
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
{!compact && hasRisingStarBadge && (
|
|
105
|
+
<StyledCompactBadge
|
|
106
|
+
variant="primary_blue"
|
|
107
|
+
size="small"
|
|
108
|
+
LeadingIcon={StarEmptyIcon}
|
|
109
|
+
className={storeActorHeaderClassNames.badge}
|
|
110
|
+
/>
|
|
111
|
+
)}
|
|
110
112
|
</ActorAvatarWrapper>
|
|
111
113
|
<ActorTitleWrapper>
|
|
112
114
|
<div className={storeActorHeaderClassNames.title}>
|
|
113
|
-
<Text as=
|
|
114
|
-
|
|
115
|
+
<Text as="h3" weight={compact ? 'medium' : 'bold'} color={theme.color.neutral.text}>
|
|
116
|
+
{title}
|
|
117
|
+
</Text>
|
|
118
|
+
{isUnderMaintenance && <WarningTriangleIcon size="12" color={theme.color.warning.icon} />}
|
|
115
119
|
</div>
|
|
116
120
|
<Text
|
|
117
121
|
size="small"
|
|
118
|
-
weight=
|
|
122
|
+
weight="medium"
|
|
119
123
|
type="code"
|
|
120
124
|
color={theme.color.neutral.textSubtle}
|
|
121
125
|
className={storeActorHeaderClassNames.slug}
|
|
@@ -13,7 +13,7 @@ const Grid = styled.div`
|
|
|
13
13
|
grid-template-columns: repeat(2, auto);
|
|
14
14
|
gap: 1rem 5rem;
|
|
15
15
|
|
|
16
|
-
input{
|
|
16
|
+
input {
|
|
17
17
|
width: 100%;
|
|
18
18
|
}
|
|
19
19
|
`;
|
|
@@ -22,17 +22,9 @@ export const SwitchPrimitive = () => {
|
|
|
22
22
|
const [value, setValue] = useState(1);
|
|
23
23
|
return (
|
|
24
24
|
<Grid>
|
|
25
|
-
<Switch value={value} setValue={setValue}/> <p>checked vs unchecked</p>
|
|
26
|
-
<Switch name="Disabled"
|
|
27
|
-
|
|
28
|
-
value={false}
|
|
29
|
-
setValue={() => {}}
|
|
30
|
-
/> <p>disabled</p>
|
|
31
|
-
<Switch name="Error"
|
|
32
|
-
error='Test error'
|
|
33
|
-
value={value}
|
|
34
|
-
setValue={setValue}
|
|
35
|
-
/> <p>error</p>
|
|
25
|
+
<Switch value={value} setValue={setValue} /> <p>checked vs unchecked</p>
|
|
26
|
+
<Switch name="Disabled" disabled value={false} setValue={() => {}} /> <p>disabled</p>
|
|
27
|
+
<Switch name="Error" error="Test error" value={value} setValue={setValue} /> <p>error</p>
|
|
36
28
|
</Grid>
|
|
37
29
|
);
|
|
38
30
|
};
|
|
@@ -8,7 +8,9 @@ export const switchStyle = css`
|
|
|
8
8
|
background-color: ${theme.color.neutral.actionSecondary};
|
|
9
9
|
border-radius: 100px;
|
|
10
10
|
position: relative;
|
|
11
|
-
transition:
|
|
11
|
+
transition:
|
|
12
|
+
border-color 120ms ease-out,
|
|
13
|
+
background-color 120ms ease-out !important;
|
|
12
14
|
vertical-align: middle;
|
|
13
15
|
|
|
14
16
|
&:focus-visible {
|
|
@@ -28,11 +30,11 @@ export const switchStyle = css`
|
|
|
28
30
|
background-color: ${theme.color.danger.action};
|
|
29
31
|
|
|
30
32
|
&:hover {
|
|
31
|
-
|
|
33
|
+
background-color: ${theme.color.danger.actionHover};
|
|
32
34
|
}
|
|
33
35
|
}
|
|
34
36
|
|
|
35
|
-
&[data-state=
|
|
37
|
+
&[data-state='checked'] {
|
|
36
38
|
background-color: ${theme.color.success.action};
|
|
37
39
|
|
|
38
40
|
&:hover {
|