@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,52 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled, { css } from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import type { WithTransientProps } from '../../type_utils';
|
|
5
|
+
import type { BoxProps } from '../box';
|
|
6
|
+
import { Box } from '../box';
|
|
7
|
+
|
|
8
|
+
export interface TransientTextBaseProps {
|
|
9
|
+
italic?: boolean
|
|
10
|
+
uppercase?: boolean
|
|
11
|
+
align?: 'left' | 'right' | 'center'
|
|
12
|
+
color?: string,
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
export type StyledTextBaseProps = WithTransientProps<TransientTextBaseProps>;
|
|
16
|
+
export type TextBaseProps = TransientTextBaseProps & BoxProps;
|
|
17
|
+
|
|
18
|
+
const StyledText = styled(Box)<StyledTextBaseProps>`
|
|
19
|
+
${(props) => props.$italic && css`
|
|
20
|
+
font-style: italic;
|
|
21
|
+
`}
|
|
22
|
+
|
|
23
|
+
${(props) => props.$uppercase && css`
|
|
24
|
+
text-transform: uppercase;
|
|
25
|
+
`}
|
|
26
|
+
|
|
27
|
+
${(props) => props.$align && css`
|
|
28
|
+
text-align: ${props.$align};
|
|
29
|
+
`}
|
|
30
|
+
|
|
31
|
+
${(props) => props.$color && css`
|
|
32
|
+
color: ${props.$color};
|
|
33
|
+
`}
|
|
34
|
+
`;
|
|
35
|
+
|
|
36
|
+
export const TextBaseComponent: React.FC<TextBaseProps> = ({
|
|
37
|
+
italic,
|
|
38
|
+
align,
|
|
39
|
+
color,
|
|
40
|
+
uppercase,
|
|
41
|
+
as,
|
|
42
|
+
...rest
|
|
43
|
+
}) => (
|
|
44
|
+
<StyledText
|
|
45
|
+
$italic={italic}
|
|
46
|
+
$align={align}
|
|
47
|
+
$color={color}
|
|
48
|
+
$uppercase={uppercase}
|
|
49
|
+
forwardedAs={as}
|
|
50
|
+
{...rest}
|
|
51
|
+
/>
|
|
52
|
+
);
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { theme } from '../../design_system/theme';
|
|
6
|
+
import type { WithTransientProps } from '../../type_utils';
|
|
7
|
+
import type { TextBaseProps } from './text_base';
|
|
8
|
+
import { TextBaseComponent } from './text_base';
|
|
9
|
+
|
|
10
|
+
export type ContentTextType = 'paragraph' | 'snippet';
|
|
11
|
+
export type ContentTextWeight = 'normal' | 'bold';
|
|
12
|
+
|
|
13
|
+
export interface TransientContentTextProps {
|
|
14
|
+
type?: ContentTextType,
|
|
15
|
+
weight?: ContentTextWeight,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type StyledContentTextProps = WithTransientProps<TransientContentTextProps>;
|
|
19
|
+
export type ContentTextProps = TransientContentTextProps & TextBaseProps;
|
|
20
|
+
|
|
21
|
+
type TextContentVariants = {
|
|
22
|
+
[Type in ContentTextType]: {
|
|
23
|
+
[Weight in ContentTextWeight]: FlattenSimpleInterpolation;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const TEXT_SHARED_VARIANTS_CSS: TextContentVariants = {
|
|
28
|
+
paragraph: {
|
|
29
|
+
normal: css`
|
|
30
|
+
${theme.typography.content.mobile.paragraph}
|
|
31
|
+
|
|
32
|
+
@media (min-width: ${theme.layout.tablet}) {
|
|
33
|
+
${theme.typography.content.tablet.paragraph}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (min-width: ${theme.layout.desktop}) {
|
|
37
|
+
${theme.typography.content.desktop.paragraph}
|
|
38
|
+
}
|
|
39
|
+
`,
|
|
40
|
+
bold: css`
|
|
41
|
+
${theme.typography.content.mobile.paragraphStrong}
|
|
42
|
+
|
|
43
|
+
@media (min-width: ${theme.layout.tablet}) {
|
|
44
|
+
${theme.typography.content.tablet.paragraphStrong}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (min-width: ${theme.layout.desktop}) {
|
|
48
|
+
${theme.typography.content.desktop.paragraphStrong}
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
},
|
|
52
|
+
snippet: {
|
|
53
|
+
normal: css`
|
|
54
|
+
${theme.typography.content.mobile.snippet}
|
|
55
|
+
|
|
56
|
+
@media (min-width: ${theme.layout.tablet}) {
|
|
57
|
+
${theme.typography.content.tablet.snippet}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (min-width: ${theme.layout.desktop}) {
|
|
61
|
+
${theme.typography.content.desktop.snippet}
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
bold: css`
|
|
65
|
+
${theme.typography.content.mobile.snippetStrong}
|
|
66
|
+
|
|
67
|
+
@media (min-width: ${theme.layout.tablet}) {
|
|
68
|
+
${theme.typography.content.tablet.snippetStrong}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (min-width: ${theme.layout.desktop}) {
|
|
72
|
+
${theme.typography.content.desktop.snippetStrong}
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
},
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
const StyledTextContent = styled(TextBaseComponent)<StyledContentTextProps>`
|
|
79
|
+
${(props) => TEXT_SHARED_VARIANTS_CSS[props.$type || 'paragraph'][props.$weight || 'normal']}
|
|
80
|
+
`;
|
|
81
|
+
|
|
82
|
+
export const TextContent = forwardRef<HTMLElement | undefined, ContentTextProps>(({
|
|
83
|
+
type,
|
|
84
|
+
weight,
|
|
85
|
+
as,
|
|
86
|
+
...rest
|
|
87
|
+
}, ref) => {
|
|
88
|
+
return (
|
|
89
|
+
<StyledTextContent
|
|
90
|
+
$type={type}
|
|
91
|
+
$weight={weight}
|
|
92
|
+
forwardedAs={as || 'p'}
|
|
93
|
+
ref={ref}
|
|
94
|
+
// We have global CSS file that defines margins for p and h to some 'normalized' value
|
|
95
|
+
// But at the same time we want to have default margin set to 0 for Text and Headings
|
|
96
|
+
// In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
|
|
97
|
+
// Until then we have to set default 0 margin here
|
|
98
|
+
m='none'
|
|
99
|
+
{...rest}
|
|
100
|
+
/>
|
|
101
|
+
);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
TextContent.displayName = 'TextContent';
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import type { FlattenSimpleInterpolation } from 'styled-components';
|
|
3
|
+
import styled, { css } from 'styled-components';
|
|
4
|
+
|
|
5
|
+
import { theme } from '../../design_system/theme';
|
|
6
|
+
import type { WithTransientProps } from '../../type_utils';
|
|
7
|
+
import type { TextBaseProps } from './text_base';
|
|
8
|
+
import { TextBaseComponent } from './text_base';
|
|
9
|
+
|
|
10
|
+
export type MarketingTextSize = 'large' | 'regular' | 'small' | 'extraSmall';
|
|
11
|
+
export type MarketingTextWeight = 'normal' | 'bold';
|
|
12
|
+
|
|
13
|
+
export interface TransientMarketingTextProps {
|
|
14
|
+
size?: MarketingTextSize,
|
|
15
|
+
weight?: MarketingTextWeight,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
type StyledMarketingTextProps = WithTransientProps<TransientMarketingTextProps>;
|
|
19
|
+
export type MarketingTextProps = TransientMarketingTextProps & TextBaseProps;
|
|
20
|
+
|
|
21
|
+
type TextMarketingVariants = {
|
|
22
|
+
[Size in MarketingTextSize]: {
|
|
23
|
+
[Weight in MarketingTextWeight]: FlattenSimpleInterpolation;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const TEXT_MARKETING_VARIANTS_CSS: TextMarketingVariants = {
|
|
28
|
+
large: {
|
|
29
|
+
normal: css`
|
|
30
|
+
${theme.typography.marketing.mobile.bodyL}
|
|
31
|
+
|
|
32
|
+
@media (${theme.device.tablet}) {
|
|
33
|
+
${theme.typography.marketing.tablet.bodyL}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
@media (${theme.device.desktop}) {
|
|
37
|
+
${theme.typography.marketing.desktop.bodyL}
|
|
38
|
+
}
|
|
39
|
+
`,
|
|
40
|
+
bold: css`
|
|
41
|
+
${theme.typography.marketing.mobile.bodyLStrong}
|
|
42
|
+
|
|
43
|
+
@media (${theme.device.tablet}) {
|
|
44
|
+
${theme.typography.marketing.tablet.bodyLStrong}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (${theme.device.desktop}) {
|
|
48
|
+
${theme.typography.marketing.desktop.bodyLStrong}
|
|
49
|
+
}
|
|
50
|
+
`,
|
|
51
|
+
},
|
|
52
|
+
regular: {
|
|
53
|
+
normal: css`
|
|
54
|
+
${theme.typography.marketing.mobile.bodyM}
|
|
55
|
+
|
|
56
|
+
@media (${theme.device.tablet}) {
|
|
57
|
+
${theme.typography.marketing.tablet.bodyM}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
@media (${theme.device.desktop}) {
|
|
61
|
+
${theme.typography.marketing.desktop.bodyM}
|
|
62
|
+
}
|
|
63
|
+
`,
|
|
64
|
+
bold: css`
|
|
65
|
+
${theme.typography.marketing.mobile.bodyMStrong}
|
|
66
|
+
|
|
67
|
+
@media (${theme.device.tablet}) {
|
|
68
|
+
${theme.typography.marketing.tablet.bodyMStrong}
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
@media (${theme.device.desktop}) {
|
|
72
|
+
${theme.typography.marketing.desktop.bodyMStrong}
|
|
73
|
+
}
|
|
74
|
+
`,
|
|
75
|
+
},
|
|
76
|
+
small: {
|
|
77
|
+
normal: css`
|
|
78
|
+
${theme.typography.marketing.mobile.bodyS}
|
|
79
|
+
|
|
80
|
+
@media (${theme.device.tablet}) {
|
|
81
|
+
${theme.typography.marketing.tablet.bodyS}
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
@media (${theme.device.desktop}) {
|
|
85
|
+
${theme.typography.marketing.desktop.bodyS}
|
|
86
|
+
}
|
|
87
|
+
`,
|
|
88
|
+
bold: css`
|
|
89
|
+
${theme.typography.marketing.mobile.bodySStrong}
|
|
90
|
+
|
|
91
|
+
@media (${theme.device.tablet}) {
|
|
92
|
+
${theme.typography.marketing.tablet.bodySStrong}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@media (${theme.device.desktop}) {
|
|
96
|
+
${theme.typography.marketing.desktop.bodySStrong}
|
|
97
|
+
}
|
|
98
|
+
`,
|
|
99
|
+
},
|
|
100
|
+
extraSmall: {
|
|
101
|
+
normal: css`
|
|
102
|
+
${theme.typography.marketing.mobile.bodyXs}
|
|
103
|
+
|
|
104
|
+
@media (${theme.device.tablet}) {
|
|
105
|
+
${theme.typography.marketing.tablet.bodyXs}
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (${theme.device.desktop}) {
|
|
109
|
+
${theme.typography.marketing.desktop.bodyXs}
|
|
110
|
+
}
|
|
111
|
+
`,
|
|
112
|
+
bold: css`
|
|
113
|
+
${theme.typography.marketing.mobile.bodyXsStrong}
|
|
114
|
+
|
|
115
|
+
@media (${theme.device.tablet}) {
|
|
116
|
+
${theme.typography.marketing.tablet.bodyXsStrong}
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
@media (${theme.device.desktop}) {
|
|
120
|
+
${theme.typography.marketing.desktop.bodyXsStrong}
|
|
121
|
+
}
|
|
122
|
+
`,
|
|
123
|
+
},
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
const StyledTextMarketing = styled(TextBaseComponent)<StyledMarketingTextProps>`
|
|
127
|
+
${(props) => TEXT_MARKETING_VARIANTS_CSS[props.$size || 'regular'][props.$weight || 'normal']}
|
|
128
|
+
`;
|
|
129
|
+
|
|
130
|
+
export const TextMarketing = forwardRef<HTMLElement | undefined, MarketingTextProps>(({
|
|
131
|
+
weight,
|
|
132
|
+
size,
|
|
133
|
+
as,
|
|
134
|
+
...rest
|
|
135
|
+
}, ref) => {
|
|
136
|
+
return (
|
|
137
|
+
<StyledTextMarketing
|
|
138
|
+
$weight={weight}
|
|
139
|
+
$size={size}
|
|
140
|
+
forwardedAs={as || 'p'}
|
|
141
|
+
ref={ref}
|
|
142
|
+
// We have global CSS file that defines margins for p and h to some 'normalized' value
|
|
143
|
+
// But at the same time we want to have default margin set to 0 for Text and Headings
|
|
144
|
+
// In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
|
|
145
|
+
// Until then we have to set default 0 margin here
|
|
146
|
+
m='none'
|
|
147
|
+
{...rest}
|
|
148
|
+
/>
|
|
149
|
+
);
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
TextMarketing.displayName = 'TextMarketing';
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import React, { forwardRef } from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { theme } from '../../design_system/theme';
|
|
5
|
+
import type { WithTransientProps } from '../../type_utils';
|
|
6
|
+
import type { TextBaseProps } from './text_base';
|
|
7
|
+
import { TextBaseComponent } from './text_base';
|
|
8
|
+
|
|
9
|
+
export type SharedTextType = 'body' | 'code';
|
|
10
|
+
export type SharedTextSize = 'regular' | 'small' | 'big';
|
|
11
|
+
export type SharedTextWeight = 'normal' | 'medium' | 'bold';
|
|
12
|
+
|
|
13
|
+
export interface TransientSharedTextProps {
|
|
14
|
+
type?: SharedTextType,
|
|
15
|
+
size?: SharedTextSize,
|
|
16
|
+
weight?: SharedTextWeight,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
type StyledSharedTextProps = WithTransientProps<TransientSharedTextProps>;
|
|
20
|
+
export type SharedTextProps = TransientSharedTextProps & TextBaseProps;
|
|
21
|
+
|
|
22
|
+
type TextSharedVariants = {
|
|
23
|
+
[Type in SharedTextType]: {
|
|
24
|
+
[Size in SharedTextSize]: {
|
|
25
|
+
[Weight in SharedTextWeight]: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const TEXT_SHARED_VARIANTS_CSS: TextSharedVariants = {
|
|
31
|
+
body: {
|
|
32
|
+
regular: {
|
|
33
|
+
normal: theme.typography.shared.tablet.bodyM,
|
|
34
|
+
medium: theme.typography.shared.tablet.bodyMMedium,
|
|
35
|
+
bold: theme.typography.shared.tablet.bodyMStrong,
|
|
36
|
+
},
|
|
37
|
+
small: {
|
|
38
|
+
normal: theme.typography.shared.tablet.bodyS,
|
|
39
|
+
medium: theme.typography.shared.tablet.bodySMedium,
|
|
40
|
+
bold: theme.typography.shared.tablet.bodySStrong,
|
|
41
|
+
},
|
|
42
|
+
big: {
|
|
43
|
+
normal: theme.typography.shared.tablet.bodyL,
|
|
44
|
+
medium: theme.typography.shared.tablet.bodyLMedium,
|
|
45
|
+
bold: theme.typography.shared.tablet.bodyLStrong,
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
code: {
|
|
49
|
+
regular: {
|
|
50
|
+
normal: theme.typography.shared.tablet.codeM,
|
|
51
|
+
medium: theme.typography.shared.tablet.codeMMedium,
|
|
52
|
+
bold: theme.typography.shared.tablet.codeMStrong,
|
|
53
|
+
},
|
|
54
|
+
small: {
|
|
55
|
+
normal: theme.typography.shared.tablet.codeS,
|
|
56
|
+
medium: theme.typography.shared.tablet.codeSMedium,
|
|
57
|
+
bold: theme.typography.shared.tablet.codeSStrong,
|
|
58
|
+
},
|
|
59
|
+
big: {
|
|
60
|
+
normal: theme.typography.shared.tablet.codeL,
|
|
61
|
+
medium: theme.typography.shared.tablet.codeLMedium,
|
|
62
|
+
bold: theme.typography.shared.tablet.codeLStrong,
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
const StyledTextShared = styled(TextBaseComponent)<StyledSharedTextProps>`
|
|
68
|
+
${(props) => TEXT_SHARED_VARIANTS_CSS[props.$type || 'body'][props.$size || 'regular'][props.$weight || 'normal']}
|
|
69
|
+
`;
|
|
70
|
+
|
|
71
|
+
const TextShared = forwardRef<HTMLElement | undefined, SharedTextProps>(({
|
|
72
|
+
type,
|
|
73
|
+
size,
|
|
74
|
+
weight,
|
|
75
|
+
as,
|
|
76
|
+
...rest
|
|
77
|
+
}, ref) => {
|
|
78
|
+
return (
|
|
79
|
+
<StyledTextShared
|
|
80
|
+
$type={type}
|
|
81
|
+
$size={size}
|
|
82
|
+
$weight={weight}
|
|
83
|
+
forwardedAs={as || 'p'}
|
|
84
|
+
ref={ref}
|
|
85
|
+
// We have global CSS file that defines margins for p and h to some 'normalized' value
|
|
86
|
+
// But at the same time we want to have default margin set to 0 for Text and Headings
|
|
87
|
+
// In perfect world, all texts would be rendered using Text/Heading components and we could have 0 margin set globally
|
|
88
|
+
// Until then we have to set default 0 margin here
|
|
89
|
+
m='none'
|
|
90
|
+
{...rest}
|
|
91
|
+
/>
|
|
92
|
+
);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
TextShared.displayName = 'TextShared';
|
|
96
|
+
export default TextShared;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { theme } from '../../design_system/theme';
|
|
5
|
+
import type {
|
|
6
|
+
TileSharedProps,
|
|
7
|
+
TileSizesType } from './shared';
|
|
8
|
+
import {
|
|
9
|
+
TILE_SIZES,
|
|
10
|
+
tileStyle,
|
|
11
|
+
} from './shared';
|
|
12
|
+
|
|
13
|
+
interface HorizontalTileProps extends TileSharedProps {
|
|
14
|
+
icon?: React.ReactNode;
|
|
15
|
+
action?: React.ReactNode;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface StyledTileWrapperProps {
|
|
19
|
+
$hasIcon?: boolean;
|
|
20
|
+
$size?: TileSizesType;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const WrapperClasses = {
|
|
24
|
+
TILE_CONTENT: 'Tile-Content',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const StyledTileWrapper = styled.div<StyledTileWrapperProps>`
|
|
28
|
+
${tileStyle}
|
|
29
|
+
padding: ${({ $size }) => ($size === TILE_SIZES.SMALL ? theme.space.space16 : theme.space.space24)};
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: row;
|
|
32
|
+
align-items: center;
|
|
33
|
+
|
|
34
|
+
cursor: pointer;
|
|
35
|
+
transition: box-shadow ${theme.transition.smoothEaseOut},
|
|
36
|
+
background-color ${theme.transition.smoothEaseOut},
|
|
37
|
+
border-color ${theme.transition.smoothEaseOut};
|
|
38
|
+
|
|
39
|
+
&:hover {
|
|
40
|
+
box-shadow: ${theme.shadow.shadow1};
|
|
41
|
+
background-color: ${theme.color.neutral.hover};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
&:active,
|
|
45
|
+
&:focus {
|
|
46
|
+
border-color: ${theme.color.primary.action};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
${({ $hasIcon }) => $hasIcon && `gap: ${theme.space.space8};`}
|
|
50
|
+
|
|
51
|
+
.${WrapperClasses.TILE_CONTENT} {
|
|
52
|
+
flex-grow: 1;
|
|
53
|
+
}
|
|
54
|
+
`;
|
|
55
|
+
|
|
56
|
+
export const HorizontalTile: React.FC<HorizontalTileProps> = ({
|
|
57
|
+
content,
|
|
58
|
+
icon,
|
|
59
|
+
action,
|
|
60
|
+
size = TILE_SIZES.SMALL,
|
|
61
|
+
onClick,
|
|
62
|
+
...otherProps
|
|
63
|
+
}) => {
|
|
64
|
+
return (
|
|
65
|
+
<StyledTileWrapper
|
|
66
|
+
$hasIcon={!!icon}
|
|
67
|
+
$size={size}
|
|
68
|
+
onClick={onClick}
|
|
69
|
+
{...otherProps}
|
|
70
|
+
>
|
|
71
|
+
<div>{icon}</div>
|
|
72
|
+
<div className={WrapperClasses.TILE_CONTENT}>{content}</div>
|
|
73
|
+
<div>{action}</div>
|
|
74
|
+
</StyledTileWrapper>
|
|
75
|
+
);
|
|
76
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { css } from 'styled-components';
|
|
2
|
+
|
|
3
|
+
import { theme } from '../../design_system/theme';
|
|
4
|
+
|
|
5
|
+
export const TILE_SIZES = {
|
|
6
|
+
SMALL: 'S',
|
|
7
|
+
LARGE: 'L',
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export type TileSizesType = typeof TILE_SIZES[keyof typeof TILE_SIZES];
|
|
11
|
+
|
|
12
|
+
export const tileStyle = css`
|
|
13
|
+
background-color: ${theme.color.neutral.background};
|
|
14
|
+
border: 1px solid ${theme.color.neutral.border};
|
|
15
|
+
border-radius: ${theme.radius.radius12};
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
export type TileSharedProps = {
|
|
19
|
+
content: React.ReactNode,
|
|
20
|
+
size?: TileSizesType,
|
|
21
|
+
isClickable?: boolean,
|
|
22
|
+
onClick?: () => void,
|
|
23
|
+
id?: string;
|
|
24
|
+
className?: string;
|
|
25
|
+
style?: React.CSSProperties;
|
|
26
|
+
as?: React.ElementType;
|
|
27
|
+
};
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import styled from 'styled-components';
|
|
3
|
+
|
|
4
|
+
import { theme } from '../../design_system/theme';
|
|
5
|
+
import type {
|
|
6
|
+
TileSharedProps,
|
|
7
|
+
TileSizesType } from './shared';
|
|
8
|
+
import {
|
|
9
|
+
TILE_SIZES,
|
|
10
|
+
tileStyle,
|
|
11
|
+
} from './shared';
|
|
12
|
+
|
|
13
|
+
interface HorizontalTileProps extends TileSharedProps {
|
|
14
|
+
content: React.ReactNode;
|
|
15
|
+
icon?: React.ReactNode;
|
|
16
|
+
action?: React.ReactNode;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
interface StyledTileWrapperProps {
|
|
20
|
+
$size?: TileSizesType;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const WrapperClasses = {
|
|
24
|
+
TILE_CONTENT: 'Tile-Content',
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
const StyledTileWrapper = styled.div<StyledTileWrapperProps>`
|
|
28
|
+
${tileStyle}
|
|
29
|
+
padding: ${({ $size }) => ($size === TILE_SIZES.SMALL ? theme.space.space16 : theme.space.space24)};
|
|
30
|
+
width: 100%;
|
|
31
|
+
cursor: pointer;
|
|
32
|
+
transition: box-shadow ${theme.transition.smoothEaseOut},
|
|
33
|
+
background-color ${theme.transition.smoothEaseOut},
|
|
34
|
+
border-color ${theme.transition.smoothEaseOut};
|
|
35
|
+
|
|
36
|
+
&:hover {
|
|
37
|
+
box-shadow: ${theme.shadow.shadow1};
|
|
38
|
+
background-color: ${theme.color.neutral.hover};
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
&:active,
|
|
42
|
+
&:focus {
|
|
43
|
+
border-color: ${theme.color.primary.action};
|
|
44
|
+
}
|
|
45
|
+
`;
|
|
46
|
+
|
|
47
|
+
export const VerticalTile: React.FC<HorizontalTileProps> = ({
|
|
48
|
+
content,
|
|
49
|
+
size = TILE_SIZES.LARGE,
|
|
50
|
+
onClick,
|
|
51
|
+
...otherProps
|
|
52
|
+
}) => {
|
|
53
|
+
return (
|
|
54
|
+
<StyledTileWrapper $size={size} onClick={onClick} {...otherProps}>
|
|
55
|
+
<div className={WrapperClasses.TILE_CONTENT}>{content}</div>
|
|
56
|
+
</StyledTileWrapper>
|
|
57
|
+
);
|
|
58
|
+
};
|