@apify/ui-library 1.138.0 → 1.138.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/src/components/action_link.d.ts.map +1 -1
- package/dist/src/components/action_link.js +3 -3
- package/dist/src/components/action_link.js.map +1 -1
- package/dist/src/components/actor_template_card.d.ts.map +1 -1
- package/dist/src/components/actor_template_card.js +3 -3
- package/dist/src/components/actor_template_card.js.map +1 -1
- package/dist/src/components/avatar/actor_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/actor_avatar.js +3 -3
- package/dist/src/components/avatar/actor_avatar.js.map +1 -1
- package/dist/src/components/avatar/boring_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/boring_avatar.js +8 -7
- package/dist/src/components/avatar/boring_avatar.js.map +1 -1
- package/dist/src/components/avatar/user_avatar.d.ts.map +1 -1
- package/dist/src/components/avatar/user_avatar.js +1 -1
- package/dist/src/components/avatar/user_avatar.js.map +1 -1
- package/dist/src/components/badge.d.ts.map +1 -1
- package/dist/src/components/badge.js +10 -3
- package/dist/src/components/badge.js.map +1 -1
- package/dist/src/components/banner.d.ts.map +1 -1
- package/dist/src/components/banner.js +4 -3
- package/dist/src/components/banner.js.map +1 -1
- package/dist/src/components/blog_article.d.ts.map +1 -1
- package/dist/src/components/blog_article.js +2 -3
- package/dist/src/components/blog_article.js.map +1 -1
- package/dist/src/components/box.d.ts.map +1 -1
- package/dist/src/components/box.js +32 -24
- package/dist/src/components/box.js.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.d.ts.map +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.js +1 -1
- package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
- package/dist/src/components/button.d.ts.map +1 -1
- package/dist/src/components/button.js +12 -9
- package/dist/src/components/button.js.map +1 -1
- package/dist/src/components/card_container.d.ts.map +1 -1
- package/dist/src/components/card_container.js +5 -3
- package/dist/src/components/card_container.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.js +1 -1
- package/dist/src/components/checkbox/checkbox.js.map +1 -1
- package/dist/src/components/checkbox/checkbox.style.d.ts.map +1 -1
- package/dist/src/components/checkbox/checkbox.style.js +7 -4
- package/dist/src/components/checkbox/checkbox.style.js.map +1 -1
- package/dist/src/components/chip.d.ts.map +1 -1
- package/dist/src/components/chip.js +1 -1
- package/dist/src/components/chip.js.map +1 -1
- package/dist/src/components/code/action_button.d.ts.map +1 -1
- package/dist/src/components/code/action_button.js +5 -5
- package/dist/src/components/code/action_button.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.js +19 -8
- package/dist/src/components/code/code_block/code_block.js.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block.styled.js +18 -15
- package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
- package/dist/src/components/code/code_block/code_block_with_tabs.js +10 -8
- package/dist/src/components/code/code_block/code_block_with_tabs.js.map +1 -1
- package/dist/src/components/code/code_block/utils.d.ts.map +1 -1
- package/dist/src/components/code/code_block/utils.js.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
- package/dist/src/components/code/inline_code/inline_code.js +2 -2
- package/dist/src/components/code/inline_code/inline_code.js.map +1 -1
- package/dist/src/components/code/one_light_theme.d.ts.map +1 -1
- package/dist/src/components/code/one_light_theme.js +2 -17
- package/dist/src/components/code/one_light_theme.js.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
- package/dist/src/components/code/one_line_code/one_line_code.js +11 -14
- package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
- package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
- package/dist/src/components/code/prism_highlighter.js +35 -27
- package/dist/src/components/code/prism_highlighter.js.map +1 -1
- package/dist/src/components/code/prism_python.js.map +1 -1
- package/dist/src/components/collapsible_card/collapsible_card.d.ts.map +1 -1
- package/dist/src/components/collapsible_card/collapsible_card.js +7 -6
- package/dist/src/components/collapsible_card/collapsible_card.js.map +1 -1
- package/dist/src/components/color_wheel_gradient.d.ts.map +1 -1
- package/dist/src/components/color_wheel_gradient.js +4 -2
- package/dist/src/components/color_wheel_gradient.js.map +1 -1
- package/dist/src/components/floating/floating_component_base.d.ts +1 -1
- package/dist/src/components/floating/floating_component_base.d.ts.map +1 -1
- package/dist/src/components/floating/floating_component_base.js +3 -5
- package/dist/src/components/floating/floating_component_base.js.map +1 -1
- package/dist/src/components/floating/menu.d.ts.map +1 -1
- package/dist/src/components/floating/menu.js +11 -5
- package/dist/src/components/floating/menu.js.map +1 -1
- package/dist/src/components/floating/menu_common.d.ts +4 -4
- package/dist/src/components/floating/menu_common.d.ts.map +1 -1
- package/dist/src/components/floating/menu_common.js +1 -1
- package/dist/src/components/floating/menu_common.js.map +1 -1
- package/dist/src/components/floating/menu_components.d.ts.map +1 -1
- package/dist/src/components/floating/menu_components.js +9 -7
- package/dist/src/components/floating/menu_components.js.map +1 -1
- package/dist/src/components/floating/tooltip.d.ts +2 -2
- package/dist/src/components/floating/tooltip.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip.js +10 -9
- package/dist/src/components/floating/tooltip.js.map +1 -1
- package/dist/src/components/floating/tooltip_content.d.ts.map +1 -1
- package/dist/src/components/floating/tooltip_content.js +3 -3
- package/dist/src/components/floating/tooltip_content.js.map +1 -1
- package/dist/src/components/icon_button.d.ts.map +1 -1
- package/dist/src/components/icon_button.js +10 -8
- package/dist/src/components/icon_button.js.map +1 -1
- package/dist/src/components/image.d.ts.map +1 -1
- package/dist/src/components/image.js +1 -1
- package/dist/src/components/image.js.map +1 -1
- package/dist/src/components/link.d.ts.map +1 -1
- package/dist/src/components/link.js +5 -5
- package/dist/src/components/link.js.map +1 -1
- package/dist/src/components/message.d.ts.map +1 -1
- package/dist/src/components/message.js +21 -21
- package/dist/src/components/message.js.map +1 -1
- package/dist/src/components/rating.d.ts.map +1 -1
- package/dist/src/components/rating.js +5 -6
- package/dist/src/components/rating.js.map +1 -1
- package/dist/src/components/readme_renderer/pythonize_value.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/pythonize_value.js +10 -6
- package/dist/src/components/readme_renderer/pythonize_value.js.map +1 -1
- package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/table_of_contents.js +16 -15
- package/dist/src/components/readme_renderer/table_of_contents.js.map +1 -1
- package/dist/src/components/readme_renderer/utils.d.ts.map +1 -1
- package/dist/src/components/readme_renderer/utils.js +6 -6
- package/dist/src/components/readme_renderer/utils.js.map +1 -1
- package/dist/src/components/select/select.d.ts.map +1 -1
- package/dist/src/components/select/select.js +14 -13
- package/dist/src/components/select/select.js.map +1 -1
- package/dist/src/components/shortcut.d.ts +1 -1
- package/dist/src/components/shortcut.d.ts.map +1 -1
- package/dist/src/components/shortcut.js +2 -2
- package/dist/src/components/shortcut.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown.js +32 -35
- package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
- package/dist/src/components/simple_markdown/simple_markdown_components.js +26 -12
- package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
- package/dist/src/components/spinner.d.ts.map +1 -1
- package/dist/src/components/spinner.js +3 -1
- package/dist/src/components/spinner.js.map +1 -1
- package/dist/src/components/store/store_actor_header.d.ts.map +1 -1
- package/dist/src/components/store/store_actor_header.js +1 -1
- package/dist/src/components/store/store_actor_header.js.map +1 -1
- package/dist/src/components/switch/switch.d.ts.map +1 -1
- package/dist/src/components/switch/switch.js +1 -1
- package/dist/src/components/switch/switch.js.map +1 -1
- package/dist/src/components/switch/switch.style.d.ts.map +1 -1
- package/dist/src/components/switch/switch.style.js +5 -3
- package/dist/src/components/switch/switch.style.js.map +1 -1
- package/dist/src/components/table/table.styled.js +3 -3
- package/dist/src/components/table/table.styled.js.map +1 -1
- package/dist/src/components/table/table_error_row.d.ts.map +1 -1
- package/dist/src/components/table/table_error_row.js +1 -1
- package/dist/src/components/table/table_error_row.js.map +1 -1
- package/dist/src/components/table/table_row.d.ts.map +1 -1
- package/dist/src/components/table/table_row.js +1 -1
- package/dist/src/components/table/table_row.js.map +1 -1
- package/dist/src/components/table/table_wrapper.d.ts.map +1 -1
- package/dist/src/components/table/table_wrapper.js +3 -3
- package/dist/src/components/table/table_wrapper.js.map +1 -1
- package/dist/src/components/tabs/tab.d.ts.map +1 -1
- package/dist/src/components/tabs/tab.js +7 -5
- package/dist/src/components/tabs/tab.js.map +1 -1
- package/dist/src/components/tabs/tabs.d.ts.map +1 -1
- package/dist/src/components/tabs/tabs.js +3 -3
- package/dist/src/components/tabs/tabs.js.map +1 -1
- package/dist/src/components/tag.d.ts +1 -1
- package/dist/src/components/tag.d.ts.map +1 -1
- package/dist/src/components/tag.js +1 -1
- package/dist/src/components/tag.js.map +1 -1
- package/dist/src/components/text/heading_content.d.ts.map +1 -1
- package/dist/src/components/text/heading_content.js +1 -1
- package/dist/src/components/text/heading_content.js.map +1 -1
- package/dist/src/components/text/heading_marketing.d.ts.map +1 -1
- package/dist/src/components/text/heading_marketing.js +1 -1
- package/dist/src/components/text/heading_marketing.js.map +1 -1
- package/dist/src/components/text/heading_shared.d.ts.map +1 -1
- package/dist/src/components/text/heading_shared.js +1 -1
- package/dist/src/components/text/heading_shared.js.map +1 -1
- package/dist/src/components/text/index.d.ts +1 -1
- package/dist/src/components/text/index.d.ts.map +1 -1
- package/dist/src/components/text/text_base.d.ts.map +1 -1
- package/dist/src/components/text/text_base.js +16 -12
- package/dist/src/components/text/text_base.js.map +1 -1
- package/dist/src/components/text/text_content.d.ts.map +1 -1
- package/dist/src/components/text/text_content.js +1 -1
- package/dist/src/components/text/text_content.js.map +1 -1
- package/dist/src/components/text/text_marketing.d.ts.map +1 -1
- package/dist/src/components/text/text_marketing.js +1 -1
- package/dist/src/components/text/text_marketing.js.map +1 -1
- package/dist/src/components/text/text_shared.d.ts +1 -1
- package/dist/src/components/text/text_shared.d.ts.map +1 -1
- package/dist/src/components/text/text_shared.js +1 -1
- package/dist/src/components/text/text_shared.js.map +1 -1
- package/dist/src/components/tile/horizontal_tile.d.ts.map +1 -1
- package/dist/src/components/tile/horizontal_tile.js +3 -2
- package/dist/src/components/tile/horizontal_tile.js.map +1 -1
- package/dist/src/components/tile/shared.d.ts +1 -1
- package/dist/src/components/tile/shared.d.ts.map +1 -1
- package/dist/src/components/tile/vertical_tile.d.ts.map +1 -1
- package/dist/src/components/tile/vertical_tile.js +3 -2
- package/dist/src/components/tile/vertical_tile.js.map +1 -1
- package/dist/src/components/to_consolidate/card.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/card.js +20 -15
- package/dist/src/components/to_consolidate/card.js.map +1 -1
- package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/markdown.js +36 -20
- package/dist/src/components/to_consolidate/markdown.js.map +1 -1
- package/dist/src/components/to_consolidate/pagination.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/pagination.js +6 -6
- package/dist/src/components/to_consolidate/pagination.js.map +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.d.ts.map +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.js +1 -1
- package/dist/src/components/to_consolidate/tab_number_chip.js.map +1 -1
- package/dist/src/design_system/theme.d.ts.map +1 -1
- package/dist/src/design_system/theme.js +1 -1
- package/dist/src/design_system/theme.js.map +1 -1
- package/dist/src/design_system/typography_theme.d.ts.map +1 -1
- package/dist/src/design_system/typography_theme.js.map +1 -1
- package/dist/src/ui_dependency_provider.d.ts.map +1 -1
- package/dist/src/ui_dependency_provider.js +2 -2
- package/dist/src/ui_dependency_provider.js.map +1 -1
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +8 -6
- package/src/codemods/generate_typograpy_tokens_files.mjs +23 -28
- package/src/components/action_link.tsx +13 -23
- package/src/components/actor_template_card.stories.tsx +20 -14
- package/src/components/actor_template_card.tsx +4 -21
- package/src/components/avatar/actor_avatar.tsx +3 -4
- package/src/components/avatar/boring_avatar.tsx +134 -167
- package/src/components/avatar/user_avatar.stories.tsx +1 -5
- package/src/components/avatar/user_avatar.tsx +6 -20
- package/src/components/badge.stories.jsx +26 -40
- package/src/components/badge.tsx +37 -26
- package/src/components/banner.stories.tsx +10 -28
- package/src/components/banner.tsx +11 -14
- package/src/components/blog_article.tsx +6 -4
- package/src/components/box.tsx +90 -89
- package/src/components/breadcrumb/breadcrumb.stories.tsx +2 -8
- package/src/components/breadcrumb/breadcrumb.tsx +7 -5
- package/src/components/button.stories.tsx +70 -66
- package/src/components/button.tsx +33 -39
- package/src/components/card_container.stories.tsx +28 -29
- package/src/components/card_container.tsx +15 -10
- package/src/components/checkbox/checkbox.stories.tsx +52 -17
- package/src/components/checkbox/checkbox.style.ts +7 -4
- package/src/components/checkbox/checkbox.tsx +6 -9
- package/src/components/chip.stories.tsx +15 -5
- package/src/components/chip.tsx +26 -16
- package/src/components/code/action_button.tsx +10 -12
- package/src/components/code/code_block/code_block.stories.jsx +7 -25
- package/src/components/code/code_block/code_block.styled.tsx +26 -19
- package/src/components/code/code_block/code_block.tsx +26 -24
- package/src/components/code/code_block/code_block_with_tabs.stories.tsx +12 -18
- package/src/components/code/code_block/code_block_with_tabs.tsx +30 -16
- package/src/components/code/code_block/utils.tsx +23 -15
- package/src/components/code/inline_code/inline_code.stories.tsx +18 -10
- package/src/components/code/inline_code/inline_code.tsx +16 -21
- package/src/components/code/one_light_theme.ts +2 -17
- package/src/components/code/one_line_code/one_line_code.stories.tsx +31 -19
- package/src/components/code/one_line_code/one_line_code.tsx +19 -30
- package/src/components/code/prism_highlighter.tsx +117 -109
- package/src/components/code/prism_python.ts +4 -2
- package/src/components/collapsible_card/collapsible_card.stories.tsx +2 -1
- package/src/components/collapsible_card/collapsible_card.tsx +30 -15
- package/src/components/color_wheel_gradient.tsx +9 -7
- package/src/components/floating/floating_component_base.tsx +16 -9
- package/src/components/floating/menu.tsx +37 -46
- package/src/components/floating/menu_common.tsx +24 -30
- package/src/components/floating/menu_components.tsx +24 -24
- package/src/components/floating/tooltip.stories.jsx +85 -68
- package/src/components/floating/tooltip.tsx +32 -39
- package/src/components/floating/tooltip_content.tsx +8 -16
- package/src/components/icon_button.stories.tsx +176 -188
- package/src/components/icon_button.tsx +72 -58
- package/src/components/image.tsx +5 -11
- package/src/components/link.stories.tsx +4 -2
- package/src/components/link.tsx +70 -70
- package/src/components/message.stories.jsx +35 -33
- package/src/components/message.tsx +45 -45
- package/src/components/rating.tsx +37 -44
- package/src/components/readme_renderer/pythonize_value.ts +19 -7
- package/src/components/readme_renderer/table_of_contents.stories.tsx +40 -15
- package/src/components/readme_renderer/table_of_contents.tsx +87 -85
- package/src/components/readme_renderer/utils.tsx +17 -13
- package/src/components/select/select.stories.tsx +19 -46
- package/src/components/select/select.tsx +103 -101
- package/src/components/shortcut.stories.jsx +23 -14
- package/src/components/shortcut.tsx +2 -13
- package/src/components/simple_markdown/simple_markdown.stories.tsx +5 -10
- package/src/components/simple_markdown/simple_markdown.tsx +152 -55
- package/src/components/simple_markdown/simple_markdown_components.tsx +49 -59
- package/src/components/spinner.stories.tsx +14 -8
- package/src/components/spinner.tsx +5 -3
- package/src/components/store/store_actor_header.stories.tsx +2 -11
- package/src/components/store/store_actor_header.tsx +20 -16
- package/src/components/switch/switch.stories.jsx +4 -12
- package/src/components/switch/switch.style.ts +5 -3
- package/src/components/switch/switch.tsx +3 -13
- package/src/components/table/table.stories.tsx +5 -2
- package/src/components/table/table.styled.ts +3 -3
- package/src/components/table/table_error_row.tsx +5 -1
- package/src/components/table/table_row.tsx +1 -5
- package/src/components/table/table_wrapper.tsx +12 -12
- package/src/components/tabs/tab.stories.tsx +1 -5
- package/src/components/tabs/tab.tsx +33 -13
- package/src/components/tabs/tabs.tsx +14 -18
- package/src/components/tag.stories.jsx +35 -45
- package/src/components/tag.tsx +18 -22
- package/src/components/text/heading_content.stories.tsx +13 -24
- package/src/components/text/heading_content.tsx +3 -7
- package/src/components/text/heading_marketing.stories.tsx +4 -3
- package/src/components/text/heading_marketing.tsx +12 -8
- package/src/components/text/heading_shared.stories.tsx +3 -2
- package/src/components/text/heading_shared.tsx +3 -7
- package/src/components/text/index.ts +1 -3
- package/src/components/text/text_base.tsx +29 -35
- package/src/components/text/text_content.stories.tsx +17 -13
- package/src/components/text/text_content.tsx +20 -23
- package/src/components/text/text_marketing.stories.tsx +4 -3
- package/src/components/text/text_marketing.tsx +20 -23
- package/src/components/text/text_shared.stories.tsx +4 -3
- package/src/components/text/text_shared.tsx +23 -27
- package/src/components/tile/horizontal_tile.stories.tsx +6 -2
- package/src/components/tile/horizontal_tile.tsx +5 -15
- package/src/components/tile/shared.ts +5 -5
- package/src/components/tile/vertical_tile.stories.tsx +10 -18
- package/src/components/tile/vertical_tile.tsx +4 -9
- package/src/components/to_consolidate/card.stories.tsx +3 -1
- package/src/components/to_consolidate/card.tsx +67 -58
- package/src/components/to_consolidate/markdown.tsx +76 -62
- package/src/components/to_consolidate/pagination.tsx +11 -15
- package/src/components/to_consolidate/tab_number_chip.tsx +5 -6
- package/src/design_system/colors/build_color_tokens.js +7 -15
- package/src/design_system/theme.ts +1 -8
- package/src/design_system/tokens/radiuses.stories.tsx +9 -1
- package/src/design_system/tokens/shadows.stories.tsx +3 -1
- package/src/design_system/typography_theme.ts +78 -39
- package/src/ui_dependency_provider.tsx +16 -23
|
@@ -19,7 +19,7 @@ const StyledThumb = styled(SwitchPrimitiveReact.Thumb)`
|
|
|
19
19
|
transition: transform 100ms;
|
|
20
20
|
transform: translateX(2px);
|
|
21
21
|
will-change: transform;
|
|
22
|
-
&[data-state=
|
|
22
|
+
&[data-state='checked'] {
|
|
23
23
|
transform: translateX(18px);
|
|
24
24
|
}
|
|
25
25
|
`;
|
|
@@ -31,23 +31,13 @@ type SwitchPrimitiveProps = {
|
|
|
31
31
|
readOnly?: boolean;
|
|
32
32
|
} & Omit<React.ComponentPropsWithoutRef<typeof SwitchPrimitiveReact.Root>, 'checked' | 'onCheckedChange' | 'value'>;
|
|
33
33
|
|
|
34
|
-
export const SwitchPrimitive = ({
|
|
35
|
-
value,
|
|
36
|
-
setValue,
|
|
37
|
-
error,
|
|
38
|
-
disabled,
|
|
39
|
-
readOnly,
|
|
40
|
-
...rest
|
|
41
|
-
}: SwitchPrimitiveProps) => (
|
|
34
|
+
export const SwitchPrimitive = ({ value, setValue, error, disabled, readOnly, ...rest }: SwitchPrimitiveProps) => (
|
|
42
35
|
<StyledSwitch
|
|
43
36
|
{...rest}
|
|
44
37
|
checked={value}
|
|
45
38
|
onCheckedChange={setValue}
|
|
46
39
|
disabled={disabled || readOnly}
|
|
47
|
-
className={clsx(
|
|
48
|
-
error && 'error',
|
|
49
|
-
(disabled || readOnly) && 'disabled',
|
|
50
|
-
)}
|
|
40
|
+
className={clsx(error && 'error', (disabled || readOnly) && 'disabled')}
|
|
51
41
|
>
|
|
52
42
|
<StyledThumb />
|
|
53
43
|
</StyledSwitch>
|
|
@@ -57,7 +57,8 @@ const meta: Meta = {
|
|
|
57
57
|
parameters: {
|
|
58
58
|
docs: {
|
|
59
59
|
description: {
|
|
60
|
-
component:
|
|
60
|
+
component:
|
|
61
|
+
'Compositional table primitives. Compose together to build any table layout. See subcomponents below.',
|
|
61
62
|
},
|
|
62
63
|
},
|
|
63
64
|
},
|
|
@@ -240,7 +241,9 @@ export const DirectData: Story = {
|
|
|
240
241
|
<TableBody>
|
|
241
242
|
{items.map((item) => (
|
|
242
243
|
<TableRow key={item._id}>
|
|
243
|
-
<TableCell
|
|
244
|
+
<TableCell>
|
|
245
|
+
<Text weight="bold">{item.key}</Text>
|
|
246
|
+
</TableCell>
|
|
244
247
|
<TableCell>{item.value}</TableCell>
|
|
245
248
|
<TableCell>{item.updatedAt}</TableCell>
|
|
246
249
|
</TableRow>
|
|
@@ -59,9 +59,9 @@ export const StyledTable = styled.table`
|
|
|
59
59
|
|
|
60
60
|
/* Generic cell padding */
|
|
61
61
|
.${tableClassNames.HEAD_CELL},
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
.${tableClassNames.BODY_CELL},
|
|
63
|
+
.${tableClassNames.ROW_EMPTY_CELL},
|
|
64
|
+
.${tableClassNames.ROW_EXPANSION_CELL} {
|
|
65
65
|
padding: ${theme.space.space8};
|
|
66
66
|
position: relative;
|
|
67
67
|
}
|
|
@@ -4,7 +4,11 @@ import { Text } from '../text/index.js';
|
|
|
4
4
|
import { tableClassNames } from './table.styled.js';
|
|
5
5
|
import { tableTestIds } from './table_test_ids.js';
|
|
6
6
|
|
|
7
|
-
export const TableErrorRow: FC<{ colSpan: number; children?: ReactNode; error?: Error | null }> = ({
|
|
7
|
+
export const TableErrorRow: FC<{ colSpan: number; children?: ReactNode; error?: Error | null }> = ({
|
|
8
|
+
colSpan,
|
|
9
|
+
children,
|
|
10
|
+
error,
|
|
11
|
+
}) => (
|
|
8
12
|
<tr data-test={tableTestIds.ERROR_ROW} className={tableClassNames.ROW_EMPTY}>
|
|
9
13
|
<td colSpan={colSpan} className={tableClassNames.ROW_EMPTY_CELL}>
|
|
10
14
|
{children ?? <Text color="error">{error?.message ?? 'Failed to load data'}</Text>}
|
|
@@ -22,9 +22,5 @@ export const TableRow: FC<TableRowProps> = ({ className, clickable, expanded, to
|
|
|
22
22
|
|
|
23
23
|
if (!to) return row;
|
|
24
24
|
|
|
25
|
-
return
|
|
26
|
-
<TableRowLinkContext.Provider value={to}>
|
|
27
|
-
{row}
|
|
28
|
-
</TableRowLinkContext.Provider>
|
|
29
|
-
);
|
|
25
|
+
return <TableRowLinkContext.Provider value={to}>{row}</TableRowLinkContext.Provider>;
|
|
30
26
|
};
|
|
@@ -2,15 +2,15 @@ import type { FC } from 'react';
|
|
|
2
2
|
import { useCallback, useEffect, useRef } from 'react';
|
|
3
3
|
|
|
4
4
|
import { Box } from '../box.js';
|
|
5
|
-
import {
|
|
6
|
-
StyledHorizontallyScrollableTableWrapper,
|
|
7
|
-
StyledTableFooterWrapper,
|
|
8
|
-
tableClassNames,
|
|
9
|
-
} from './table.styled.js';
|
|
5
|
+
import { StyledHorizontallyScrollableTableWrapper, StyledTableFooterWrapper, tableClassNames } from './table.styled.js';
|
|
10
6
|
import { tableTestIds } from './table_test_ids.js';
|
|
11
7
|
import type { HorizontallyScrollableTableWrapperProps } from './types.js';
|
|
12
8
|
|
|
13
|
-
export const HorizontallyScrollableTableWrapper: FC<HorizontallyScrollableTableWrapperProps> = ({
|
|
9
|
+
export const HorizontallyScrollableTableWrapper: FC<HorizontallyScrollableTableWrapperProps> = ({
|
|
10
|
+
children,
|
|
11
|
+
footer,
|
|
12
|
+
className,
|
|
13
|
+
}) => {
|
|
14
14
|
const scrollableRef = useRef<HTMLDivElement>(null);
|
|
15
15
|
const wrapperRef = useRef<HTMLDivElement>(null);
|
|
16
16
|
const animationFrameIdRef = useRef(0);
|
|
@@ -57,15 +57,15 @@ export const HorizontallyScrollableTableWrapper: FC<HorizontallyScrollableTableW
|
|
|
57
57
|
}, [updateShadows, throttledUpdateShadows]);
|
|
58
58
|
|
|
59
59
|
return (
|
|
60
|
-
<StyledHorizontallyScrollableTableWrapper
|
|
60
|
+
<StyledHorizontallyScrollableTableWrapper
|
|
61
|
+
data-test={tableTestIds.WRAPPER}
|
|
62
|
+
ref={wrapperRef}
|
|
63
|
+
className={className}
|
|
64
|
+
>
|
|
61
65
|
<Box className={tableClassNames.WRAPPER_SCROLLABLE} ref={scrollableRef}>
|
|
62
66
|
{children}
|
|
63
67
|
</Box>
|
|
64
|
-
{footer &&
|
|
65
|
-
<StyledTableFooterWrapper>
|
|
66
|
-
{footer}
|
|
67
|
-
</StyledTableFooterWrapper>
|
|
68
|
-
)}
|
|
68
|
+
{footer && <StyledTableFooterWrapper>{footer}</StyledTableFooterWrapper>}
|
|
69
69
|
</StyledHorizontallyScrollableTableWrapper>
|
|
70
70
|
);
|
|
71
71
|
};
|
|
@@ -59,11 +59,7 @@ const sampleTabs = [
|
|
|
59
59
|
{ id: 'tab-5', title: 'Reports', to: '#' },
|
|
60
60
|
];
|
|
61
61
|
|
|
62
|
-
export const TabVariants = (args: {
|
|
63
|
-
Icon?: boolean;
|
|
64
|
-
chip?: string;
|
|
65
|
-
rollout?: 'alpha' | 'beta' | 'none';
|
|
66
|
-
}) => {
|
|
62
|
+
export const TabVariants = (args: { Icon?: boolean; chip?: string; rollout?: 'alpha' | 'beta' | 'none' }) => {
|
|
67
63
|
const { Icon = false, chip = '', rollout = 'none' } = args;
|
|
68
64
|
const [activeTab, setActiveTab] = React.useState('tab-1');
|
|
69
65
|
|
|
@@ -16,7 +16,9 @@ import { Link } from '../link.js';
|
|
|
16
16
|
import { Text } from '../text/index.js';
|
|
17
17
|
import type { SharedTextSize } from '../text/text_shared.js';
|
|
18
18
|
|
|
19
|
-
type SharedTabProps = Omit<RegularBoxProps, 'as' | 'onClick'> &
|
|
19
|
+
type SharedTabProps = Omit<RegularBoxProps, 'as' | 'onClick'> &
|
|
20
|
+
MarginSpacingProps &
|
|
21
|
+
Omit<RegularLinkProps, 'hideExternalIcon' | 'showExternalIcon'>;
|
|
20
22
|
|
|
21
23
|
export type TabVariant = 'default' | 'boxed' | 'buttoned';
|
|
22
24
|
|
|
@@ -32,7 +34,7 @@ export type TabData = SharedTabProps & {
|
|
|
32
34
|
export type TabProps = TabData & {
|
|
33
35
|
variant?: TabVariant;
|
|
34
36
|
active?: boolean;
|
|
35
|
-
onSelect?: (data: { id: string
|
|
37
|
+
onSelect?: (data: { id: string; href: string; event: React.MouseEvent }) => void;
|
|
36
38
|
};
|
|
37
39
|
|
|
38
40
|
const tabVariantTextSize = {
|
|
@@ -54,7 +56,7 @@ const tabVariantStyle = {
|
|
|
54
56
|
color: ${theme.color.neutral.textSubtle};
|
|
55
57
|
|
|
56
58
|
&:hover {
|
|
57
|
-
color: ${theme.color.primaryBlack.actionHover}
|
|
59
|
+
color: ${theme.color.primaryBlack.actionHover};
|
|
58
60
|
}
|
|
59
61
|
|
|
60
62
|
&.active {
|
|
@@ -154,10 +156,12 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
154
156
|
flex-shrink: 0;
|
|
155
157
|
cursor: pointer;
|
|
156
158
|
position: relative;
|
|
157
|
-
transition:
|
|
159
|
+
transition:
|
|
160
|
+
background-color ${theme.transition.fastEaseOut},
|
|
161
|
+
border-color ${theme.transition.fastEaseOut},
|
|
162
|
+
color ${theme.transition.fastEaseOut};
|
|
158
163
|
z-index: 1;
|
|
159
164
|
|
|
160
|
-
|
|
161
165
|
${({ $variant }) => tabVariantStyle[$variant]};
|
|
162
166
|
|
|
163
167
|
&.disabled {
|
|
@@ -178,8 +182,21 @@ const TabWrapper = styled(Link)<TabWrapperProps>`
|
|
|
178
182
|
}
|
|
179
183
|
`;
|
|
180
184
|
|
|
181
|
-
export const Tab = ({
|
|
182
|
-
|
|
185
|
+
export const Tab = ({
|
|
186
|
+
variant = 'default',
|
|
187
|
+
id,
|
|
188
|
+
to,
|
|
189
|
+
Icon,
|
|
190
|
+
title,
|
|
191
|
+
chip,
|
|
192
|
+
rollout,
|
|
193
|
+
className,
|
|
194
|
+
onSelect,
|
|
195
|
+
active = false,
|
|
196
|
+
disabled = false,
|
|
197
|
+
...props
|
|
198
|
+
}: TabProps) => {
|
|
199
|
+
const href = typeof to === 'string' ? to : createPath(to);
|
|
183
200
|
return (
|
|
184
201
|
<TabWrapper
|
|
185
202
|
{...props}
|
|
@@ -193,16 +210,19 @@ export const Tab = ({ variant = 'default', id, to, Icon, title, chip, rollout, c
|
|
|
193
210
|
$variant={variant}
|
|
194
211
|
>
|
|
195
212
|
{Icon && <Icon size="16" className={TAB_CLASSNAMES.ICON} />}
|
|
196
|
-
<Text size={tabVariantTextSize[variant]} className={TAB_CLASSNAMES.TITLE} weight="bold" as="div">
|
|
213
|
+
<Text size={tabVariantTextSize[variant]} className={TAB_CLASSNAMES.TITLE} weight="bold" as="div">
|
|
214
|
+
{title}
|
|
215
|
+
</Text>
|
|
197
216
|
{chip && (
|
|
198
|
-
<Badge
|
|
199
|
-
size={tabVariantBadgeSize[variant]}
|
|
200
|
-
variant={active ? 'primary_black' : 'neutral_subtle'}
|
|
201
|
-
>
|
|
217
|
+
<Badge size={tabVariantBadgeSize[variant]} variant={active ? 'primary_black' : 'neutral_subtle'}>
|
|
202
218
|
{chip}
|
|
203
219
|
</Badge>
|
|
204
220
|
)}
|
|
205
|
-
{rollout &&
|
|
221
|
+
{rollout && (
|
|
222
|
+
<Badge size={tabVariantBadgeSize[variant]} variant="primary_blue">
|
|
223
|
+
{rollout}
|
|
224
|
+
</Badge>
|
|
225
|
+
)}
|
|
206
226
|
</TabWrapper>
|
|
207
227
|
);
|
|
208
228
|
};
|
|
@@ -16,7 +16,7 @@ export type TabsProps = SharedTabsProps & {
|
|
|
16
16
|
variant?: TabVariant;
|
|
17
17
|
tabs: TabData[];
|
|
18
18
|
activeTab?: string;
|
|
19
|
-
onSelect?: (data: { id: string
|
|
19
|
+
onSelect?: (data: { id: string; href: string; event: React.MouseEvent }) => void;
|
|
20
20
|
};
|
|
21
21
|
|
|
22
22
|
const tabsVariantStyle = {
|
|
@@ -83,7 +83,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
& > [role=
|
|
86
|
+
& > [role='cell'] {
|
|
87
87
|
position: sticky;
|
|
88
88
|
top: 0;
|
|
89
89
|
height: 100%;
|
|
@@ -93,7 +93,7 @@ const TabsWrapper = styled(Box)<TabsWrapperProps>`
|
|
|
93
93
|
transition: opacity ${theme.transition.fastEaseOut};
|
|
94
94
|
z-index: 2;
|
|
95
95
|
|
|
96
|
-
&[aria-hidden=
|
|
96
|
+
&[aria-hidden='false'] {
|
|
97
97
|
opacity: 1;
|
|
98
98
|
}
|
|
99
99
|
|
|
@@ -153,19 +153,15 @@ export const Tabs = ({ variant = 'default', tabs, activeTab, onSelect, ...props
|
|
|
153
153
|
setOveflowState(isTabsOverflowing(event.currentTarget as HTMLDivElement));
|
|
154
154
|
}, []);
|
|
155
155
|
|
|
156
|
-
return
|
|
157
|
-
<
|
|
158
|
-
|
|
159
|
-
{
|
|
160
|
-
|
|
161
|
-
{...tab}
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
))}
|
|
168
|
-
</div>
|
|
169
|
-
<div role="cell" aria-hidden={!overflowState?.right} />
|
|
170
|
-
</TabsWrapper>;
|
|
156
|
+
return (
|
|
157
|
+
<TabsWrapper {...props} data-test="tabs-wrapper" $variant={variant}>
|
|
158
|
+
<div role="cell" aria-hidden={!overflowState?.left} />
|
|
159
|
+
<div ref={ref} role="tablist" onScroll={scrollHandler}>
|
|
160
|
+
{tabs.map((tab) => (
|
|
161
|
+
<Tab {...tab} key={tab.id} variant={variant} active={tab.id === activeTab} onSelect={onSelect} />
|
|
162
|
+
))}
|
|
163
|
+
</div>
|
|
164
|
+
<div role="cell" aria-hidden={!overflowState?.right} />
|
|
165
|
+
</TabsWrapper>
|
|
166
|
+
);
|
|
171
167
|
};
|
|
@@ -1,15 +1,9 @@
|
|
|
1
1
|
import { Fragment } from 'react';
|
|
2
2
|
import styled from 'styled-components';
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
PeopleIcon, PlusIcon,
|
|
6
|
-
} from '@apify/ui-icons';
|
|
4
|
+
import { PeopleIcon, PlusIcon } from '@apify/ui-icons';
|
|
7
5
|
|
|
8
|
-
import {
|
|
9
|
-
Tag,
|
|
10
|
-
TAG_SIZES,
|
|
11
|
-
TAG_VARIANTS,
|
|
12
|
-
} from './tag.tsx';
|
|
6
|
+
import { Tag, TAG_SIZES, TAG_VARIANTS } from './tag.tsx';
|
|
13
7
|
import { SHARED_TEXT_TYPES } from './text/text_shared.tsx';
|
|
14
8
|
|
|
15
9
|
export default {
|
|
@@ -25,7 +19,7 @@ export default {
|
|
|
25
19
|
|
|
26
20
|
const Table = styled.table`
|
|
27
21
|
td {
|
|
28
|
-
padding: 8px
|
|
22
|
+
padding: 8px;
|
|
29
23
|
}
|
|
30
24
|
`;
|
|
31
25
|
|
|
@@ -33,44 +27,40 @@ export const Default = () => {
|
|
|
33
27
|
return (
|
|
34
28
|
<Table>
|
|
35
29
|
<tbody>
|
|
36
|
-
{TAG_VARIANTS.map((variant) =>
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
30
|
+
{TAG_VARIANTS.map((variant) => (
|
|
31
|
+
<tr key={variant}>
|
|
32
|
+
{TAG_SIZES.map((size) => {
|
|
33
|
+
return (
|
|
34
|
+
<Fragment key={size}>
|
|
35
|
+
<td>
|
|
36
|
+
<Tag
|
|
37
|
+
size={size}
|
|
38
|
+
variant={variant}
|
|
39
|
+
LeadingIcon={PeopleIcon}
|
|
40
|
+
TrailingIcon={PlusIcon}
|
|
41
|
+
>
|
|
47
42
|
Tag
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
43
|
+
</Tag>
|
|
44
|
+
</td>
|
|
45
|
+
<td>
|
|
46
|
+
<Tag
|
|
47
|
+
size={size}
|
|
48
|
+
type="code"
|
|
49
|
+
variant={variant}
|
|
50
|
+
LeadingIcon={PeopleIcon}
|
|
51
|
+
TrailingIcon={PlusIcon}
|
|
52
|
+
>
|
|
58
53
|
Tag
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
</Fragment>
|
|
70
|
-
);
|
|
71
|
-
})}
|
|
72
|
-
</tr>,
|
|
73
|
-
)}
|
|
54
|
+
</Tag>
|
|
55
|
+
</td>
|
|
56
|
+
<td>
|
|
57
|
+
<Tag size={size} variant={variant} LeadingIcon={PeopleIcon}></Tag>
|
|
58
|
+
</td>
|
|
59
|
+
</Fragment>
|
|
60
|
+
);
|
|
61
|
+
})}
|
|
62
|
+
</tr>
|
|
63
|
+
))}
|
|
74
64
|
</tbody>
|
|
75
65
|
</Table>
|
|
76
66
|
);
|
package/src/components/tag.tsx
CHANGED
|
@@ -23,7 +23,7 @@ const TAG_ICON_SIZES = {
|
|
|
23
23
|
} satisfies Record<TagSize, IconSize>;
|
|
24
24
|
|
|
25
25
|
export const TAG_VARIANTS = ['primary', 'secondary', 'subtle', 'accent', 'success', 'warning', 'error'] as const;
|
|
26
|
-
type TagVariant = typeof TAG_VARIANTS[number];
|
|
26
|
+
type TagVariant = (typeof TAG_VARIANTS)[number];
|
|
27
27
|
|
|
28
28
|
type TagNodeType = Extract<React.ElementType, 'a' | 'button'>;
|
|
29
29
|
type TagNodePropsMap = {
|
|
@@ -38,14 +38,15 @@ type TagNodePropsMap = {
|
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
type SharedTagProps = Omit<RegularBoxProps, 'as'> & MarginSpacingProps;
|
|
41
|
-
export type TagProps<T extends TagNodeType> = SharedTagProps &
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
41
|
+
export type TagProps<T extends TagNodeType> = SharedTagProps &
|
|
42
|
+
({
|
|
43
|
+
as?: T;
|
|
44
|
+
size?: TagSize;
|
|
45
|
+
type?: SharedTextType;
|
|
46
|
+
variant?: TagVariant;
|
|
47
|
+
LeadingIcon?: IconComponent;
|
|
48
|
+
TrailingIcon?: IconComponent;
|
|
49
|
+
} & Omit<TagNodePropsMap[T]['props'], 'size' | 'type'>);
|
|
49
50
|
|
|
50
51
|
const tagSizeStyle = {
|
|
51
52
|
big: css`
|
|
@@ -136,9 +137,7 @@ const tagVariantStyle = {
|
|
|
136
137
|
`,
|
|
137
138
|
} satisfies Record<TagVariant, FlattenSimpleInterpolation>;
|
|
138
139
|
|
|
139
|
-
type StyledTagProps = WithTransientProps<
|
|
140
|
-
Required<Pick<TagProps<TagNodeType>, 'size' | 'variant'>>
|
|
141
|
-
>;
|
|
140
|
+
type StyledTagProps = WithTransientProps<Required<Pick<TagProps<TagNodeType>, 'size' | 'variant'>>>;
|
|
142
141
|
|
|
143
142
|
const StyledTag = styled(Box)<StyledTagProps>`
|
|
144
143
|
${({ $size }) => tagSizeStyle[$size]};
|
|
@@ -178,21 +177,19 @@ function TagWrapper<T extends TagNodeType>(
|
|
|
178
177
|
}: TagProps<T>,
|
|
179
178
|
ref: ForwardedRef<TagNodePropsMap[T]['element']>,
|
|
180
179
|
) {
|
|
181
|
-
const component: React.ElementType =
|
|
180
|
+
const component: React.ElementType = as === 'a' ? Link : (as ?? 'button');
|
|
182
181
|
|
|
183
182
|
// Map 'regular' tag size to 'small' text size for better visual balance when displayed next to small button
|
|
184
183
|
const textSize: SharedTextSize = size === 'regular' ? 'small' : size;
|
|
185
184
|
|
|
186
185
|
return (
|
|
187
|
-
<StyledTag
|
|
188
|
-
as={component}
|
|
189
|
-
ref={ref}
|
|
190
|
-
$variant={variant}
|
|
191
|
-
$size={size}
|
|
192
|
-
{...props}
|
|
193
|
-
>
|
|
186
|
+
<StyledTag as={component} ref={ref} $variant={variant} $size={size} {...props}>
|
|
194
187
|
{LeadingIcon && <LeadingIcon size={TAG_ICON_SIZES[size]} />}
|
|
195
|
-
{children && (
|
|
188
|
+
{children && (
|
|
189
|
+
<Text size={textSize} type={type} weight="medium">
|
|
190
|
+
{children}
|
|
191
|
+
</Text>
|
|
192
|
+
)}
|
|
196
193
|
{TrailingIcon && <TrailingIcon size={TAG_ICON_SIZES[size]} />}
|
|
197
194
|
</StyledTag>
|
|
198
195
|
);
|
|
@@ -201,6 +198,5 @@ TagWrapper.displayName = 'Tag';
|
|
|
201
198
|
|
|
202
199
|
// `forwardRef` can't handle generic types, should be fixable with React 19
|
|
203
200
|
export const Tag = forwardRef(TagWrapper) as <T extends TagNodeType>(
|
|
204
|
-
|
|
205
201
|
props: TagProps<T> & { ref?: ForwardedRef<TagNodePropsMap[T]['element']> },
|
|
206
202
|
) => ReturnType<typeof TagWrapper>;
|
|
@@ -10,9 +10,10 @@ export default {
|
|
|
10
10
|
parameters: {
|
|
11
11
|
docs: {
|
|
12
12
|
description: {
|
|
13
|
-
component:
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
component:
|
|
14
|
+
'⚠️ **Internal Component**: This component is specifically designed for use within the SimpleMarkdown component. ' +
|
|
15
|
+
'It provides content-specific heading styles for markdown rendering. \n' +
|
|
16
|
+
'For general heading usage, use HeadingShared or HeadingMarketing instead.',
|
|
16
17
|
},
|
|
17
18
|
},
|
|
18
19
|
},
|
|
@@ -116,52 +117,40 @@ export const AllVariants: Story = {
|
|
|
116
117
|
<WarningBanner>
|
|
117
118
|
<strong>⚠️ Internal Component</strong>
|
|
118
119
|
<p>
|
|
119
|
-
HeadingContent is used exclusively by the SimpleMarkdown component for rendering
|
|
120
|
-
|
|
121
|
-
|
|
120
|
+
HeadingContent is used exclusively by the SimpleMarkdown component for rendering markdown headings.
|
|
121
|
+
For general heading usage in your application, use HeadingShared or HeadingMarketing components
|
|
122
|
+
instead.
|
|
122
123
|
</p>
|
|
123
124
|
</WarningBanner>
|
|
124
125
|
|
|
125
126
|
<HeadingShowcase>
|
|
126
127
|
<small>heading1 (default: h1) - Used for # in markdown</small>
|
|
127
|
-
<HeadingContent type="heading1">
|
|
128
|
-
Heading 1 - Main Document Title
|
|
129
|
-
</HeadingContent>
|
|
128
|
+
<HeadingContent type="heading1">Heading 1 - Main Document Title</HeadingContent>
|
|
130
129
|
</HeadingShowcase>
|
|
131
130
|
|
|
132
131
|
<HeadingShowcase>
|
|
133
132
|
<small>heading2 (default: h2) - Used for ## in markdown</small>
|
|
134
|
-
<HeadingContent type="heading2">
|
|
135
|
-
Heading 2 - Major Section
|
|
136
|
-
</HeadingContent>
|
|
133
|
+
<HeadingContent type="heading2">Heading 2 - Major Section</HeadingContent>
|
|
137
134
|
</HeadingShowcase>
|
|
138
135
|
|
|
139
136
|
<HeadingShowcase>
|
|
140
137
|
<small>heading3 (default: h3) - Used for ### in markdown</small>
|
|
141
|
-
<HeadingContent type="heading3">
|
|
142
|
-
Heading 3 - Subsection
|
|
143
|
-
</HeadingContent>
|
|
138
|
+
<HeadingContent type="heading3">Heading 3 - Subsection</HeadingContent>
|
|
144
139
|
</HeadingShowcase>
|
|
145
140
|
|
|
146
141
|
<HeadingShowcase>
|
|
147
142
|
<small>heading4 (default: h4) - Used for #### in markdown</small>
|
|
148
|
-
<HeadingContent type="heading4">
|
|
149
|
-
Heading 4 - Minor Section
|
|
150
|
-
</HeadingContent>
|
|
143
|
+
<HeadingContent type="heading4">Heading 4 - Minor Section</HeadingContent>
|
|
151
144
|
</HeadingShowcase>
|
|
152
145
|
|
|
153
146
|
<HeadingShowcase>
|
|
154
147
|
<small>heading5 (default: h5) - Used for ##### in markdown</small>
|
|
155
|
-
<HeadingContent type="heading5">
|
|
156
|
-
Heading 5 - Sub-minor Section
|
|
157
|
-
</HeadingContent>
|
|
148
|
+
<HeadingContent type="heading5">Heading 5 - Sub-minor Section</HeadingContent>
|
|
158
149
|
</HeadingShowcase>
|
|
159
150
|
|
|
160
151
|
<HeadingShowcase>
|
|
161
152
|
<small>heading6 (default: h6) - Used for ###### in markdown</small>
|
|
162
|
-
<HeadingContent type="heading6">
|
|
163
|
-
Heading 6 - Smallest Heading
|
|
164
|
-
</HeadingContent>
|
|
153
|
+
<HeadingContent type="heading6">Heading 6 - Smallest Heading</HeadingContent>
|
|
165
154
|
</HeadingShowcase>
|
|
166
155
|
</StoryWrapper>
|
|
167
156
|
),
|
|
@@ -9,7 +9,7 @@ import { TextBaseComponent } from './text_base.js';
|
|
|
9
9
|
type HeadingContentType = 'heading1' | 'heading2' | 'heading3' | 'heading4' | 'heading5' | 'heading6';
|
|
10
10
|
|
|
11
11
|
interface HeadingContentTransientProps {
|
|
12
|
-
type?: HeadingContentType
|
|
12
|
+
type?: HeadingContentType;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const getContentHeadingStyles = (headingType: HeadingContentType) => css`
|
|
@@ -43,16 +43,12 @@ const StyledHeadingContent = styled(TextBaseComponent)<StyledHeadingContentProps
|
|
|
43
43
|
/**
|
|
44
44
|
* @deprecated Use Heading or HeadingMarketing from ui-library
|
|
45
45
|
*/
|
|
46
|
-
export const HeadingContent: React.FC<HeadingContentProps> = ({
|
|
47
|
-
type,
|
|
48
|
-
as,
|
|
49
|
-
...rest
|
|
50
|
-
}) => {
|
|
46
|
+
export const HeadingContent: React.FC<HeadingContentProps> = ({ type, as, ...rest }) => {
|
|
51
47
|
return (
|
|
52
48
|
<StyledHeadingContent
|
|
53
49
|
$type={type}
|
|
54
50
|
forwardedAs={as || HEADING_CONTENT_DEFAULT_ELEMENTS[type || 'heading1']}
|
|
55
|
-
m=
|
|
51
|
+
m="none"
|
|
56
52
|
{...rest}
|
|
57
53
|
/>
|
|
58
54
|
);
|
|
@@ -9,9 +9,10 @@ export default {
|
|
|
9
9
|
parameters: {
|
|
10
10
|
docs: {
|
|
11
11
|
description: {
|
|
12
|
-
component:
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
component:
|
|
13
|
+
'Marketing headings are designed for promotional and web-facing content. ' +
|
|
14
|
+
'These typography elements are primarily used for marketing pages, landing pages,' +
|
|
15
|
+
' and other web components where a strong visual presence is needed.',
|
|
15
16
|
},
|
|
16
17
|
},
|
|
17
18
|
},
|
|
@@ -6,10 +6,18 @@ import type { WithTransientProps } from '../../type_utils.js';
|
|
|
6
6
|
import type { TextBaseProps } from './text_base.js';
|
|
7
7
|
import { TextBaseComponent } from './text_base.js';
|
|
8
8
|
|
|
9
|
-
type HeadingMarketingType =
|
|
9
|
+
type HeadingMarketingType =
|
|
10
|
+
| 'titleXs'
|
|
11
|
+
| 'titleS'
|
|
12
|
+
| 'titleM'
|
|
13
|
+
| 'titleMl'
|
|
14
|
+
| 'titleL'
|
|
15
|
+
| 'titleXl'
|
|
16
|
+
| 'title2xl'
|
|
17
|
+
| 'title3xl';
|
|
10
18
|
|
|
11
19
|
interface HeadingMarketingTransientProps {
|
|
12
|
-
type?: HeadingMarketingType
|
|
20
|
+
type?: HeadingMarketingType;
|
|
13
21
|
}
|
|
14
22
|
|
|
15
23
|
type StyledHeadingMarketingProps = WithTransientProps<HeadingMarketingTransientProps>;
|
|
@@ -40,16 +48,12 @@ const StyledHeadingMarketing = styled(TextBaseComponent)<StyledHeadingMarketingP
|
|
|
40
48
|
`}
|
|
41
49
|
`;
|
|
42
50
|
|
|
43
|
-
export const HeadingMarketing: React.FC<HeadingMarketingProps> = ({
|
|
44
|
-
type,
|
|
45
|
-
as,
|
|
46
|
-
...rest
|
|
47
|
-
}) => {
|
|
51
|
+
export const HeadingMarketing: React.FC<HeadingMarketingProps> = ({ type, as, ...rest }) => {
|
|
48
52
|
return (
|
|
49
53
|
<StyledHeadingMarketing
|
|
50
54
|
$type={type}
|
|
51
55
|
forwardedAs={as || HEADING_MARKETING_DEFAULT_ELEMENTS[type || 'titleL']}
|
|
52
|
-
m=
|
|
56
|
+
m="none"
|
|
53
57
|
{...rest}
|
|
54
58
|
/>
|
|
55
59
|
);
|