@apify/ui-library 0.51.6-featurepublishuilibrary-0a4729.38266
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/.eslintrc +39 -0
- package/.stylelintrc +12 -0
- package/CHANGELOG.md +2804 -0
- package/README.md +15 -0
- package/dist/src/components/action_link.d.ts +5 -0
- package/dist/src/components/action_link.d.ts.map +1 -0
- package/dist/src/components/action_link.jsx +35 -0
- package/dist/src/components/action_link.jsx.map +1 -0
- package/dist/src/components/actor_template_card.d.ts +10 -0
- package/dist/src/components/actor_template_card.d.ts.map +1 -0
- package/dist/src/components/actor_template_card.jsx +73 -0
- package/dist/src/components/actor_template_card.jsx.map +1 -0
- package/dist/src/components/badge.d.ts +26 -0
- package/dist/src/components/badge.d.ts.map +1 -0
- package/dist/src/components/badge.jsx +96 -0
- package/dist/src/components/badge.jsx.map +1 -0
- package/dist/src/components/banner.d.ts +11 -0
- package/dist/src/components/banner.d.ts.map +1 -0
- package/dist/src/components/banner.jsx +73 -0
- package/dist/src/components/banner.jsx.map +1 -0
- package/dist/src/components/blog_article.d.ts +9 -0
- package/dist/src/components/blog_article.d.ts.map +1 -0
- package/dist/src/components/blog_article.jsx +73 -0
- package/dist/src/components/blog_article.jsx.map +1 -0
- package/dist/src/components/box.d.ts +41 -0
- package/dist/src/components/box.d.ts.map +1 -0
- package/dist/src/components/box.jsx +48 -0
- package/dist/src/components/box.jsx.map +1 -0
- package/dist/src/components/button.d.ts +35 -0
- package/dist/src/components/button.d.ts.map +1 -0
- package/dist/src/components/button.jsx +193 -0
- package/dist/src/components/button.jsx.map +1 -0
- package/dist/src/components/chip.d.ts +52 -0
- package/dist/src/components/chip.d.ts.map +1 -0
- package/dist/src/components/chip.jsx +89 -0
- package/dist/src/components/chip.jsx.map +1 -0
- package/dist/src/components/code/action_button.d.ts +11 -0
- package/dist/src/components/code/action_button.d.ts.map +1 -0
- package/dist/src/components/code/action_button.jsx +67 -0
- package/dist/src/components/code/action_button.jsx.map +1 -0
- package/dist/src/components/code/code_block/code_block.d.ts +38 -0
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -0
- package/dist/src/components/code/code_block/code_block.jsx +99 -0
- package/dist/src/components/code/code_block/code_block.jsx.map +1 -0
- package/dist/src/components/code/code_block/code_block.styled.d.ts +13 -0
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -0
- package/dist/src/components/code/code_block/code_block.styled.jsx +215 -0
- package/dist/src/components/code/code_block/code_block.styled.jsx.map +1 -0
- package/dist/src/components/code/code_block/utils.d.ts +2 -0
- package/dist/src/components/code/code_block/utils.d.ts.map +1 -0
- package/dist/src/components/code/code_block/utils.js +20 -0
- package/dist/src/components/code/code_block/utils.js.map +1 -0
- package/dist/src/components/code/index.d.ts +4 -0
- package/dist/src/components/code/index.d.ts.map +1 -0
- package/dist/src/components/code/index.js +4 -0
- package/dist/src/components/code/index.js.map +1 -0
- package/dist/src/components/code/inline_code/inline_code.d.ts +11 -0
- package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -0
- package/dist/src/components/code/inline_code/inline_code.jsx +24 -0
- package/dist/src/components/code/inline_code/inline_code.jsx.map +1 -0
- package/dist/src/components/code/one_line_code/one_line_code.d.ts +27 -0
- package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -0
- package/dist/src/components/code/one_line_code/one_line_code.jsx +157 -0
- package/dist/src/components/code/one_line_code/one_line_code.jsx.map +1 -0
- package/dist/src/components/code/syntax_highlighter.d.ts +16 -0
- package/dist/src/components/code/syntax_highlighter.d.ts.map +1 -0
- package/dist/src/components/code/syntax_highlighter.jsx +94 -0
- package/dist/src/components/code/syntax_highlighter.jsx.map +1 -0
- package/dist/src/components/color_wheel_gradient.d.ts +9 -0
- package/dist/src/components/color_wheel_gradient.d.ts.map +1 -0
- package/dist/src/components/color_wheel_gradient.jsx +23 -0
- package/dist/src/components/color_wheel_gradient.jsx.map +1 -0
- package/dist/src/components/floating/index.d.ts +4 -0
- package/dist/src/components/floating/index.d.ts.map +1 -0
- package/dist/src/components/floating/index.js +4 -0
- package/dist/src/components/floating/index.js.map +1 -0
- package/dist/src/components/floating/menu.d.ts +33 -0
- package/dist/src/components/floating/menu.d.ts.map +1 -0
- package/dist/src/components/floating/menu.jsx +95 -0
- package/dist/src/components/floating/menu.jsx.map +1 -0
- package/dist/src/components/floating/menu_common.d.ts +42 -0
- package/dist/src/components/floating/menu_common.d.ts.map +1 -0
- package/dist/src/components/floating/menu_common.jsx +20 -0
- package/dist/src/components/floating/menu_common.jsx.map +1 -0
- package/dist/src/components/floating/menu_components.d.ts +29 -0
- package/dist/src/components/floating/menu_components.d.ts.map +1 -0
- package/dist/src/components/floating/menu_components.jsx +73 -0
- package/dist/src/components/floating/menu_components.jsx.map +1 -0
- package/dist/src/components/image.d.ts +12 -0
- package/dist/src/components/image.d.ts.map +1 -0
- package/dist/src/components/image.jsx +8 -0
- package/dist/src/components/image.jsx.map +1 -0
- package/dist/src/components/index.d.ts +21 -0
- package/dist/src/components/index.d.ts.map +1 -0
- package/dist/src/components/index.js +21 -0
- package/dist/src/components/index.js.map +1 -0
- package/dist/src/components/link.d.ts +24 -0
- package/dist/src/components/link.d.ts.map +1 -0
- package/dist/src/components/link.jsx +67 -0
- package/dist/src/components/link.jsx.map +1 -0
- package/dist/src/components/message.d.ts +31 -0
- package/dist/src/components/message.d.ts.map +1 -0
- package/dist/src/components/message.jsx +105 -0
- package/dist/src/components/message.jsx.map +1 -0
- package/dist/src/components/readme_renderer/index.d.ts +4 -0
- package/dist/src/components/readme_renderer/index.d.ts.map +1 -0
- package/dist/src/components/readme_renderer/index.js +4 -0
- package/dist/src/components/readme_renderer/index.js.map +1 -0
- package/dist/src/components/readme_renderer/pythonize_value.d.ts +3 -0
- package/dist/src/components/readme_renderer/pythonize_value.d.ts.map +1 -0
- package/dist/src/components/readme_renderer/pythonize_value.js +81 -0
- package/dist/src/components/readme_renderer/pythonize_value.js.map +1 -0
- package/dist/src/components/readme_renderer/table_of_contents.d.ts +10 -0
- package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -0
- package/dist/src/components/readme_renderer/table_of_contents.jsx +197 -0
- package/dist/src/components/readme_renderer/table_of_contents.jsx.map +1 -0
- package/dist/src/components/readme_renderer/utils.d.ts +6 -0
- package/dist/src/components/readme_renderer/utils.d.ts.map +1 -0
- package/dist/src/components/readme_renderer/utils.jsx +42 -0
- package/dist/src/components/readme_renderer/utils.jsx.map +1 -0
- package/dist/src/components/simple_markdown/index.d.ts +3 -0
- package/dist/src/components/simple_markdown/index.d.ts.map +1 -0
- package/dist/src/components/simple_markdown/index.jsx +3 -0
- package/dist/src/components/simple_markdown/index.jsx.map +1 -0
- package/dist/src/components/simple_markdown/simple_markdown.d.ts +16 -0
- package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -0
- package/dist/src/components/simple_markdown/simple_markdown.jsx +137 -0
- package/dist/src/components/simple_markdown/simple_markdown.jsx.map +1 -0
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +26 -0
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -0
- package/dist/src/components/simple_markdown/simple_markdown_components.jsx +193 -0
- package/dist/src/components/simple_markdown/simple_markdown_components.jsx.map +1 -0
- package/dist/src/components/tag.d.ts +38 -0
- package/dist/src/components/tag.d.ts.map +1 -0
- package/dist/src/components/tag.jsx +126 -0
- package/dist/src/components/tag.jsx.map +1 -0
- package/dist/src/components/text/heading_content.d.ts +10 -0
- package/dist/src/components/text/heading_content.d.ts.map +1 -0
- package/dist/src/components/text/heading_content.jsx +31 -0
- package/dist/src/components/text/heading_content.jsx.map +1 -0
- package/dist/src/components/text/heading_marketing.d.ts +10 -0
- package/dist/src/components/text/heading_marketing.d.ts.map +1 -0
- package/dist/src/components/text/heading_marketing.jsx +31 -0
- package/dist/src/components/text/heading_marketing.jsx.map +1 -0
- package/dist/src/components/text/heading_shared.d.ts +10 -0
- package/dist/src/components/text/heading_shared.d.ts.map +1 -0
- package/dist/src/components/text/heading_shared.jsx +32 -0
- package/dist/src/components/text/heading_shared.jsx.map +1 -0
- package/dist/src/components/text/index.d.ts +12 -0
- package/dist/src/components/text/index.d.ts.map +1 -0
- package/dist/src/components/text/index.js +11 -0
- package/dist/src/components/text/index.js.map +1 -0
- package/dist/src/components/text/text_base.d.ts +13 -0
- package/dist/src/components/text/text_base.d.ts.map +1 -0
- package/dist/src/components/text/text_base.jsx +23 -0
- package/dist/src/components/text/text_base.jsx.map +1 -0
- package/dist/src/components/text/text_content.d.ts +11 -0
- package/dist/src/components/text/text_content.d.ts.map +1 -0
- package/dist/src/components/text/text_content.jsx +68 -0
- package/dist/src/components/text/text_content.jsx.map +1 -0
- package/dist/src/components/text/text_marketing.d.ts +11 -0
- package/dist/src/components/text/text_marketing.d.ts.map +1 -0
- package/dist/src/components/text/text_marketing.jsx +116 -0
- package/dist/src/components/text/text_marketing.jsx.map +1 -0
- package/dist/src/components/text/text_shared.d.ts +14 -0
- package/dist/src/components/text/text_shared.d.ts.map +1 -0
- package/dist/src/components/text/text_shared.jsx +55 -0
- package/dist/src/components/text/text_shared.jsx.map +1 -0
- package/dist/src/components/tile/horizontal_tile.d.ts +9 -0
- package/dist/src/components/tile/horizontal_tile.d.ts.map +1 -0
- package/dist/src/components/tile/horizontal_tile.jsx +43 -0
- package/dist/src/components/tile/horizontal_tile.jsx.map +1 -0
- package/dist/src/components/tile/index.d.ts +3 -0
- package/dist/src/components/tile/index.d.ts.map +1 -0
- package/dist/src/components/tile/index.js +3 -0
- package/dist/src/components/tile/index.js.map +1 -0
- package/dist/src/components/tile/shared.d.ts +17 -0
- package/dist/src/components/tile/shared.d.ts.map +1 -0
- package/dist/src/components/tile/shared.js +12 -0
- package/dist/src/components/tile/shared.js.map +1 -0
- package/dist/src/components/tile/vertical_tile.d.ts +10 -0
- package/dist/src/components/tile/vertical_tile.d.ts.map +1 -0
- package/dist/src/components/tile/vertical_tile.jsx +32 -0
- package/dist/src/components/tile/vertical_tile.jsx.map +1 -0
- package/dist/src/components/to_consolidate/card.d.ts +27 -0
- package/dist/src/components/to_consolidate/card.d.ts.map +1 -0
- package/dist/src/components/to_consolidate/card.jsx +93 -0
- package/dist/src/components/to_consolidate/card.jsx.map +1 -0
- package/dist/src/components/to_consolidate/index.d.ts +5 -0
- package/dist/src/components/to_consolidate/index.d.ts.map +1 -0
- package/dist/src/components/to_consolidate/index.js +5 -0
- package/dist/src/components/to_consolidate/index.js.map +1 -0
- package/dist/src/components/to_consolidate/markdown.d.ts +40 -0
- package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -0
- package/dist/src/components/to_consolidate/markdown.jsx +454 -0
- package/dist/src/components/to_consolidate/markdown.jsx.map +1 -0
- package/dist/src/components/to_consolidate/pagination.d.ts +8 -0
- package/dist/src/components/to_consolidate/pagination.d.ts.map +1 -0
- package/dist/src/components/to_consolidate/pagination.jsx +88 -0
- package/dist/src/components/to_consolidate/pagination.jsx.map +1 -0
- package/dist/src/components/to_consolidate/tab_number_chip.d.ts +7 -0
- package/dist/src/components/to_consolidate/tab_number_chip.d.ts.map +1 -0
- package/dist/src/components/to_consolidate/tab_number_chip.jsx +22 -0
- package/dist/src/components/to_consolidate/tab_number_chip.jsx.map +1 -0
- package/dist/src/design_system/colors_theme.d.ts +213 -0
- package/dist/src/design_system/colors_theme.d.ts.map +1 -0
- package/dist/src/design_system/colors_theme.js +213 -0
- package/dist/src/design_system/colors_theme.js.map +1 -0
- package/dist/src/design_system/properties_theme.d.ts +175 -0
- package/dist/src/design_system/properties_theme.d.ts.map +1 -0
- package/dist/src/design_system/properties_theme.js +315 -0
- package/dist/src/design_system/properties_theme.js.map +1 -0
- package/dist/src/design_system/theme.d.ts +630 -0
- package/dist/src/design_system/theme.d.ts.map +1 -0
- package/dist/src/design_system/theme.js +17 -0
- package/dist/src/design_system/theme.js.map +1 -0
- package/dist/src/design_system/tokens/index.d.ts +6 -0
- package/dist/src/design_system/tokens/index.d.ts.map +1 -0
- package/dist/src/design_system/tokens/index.js +6 -0
- package/dist/src/design_system/tokens/index.js.map +1 -0
- package/dist/src/design_system/tokens/layouts.d.ts +29 -0
- package/dist/src/design_system/tokens/layouts.d.ts.map +1 -0
- package/dist/src/design_system/tokens/layouts.js +29 -0
- package/dist/src/design_system/tokens/layouts.js.map +1 -0
- package/dist/src/design_system/tokens/radiuses.d.ts +23 -0
- package/dist/src/design_system/tokens/radiuses.d.ts.map +1 -0
- package/dist/src/design_system/tokens/radiuses.js +23 -0
- package/dist/src/design_system/tokens/radiuses.js.map +1 -0
- package/dist/src/design_system/tokens/shadows.d.ts +23 -0
- package/dist/src/design_system/tokens/shadows.d.ts.map +1 -0
- package/dist/src/design_system/tokens/shadows.js +23 -0
- package/dist/src/design_system/tokens/shadows.js.map +1 -0
- package/dist/src/design_system/tokens/spaces.d.ts +15 -0
- package/dist/src/design_system/tokens/spaces.d.ts.map +1 -0
- package/dist/src/design_system/tokens/spaces.js +14 -0
- package/dist/src/design_system/tokens/spaces.js.map +1 -0
- package/dist/src/design_system/tokens/transitions.d.ts +20 -0
- package/dist/src/design_system/tokens/transitions.d.ts.map +1 -0
- package/dist/src/design_system/tokens/transitions.js +20 -0
- package/dist/src/design_system/tokens/transitions.js.map +1 -0
- package/dist/src/design_system/typography_theme.d.ts +189 -0
- package/dist/src/design_system/typography_theme.d.ts.map +1 -0
- package/dist/src/design_system/typography_theme.js +190 -0
- package/dist/src/design_system/typography_theme.js.map +1 -0
- package/dist/src/index.d.ts +7 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +7 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/type_utils.d.ts +6 -0
- package/dist/src/type_utils.d.ts.map +1 -0
- package/dist/src/type_utils.js +2 -0
- package/dist/src/type_utils.js.map +1 -0
- package/dist/src/ui_dependency_provider.d.ts +29 -0
- package/dist/src/ui_dependency_provider.d.ts.map +1 -0
- package/dist/src/ui_dependency_provider.jsx +14 -0
- package/dist/src/ui_dependency_provider.jsx.map +1 -0
- package/dist/src/utils/copy_to_clipboard.d.ts +7 -0
- package/dist/src/utils/copy_to_clipboard.d.ts.map +1 -0
- package/dist/src/utils/copy_to_clipboard.js +16 -0
- package/dist/src/utils/copy_to_clipboard.js.map +1 -0
- package/dist/src/utils/image_color.d.ts +7 -0
- package/dist/src/utils/image_color.d.ts.map +1 -0
- package/dist/src/utils/image_color.js +35 -0
- package/dist/src/utils/image_color.js.map +1 -0
- package/dist/src/utils/index.d.ts +4 -0
- package/dist/src/utils/index.d.ts.map +1 -0
- package/dist/src/utils/index.js +4 -0
- package/dist/src/utils/index.js.map +1 -0
- package/dist/src/utils/sanitization.d.ts +11 -0
- package/dist/src/utils/sanitization.d.ts.map +1 -0
- package/dist/src/utils/sanitization.js +16 -0
- package/dist/src/utils/sanitization.js.map +1 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -0
- package/package.json +71 -0
- package/src/codemods/generate_color_property_tokens.mjs +97 -0
- package/src/codemods/generate_color_theme_files.mjs +46 -0
- package/src/codemods/generate_typograpy_tokens_files.mjs +136 -0
- package/src/components/action_link.tsx +59 -0
- package/src/components/actor_template_card.tsx +99 -0
- package/src/components/badge.tsx +144 -0
- package/src/components/banner.tsx +95 -0
- package/src/components/blog_article.tsx +85 -0
- package/src/components/box.tsx +127 -0
- package/src/components/button.tsx +303 -0
- package/src/components/chip.tsx +121 -0
- package/src/components/code/action_button.tsx +96 -0
- package/src/components/code/code_block/code_block.styled.tsx +228 -0
- package/src/components/code/code_block/code_block.tsx +235 -0
- package/src/components/code/code_block/utils.ts +19 -0
- package/src/components/code/index.ts +3 -0
- package/src/components/code/inline_code/inline_code.tsx +44 -0
- package/src/components/code/one_line_code/one_line_code.tsx +232 -0
- package/src/components/code/syntax_highlighter.tsx +125 -0
- package/src/components/color_wheel_gradient.tsx +31 -0
- package/src/components/floating/index.ts +3 -0
- package/src/components/floating/menu.tsx +191 -0
- package/src/components/floating/menu_common.tsx +31 -0
- package/src/components/floating/menu_components.tsx +94 -0
- package/src/components/image.tsx +23 -0
- package/src/components/index.ts +20 -0
- package/src/components/link.tsx +114 -0
- package/src/components/message.tsx +157 -0
- package/src/components/readme_renderer/index.ts +3 -0
- package/src/components/readme_renderer/pythonize_value.ts +78 -0
- package/src/components/readme_renderer/table_of_contents.tsx +257 -0
- package/src/components/readme_renderer/utils.tsx +46 -0
- package/src/components/simple_markdown/index.tsx +2 -0
- package/src/components/simple_markdown/simple_markdown.tsx +181 -0
- package/src/components/simple_markdown/simple_markdown_components.tsx +295 -0
- package/src/components/tag.tsx +185 -0
- package/src/components/text/heading_content.tsx +56 -0
- package/src/components/text/heading_marketing.tsx +55 -0
- package/src/components/text/heading_shared.tsx +57 -0
- package/src/components/text/index.ts +18 -0
- package/src/components/text/text_base.tsx +52 -0
- package/src/components/text/text_content.tsx +104 -0
- package/src/components/text/text_marketing.tsx +152 -0
- package/src/components/text/text_shared.tsx +96 -0
- package/src/components/tile/horizontal_tile.tsx +76 -0
- package/src/components/tile/index.ts +2 -0
- package/src/components/tile/shared.ts +27 -0
- package/src/components/tile/vertical_tile.tsx +58 -0
- package/src/components/to_consolidate/card.tsx +141 -0
- package/src/components/to_consolidate/index.ts +4 -0
- package/src/components/to_consolidate/markdown.tsx +593 -0
- package/src/components/to_consolidate/pagination.tsx +139 -0
- package/src/components/to_consolidate/tab_number_chip.tsx +31 -0
- package/src/design_system/colors_theme.ts +213 -0
- package/src/design_system/generate_color_definitions.js +43 -0
- package/src/design_system/properties_theme.ts +453 -0
- package/src/design_system/supernova_color_tokens.json +1766 -0
- package/src/design_system/supernova_typography_tokens.json +657 -0
- package/src/design_system/theme.ts +26 -0
- package/src/design_system/tokens/index.ts +5 -0
- package/src/design_system/tokens/layouts.ts +29 -0
- package/src/design_system/tokens/radiuses.ts +22 -0
- package/src/design_system/tokens/shadows.ts +22 -0
- package/src/design_system/tokens/spaces.ts +15 -0
- package/src/design_system/tokens/transitions.ts +19 -0
- package/src/design_system/typography_theme.ts +197 -0
- package/src/index.ts +7 -0
- package/src/type_utils.ts +7 -0
- package/src/ui_dependency_provider.tsx +50 -0
- package/src/utils/copy_to_clipboard.ts +24 -0
- package/src/utils/image_color.ts +44 -0
- package/src/utils/index.ts +3 -0
- package/src/utils/sanitization.ts +14 -0
- package/tsconfig.build.json +18 -0
- package/tsconfig.json +10 -0
package/package.json
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@apify/ui-library",
|
|
3
|
+
"version": "0.51.6-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
|
|
4
|
+
"description": "React components shared between Apify app and web",
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"repository": "https://github.com/apify-packages/meta-package-repo",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"main": "dist/src/index.js",
|
|
9
|
+
"types": "dist/src/index.d.ts",
|
|
10
|
+
"publishConfig": {
|
|
11
|
+
"registry": "https://registry.npmjs.org",
|
|
12
|
+
"access": "public"
|
|
13
|
+
},
|
|
14
|
+
"scripts": {
|
|
15
|
+
"test": "echo \"Warning: no test specified\" && exit 0",
|
|
16
|
+
"lint": "eslint . --ext .ts,.tsx",
|
|
17
|
+
"lint:fix": "eslint . --ext .ts,.tsx --fix",
|
|
18
|
+
"build": "npm run clean && npm run compile",
|
|
19
|
+
"clean": "rimraf ./dist",
|
|
20
|
+
"compile": "tsc -p tsconfig.build.json",
|
|
21
|
+
"generate-theme": "node ./src/codemods/generate_color_theme_files.mjs && node src/codemods/generate_color_property_tokens.mjs && node src/codemods/generate_typograpy_tokens_files.mjs && npm run lint:fix",
|
|
22
|
+
"generate-color-definition": "node ./src/design_system/generate_color_definitions.js",
|
|
23
|
+
"postpublish": "npm run clean"
|
|
24
|
+
},
|
|
25
|
+
"//": [
|
|
26
|
+
"Storybook for the components lives in a separate package components-storybook.",
|
|
27
|
+
"It's not nice, but helps us to get around the problem of multiple react instances."
|
|
28
|
+
],
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@apify/icons": "^0.40.5-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
|
|
31
|
+
"@apify/log": "^2.5.11",
|
|
32
|
+
"@apify/ui-icons": "^0.2.2-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
|
|
33
|
+
"@floating-ui/react": "^0.26.2",
|
|
34
|
+
"clsx": "^2.0.0",
|
|
35
|
+
"dayjs": "1.11.9",
|
|
36
|
+
"fast-average-color": "^9.4.0",
|
|
37
|
+
"history": "^5.3.0",
|
|
38
|
+
"lodash": "^4.17.21",
|
|
39
|
+
"query-string": "^8.1.0",
|
|
40
|
+
"react-markdown": "^8.0.5",
|
|
41
|
+
"react-syntax-highlighter": "^15.5.0",
|
|
42
|
+
"rehype-raw": "^6.1.1",
|
|
43
|
+
"rehype-sanitize": "^6.0.0",
|
|
44
|
+
"remark-gfm": "^3.0.1",
|
|
45
|
+
"remark-toc": "8.0.1",
|
|
46
|
+
"slugify": "^1.6.6"
|
|
47
|
+
},
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"react": "17.x || 18.x",
|
|
50
|
+
"react-dom": "17.x || 18.x",
|
|
51
|
+
"styled-components": "^5.3.3"
|
|
52
|
+
},
|
|
53
|
+
"devDependencies": {
|
|
54
|
+
"@apify/eslint-config-ts": "^0.4.1",
|
|
55
|
+
"@types/lodash": "^4.14.200",
|
|
56
|
+
"@types/node": "^22.10.5",
|
|
57
|
+
"@types/react": "^18.2.74",
|
|
58
|
+
"@types/react-syntax-highlighter": "^15.5.9",
|
|
59
|
+
"@types/styled-components": "^5.1.34",
|
|
60
|
+
"@typescript-eslint/eslint-plugin": "^5.62.0",
|
|
61
|
+
"@typescript-eslint/parser": "^5.62.0",
|
|
62
|
+
"eslint": "^8.45.0",
|
|
63
|
+
"eslint-plugin-import": "2.26.0",
|
|
64
|
+
"eslint-plugin-react": "^7.32.2",
|
|
65
|
+
"eslint-plugin-react-hooks": "^4.6.0",
|
|
66
|
+
"eslint-plugin-sonarjs": "^1.0.3",
|
|
67
|
+
"recast": "^0.23.9",
|
|
68
|
+
"typescript": "^5.1.6"
|
|
69
|
+
},
|
|
70
|
+
"gitHead": "7412d8cbd301449ad5fa482fe4e558a053396ad5"
|
|
71
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
|
|
3
|
+
import { print, types } from 'recast';
|
|
4
|
+
|
|
5
|
+
const { builders } = types;
|
|
6
|
+
|
|
7
|
+
const code = readFileSync('./src/design_system/supernova_color_tokens.json', 'utf-8');
|
|
8
|
+
|
|
9
|
+
const lightColorTokens = JSON.parse(code).light;
|
|
10
|
+
|
|
11
|
+
const getObjectValueByPath = (obj, path) => {
|
|
12
|
+
return path.split('.').reduce((acc, part) => acc && acc[part], obj);
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const getColorPropertyName = (semanticCategory, property) => {
|
|
16
|
+
const semanticColorName = `${property.split(/[_ ]/).map((semanticPartName) => semanticPartName.toLowerCase()).join('-')}`;
|
|
17
|
+
|
|
18
|
+
// lower case and replace spaces with dashes
|
|
19
|
+
const semanticCategoryName = semanticCategory.toLowerCase().split(' ').join('-');
|
|
20
|
+
|
|
21
|
+
return `--color-${semanticCategoryName}-${semanticColorName}`;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const generateColorPropertyTokens = (supernovaColorsDefinitions) => {
|
|
25
|
+
const mergedPalettes = { ...supernovaColorsDefinitions.Semantic, ...supernovaColorsDefinitions.Decorative };
|
|
26
|
+
|
|
27
|
+
const colorTheme = {};
|
|
28
|
+
for (const [category, palette] of Object.entries(mergedPalettes)) {
|
|
29
|
+
// convert to camelCase if there are multiple words in the category name
|
|
30
|
+
const categoryName = category
|
|
31
|
+
.split(' ')
|
|
32
|
+
.map((word, i) => (i === 0
|
|
33
|
+
? word.toLocaleLowerCase()
|
|
34
|
+
: `${word.charAt(0).toUpperCase()}${word.slice(1)}`),
|
|
35
|
+
)
|
|
36
|
+
.join('');
|
|
37
|
+
colorTheme[categoryName] = {};
|
|
38
|
+
|
|
39
|
+
for (const [key, { value }] of Object.entries(palette)) {
|
|
40
|
+
const [firstPart, ...rest] = key.split(' ');
|
|
41
|
+
const propertyName = `${firstPart.toLowerCase()}${rest.join('')}`;
|
|
42
|
+
|
|
43
|
+
const hexLocator = value.slice(1, -1);
|
|
44
|
+
const hex = value.startsWith('#') ? value : getObjectValueByPath(supernovaColorsDefinitions, hexLocator)?.value;
|
|
45
|
+
|
|
46
|
+
colorTheme[categoryName][propertyName] = {
|
|
47
|
+
variable: `var(${getColorPropertyName(category, key)})`,
|
|
48
|
+
hex,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return colorTheme;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
const createPropertyDeclaration = (tokens) => {
|
|
57
|
+
const paletteArray = [];
|
|
58
|
+
|
|
59
|
+
for (const [paletteName, paletteProps] of [...Object.entries(tokens)]) {
|
|
60
|
+
const paletteItemsArray = [];
|
|
61
|
+
|
|
62
|
+
for (const [paletteItemName, { variable, hex }] of Object.entries(paletteProps)) {
|
|
63
|
+
const objectPropertyItem = builders.property(
|
|
64
|
+
'init',
|
|
65
|
+
builders.identifier(paletteItemName),
|
|
66
|
+
builders.literal(variable),
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
objectPropertyItem.comments = [builders.commentBlock(` ${hex} `)];
|
|
70
|
+
|
|
71
|
+
paletteItemsArray.push(objectPropertyItem);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
paletteArray.push(builders.property(
|
|
75
|
+
'init',
|
|
76
|
+
builders.identifier(paletteName),
|
|
77
|
+
builders.objectExpression(paletteItemsArray),
|
|
78
|
+
));
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
return builders.exportNamedDeclaration(
|
|
82
|
+
builders.variableDeclaration('const', [
|
|
83
|
+
builders.variableDeclarator(
|
|
84
|
+
builders.identifier('colorProperties'),
|
|
85
|
+
builders.tsAsExpression(builders.objectExpression(paletteArray), builders.tsTypeReference(builders.identifier('const'))),
|
|
86
|
+
)]),
|
|
87
|
+
[],
|
|
88
|
+
);
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const generatedTokens = generateColorPropertyTokens(lightColorTokens);
|
|
92
|
+
|
|
93
|
+
const lightThemeDeclaration = createPropertyDeclaration(generatedTokens);
|
|
94
|
+
|
|
95
|
+
const printedCode = print(builders.program([lightThemeDeclaration])).code;
|
|
96
|
+
|
|
97
|
+
writeFileSync('./src/design_system/properties_theme.ts', printedCode);
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
|
|
3
|
+
import { print, types } from 'recast';
|
|
4
|
+
|
|
5
|
+
const { builders } = types;
|
|
6
|
+
|
|
7
|
+
const code = readFileSync('./src/design_system/supernova_color_tokens.json', 'utf-8');
|
|
8
|
+
|
|
9
|
+
const colorTokens = JSON.parse(code);
|
|
10
|
+
|
|
11
|
+
const lightThemeProperty = colorTokens.light;
|
|
12
|
+
const darkThemeProperty = colorTokens.dark;
|
|
13
|
+
|
|
14
|
+
function createThemeDeclaration(themeProperty, variableName) {
|
|
15
|
+
const paletteArray = [];
|
|
16
|
+
|
|
17
|
+
const { Decorative, Palette } = themeProperty;
|
|
18
|
+
|
|
19
|
+
for (const [paletteName, paletteProps] of [...Object.entries(Palette), ...Object.entries(Decorative)]) {
|
|
20
|
+
for (const [paletteItemName, paletteItem] of Object.entries(paletteProps)) {
|
|
21
|
+
paletteArray.push(
|
|
22
|
+
builders.property(
|
|
23
|
+
'init',
|
|
24
|
+
builders.identifier(`${paletteName.toLowerCase()}${paletteItemName}`),
|
|
25
|
+
builders.literal(paletteItem.value),
|
|
26
|
+
),
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return builders.exportNamedDeclaration(
|
|
32
|
+
builders.variableDeclaration('const', [
|
|
33
|
+
builders.variableDeclarator(
|
|
34
|
+
builders.identifier(variableName),
|
|
35
|
+
builders.tsAsExpression(builders.objectExpression(paletteArray), builders.tsTypeReference(builders.identifier('const'))),
|
|
36
|
+
)]),
|
|
37
|
+
[],
|
|
38
|
+
);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const lightThemeDeclaration = createThemeDeclaration(lightThemeProperty, 'lightTheme');
|
|
42
|
+
const darkThemeDeclaration = createThemeDeclaration(darkThemeProperty, 'darkTheme');
|
|
43
|
+
|
|
44
|
+
const printedCode = print(builders.program([lightThemeDeclaration, darkThemeDeclaration])).code;
|
|
45
|
+
|
|
46
|
+
writeFileSync('./src/design_system/colors_theme.ts', printedCode);
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { readFileSync, writeFileSync } from 'fs';
|
|
2
|
+
|
|
3
|
+
import { print, types } from 'recast';
|
|
4
|
+
|
|
5
|
+
const { builders } = types;
|
|
6
|
+
|
|
7
|
+
const code = readFileSync('./src/design_system/supernova_typography_tokens.json', 'utf-8');
|
|
8
|
+
|
|
9
|
+
const fontFamilies = {
|
|
10
|
+
inter: `Inter, sans-serif`,
|
|
11
|
+
gtWalsheim: `'GT-Walsheim-Regular', sans-serif`,
|
|
12
|
+
sfPro: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'`,
|
|
13
|
+
ibmPlexMono: "'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace",
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
const transformTokenProperties = (token) => {
|
|
17
|
+
const {
|
|
18
|
+
fontWeight,
|
|
19
|
+
fontSize,
|
|
20
|
+
lineHeight,
|
|
21
|
+
fontFamily,
|
|
22
|
+
} = token.value;
|
|
23
|
+
|
|
24
|
+
// Convert font family name to font family value
|
|
25
|
+
let fontFamilyValue;
|
|
26
|
+
const fontFamilyNameParts = fontFamily.split(' '); // each word in font family name is a separate part
|
|
27
|
+
|
|
28
|
+
if (fontFamilyNameParts.length === 1) {
|
|
29
|
+
fontFamilyValue = fontFamilies[fontFamilyNameParts[0].toLowerCase()];
|
|
30
|
+
} else {
|
|
31
|
+
const fontFamilyIndex = fontFamilyNameParts.map((fontFamilyNamePart, i) => {
|
|
32
|
+
if (i === 0) return fontFamilyNamePart.toLowerCase();
|
|
33
|
+
return fontFamilyNamePart;
|
|
34
|
+
}).join('');
|
|
35
|
+
|
|
36
|
+
fontFamilyValue = fontFamilies[fontFamilyIndex];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return `font-size: ${Number(fontSize) / 10}rem; line-height: ${Number(lineHeight) / 10}rem; font-weight: ${fontWeight}; font-family: ${fontFamilyValue};`;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
const transformTokenName = (tokenName) => {
|
|
43
|
+
const [token, variant] = tokenName.split('-');
|
|
44
|
+
return (variant ? `${token}${variant.charAt(0).toUpperCase() + variant.slice(1)}` : token);
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
const extractDeviceTokensDefinitions = (tokens) => {
|
|
48
|
+
return Object.keys(tokens).reduce((acc, tokenName) => {
|
|
49
|
+
const properTokenName = transformTokenName(tokenName);
|
|
50
|
+
acc[properTokenName] = transformTokenProperties(tokens[tokenName], fontFamilies);
|
|
51
|
+
return acc;
|
|
52
|
+
}, {});
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const extractTokensDefinitions = (sharedTokens) => {
|
|
56
|
+
const sharedTokensDefinition = {
|
|
57
|
+
mobile: {},
|
|
58
|
+
tablet: {},
|
|
59
|
+
desktop: {},
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
Object.entries(sharedTokens).forEach(([tokenName, tokenValue]) => {
|
|
63
|
+
if ((tokenName === 'mobile' || tokenName === 'tablet') && typeof tokenValue !== 'string') {
|
|
64
|
+
sharedTokensDefinition[tokenName] = extractDeviceTokensDefinitions(tokenValue, fontFamilies);
|
|
65
|
+
return;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const properTokenName = transformTokenName(tokenName);
|
|
69
|
+
const transformedTokenProperties = transformTokenProperties(tokenValue, fontFamilies);
|
|
70
|
+
sharedTokensDefinition.desktop[properTokenName] = transformedTokenProperties;
|
|
71
|
+
sharedTokensDefinition.mobile[properTokenName] ||= transformedTokenProperties;
|
|
72
|
+
sharedTokensDefinition.tablet[properTokenName] ||= transformedTokenProperties;
|
|
73
|
+
});
|
|
74
|
+
|
|
75
|
+
return sharedTokensDefinition;
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const globalTokens = JSON.parse(code).global;
|
|
79
|
+
|
|
80
|
+
const sharedTokens = extractTokensDefinitions(globalTokens.shared);
|
|
81
|
+
const marketingTokens = extractTokensDefinitions(globalTokens.marketing);
|
|
82
|
+
const contentTokens = extractTokensDefinitions(globalTokens.content);
|
|
83
|
+
|
|
84
|
+
const tokensForCodeGeneration = {
|
|
85
|
+
shared: sharedTokens,
|
|
86
|
+
marketing: marketingTokens,
|
|
87
|
+
content: contentTokens,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
const createTokensCode = (tokens) => {
|
|
91
|
+
const variantsArray = [];
|
|
92
|
+
for (const [tokenVariant, tokenVariantItems] of Object.entries(tokens)) {
|
|
93
|
+
const devicesArray = [];
|
|
94
|
+
|
|
95
|
+
for (const [device, deviceTokens] of Object.entries(tokenVariantItems)) {
|
|
96
|
+
const deviceItemsArray = [];
|
|
97
|
+
|
|
98
|
+
for (const [tokenName, tokenValue] of Object.entries(deviceTokens)) {
|
|
99
|
+
deviceItemsArray.push(builders.property(
|
|
100
|
+
'init',
|
|
101
|
+
builders.identifier(tokenName),
|
|
102
|
+
builders.literal(tokenValue),
|
|
103
|
+
));
|
|
104
|
+
}
|
|
105
|
+
devicesArray.push(builders.property(
|
|
106
|
+
'init',
|
|
107
|
+
builders.identifier(device),
|
|
108
|
+
builders.objectExpression(deviceItemsArray),
|
|
109
|
+
));
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
variantsArray.push(builders.property(
|
|
113
|
+
'init',
|
|
114
|
+
builders.identifier(tokenVariant),
|
|
115
|
+
builders.objectExpression(devicesArray),
|
|
116
|
+
));
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
const exportDeclaration = builders.exportNamedDeclaration(
|
|
120
|
+
builders.variableDeclaration('const', [
|
|
121
|
+
builders.variableDeclarator(
|
|
122
|
+
builders.identifier('typographyTokens'),
|
|
123
|
+
builders.tsAsExpression(builders.objectExpression(variantsArray), builders.tsTypeReference(builders.identifier('const'))),
|
|
124
|
+
)]),
|
|
125
|
+
[],
|
|
126
|
+
);
|
|
127
|
+
|
|
128
|
+
// Add a comment to the export declaration
|
|
129
|
+
exportDeclaration.comments = [builders.commentBlock(' eslint-disable max-len ')];
|
|
130
|
+
|
|
131
|
+
return exportDeclaration;
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
const printedCode = print(builders.program([createTokensCode(tokensForCodeGeneration)])).code;
|
|
135
|
+
|
|
136
|
+
writeFileSync('./src/design_system/typography_theme.ts', printedCode);
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { ArrowLeft16, ArrowRight16 } from '@apify/icons';
|
|
5
|
+
|
|
6
|
+
import { theme } from '../design_system/theme';
|
|
7
|
+
import { Box } from './box';
|
|
8
|
+
import { Link, type LinkProps } from './link';
|
|
9
|
+
import { Heading } from './text';
|
|
10
|
+
|
|
11
|
+
const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
|
|
12
|
+
display: inline-flex;
|
|
13
|
+
align-items: center;
|
|
14
|
+
color: ${theme.color.neutral.text};
|
|
15
|
+
|
|
16
|
+
svg {
|
|
17
|
+
transition: transform 0.2s ease-in-out;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
&:hover {
|
|
21
|
+
svg {
|
|
22
|
+
transform: translate(${({ $isBackLink }) => ($isBackLink ? -3 : 3)}px, 0);
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
`;
|
|
26
|
+
|
|
27
|
+
export const ActionLink: React.FC<LinkProps> = ({
|
|
28
|
+
children,
|
|
29
|
+
as,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
|
+
return (
|
|
33
|
+
<StyledGuidepost
|
|
34
|
+
forwardedAs={as || Link}
|
|
35
|
+
$isBackLink={false}
|
|
36
|
+
{...rest}
|
|
37
|
+
>
|
|
38
|
+
<Heading as='span' type='titleM'>{children}</Heading>
|
|
39
|
+
<ArrowRight16 />
|
|
40
|
+
</StyledGuidepost>
|
|
41
|
+
);
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const BackLink: React.FC<LinkProps> = ({
|
|
45
|
+
children,
|
|
46
|
+
as,
|
|
47
|
+
...rest
|
|
48
|
+
}) => {
|
|
49
|
+
return (
|
|
50
|
+
<StyledGuidepost
|
|
51
|
+
forwardedAs={as || Link}
|
|
52
|
+
$isBackLink={true}
|
|
53
|
+
{...rest}
|
|
54
|
+
>
|
|
55
|
+
<ArrowLeft16 />
|
|
56
|
+
<Heading as='span' type='titleM'>{children}</Heading>
|
|
57
|
+
</StyledGuidepost>
|
|
58
|
+
);
|
|
59
|
+
};
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { theme } from '../design_system/theme';
|
|
5
|
+
import { TextBaseComponent } from './text/text_base';
|
|
6
|
+
import { VerticalTile } from './tile';
|
|
7
|
+
|
|
8
|
+
interface ActorTemplateCardProps {
|
|
9
|
+
id: string;
|
|
10
|
+
label: string;
|
|
11
|
+
description: string;
|
|
12
|
+
icons: React.ReactNode[];
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
const WrapperClasses = {
|
|
16
|
+
TEMPLATE_CARD_IMAGES: 'TemplateCard-Images',
|
|
17
|
+
TEMPLATE_CARD_TEXT: 'TemplateCard-Text',
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const Text = styled(TextBaseComponent)`
|
|
21
|
+
${theme.typography.marketing.mobile.bodyM}
|
|
22
|
+
color: ${theme.color.neutral.textMuted};
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
text-overflow: ellipsis;
|
|
25
|
+
display: -webkit-box;
|
|
26
|
+
-webkit-line-clamp: 3;
|
|
27
|
+
-webkit-box-orient: vertical;
|
|
28
|
+
|
|
29
|
+
@media ${theme.layout.tablet} {
|
|
30
|
+
${theme.typography.marketing.tablet.bodyM}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@media ${theme.layout.desktop} {
|
|
34
|
+
${theme.typography.marketing.desktop.bodyM}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
const Heading = styled(TextBaseComponent)`
|
|
39
|
+
${theme.typography.marketing.mobile.titleXs}
|
|
40
|
+
color: ${theme.color.neutral.text};
|
|
41
|
+
|
|
42
|
+
@media ${theme.layout.tablet} {
|
|
43
|
+
${theme.typography.marketing.tablet.titleXs}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
@media ${theme.layout.desktop} {
|
|
47
|
+
${theme.typography.marketing.desktop.titleXs}
|
|
48
|
+
}
|
|
49
|
+
`;
|
|
50
|
+
|
|
51
|
+
const TemplateCardContentWrapper = styled.div`
|
|
52
|
+
display: flex;
|
|
53
|
+
flex-direction: column;
|
|
54
|
+
align-items: flex-start;
|
|
55
|
+
align-self: stretch;
|
|
56
|
+
flex: 1 0 0;
|
|
57
|
+
gap: ${theme.space.space16};
|
|
58
|
+
|
|
59
|
+
.${WrapperClasses.TEMPLATE_CARD_IMAGES} {
|
|
60
|
+
display: flex;
|
|
61
|
+
align-items: flex-start;
|
|
62
|
+
gap: ${theme.space.space16};
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.${WrapperClasses.TEMPLATE_CARD_TEXT} {
|
|
66
|
+
display: flex;
|
|
67
|
+
flex-direction: column;
|
|
68
|
+
align-items: flex-start;
|
|
69
|
+
align-self: stretch;
|
|
70
|
+
gap: ${theme.space.space4};
|
|
71
|
+
}
|
|
72
|
+
`;
|
|
73
|
+
|
|
74
|
+
export const ActorTemplateCard: React.FC<ActorTemplateCardProps> = ({
|
|
75
|
+
id,
|
|
76
|
+
label,
|
|
77
|
+
description,
|
|
78
|
+
icons,
|
|
79
|
+
}) => {
|
|
80
|
+
const templateCardContent = (
|
|
81
|
+
<TemplateCardContentWrapper>
|
|
82
|
+
<div className={WrapperClasses.TEMPLATE_CARD_IMAGES}>
|
|
83
|
+
{icons}
|
|
84
|
+
</div>
|
|
85
|
+
<div className={WrapperClasses.TEMPLATE_CARD_TEXT}>
|
|
86
|
+
<Heading>{label}</Heading>
|
|
87
|
+
<Text>{description}</Text>
|
|
88
|
+
</div>
|
|
89
|
+
</TemplateCardContentWrapper>
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<VerticalTile
|
|
94
|
+
id={`actor-template-card-${id}`}
|
|
95
|
+
content={templateCardContent}
|
|
96
|
+
isClickable
|
|
97
|
+
/>
|
|
98
|
+
);
|
|
99
|
+
};
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import styled, { css, type FlattenSimpleInterpolation } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { IconComponent, IconSize } from '@apify/ui-icons';
|
|
5
|
+
|
|
6
|
+
import { theme } from '../design_system/theme';
|
|
7
|
+
import type { WithTransientProps } from '../type_utils';
|
|
8
|
+
import { type RegularBoxProps, type MarginSpacingProps, Box } from './box';
|
|
9
|
+
|
|
10
|
+
type BadgeSize = typeof BADGE_SIZES[number];
|
|
11
|
+
|
|
12
|
+
export const BADGE_SIZES = ['medium', 'small'] as const;
|
|
13
|
+
|
|
14
|
+
const BADGE_ICON_SIZES = {
|
|
15
|
+
medium: '16',
|
|
16
|
+
small: '12',
|
|
17
|
+
} satisfies Record<BadgeSize, IconSize>;
|
|
18
|
+
|
|
19
|
+
const badgeSizeStyle = {
|
|
20
|
+
medium: ($code) => css`
|
|
21
|
+
padding: ${theme.space.space4} ${theme.space.space8};
|
|
22
|
+
border-radius: ${theme.radius.radius6};
|
|
23
|
+
${$code
|
|
24
|
+
? theme.typography.shared.desktop.codeMMedium
|
|
25
|
+
: theme.typography.shared.desktop.bodyMMedium
|
|
26
|
+
}
|
|
27
|
+
`,
|
|
28
|
+
small: ($code) => css`
|
|
29
|
+
height: 2rem;
|
|
30
|
+
padding: ${theme.space.space2} ${theme.space.space6};
|
|
31
|
+
border-radius: ${theme.radius.radius4};
|
|
32
|
+
${$code
|
|
33
|
+
? theme.typography.shared.desktop.codeSMedium
|
|
34
|
+
: theme.typography.shared.desktop.bodySMedium
|
|
35
|
+
}
|
|
36
|
+
`,
|
|
37
|
+
} satisfies Record<BadgeSize, (code: boolean) => FlattenSimpleInterpolation>;
|
|
38
|
+
|
|
39
|
+
type BadgeVariant = typeof BADGE_VARIANTS[number];
|
|
40
|
+
|
|
41
|
+
export const BADGE_VARIANTS = ['neutral', 'neutral_muted', 'neutral_subtle', 'primary_black', 'primary_blue', 'success', 'warning', 'danger'] as const;
|
|
42
|
+
|
|
43
|
+
const badgeVariantStyle = {
|
|
44
|
+
neutral: css`
|
|
45
|
+
color: ${theme.color.neutral.text};
|
|
46
|
+
fill: ${theme.color.neutral.text};
|
|
47
|
+
background: ${theme.color.neutral.background};
|
|
48
|
+
box-shadow: inset 0 0 0 1px ${theme.color.neutral.border};
|
|
49
|
+
`,
|
|
50
|
+
neutral_muted: css`
|
|
51
|
+
color: ${theme.color.neutral.text};
|
|
52
|
+
fill: ${theme.color.neutral.text};
|
|
53
|
+
background: ${theme.color.neutral.chipBackground};
|
|
54
|
+
`,
|
|
55
|
+
neutral_subtle: css`
|
|
56
|
+
color: ${theme.color.neutral.textSubtle};
|
|
57
|
+
fill: ${theme.color.neutral.textSubtle};
|
|
58
|
+
background: ${theme.color.neutral.backgroundSubtle};
|
|
59
|
+
`,
|
|
60
|
+
primary_black: css`
|
|
61
|
+
color: ${theme.color.primaryBlack.chipText};
|
|
62
|
+
fill: ${theme.color.primaryBlack.chipText};
|
|
63
|
+
background: ${theme.color.primaryBlack.background};
|
|
64
|
+
`,
|
|
65
|
+
primary_blue: css`
|
|
66
|
+
color: ${theme.color.primary.chipText};
|
|
67
|
+
fill: ${theme.color.primaryBlack.chipText};
|
|
68
|
+
background: ${theme.color.primary.background};
|
|
69
|
+
`,
|
|
70
|
+
success: css`
|
|
71
|
+
color: ${theme.color.success.chipText};
|
|
72
|
+
fill: ${theme.color.success.chipText};
|
|
73
|
+
background: ${theme.color.success.background};
|
|
74
|
+
`,
|
|
75
|
+
warning: css`
|
|
76
|
+
color: ${theme.color.warning.chipText};
|
|
77
|
+
fill: ${theme.color.warning.chipText};
|
|
78
|
+
background: ${theme.color.warning.background};
|
|
79
|
+
`,
|
|
80
|
+
danger: css`
|
|
81
|
+
color: ${theme.color.danger.chipText};
|
|
82
|
+
fill: ${theme.color.danger.chipText};
|
|
83
|
+
background: ${theme.color.danger.background};
|
|
84
|
+
`,
|
|
85
|
+
} satisfies Record<BadgeVariant, FlattenSimpleInterpolation>;
|
|
86
|
+
|
|
87
|
+
type StyledBadgeProps = WithTransientProps<
|
|
88
|
+
Required<Pick<BadgeProps, 'size' | 'variant' | 'code'>>
|
|
89
|
+
>;
|
|
90
|
+
|
|
91
|
+
const StyledBadge = styled(Box)<StyledBadgeProps>`
|
|
92
|
+
${({ $size, $code }) => badgeSizeStyle[$size]($code)};
|
|
93
|
+
${({ $variant }) => badgeVariantStyle[$variant]};
|
|
94
|
+
|
|
95
|
+
/* Static styles */
|
|
96
|
+
width: fit-content;
|
|
97
|
+
border: none;
|
|
98
|
+
outline: none;
|
|
99
|
+
display: flex;
|
|
100
|
+
flex-direction: row;
|
|
101
|
+
justify-content: center;
|
|
102
|
+
align-items: center;
|
|
103
|
+
white-space: nowrap;
|
|
104
|
+
gap: ${theme.space.space4};
|
|
105
|
+
`;
|
|
106
|
+
|
|
107
|
+
export type BadgeProps = Omit<RegularBoxProps, 'onClick'> & MarginSpacingProps & {
|
|
108
|
+
as?: Exclude<React.ElementType, 'a' | 'button'>;
|
|
109
|
+
size?: BadgeSize;
|
|
110
|
+
variant?: BadgeVariant;
|
|
111
|
+
LeadingIcon?: IconComponent;
|
|
112
|
+
code?: boolean;
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* Component for displaying non-interactive chip descendant.
|
|
117
|
+
*/
|
|
118
|
+
export const Badge = forwardRef(
|
|
119
|
+
({
|
|
120
|
+
size = 'small',
|
|
121
|
+
variant = 'neutral',
|
|
122
|
+
LeadingIcon,
|
|
123
|
+
children,
|
|
124
|
+
code = false,
|
|
125
|
+
...props
|
|
126
|
+
}: BadgeProps,
|
|
127
|
+
ref,
|
|
128
|
+
) => {
|
|
129
|
+
return (
|
|
130
|
+
<StyledBadge
|
|
131
|
+
ref={ref}
|
|
132
|
+
$size={size}
|
|
133
|
+
$variant={variant}
|
|
134
|
+
$code={code}
|
|
135
|
+
{...props}
|
|
136
|
+
>
|
|
137
|
+
{LeadingIcon && <LeadingIcon size={BADGE_ICON_SIZES[size]} />}
|
|
138
|
+
{children}
|
|
139
|
+
</StyledBadge>
|
|
140
|
+
);
|
|
141
|
+
},
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
Badge.displayName = 'Badge';
|