@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_wheel_gradient.d.ts","sourceRoot":"","sources":["../../../src/components/color_wheel_gradient.tsx"],"names":[],"mappings":"AAEA,MAAM,WAAW,uBAAuB;IACpC,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,eAAO,MAAM,kBAAkB,yFAoB5B,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import styled from 'styled-components';
|
|
2
|
+
export const ColorWheelGradient = styled.div `${({ radius, rotation = 0, blurSize = 40, translateX = 0, translateY = 0 }) => `
|
|
3
|
+
z-index: 1;
|
|
4
|
+
position: absolute;
|
|
5
|
+
width: ${radius ? `${radius}px` : 'auto'};
|
|
6
|
+
height: ${radius ? `${radius}px` : 'auto'};
|
|
7
|
+
transform-origin: center;
|
|
8
|
+
transform: translate(${translateX}px, ${translateY}px) rotate(${rotation}deg);
|
|
9
|
+
|
|
10
|
+
opacity: 0.30;
|
|
11
|
+
background: conic-gradient(
|
|
12
|
+
rgba(93, 133, 225, 0.99) 0deg,
|
|
13
|
+
rgba(106, 20, 222, 0.99) 69deg,
|
|
14
|
+
rgba(228, 68, 103, 0.99) 150deg,
|
|
15
|
+
rgba(250, 129, 54, 0.99) 221deg,
|
|
16
|
+
rgba(240, 178, 27, 0.99) 287deg,
|
|
17
|
+
rgba(18, 150, 111, 0.99) 360deg
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
border-radius: 50%;
|
|
21
|
+
filter: blur(${blurSize}px)
|
|
22
|
+
`}`;
|
|
23
|
+
//# sourceMappingURL=color_wheel_gradient.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color_wheel_gradient.jsx","sourceRoot":"","sources":["../../../src/components/color_wheel_gradient.tsx"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAUvC,MAAM,CAAC,MAAM,kBAAkB,GAAG,MAAM,CAAC,GAAG,CAAyB,GAAG,CAAC,EAAE,MAAM,EAAE,QAAQ,GAAG,CAAC,EAAE,QAAQ,GAAG,EAAE,EAAE,UAAU,GAAG,CAAC,EAAE,UAAU,GAAG,CAAC,EAAE,EAAE,EAAE,CAAC;;;aAGxI,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM;cAC9B,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,IAAI,CAAC,CAAC,CAAC,MAAM;;2BAElB,UAAU,OAAO,UAAU,cAAc,QAAQ;;;;;;;;;;;;;mBAazD,QAAQ;CAC1B,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/floating/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BoxProps } from '../box';
|
|
3
|
+
export declare const menuClassNames: {
|
|
4
|
+
WRAPPER: string;
|
|
5
|
+
BASE: string;
|
|
6
|
+
LIST: string;
|
|
7
|
+
ITEM: string;
|
|
8
|
+
};
|
|
9
|
+
type SelectActionType = 'click' | 'enter' | 'space' | 'type';
|
|
10
|
+
export interface MenuOption {
|
|
11
|
+
label: string;
|
|
12
|
+
value: string;
|
|
13
|
+
}
|
|
14
|
+
export interface MenuProps<T = MenuOption> {
|
|
15
|
+
options: T[];
|
|
16
|
+
value?: string;
|
|
17
|
+
onSelect: (newValue: string, selectedBy: SelectActionType) => void;
|
|
18
|
+
defaultLabel?: React.ReactNode;
|
|
19
|
+
closeOnSelect?: boolean;
|
|
20
|
+
renderOption?: (option: T) => React.ReactNode;
|
|
21
|
+
components?: {
|
|
22
|
+
MenuBase?: React.ElementType;
|
|
23
|
+
Menu?: React.ElementType;
|
|
24
|
+
MenuItem?: React.ElementType;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* This example is a Select taken from https://floating-ui.com/docs/react-examples
|
|
29
|
+
* It tries to mimic API of react-select as closely as possible
|
|
30
|
+
*/
|
|
31
|
+
export declare const Menu: <T extends MenuOption>({ options, value, onSelect, closeOnSelect, defaultLabel, components, renderOption, className, ...rest }: MenuProps<T> & BoxProps) => React.JSX.Element;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=menu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu.tsx"],"names":[],"mappings":"AAWA,OAAO,KAIN,MAAM,OAAO,CAAC;AAEf,OAAO,EAEH,KAAK,QAAQ,EAChB,MAAM,QAAQ,CAAC;AAShB,eAAO,MAAM,cAAc;;;;;CAK1B,CAAC;AAEF,KAAK,gBAAgB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAI7D,MAAM,WAAW,UAAU;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC,GAAG,UAAU;IACrC,OAAO,EAAE,CAAC,EAAE,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,gBAAgB,KAAK,IAAI,CAAC;IACnE,YAAY,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC/B,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,KAAK,CAAC,SAAS,CAAC;IAC9C,UAAU,CAAC,EAAE;QACT,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;QAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;QACzB,QAAQ,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;KAChC,CAAC;CACL;AAID;;;GAGG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,UAAU,2GAUtC,SAAS,CAAC,CAAC,CAAC,GAAG,QAAQ,sBAmHzB,CAAC"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { useRole, useListNavigation, useTypeahead, useClick, useDismiss, useInteractions, FloatingPortal, FloatingFocusManager, } from '@floating-ui/react';
|
|
2
|
+
import clsx from 'clsx';
|
|
3
|
+
import React, { useState, useRef, useMemo, } from 'react';
|
|
4
|
+
import { Box, } from '../box';
|
|
5
|
+
import { Text } from '../text';
|
|
6
|
+
import { useFloatingMenu } from './menu_common';
|
|
7
|
+
import { DropdownMenuBaseComponent, ListMenuComponent, ListMenuItemComponent, } from './menu_components';
|
|
8
|
+
export const menuClassNames = {
|
|
9
|
+
WRAPPER: 'menu-wrapper',
|
|
10
|
+
BASE: 'menu-base',
|
|
11
|
+
LIST: 'menu-list',
|
|
12
|
+
ITEM: 'menu-item',
|
|
13
|
+
};
|
|
14
|
+
const defaultRenderOption = ({ label }) => (<Text as='span'>{label}</Text>);
|
|
15
|
+
/**
|
|
16
|
+
* This example is a Select taken from https://floating-ui.com/docs/react-examples
|
|
17
|
+
* It tries to mimic API of react-select as closely as possible
|
|
18
|
+
*/
|
|
19
|
+
export const Menu = ({ options, value, onSelect, closeOnSelect = true, defaultLabel, components, renderOption, className, ...rest }) => {
|
|
20
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
21
|
+
const { refs, floatingStyles, context } = useFloatingMenu({
|
|
22
|
+
isOpen,
|
|
23
|
+
setIsOpen,
|
|
24
|
+
});
|
|
25
|
+
const selectedIndex = useMemo(() => {
|
|
26
|
+
const foundIndex = options.findIndex((option) => option.value === value);
|
|
27
|
+
return foundIndex < 0 ? null : foundIndex;
|
|
28
|
+
}, [options, value]);
|
|
29
|
+
const [activeIndex, setActiveIndex] = useState(null);
|
|
30
|
+
const handleSelect = (newIndex, selectedBy) => {
|
|
31
|
+
onSelect(options[newIndex].value, selectedBy);
|
|
32
|
+
if (closeOnSelect)
|
|
33
|
+
setIsOpen(false);
|
|
34
|
+
};
|
|
35
|
+
const listRef = useRef([]);
|
|
36
|
+
const isTypingRef = useRef(false);
|
|
37
|
+
const listContentRef = useRef(options.map((option) => option.label));
|
|
38
|
+
const click = useClick(context, { event: 'mousedown' });
|
|
39
|
+
const dismiss = useDismiss(context);
|
|
40
|
+
const typeahead = useTypeahead(context, {
|
|
41
|
+
listRef: listContentRef,
|
|
42
|
+
activeIndex,
|
|
43
|
+
selectedIndex,
|
|
44
|
+
onMatch: isOpen ? setActiveIndex : (newIndex) => onSelect(options[newIndex].value, 'type'),
|
|
45
|
+
onTypingChange(isTyping) {
|
|
46
|
+
isTypingRef.current = isTyping;
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const role = useRole(context, { role: 'listbox' });
|
|
50
|
+
const listNav = useListNavigation(context, {
|
|
51
|
+
listRef,
|
|
52
|
+
activeIndex,
|
|
53
|
+
selectedIndex,
|
|
54
|
+
onNavigate: setActiveIndex,
|
|
55
|
+
loop: true,
|
|
56
|
+
});
|
|
57
|
+
const { getFloatingProps, getItemProps, getReferenceProps } = useInteractions([click, dismiss, role, listNav, typeahead]);
|
|
58
|
+
const MenuBaseComponent = components?.MenuBase || DropdownMenuBaseComponent;
|
|
59
|
+
const MenuComponent = components?.Menu || ListMenuComponent;
|
|
60
|
+
const MenuItemComponent = components?.MenuItem || ListMenuItemComponent;
|
|
61
|
+
const effectiveRenderOption = renderOption || defaultRenderOption;
|
|
62
|
+
return (<Box className={clsx(className, menuClassNames.WRAPPER)} {...rest}>
|
|
63
|
+
<MenuBaseComponent aria-labelledby="select-label" aria-autocomplete="none" ref={refs.setReference} {...getReferenceProps()} className={menuClassNames.BASE} tabindex="0">
|
|
64
|
+
{selectedIndex !== null ? options[selectedIndex].label : defaultLabel}
|
|
65
|
+
</MenuBaseComponent>
|
|
66
|
+
<FloatingPortal>
|
|
67
|
+
<FloatingFocusManager context={context} modal={false}>
|
|
68
|
+
<MenuComponent ref={refs.setFloating} style={{
|
|
69
|
+
...floatingStyles,
|
|
70
|
+
// TODO: We should consider not doing this by default
|
|
71
|
+
...!isOpen && { display: 'none' }, // needs to be rendered, because of SEO
|
|
72
|
+
}} {...getFloatingProps()} className={menuClassNames.LIST}>
|
|
73
|
+
{options.map((option, i) => (<MenuItemComponent key={option.value} $isSelected={i === selectedIndex} $isActive={i === activeIndex} ref={(node) => {
|
|
74
|
+
listRef.current[i] = node;
|
|
75
|
+
}} role="option" tabIndex={i === activeIndex ? 0 : -1} className={menuClassNames.ITEM} aria-selected={i === selectedIndex && i === activeIndex} {...getItemProps({
|
|
76
|
+
onClick: () => handleSelect(i, 'click'), // Handles mouse click
|
|
77
|
+
onKeyDown: (event) => {
|
|
78
|
+
if (event.key === 'Enter') {
|
|
79
|
+
event.preventDefault();
|
|
80
|
+
handleSelect(i, 'enter'); // Handles enter press
|
|
81
|
+
}
|
|
82
|
+
if (event.key === ' ' && !isTypingRef.current) {
|
|
83
|
+
event.preventDefault();
|
|
84
|
+
handleSelect(i, 'space');
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
})}>
|
|
88
|
+
{effectiveRenderOption(option)}
|
|
89
|
+
</MenuItemComponent>))}
|
|
90
|
+
</MenuComponent>
|
|
91
|
+
</FloatingFocusManager>
|
|
92
|
+
</FloatingPortal>
|
|
93
|
+
</Box>);
|
|
94
|
+
};
|
|
95
|
+
//# sourceMappingURL=menu.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu.jsx","sourceRoot":"","sources":["../../../../src/components/floating/menu.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,OAAO,EACP,iBAAiB,EACjB,YAAY,EACZ,QAAQ,EACR,UAAU,EACV,eAAe,EACf,cAAc,EACd,oBAAoB,GACvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,KAAK,EAAE,EACV,QAAQ,EACR,MAAM,EACN,OAAO,GACV,MAAM,OAAO,CAAC;AAEf,OAAO,EACH,GAAG,GAEN,MAAM,QAAQ,CAAC;AAChB,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EACH,yBAAyB,EACzB,iBAAiB,EACjB,qBAAqB,GACxB,MAAM,mBAAmB,CAAC;AAE3B,MAAM,CAAC,MAAM,cAAc,GAAG;IAC1B,OAAO,EAAE,cAAc;IACvB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;CACpB,CAAC;AAyBF,MAAM,mBAAmB,GAAG,CAAC,EAAE,KAAK,EAAc,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC;AAExF;;;GAGG;AACH,MAAM,CAAC,MAAM,IAAI,GAAG,CAAuB,EACvC,OAAO,EACP,KAAK,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,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CACrC,SAAS,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC,CAC/B,aAAa,CAAC,CAAC,CAAC,KAAK,aAAa,IAAI,CAAC,KAAK,WAAW,CAAC,CACxD,IAAI,YAAY,CAAC;YACb,OAAO,EAAE,GAAG,EAAE,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,EAAE,sBAAsB;YAC/D,SAAS,EAAE,CAAC,KAAK,EAAE,EAAE;gBACjB,IAAI,KAAK,CAAC,GAAG,KAAK,OAAO,EAAE,CAAC;oBACxB,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,sBAAsB;gBACpD,CAAC;gBAED,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,IAAI,CAAC,WAAW,CAAC,OAAO,EAAE,CAAC;oBAC5C,KAAK,CAAC,cAAc,EAAE,CAAC;oBACvB,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC;gBAC7B,CAAC;YACL,CAAC;SACJ,CAAC,CAAC,CAEH;gCAAA,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAClC;4BAAA,EAAE,iBAAiB,CAAC,CACvB,CAAC,CACN;oBAAA,EAAE,aAAa,CACnB;gBAAA,EAAE,oBAAoB,CAC1B;YAAA,EAAE,cAAc,CACpB;QAAA,EAAE,GAAG,CAAC,CACT,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
export declare const useFloatingMenu: ({ isOpen, setIsOpen, }: {
|
|
2
|
+
isOpen: boolean;
|
|
3
|
+
setIsOpen: (newIsOpen: boolean) => void;
|
|
4
|
+
}) => {
|
|
5
|
+
placement: import("@floating-ui/utils").Placement;
|
|
6
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
7
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
8
|
+
x: number;
|
|
9
|
+
y: number;
|
|
10
|
+
isPositioned: boolean;
|
|
11
|
+
update: () => void;
|
|
12
|
+
floatingStyles: React.CSSProperties;
|
|
13
|
+
refs: {
|
|
14
|
+
reference: import("react").MutableRefObject<import("@floating-ui/react-dom").ReferenceType | null>;
|
|
15
|
+
floating: React.MutableRefObject<HTMLElement | null>;
|
|
16
|
+
setReference: (node: import("@floating-ui/react-dom").ReferenceType | null) => void;
|
|
17
|
+
setFloating: (node: HTMLElement | null) => void;
|
|
18
|
+
} & import("@floating-ui/react").ExtendedRefs<Element>;
|
|
19
|
+
elements: {
|
|
20
|
+
reference: import("@floating-ui/react-dom").ReferenceType | null;
|
|
21
|
+
floating: HTMLElement | null;
|
|
22
|
+
} & import("@floating-ui/react").ExtendedElements<Element>;
|
|
23
|
+
context: {
|
|
24
|
+
x: number;
|
|
25
|
+
y: number;
|
|
26
|
+
placement: import("@floating-ui/utils").Placement;
|
|
27
|
+
strategy: import("@floating-ui/utils").Strategy;
|
|
28
|
+
middlewareData: import("@floating-ui/core").MiddlewareData;
|
|
29
|
+
isPositioned: boolean;
|
|
30
|
+
update: () => void;
|
|
31
|
+
floatingStyles: React.CSSProperties;
|
|
32
|
+
open: boolean;
|
|
33
|
+
onOpenChange: (open: boolean, event?: Event, reason?: import("@floating-ui/react").OpenChangeReason) => void;
|
|
34
|
+
events: import("@floating-ui/react").FloatingEvents;
|
|
35
|
+
dataRef: React.MutableRefObject<import("@floating-ui/react").ContextData>;
|
|
36
|
+
nodeId: string | undefined;
|
|
37
|
+
floatingId: string;
|
|
38
|
+
refs: import("@floating-ui/react").ExtendedRefs<Element>;
|
|
39
|
+
elements: import("@floating-ui/react").ExtendedElements<Element>;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=menu_common.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu_common.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu_common.tsx"],"names":[],"mappings":"AAOA,eAAO,MAAM,eAAe,2BAGzB;IACC,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,CAAC,SAAS,EAAE,OAAO,KAAK,IAAI,CAAA;CAC1C;;;;;;;;oBAkBymQ,MAAO,aAAa;;;kBAAiV,MAAO,gBAAgB;;;;;;;;;;;;;;;;wBAA5X,MAAO,aAAa;;;;iBAAukB,MAAO,gBAAgB;;;;;;CAD1tR,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { useFloating, offset, size, autoUpdate, } from '@floating-ui/react';
|
|
2
|
+
export const useFloatingMenu = ({ isOpen, setIsOpen, }) => useFloating({
|
|
3
|
+
placement: 'bottom-start',
|
|
4
|
+
open: isOpen,
|
|
5
|
+
onOpenChange: setIsOpen,
|
|
6
|
+
whileElementsMounted: autoUpdate,
|
|
7
|
+
middleware: [
|
|
8
|
+
offset(5),
|
|
9
|
+
size({
|
|
10
|
+
apply({ elements, availableHeight }) {
|
|
11
|
+
Object.assign(elements.floating.style, {
|
|
12
|
+
maxHeight: `${availableHeight}px`,
|
|
13
|
+
minHeight: '50px',
|
|
14
|
+
});
|
|
15
|
+
},
|
|
16
|
+
padding: 10,
|
|
17
|
+
}),
|
|
18
|
+
],
|
|
19
|
+
});
|
|
20
|
+
//# sourceMappingURL=menu_common.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu_common.jsx","sourceRoot":"","sources":["../../../../src/components/floating/menu_common.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,WAAW,EACX,MAAM,EACN,IAAI,EACJ,UAAU,GACb,MAAM,oBAAoB,CAAC;AAE5B,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC5B,MAAM,EACN,SAAS,GAIZ,EAAE,EAAE,CAAC,WAAW,CAAU;IACvB,SAAS,EAAE,cAAc;IACzB,IAAI,EAAE,MAAM;IACZ,YAAY,EAAE,SAAS;IACvB,oBAAoB,EAAE,UAAU;IAChC,UAAU,EAAE;QACR,MAAM,CAAC,CAAC,CAAC;QACT,IAAI,CAAC;YACD,KAAK,CAAC,EAAE,QAAQ,EAAE,eAAe,EAAE;gBAC/B,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,CAAC,KAAK,EAAE;oBACnC,SAAS,EAAE,GAAG,eAAe,IAAI;oBACjC,SAAS,EAAE,MAAM;iBACpB,CAAC,CAAC;YACP,CAAC;YACD,OAAO,EAAE,EAAE;SACd,CAAC;KACL;CACJ,CAAC,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type UseFloatingReturn, type ReferenceType } from '@floating-ui/react';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export type FloatingContext = Pick<UseFloatingReturn<ReferenceType>, 'context'>['context'];
|
|
4
|
+
/**
|
|
5
|
+
* Menu wrapper component
|
|
6
|
+
*/
|
|
7
|
+
export declare const ListMenuComponent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../box").BoxProps & React.RefAttributes<HTMLElement>>, any, {
|
|
8
|
+
p: "space8";
|
|
9
|
+
}, "p">;
|
|
10
|
+
interface SelectableListMenuItemProps {
|
|
11
|
+
$isActive?: boolean;
|
|
12
|
+
$isSelected?: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Menu item component
|
|
16
|
+
*/
|
|
17
|
+
export declare const ListMenuItemComponent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../box").BoxProps & React.RefAttributes<HTMLElement>>, any, {
|
|
18
|
+
px: "space8";
|
|
19
|
+
} & SelectableListMenuItemProps, "px">;
|
|
20
|
+
/**
|
|
21
|
+
* Menu base component WITHOUT dropdown icon
|
|
22
|
+
*/
|
|
23
|
+
export declare const PlainMenuBaseComponent: import("styled-components").StyledComponent<React.ForwardRefExoticComponent<import("../box").BoxProps & React.RefAttributes<HTMLElement>>, any, {}, never>;
|
|
24
|
+
/**
|
|
25
|
+
* Menu base component WITH dropdown icon
|
|
26
|
+
*/
|
|
27
|
+
export declare const DropdownMenuBaseComponent: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLElement>>;
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=menu_components.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu_components.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu_components.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,KAAK,iBAAiB,EACtB,KAAK,aAAa,EACrB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,KAAqB,MAAM,OAAO,CAAC;AAQ1C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,iBAAiB;;OAe7B,CAAC;AAEF,UAAU,2BAA2B;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB;;sCAgBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,4JAelC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,sFAUpC,CAAC"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
import { ChevronDown16 } from '@apify/icons';
|
|
4
|
+
import { theme } from '../../design_system/theme';
|
|
5
|
+
import { Box } from '../box';
|
|
6
|
+
/**
|
|
7
|
+
* Menu wrapper component
|
|
8
|
+
*/
|
|
9
|
+
export const ListMenuComponent = styled(Box).attrs({
|
|
10
|
+
p: 'space8',
|
|
11
|
+
}) `
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
max-height: 300px;
|
|
15
|
+
min-width: 160px;
|
|
16
|
+
box-shadow: ${theme.shadow.shadow2};
|
|
17
|
+
background: ${theme.color.neutral.background};
|
|
18
|
+
border: 1px solid ${theme.color.neutral.separatorSubtle};
|
|
19
|
+
border-radius: ${theme.radius.radius8};
|
|
20
|
+
scrollbar-color: ${theme.color.neutral.separatorSubtle} ${theme.color.neutral.background};
|
|
21
|
+
outline: none;
|
|
22
|
+
overflow-y: auto;
|
|
23
|
+
z-index: 10;
|
|
24
|
+
`;
|
|
25
|
+
/**
|
|
26
|
+
* Menu item component
|
|
27
|
+
*/
|
|
28
|
+
export const ListMenuItemComponent = styled(Box).attrs({
|
|
29
|
+
px: 'space8',
|
|
30
|
+
}) `
|
|
31
|
+
border-radius: ${theme.radius.radius8};
|
|
32
|
+
outline: none;
|
|
33
|
+
cursor: pointer;
|
|
34
|
+
white-space: nowrap;
|
|
35
|
+
|
|
36
|
+
${({ $isActive }) => $isActive && css `
|
|
37
|
+
background-color: ${theme.color.neutral.hover};
|
|
38
|
+
`}
|
|
39
|
+
|
|
40
|
+
${({ $isSelected }) => $isSelected && css `
|
|
41
|
+
background-color: ${theme.color.neutral.backgroundSubtle};
|
|
42
|
+
color: ${theme.color.primary.text};
|
|
43
|
+
`}
|
|
44
|
+
`;
|
|
45
|
+
/**
|
|
46
|
+
* Menu base component WITHOUT dropdown icon
|
|
47
|
+
*/
|
|
48
|
+
export const PlainMenuBaseComponent = styled(Box) `
|
|
49
|
+
display: flex;
|
|
50
|
+
align-items: center;
|
|
51
|
+
gap: ${theme.space.space4};
|
|
52
|
+
padding: ${theme.space.space8};
|
|
53
|
+
border-radius: ${theme.radius.radius8};
|
|
54
|
+
border: 1px solid ${theme.color.neutral.separatorSubtle};
|
|
55
|
+
background-color: ${theme.color.neutral.backgroundMuted};
|
|
56
|
+
|
|
57
|
+
cursor: pointer;
|
|
58
|
+
transition: background-color 0.2s ease-in-out;
|
|
59
|
+
|
|
60
|
+
&:hover {
|
|
61
|
+
background-color: ${theme.color.neutral.backgroundSubtle};
|
|
62
|
+
}
|
|
63
|
+
`;
|
|
64
|
+
/**
|
|
65
|
+
* Menu base component WITH dropdown icon
|
|
66
|
+
*/
|
|
67
|
+
export const DropdownMenuBaseComponent = forwardRef(({ children, ...props }, ref) => {
|
|
68
|
+
return (<PlainMenuBaseComponent {...props} ref={ref}>
|
|
69
|
+
{children}
|
|
70
|
+
<ChevronDown16 color={theme.color.neutral.icon}/>
|
|
71
|
+
</PlainMenuBaseComponent>);
|
|
72
|
+
});
|
|
73
|
+
//# sourceMappingURL=menu_components.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"menu_components.jsx","sourceRoot":"","sources":["../../../../src/components/floating/menu_components.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAE,MAAM,QAAQ,CAAC;AAI7B;;GAEG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;IAC/C,CAAC,EAAE,QAAQ;CACd,CAAC,CAAA;;;;;kBAKgB,KAAK,CAAC,MAAM,CAAC,OAAO;kBACpB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU;wBACxB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe;qBACtC,KAAK,CAAC,MAAM,CAAC,OAAO;uBAClB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe,IAAI,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU;;;;CAI3F,CAAC;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;IACnD,EAA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{ type BoxProps } from './box';
|
|
3
|
+
type ImageProps = {
|
|
4
|
+
src: string;
|
|
5
|
+
alt?: string;
|
|
6
|
+
width?: number;
|
|
7
|
+
height?: number;
|
|
8
|
+
loading?: 'eager' | 'lazy' | undefined;
|
|
9
|
+
};
|
|
10
|
+
export declare const Image: React.ForwardRefExoticComponent<ImageProps & Omit<BoxProps, "as"> & React.RefAttributes<HTMLImageElement>>;
|
|
11
|
+
export {};
|
|
12
|
+
//# sourceMappingURL=image.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAqB,MAAM,OAAO,CAAC;AAG1C,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3C,KAAK,UAAU,GAAG;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,SAAS,CAAC;CAC1C,CAAA;AAED,eAAO,MAAM,KAAK,4GAShB,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import { useSharedUiDependencies } from '../ui_dependency_provider';
|
|
3
|
+
import { Box } from './box';
|
|
4
|
+
export const Image = forwardRef((props, ref) => {
|
|
5
|
+
const { InternalImage } = useSharedUiDependencies();
|
|
6
|
+
return (<Box ref={ref} {...props} as={InternalImage}/>);
|
|
7
|
+
});
|
|
8
|
+
//# sourceMappingURL=image.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"image.jsx","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAE1C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAU3C,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAsD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAChG,MAAM,EAAE,aAAa,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACpD,OAAO,CACH,CAAC,GAAG,CACA,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,KAAK,CAAC,CACV,EAAE,CAAC,CAAC,aAAa,CAAC,EACpB,CACL,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './text';
|
|
2
|
+
export * from './box';
|
|
3
|
+
export * from './message';
|
|
4
|
+
export * from './floating';
|
|
5
|
+
export * from './button';
|
|
6
|
+
export * from './link';
|
|
7
|
+
export * from './action_link';
|
|
8
|
+
export * from './simple_markdown';
|
|
9
|
+
export * from './code';
|
|
10
|
+
export * from './color_wheel_gradient';
|
|
11
|
+
export * from './readme_renderer';
|
|
12
|
+
export * from './to_consolidate';
|
|
13
|
+
export * from './tile';
|
|
14
|
+
export * from './blog_article';
|
|
15
|
+
export * from './banner';
|
|
16
|
+
export * from './actor_template_card';
|
|
17
|
+
export * from './chip';
|
|
18
|
+
export * from './image';
|
|
19
|
+
export * from './badge';
|
|
20
|
+
export * from './tag';
|
|
21
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export * from './text';
|
|
2
|
+
export * from './box';
|
|
3
|
+
export * from './message';
|
|
4
|
+
export * from './floating';
|
|
5
|
+
export * from './button';
|
|
6
|
+
export * from './link';
|
|
7
|
+
export * from './action_link';
|
|
8
|
+
export * from './simple_markdown';
|
|
9
|
+
export * from './code';
|
|
10
|
+
export * from './color_wheel_gradient';
|
|
11
|
+
export * from './readme_renderer';
|
|
12
|
+
export * from './to_consolidate';
|
|
13
|
+
export * from './tile';
|
|
14
|
+
export * from './blog_article';
|
|
15
|
+
export * from './banner';
|
|
16
|
+
export * from './actor_template_card';
|
|
17
|
+
export * from './chip';
|
|
18
|
+
export * from './image';
|
|
19
|
+
export * from './badge';
|
|
20
|
+
export * from './tag';
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/components/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC;AACvB,cAAc,OAAO,CAAC;AACtB,cAAc,WAAW,CAAC;AAC1B,cAAc,YAAY,CAAC;AAC3B,cAAc,UAAU,CAAC;AACzB,cAAc,QAAQ,CAAC;AACvB,cAAc,eAAe,CAAC;AAC9B,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,wBAAwB,CAAC;AACvC,cAAc,mBAAmB,CAAC;AAClC,cAAc,kBAAkB,CAAC;AACjC,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,cAAc,uBAAuB,CAAC;AACtC,cAAc,QAAQ,CAAC;AACvB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,OAAO,CAAC"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Path } from 'history';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { type BoxProps } from './box';
|
|
4
|
+
export type To = string | Partial<Path>;
|
|
5
|
+
export interface RegularLinkProps {
|
|
6
|
+
to: To;
|
|
7
|
+
hideExternalIcon?: boolean;
|
|
8
|
+
showExternalIcon?: boolean;
|
|
9
|
+
rel?: string;
|
|
10
|
+
target?: string;
|
|
11
|
+
trackingId?: string;
|
|
12
|
+
trackingData?: object;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Checks if passed url is external
|
|
16
|
+
*/
|
|
17
|
+
export declare const isUrlExternal: (url: To, windowLocationHost: string) => boolean;
|
|
18
|
+
/**
|
|
19
|
+
* Checks if passed url is email
|
|
20
|
+
*/
|
|
21
|
+
export declare const isUrlEmail: (url: To) => boolean;
|
|
22
|
+
export type LinkProps = RegularLinkProps & BoxProps;
|
|
23
|
+
export declare const Link: React.ForwardRefExoticComponent<LinkProps & React.RefAttributes<HTMLElement>>;
|
|
24
|
+
//# sourceMappingURL=link.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../src/components/link.tsx"],"names":[],"mappings":"AACA,OAAO,EAAc,KAAK,IAAI,EAAE,MAAM,SAAS,CAAC;AAChD,OAAO,KAAqB,MAAM,OAAO,CAAC;AAO1C,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE3C,MAAM,MAAM,EAAE,GAAG,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;AACxC,MAAM,WAAW,gBAAgB;IAC7B,EAAE,EAAE,EAAE,CAAC;IACP,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,gBAAgB,CAAC,EAAE,OAAO,CAAC;IAC3B,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAGD;;GAEG;AACH,eAAO,MAAM,aAAa,QAAS,EAAE,sBAAsB,MAAM,YAIhE,CAAC;AAGF;;GAEG;AACH,eAAO,MAAM,UAAU,QAAS,EAAE,YAGjC,CAAC;AAsBF,MAAM,MAAM,SAAS,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEpD,eAAO,MAAM,IAAI,+EAkDf,CAAC"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import { createPath } from 'history';
|
|
3
|
+
import React, { forwardRef } from 'react';
|
|
4
|
+
import styled from 'styled-components';
|
|
5
|
+
import { ExternalLink16 } from '@apify/icons';
|
|
6
|
+
import { theme } from '../design_system/theme';
|
|
7
|
+
import { useSharedUiDependencies } from '../ui_dependency_provider';
|
|
8
|
+
import { Box } from './box';
|
|
9
|
+
// TODO: This function is copied from tools.client.js. We can remove it from there once this is deployed
|
|
10
|
+
/**
|
|
11
|
+
* Checks if passed url is external
|
|
12
|
+
*/
|
|
13
|
+
export const isUrlExternal = (url, windowLocationHost) => {
|
|
14
|
+
if (!url || typeof (url) !== 'string')
|
|
15
|
+
return false;
|
|
16
|
+
const domainMatch = url.match(/^https?:\/\/([^/?#]+)(?:[/?#]|$)/i);
|
|
17
|
+
return !!(domainMatch && domainMatch[1] !== windowLocationHost);
|
|
18
|
+
};
|
|
19
|
+
// TODO: This function is copied from tools.client.js. We can remove it from there once this is deployed
|
|
20
|
+
/**
|
|
21
|
+
* Checks if passed url is email
|
|
22
|
+
*/
|
|
23
|
+
export const isUrlEmail = (url) => {
|
|
24
|
+
if (!url || typeof (url) !== 'string')
|
|
25
|
+
return false;
|
|
26
|
+
return url.startsWith('mailto:');
|
|
27
|
+
};
|
|
28
|
+
const StyledLink = styled(Box) `
|
|
29
|
+
/* Basic positioning */
|
|
30
|
+
display: inline-flex;
|
|
31
|
+
align-items: center;
|
|
32
|
+
gap: ${theme.space.space4};
|
|
33
|
+
|
|
34
|
+
/* Default behavior */
|
|
35
|
+
text-decoration: none;
|
|
36
|
+
transition: color ${theme.transition.fastEaseInOut};
|
|
37
|
+
|
|
38
|
+
&:hover {
|
|
39
|
+
text-decoration: none;
|
|
40
|
+
color: ${theme.color.primary.actionHover};
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
&:active {
|
|
44
|
+
color: ${theme.color.primary.actionActive};
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
47
|
+
export const Link = forwardRef(({ to, children, rel, target, hideExternalIcon, showExternalIcon, onClick, trackingId, trackingData, ...rest }, ref) => {
|
|
48
|
+
const { windowLocationHost, isHrefTrusted, trackClick, InternalLink, } = useSharedUiDependencies();
|
|
49
|
+
const href = typeof (to) === 'string' ? to : createPath(to);
|
|
50
|
+
const isExternal = isUrlExternal(to, windowLocationHost);
|
|
51
|
+
const isEmail = isUrlEmail(to);
|
|
52
|
+
const isTrusted = isHrefTrusted(href);
|
|
53
|
+
const trackedOnClick = (e) => {
|
|
54
|
+
if (trackingId && trackClick)
|
|
55
|
+
trackClick(trackingId, trackingData);
|
|
56
|
+
if (onClick)
|
|
57
|
+
onClick(e);
|
|
58
|
+
};
|
|
59
|
+
const effectiveRel = clsx(rel, isExternal && 'external', (isExternal || target === '_blank') && 'noopener noreferrer', (isExternal && !isTrusted) && 'nofollow');
|
|
60
|
+
return (<StyledLink
|
|
61
|
+
// We use the InternalLink only for internal navigation
|
|
62
|
+
forwardedAs={(isEmail || isExternal) ? 'a' : InternalLink} href={href} rel={effectiveRel} target={target || (isExternal ? '_blank' : '_self')} onClick={trackedOnClick} ref={ref} {...rest}>
|
|
63
|
+
{children}
|
|
64
|
+
{((isExternal && !hideExternalIcon) || showExternalIcon) && <ExternalLink16 />}
|
|
65
|
+
</StyledLink>);
|
|
66
|
+
});
|
|
67
|
+
//# sourceMappingURL=link.jsx.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"link.jsx","sourceRoot":"","sources":["../../../src/components/link.tsx"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAa,MAAM,SAAS,CAAC;AAChD,OAAO,KAAK,EAAE,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAE9C,OAAO,EAAE,KAAK,EAAE,MAAM,wBAAwB,CAAC;AAC/C,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,EAAE,GAAG,EAAiB,MAAM,OAAO,CAAC;AAa3C,wGAAwG;AACxG;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAO,EAAE,kBAA0B,EAAE,EAAE;IACjE,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACpD,MAAM,WAAW,GAAG,GAAG,CAAC,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACnE,OAAO,CAAC,CAAC,CAAC,WAAW,IAAI,WAAW,CAAC,CAAC,CAAC,KAAK,kBAAkB,CAAC,CAAC;AACpE,CAAC,CAAC;AAEF,wGAAwG;AACxG;;GAEG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,CAAC,GAAO,EAAE,EAAE;IAClC,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IACpD,OAAO,GAAG,CAAC,UAAU,CAA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qBAAqB,EAC5D,CAAC,UAAU,IAAI,CAAC,SAAS,CAAC,IAAI,UAAU,CAC3C,CAAC;IAEF,OAAO,CACH,CAAC,UAAU;IACP,uDAAuD;IACvD,WAAW,CAAC,CAAC,CAAC,OAAO,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,YAAY,CAAC,CAC1D,IAAI,CAAC,CAAC,IAAI,CAAC,CACX,GAAG,CAAC,CAAC,YAAY,CAAC,CAClB,MAAM,CAAC,CAAC,MAAM,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CACpD,OAAO,CAAC,CAAC,cAAc,CAAC,CACxB,GAAG,CAAC,CAAC,GAAG,CAAC,CACT,IAAI,IAAI,CAAC,CAET;YAAA,CAAC,QAAQ,CACT;YAAA,CAAC,CAAC,CAAC,UAAU,IAAI,CAAC,gBAAgB,CAAC,IAAI,gBAAgB,CAAC,IAAI,CAAC,cAAc,CAAC,AAAD,EAAG,CAClF;QAAA,EAAE,UAAU,CAAC,CAChB,CAAC;AACN,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { type BoxProps } from './box';
|
|
3
|
+
export declare const messageClassNames: {
|
|
4
|
+
main: string;
|
|
5
|
+
icon: string;
|
|
6
|
+
content: string;
|
|
7
|
+
caption: string;
|
|
8
|
+
dismiss: string;
|
|
9
|
+
};
|
|
10
|
+
export type MessageType = 'info' | 'warning' | 'success' | 'danger';
|
|
11
|
+
type MessageProps = BoxProps & {
|
|
12
|
+
type: MessageType;
|
|
13
|
+
caption?: string;
|
|
14
|
+
icon?: React.ElementType;
|
|
15
|
+
onDismissClick?: () => void;
|
|
16
|
+
borderless?: boolean;
|
|
17
|
+
boxless?: boolean;
|
|
18
|
+
as?: React.ElementType;
|
|
19
|
+
dismissTrackingId?: string;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* Component used to display larger messages that are part of the content of the application.
|
|
23
|
+
*/
|
|
24
|
+
export declare const Message: React.FC<MessageProps>;
|
|
25
|
+
type SpecificMessageProps = Omit<MessageProps, 'type'>;
|
|
26
|
+
export declare const InfoMessage: (props: SpecificMessageProps) => React.JSX.Element;
|
|
27
|
+
export declare const WarningMessage: (props: SpecificMessageProps) => React.JSX.Element;
|
|
28
|
+
export declare const SuccessMessage: (props: SpecificMessageProps) => React.JSX.Element;
|
|
29
|
+
export declare const DangerMessage: (props: SpecificMessageProps) => React.JSX.Element;
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=message.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAC;AAW1B,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,OAAO,CAAC;AAI3C,eAAO,MAAM,iBAAiB;;;;;;CAM7B,CAAC;AAgEF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AASpE,KAAK,YAAY,GAAG,QAAQ,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACzB,cAAc,CAAC,EAAE,MAAM,IAAI,CAAC;IAC5B,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,EAAE,CAAC,EAAE,KAAK,CAAC,WAAW,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAwC1C,CAAC;AAEF,KAAK,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,UAAW,oBAAoB,sBAAyC,CAAC;AACjG,eAAO,MAAM,cAAc,UAAW,oBAAoB,sBAA4C,CAAC;AACvG,eAAO,MAAM,cAAc,UAAW,oBAAoB,sBAA4C,CAAC;AACvG,eAAO,MAAM,aAAa,UAAW,oBAAoB,sBAA2C,CAAC"}
|