@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
|
@@ -19,8 +19,8 @@ export const cardClassNames = {
|
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
interface TransientCardProps {
|
|
22
|
-
disabled?: boolean
|
|
23
|
-
shadowless?: boolean
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
shadowless?: boolean;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
interface RegularCardProps {
|
|
@@ -80,63 +80,72 @@ export const StyledCardWrapper = styled(Box)<StyledCardProps>`
|
|
|
80
80
|
border-bottom-left-radius: ${theme.radius.radius8};
|
|
81
81
|
}
|
|
82
82
|
|
|
83
|
-
${({ $shadowless }) =>
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
${({ $shadowless }) =>
|
|
84
|
+
$shadowless &&
|
|
85
|
+
css`
|
|
86
|
+
box-shadow: none;
|
|
87
|
+
`}
|
|
86
88
|
|
|
87
|
-
${({ $disabled }) =>
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
89
|
+
${({ $disabled }) =>
|
|
90
|
+
$disabled &&
|
|
91
|
+
css`
|
|
92
|
+
.${cardClassNames.CONTENT} {
|
|
93
|
+
&::after {
|
|
94
|
+
content: '';
|
|
95
|
+
position: absolute;
|
|
96
|
+
top: 0;
|
|
97
|
+
bottom: 0;
|
|
98
|
+
left: 0;
|
|
99
|
+
right: 0; /* stretch full */
|
|
100
|
+
background: ${theme.color.neutral.backgroundSubtle} !important;
|
|
101
|
+
opacity: 0.4;
|
|
102
|
+
pointer-events: all;
|
|
103
|
+
}
|
|
96
104
|
}
|
|
97
|
-
}
|
|
98
|
-
`)}
|
|
105
|
+
`}
|
|
99
106
|
`;
|
|
100
107
|
|
|
101
|
-
export const Card = forwardRef<HTMLElement, CardProps>(
|
|
102
|
-
as,
|
|
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
|
-
|
|
108
|
+
export const Card = forwardRef<HTMLElement, CardProps>(
|
|
109
|
+
({ as, className, caption, description, actions, children, disabled, shadowless, ...rest }, ref) => {
|
|
110
|
+
return (
|
|
111
|
+
<StyledCardWrapper
|
|
112
|
+
$disabled={disabled}
|
|
113
|
+
$shadowless={shadowless}
|
|
114
|
+
forwardedAs={as || 'section'}
|
|
115
|
+
className={clsx(cardClassNames.WRAPPER, className)}
|
|
116
|
+
data-test="card"
|
|
117
|
+
{...rest}
|
|
118
|
+
ref={ref}
|
|
119
|
+
>
|
|
120
|
+
{(!!caption || !!actions) && (
|
|
121
|
+
<header className={cardClassNames.HEADER} data-test="card-header">
|
|
122
|
+
{caption && (
|
|
123
|
+
<Text
|
|
124
|
+
as="div"
|
|
125
|
+
size="big"
|
|
126
|
+
weight="bold"
|
|
127
|
+
className={cardClassNames.CAPTION}
|
|
128
|
+
data-test="card-caption"
|
|
129
|
+
>
|
|
130
|
+
{caption}
|
|
131
|
+
</Text>
|
|
132
|
+
)}
|
|
133
|
+
{actions && (
|
|
134
|
+
<div className={cardClassNames.ACTIONS} data-test="card-actions">
|
|
135
|
+
{actions}
|
|
136
|
+
</div>
|
|
137
|
+
)}
|
|
138
|
+
</header>
|
|
139
|
+
)}
|
|
140
|
+
{description && (
|
|
141
|
+
<div className={cardClassNames.DESCRIPTION} data-test="card-description">
|
|
142
|
+
{description}
|
|
143
|
+
</div>
|
|
144
|
+
)}
|
|
145
|
+
<div className={cardClassNames.CONTENT} data-test="card-content">
|
|
146
|
+
{children}
|
|
147
|
+
</div>
|
|
148
|
+
</StyledCardWrapper>
|
|
149
|
+
);
|
|
150
|
+
},
|
|
151
|
+
);
|
|
@@ -34,17 +34,21 @@ const markdownClassNames = {
|
|
|
34
34
|
|
|
35
35
|
const StyledMarkdownWrapper = styled(Box)<StyledReadmeProps>`
|
|
36
36
|
@font-face {
|
|
37
|
-
font-family:
|
|
38
|
-
src: local(
|
|
37
|
+
font-family: 'ellipsis-font';
|
|
38
|
+
src: local('Courier');
|
|
39
39
|
unicode-range: U+2026;
|
|
40
40
|
size-adjust: 0%;
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
& > :first-child {
|
|
44
44
|
margin-top: 0;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
|
-
h1,
|
|
47
|
+
h1,
|
|
48
|
+
h2,
|
|
49
|
+
h3,
|
|
50
|
+
h4,
|
|
51
|
+
h5 {
|
|
48
52
|
scroll-margin-top: ${({ $scrollMarginTopPx }) => `${$scrollMarginTopPx}px`};
|
|
49
53
|
margin-top: ${theme.space.space32};
|
|
50
54
|
margin-bottom: ${theme.space.space16};
|
|
@@ -115,7 +119,11 @@ const StyledMarkdownWrapper = styled(Box)<StyledReadmeProps>`
|
|
|
115
119
|
}
|
|
116
120
|
}
|
|
117
121
|
|
|
118
|
-
p,
|
|
122
|
+
p,
|
|
123
|
+
li,
|
|
124
|
+
strong,
|
|
125
|
+
b,
|
|
126
|
+
table {
|
|
119
127
|
${theme.typography.content.mobile.paragraph}
|
|
120
128
|
@media (min-width: ${theme.layout.tablet}) {
|
|
121
129
|
${theme.typography.content.tablet.paragraph}
|
|
@@ -200,7 +208,8 @@ const StyledMarkdownWrapper = styled(Box)<StyledReadmeProps>`
|
|
|
200
208
|
max-width: 100%;
|
|
201
209
|
}
|
|
202
210
|
|
|
203
|
-
ul,
|
|
211
|
+
ul,
|
|
212
|
+
ol {
|
|
204
213
|
padding-left: ${theme.space.space32};
|
|
205
214
|
}
|
|
206
215
|
|
|
@@ -238,14 +247,16 @@ const StyledMarkdownWrapper = styled(Box)<StyledReadmeProps>`
|
|
|
238
247
|
overflow: auto;
|
|
239
248
|
border-collapse: collapse;
|
|
240
249
|
|
|
241
|
-
td,
|
|
250
|
+
td,
|
|
251
|
+
th {
|
|
242
252
|
border: 1px solid ${theme.color.neutral.border};
|
|
243
253
|
padding: ${theme.space.space16};
|
|
244
254
|
text-align: left;
|
|
245
255
|
}
|
|
246
256
|
|
|
247
257
|
tr:nth-child(even):not([class]) {
|
|
248
|
-
> th,
|
|
258
|
+
> th,
|
|
259
|
+
> td {
|
|
249
260
|
background-color: inherit;
|
|
250
261
|
}
|
|
251
262
|
}
|
|
@@ -304,7 +315,8 @@ const StyledMarkdownWrapper = styled(Box)<StyledReadmeProps>`
|
|
|
304
315
|
${theme.typography.content.desktop.snippet}
|
|
305
316
|
}
|
|
306
317
|
|
|
307
|
-
b,
|
|
318
|
+
b,
|
|
319
|
+
strong {
|
|
308
320
|
font-size: inherit !important;
|
|
309
321
|
line-height: inherit !important;
|
|
310
322
|
font-family: inherit !important;
|
|
@@ -329,15 +341,11 @@ const DefaultHeadingRenderer = ({ node, children }: HeadingRendererProps) => {
|
|
|
329
341
|
};
|
|
330
342
|
|
|
331
343
|
type CodeRendererComponentProps = {
|
|
332
|
-
className?: string
|
|
333
|
-
children: React.ReactNode
|
|
344
|
+
className?: string;
|
|
345
|
+
children: React.ReactNode;
|
|
334
346
|
} & MarkdownComponentExtraProps;
|
|
335
347
|
|
|
336
|
-
function CodeRenderer({
|
|
337
|
-
className,
|
|
338
|
-
children,
|
|
339
|
-
node,
|
|
340
|
-
}: CodeRendererComponentProps) {
|
|
348
|
+
function CodeRenderer({ className, children, node }: CodeRendererComponentProps) {
|
|
341
349
|
const isInline = node?.position?.start?.line === node?.position?.end?.line;
|
|
342
350
|
|
|
343
351
|
if (isInline) {
|
|
@@ -351,28 +359,19 @@ function CodeRenderer({
|
|
|
351
359
|
|
|
352
360
|
if (isOneLineCode) {
|
|
353
361
|
return (
|
|
354
|
-
<OneLineCode
|
|
355
|
-
language={language}
|
|
356
|
-
fullWidth
|
|
357
|
-
>
|
|
362
|
+
<OneLineCode language={language} fullWidth>
|
|
358
363
|
{code}
|
|
359
364
|
</OneLineCode>
|
|
360
365
|
);
|
|
361
366
|
}
|
|
362
367
|
|
|
363
368
|
return (
|
|
364
|
-
<CodeBlock
|
|
365
|
-
content={code}
|
|
366
|
-
language={language}
|
|
367
|
-
hideLineNumbers
|
|
368
|
-
fullWidth
|
|
369
|
-
hideBashHeader
|
|
370
|
-
hideBashPromptPrefixes
|
|
371
|
-
/>
|
|
369
|
+
<CodeBlock content={code} language={language} hideLineNumbers fullWidth hideBashHeader hideBashPromptPrefixes />
|
|
372
370
|
);
|
|
373
371
|
}
|
|
374
372
|
|
|
375
|
-
const youtubeRegex =
|
|
373
|
+
const youtubeRegex =
|
|
374
|
+
/^(?:https?:\/\/)?(?:www\.)?(?:m\.)?(?:youtube(?:-nocookie)?\.com|youtu\.be)\/(?:watch\?v=|embed\/|v\/)?([a-zA-Z0-9\-_]+)(?:\S*)?$/;
|
|
376
375
|
const vimeoRegex = /^((?:https?:\/\/)?(?:player\.)?vimeo\.com(?:\/video)?\/(\d+))$/;
|
|
377
376
|
|
|
378
377
|
const getVideoSrc = (link: string) => {
|
|
@@ -382,7 +381,10 @@ const getVideoSrc = (link: string) => {
|
|
|
382
381
|
if (youtubeLink) {
|
|
383
382
|
// add rel=0 to disable related videos from other channels at the end of the video
|
|
384
383
|
// add enablejsapi=1 to enable tracking videos via API through Google Analytics
|
|
385
|
-
src = qs.stringifyUrl({
|
|
384
|
+
src = qs.stringifyUrl({
|
|
385
|
+
url: `https://www.youtube.com/embed/${youtubeLink[1]}`,
|
|
386
|
+
query: { rel: 0, enablejsapi: 1 },
|
|
387
|
+
});
|
|
386
388
|
}
|
|
387
389
|
if (vimeoLink) src = `https://player.vimeo.com/video/${vimeoLink[2]}`;
|
|
388
390
|
|
|
@@ -424,13 +426,17 @@ interface LinkRendererProps extends React.AnchorHTMLAttributes<HTMLAnchorElement
|
|
|
424
426
|
}
|
|
425
427
|
|
|
426
428
|
interface LinkRendererOptions {
|
|
427
|
-
hostname?: string
|
|
429
|
+
hostname?: string;
|
|
428
430
|
}
|
|
429
431
|
|
|
430
432
|
// We want no-follow for external links
|
|
431
433
|
// Also if link is a video from youtube or vimeo, we want to render it as iframe
|
|
432
434
|
// Allowing to pass hostname to check if the link is an Apify link to the same hostname (is needed for SSR on the web)
|
|
433
|
-
const DefaultLinkRenderer = (
|
|
435
|
+
const DefaultLinkRenderer = (
|
|
436
|
+
{ node, href = '', ...props }: LinkRendererProps,
|
|
437
|
+
{ hostname }: LinkRendererOptions,
|
|
438
|
+
isUserGeneratedContent?: boolean,
|
|
439
|
+
) => {
|
|
434
440
|
const videoSrc = node.properties.enableEmbeddedVideo && !!href ? getVideoSrc(href) : undefined;
|
|
435
441
|
if (videoSrc) return <Video src={videoSrc} />;
|
|
436
442
|
|
|
@@ -439,7 +445,8 @@ const DefaultLinkRenderer = ({ node, href = '', ...props }: LinkRendererProps, {
|
|
|
439
445
|
if (isHashLink) return <a href={href} {...props} />;
|
|
440
446
|
|
|
441
447
|
let urlParsed: URL | undefined;
|
|
442
|
-
try {
|
|
448
|
+
try {
|
|
449
|
+
// TODO: replace with URL.canParse() when we have node 19+ 🥲
|
|
443
450
|
urlParsed = new URL(href);
|
|
444
451
|
} catch {
|
|
445
452
|
// Probably invalid url, go on as it doesn't make sense to track this error
|
|
@@ -448,13 +455,12 @@ const DefaultLinkRenderer = ({ node, href = '', ...props }: LinkRendererProps, {
|
|
|
448
455
|
return <span>{href}</span>;
|
|
449
456
|
}
|
|
450
457
|
|
|
451
|
-
if (!hostname &&
|
|
458
|
+
if (!hostname && typeof window !== 'undefined' && !window?.location?.hostname) return <a href={href} {...props} />;
|
|
452
459
|
|
|
453
460
|
const currentHostname = hostname || (typeof window !== 'undefined' && window?.location?.hostname.toLowerCase());
|
|
454
|
-
const hasDifferentHostname = urlParsed &&
|
|
455
|
-
const isApifyLink =
|
|
456
|
-
&& APIFY_HOSTNAMES.includes(urlParsed.hostname.toLowerCase())
|
|
457
|
-
&& urlParsed.protocol === 'https:'; // we want to disqualify links that have http: protocol. It's a mistake on users' side that we are penalized for.
|
|
461
|
+
const hasDifferentHostname = urlParsed && urlParsed.hostname.toLowerCase() !== currentHostname;
|
|
462
|
+
const isApifyLink =
|
|
463
|
+
urlParsed && APIFY_HOSTNAMES.includes(urlParsed.hostname.toLowerCase()) && urlParsed.protocol === 'https:'; // we want to disqualify links that have http: protocol. It's a mistake on users' side that we are penalized for.
|
|
458
464
|
|
|
459
465
|
let linkProps: Pick<LinkProps, 'rel' | 'target'> = {};
|
|
460
466
|
|
|
@@ -473,7 +479,7 @@ const DefaultLinkRenderer = ({ node, href = '', ...props }: LinkRendererProps, {
|
|
|
473
479
|
}
|
|
474
480
|
}
|
|
475
481
|
|
|
476
|
-
return <SharedLink {...props as LinkProps} {...linkProps} to={href}/>;
|
|
482
|
+
return <SharedLink {...(props as LinkProps)} {...linkProps} to={href} />;
|
|
477
483
|
};
|
|
478
484
|
|
|
479
485
|
// node is just to omit from exported props
|
|
@@ -541,11 +547,15 @@ export interface MarkdownProps {
|
|
|
541
547
|
theme?: UiThemeOption;
|
|
542
548
|
scrollMarginTopPx?: number; // Offset from top of page to account for sticky header
|
|
543
549
|
// Function where we can define which elements are allowed in the markdown. See // Function where we can define which elements are allowed in the markdown. See https://github.com/remarkjs/react-markdown#props for more info
|
|
544
|
-
allowElement?: AllowElement
|
|
550
|
+
allowElement?: AllowElement;
|
|
545
551
|
isUserGeneratedContent?: boolean;
|
|
546
552
|
currentPathHostname?: string;
|
|
547
553
|
addHeadingAnchors?: boolean;
|
|
548
|
-
LinkRenderer?: (
|
|
554
|
+
LinkRenderer?: (
|
|
555
|
+
props: LinkRendererProps,
|
|
556
|
+
options: LinkRendererOptions,
|
|
557
|
+
isUserGeneratedContent?: boolean,
|
|
558
|
+
) => React.ReactElement;
|
|
549
559
|
lazyLoadImages?: boolean;
|
|
550
560
|
}
|
|
551
561
|
|
|
@@ -603,33 +613,37 @@ const Markdown = ({
|
|
|
603
613
|
'ul',
|
|
604
614
|
]}
|
|
605
615
|
allowElement={allowElement}
|
|
606
|
-
components={
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
616
|
+
components={
|
|
617
|
+
{
|
|
618
|
+
h1: headingRenderer,
|
|
619
|
+
h2: headingRenderer,
|
|
620
|
+
h3: headingRenderer,
|
|
621
|
+
h4: headingRenderer,
|
|
622
|
+
h5: headingRenderer,
|
|
623
|
+
a: (linkProps: LinkRendererProps) =>
|
|
624
|
+
LinkRenderer
|
|
625
|
+
? LinkRenderer(linkProps, { hostname: currentPathHostname }, isUserGeneratedContent)
|
|
626
|
+
: DefaultLinkRenderer(
|
|
627
|
+
linkProps,
|
|
628
|
+
{ hostname: currentPathHostname },
|
|
629
|
+
isUserGeneratedContent,
|
|
630
|
+
),
|
|
631
|
+
code: (codeProps: CodeRendererComponentProps) => CodeRenderer(codeProps),
|
|
632
|
+
p: ParagraphRenderer,
|
|
633
|
+
img: ({ node, ...imageProps }: React.ImgHTMLAttributes<HTMLImageElement> & { node?: Node }) => (
|
|
634
|
+
<img {...imageProps} {...(lazyLoadImages ? { loading: 'lazy' } : {})} /> // node is injected by rehype-raw plugin and causing invalid prop
|
|
635
|
+
),
|
|
636
|
+
} as unknown as Components
|
|
637
|
+
}
|
|
626
638
|
urlTransform={(href, _children, node) => {
|
|
627
639
|
if (node.tagName === 'img') {
|
|
628
640
|
return transformImageUri ? transformImageUri(href) : href;
|
|
629
641
|
}
|
|
630
642
|
|
|
631
643
|
if (node.tagName === 'a') {
|
|
632
|
-
return transformLinkUri
|
|
644
|
+
return transformLinkUri
|
|
645
|
+
? defaultUrlTransform(transformLinkUri(href))
|
|
646
|
+
: defaultUrlTransform(href);
|
|
633
647
|
}
|
|
634
648
|
|
|
635
649
|
return href;
|
|
@@ -42,11 +42,7 @@ export type PaginationButtonsProps = {
|
|
|
42
42
|
};
|
|
43
43
|
|
|
44
44
|
// TODO: Consolidate and move to /library
|
|
45
|
-
export const PaginationButtons: FC<PaginationButtonsProps> = ({
|
|
46
|
-
page,
|
|
47
|
-
totalPages,
|
|
48
|
-
onPageChange,
|
|
49
|
-
}) => {
|
|
45
|
+
export const PaginationButtons: FC<PaginationButtonsProps> = ({ page, totalPages, onPageChange }) => {
|
|
50
46
|
// Pages to display buttons for (counting from 0, -1 and -2 will mean a special '...' disabled button)
|
|
51
47
|
const pagesToDisplay = useMemo(() => {
|
|
52
48
|
const result = [];
|
|
@@ -79,10 +75,10 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
|
|
|
79
75
|
return (
|
|
80
76
|
<StyledPageSelectionButtons>
|
|
81
77
|
<PaginationButtonBase
|
|
82
|
-
data-test=
|
|
78
|
+
data-test="page-prev-button"
|
|
83
79
|
disabled={page <= 0}
|
|
84
80
|
onClick={() => onPageChange(page - 1)}
|
|
85
|
-
trackingId=
|
|
81
|
+
trackingId="PaginationPrevPage"
|
|
86
82
|
aria-label="Previous page"
|
|
87
83
|
>
|
|
88
84
|
<ChevronLeftIcon size="16" />
|
|
@@ -91,7 +87,7 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
|
|
|
91
87
|
if (pageToDisplay === LEADING_THREE_DOTS_PAGE_KEY || pageToDisplay === TRAILING_THREE_DOTS_PAGE_KEY) {
|
|
92
88
|
return (
|
|
93
89
|
<PaginationButtonBase
|
|
94
|
-
trackingId=
|
|
90
|
+
trackingId="ThreeDots"
|
|
95
91
|
key={pageToDisplay}
|
|
96
92
|
onClick={() => undefined}
|
|
97
93
|
disabled
|
|
@@ -104,9 +100,9 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
|
|
|
104
100
|
return (
|
|
105
101
|
<PaginationButtonBase
|
|
106
102
|
key={pageToDisplay}
|
|
107
|
-
data-test=
|
|
108
|
-
trackingId=
|
|
109
|
-
className=
|
|
103
|
+
data-test="current-page-button"
|
|
104
|
+
trackingId="PaginationCurrentPage"
|
|
105
|
+
className="currentPage"
|
|
110
106
|
onClick={() => undefined}
|
|
111
107
|
>
|
|
112
108
|
{pageToDisplay + 1}
|
|
@@ -116,19 +112,19 @@ export const PaginationButtons: FC<PaginationButtonsProps> = ({
|
|
|
116
112
|
return (
|
|
117
113
|
<PaginationButtonBase
|
|
118
114
|
key={pageToDisplay}
|
|
119
|
-
data-test=
|
|
115
|
+
data-test="page-number-button"
|
|
120
116
|
onClick={() => onPageChange(pageToDisplay)}
|
|
121
|
-
trackingId=
|
|
117
|
+
trackingId="PaginationNumberedPage"
|
|
122
118
|
>
|
|
123
119
|
{pageToDisplay + 1}
|
|
124
120
|
</PaginationButtonBase>
|
|
125
121
|
);
|
|
126
122
|
})}
|
|
127
123
|
<PaginationButtonBase
|
|
128
|
-
data-test=
|
|
124
|
+
data-test="page-next-button"
|
|
129
125
|
disabled={page >= totalPages - 1}
|
|
130
126
|
onClick={() => onPageChange(page + 1)}
|
|
131
|
-
trackingId=
|
|
127
|
+
trackingId="PaginationNextPage"
|
|
132
128
|
aria-label="Next page"
|
|
133
129
|
>
|
|
134
130
|
<ChevronRightIcon size="16" />
|
|
@@ -22,10 +22,9 @@ interface ChipProps {
|
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
export const TabNumberChip: React.FC<ChipProps> = ({ children, ...rest }) => {
|
|
25
|
-
return
|
|
26
|
-
size=
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
</StyledChip>;
|
|
25
|
+
return (
|
|
26
|
+
<StyledChip size="small" {...rest}>
|
|
27
|
+
{children}
|
|
28
|
+
</StyledChip>
|
|
29
|
+
);
|
|
31
30
|
};
|
|
@@ -7,9 +7,7 @@ const DO_NOT_EXPORT_COMMENT = `/**
|
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
9
|
function toCamelCase(str) {
|
|
10
|
-
return str
|
|
11
|
-
.toLowerCase()
|
|
12
|
-
.replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
|
|
10
|
+
return str.toLowerCase().replace(/[^a-zA-Z0-9]+(.)/g, (_, chr) => chr.toUpperCase());
|
|
13
11
|
}
|
|
14
12
|
|
|
15
13
|
/**
|
|
@@ -23,11 +21,10 @@ function objectToTSLiteral(obj, indentLevel = 0) {
|
|
|
23
21
|
const entries = Object.entries(obj);
|
|
24
22
|
if (entries.length === 0) return '{}';
|
|
25
23
|
return `{\n${entries
|
|
26
|
-
.map(
|
|
27
|
-
([key, value]) => `${indent(indentLevel + 1)}${key}: ${objectToTSLiteral(value, indentLevel + 1)}`,
|
|
28
|
-
)
|
|
24
|
+
.map(([key, value]) => `${indent(indentLevel + 1)}${key}: ${objectToTSLiteral(value, indentLevel + 1)}`)
|
|
29
25
|
.join('\n')}\n${indent(indentLevel)}}${indentLevel > 0 ? ',' : ''}`;
|
|
30
|
-
}
|
|
26
|
+
}
|
|
27
|
+
if (typeof obj === 'string') {
|
|
31
28
|
return `'${obj}',`;
|
|
32
29
|
}
|
|
33
30
|
return String(obj);
|
|
@@ -44,9 +41,7 @@ async function buildTheme(theme) {
|
|
|
44
41
|
name: 'name/prefix-color-name',
|
|
45
42
|
type: 'name',
|
|
46
43
|
transform: (prop) => {
|
|
47
|
-
return prop.name
|
|
48
|
-
.replace(/^semantic/, 'color')
|
|
49
|
-
.replace(/^decorative/, 'color');
|
|
44
|
+
return prop.name.replace(/^semantic/, 'color').replace(/^decorative/, 'color');
|
|
50
45
|
},
|
|
51
46
|
});
|
|
52
47
|
|
|
@@ -117,7 +112,7 @@ async function buildTheme(theme) {
|
|
|
117
112
|
filter: (token) => ['Decorative', 'Palette', 'Brand'].includes(token.path[0]),
|
|
118
113
|
});
|
|
119
114
|
|
|
120
|
-
const styleDictionary = await
|
|
115
|
+
const styleDictionary = await new StyleDictionary().extend({
|
|
121
116
|
source: [`src/design_system/colors/figma_color_tokens.${theme}.json`],
|
|
122
117
|
platforms: {
|
|
123
118
|
ts: {
|
|
@@ -178,7 +173,4 @@ async function buildTheme(theme) {
|
|
|
178
173
|
await styleDictionary.buildPlatform('style');
|
|
179
174
|
}
|
|
180
175
|
|
|
181
|
-
await Promise.all([
|
|
182
|
-
buildTheme('light'),
|
|
183
|
-
buildTheme('dark'),
|
|
184
|
-
]);
|
|
176
|
+
await Promise.all([buildTheme('light'), buildTheme('dark')]);
|
|
@@ -1,12 +1,5 @@
|
|
|
1
1
|
import { colorProperties, darkTheme, lightTheme } from './colors/index.js';
|
|
2
|
-
import {
|
|
3
|
-
devices,
|
|
4
|
-
layouts,
|
|
5
|
-
radiuses,
|
|
6
|
-
shadows,
|
|
7
|
-
spaces,
|
|
8
|
-
transitions,
|
|
9
|
-
} from './tokens/index.js';
|
|
2
|
+
import { devices, layouts, radiuses, shadows, spaces, transitions } from './tokens/index.js';
|
|
10
3
|
import { typographyTokens } from './typography_theme.js';
|
|
11
4
|
|
|
12
5
|
export const theme = {
|
|
@@ -4,7 +4,15 @@ import { theme } from '../theme.js';
|
|
|
4
4
|
import { radiuses } from './radiuses.js';
|
|
5
5
|
|
|
6
6
|
const RadiusesShowcase = () => (
|
|
7
|
-
<div
|
|
7
|
+
<div
|
|
8
|
+
style={{
|
|
9
|
+
display: 'grid',
|
|
10
|
+
gridTemplateColumns: 'repeat(7, 1fr)',
|
|
11
|
+
gap: '16px',
|
|
12
|
+
padding: '20px',
|
|
13
|
+
backgroundColor: theme.color.neutral.background,
|
|
14
|
+
}}
|
|
15
|
+
>
|
|
8
16
|
{Object.entries(radiuses).map(([key, value]) => (
|
|
9
17
|
<div key={key} style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', gap: '6px' }}>
|
|
10
18
|
<div
|
|
@@ -33,7 +33,9 @@ const ShadowsShowcase = () => (
|
|
|
33
33
|
/>
|
|
34
34
|
<div style={{ textAlign: 'center' }}>
|
|
35
35
|
<div style={{ fontSize: '12px', color: theme.color.neutral.text, fontWeight: '500' }}>{key}</div>
|
|
36
|
-
<div style={{ fontSize: '10px', color: theme.color.neutral.textMuted, fontFamily: 'monospace' }}>
|
|
36
|
+
<div style={{ fontSize: '10px', color: theme.color.neutral.textMuted, fontFamily: 'monospace' }}>
|
|
37
|
+
{value}
|
|
38
|
+
</div>
|
|
37
39
|
</div>
|
|
38
40
|
</div>
|
|
39
41
|
))}
|