@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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { autoUpdate, offset, size, useFloating
|
|
1
|
+
import { autoUpdate, offset, size, useFloating } from '@floating-ui/react';
|
|
2
2
|
export const useFloatingMenu = ({ isOpen, setIsOpen, placement = 'bottom-start', }) => useFloating({
|
|
3
3
|
placement,
|
|
4
4
|
open: isOpen,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu_common.js","sourceRoot":"","sources":["../../../../src/components/floating/menu_common.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"menu_common.js","sourceRoot":"","sources":["../../../../src/components/floating/menu_common.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAE3E,MAAM,CAAC,MAAM,eAAe,GAAG,CAAC,EAC5B,MAAM,EACN,SAAS,EACT,SAAS,GAAG,cAAc,GAK7B,EAAE,EAAE,CACD,WAAW,CAAU;IACjB,SAAS;IACT,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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu_components.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu_components.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"menu_components.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/menu_components.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAOhF,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,WAAW,CAAC;AAG1C,MAAM,MAAM,eAAe,GAAG,IAAI,CAAC,iBAAiB,CAAC,aAAa,CAAC,EAAE,SAAS,CAAC,CAAC,SAAS,CAAC,CAAC;AAE3F;;GAEG;AACH,eAAO,MAAM,iBAAiB,6pBAe7B,CAAC;AAEF,UAAU,2BAA2B;IACjC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,WAAW,CAAC,EAAE,OAAO,CAAC;CACzB;AAED;;GAEG;AACH,eAAO,MAAM,qBAAqB,ooBAoBjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,sBAAsB,ocAelC,CAAC;AAEF,KAAK,8BAA8B,GAAG;IAClC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B,GAAG,QAAQ,CAAC;AAEb;;GAEG;AACH,eAAO,MAAM,yBAAyB,wHASrC,CAAC"}
|
|
@@ -35,14 +35,16 @@ export const ListMenuItemComponent = styled(Box).attrs({
|
|
|
35
35
|
cursor: pointer;
|
|
36
36
|
white-space: nowrap;
|
|
37
37
|
|
|
38
|
-
${({ $isActive }) => $isActive &&
|
|
39
|
-
|
|
40
|
-
|
|
38
|
+
${({ $isActive }) => $isActive &&
|
|
39
|
+
css `
|
|
40
|
+
background-color: ${theme.color.neutral.hover};
|
|
41
|
+
`}
|
|
41
42
|
|
|
42
|
-
${({ $isSelected }) => $isSelected &&
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
43
|
+
${({ $isSelected }) => $isSelected &&
|
|
44
|
+
css `
|
|
45
|
+
background-color: ${theme.color.neutral.backgroundSubtle};
|
|
46
|
+
color: ${theme.color.primary.text};
|
|
47
|
+
`}
|
|
46
48
|
`;
|
|
47
49
|
/**
|
|
48
50
|
* Menu base component WITHOUT dropdown icon
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menu_components.js","sourceRoot":"","sources":["../../../../src/components/floating/menu_components.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"menu_components.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AAC,KAAK,CAAC,OAAO,CAAC,IAAI;SACpC;CACR,CAAC;AAEF;;GAEG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;WAGtC,KAAK,CAAC,KAAK,CAAC,MAAM;eACd,KAAK,CAAC,KAAK,CAAC,MAAM;qBACZ,KAAK,CAAC,MAAM,CAAC,OAAO;wBACjB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe;wBACnC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,eAAe;;;;;;4BAM/B,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,gBAAgB;;CAE/D,CAAC;AAMF;;GAEG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,UAAU,CAC/C,CAAC,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,EAAE,EAAE;IAC5B,OAAO,CACH,MAAC,sBAAsB,OAAK,KAAK,EAAE,GAAG,EAAE,GAAG,aACtC,QAAQ,EACT,KAAC,eAAe,IAAC,IAAI,EAAC,IAAI,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI,GAAI,IACzC,CAC5B,CAAC;AACN,CAAC,CACJ,CAAC"}
|
|
@@ -4,7 +4,7 @@ export declare const TOOLTIP_TEXT_ALIGNS: {
|
|
|
4
4
|
readonly LEFT: "left";
|
|
5
5
|
readonly CENTER: "center";
|
|
6
6
|
};
|
|
7
|
-
export type TooltipTextAlign = typeof TOOLTIP_TEXT_ALIGNS[keyof typeof TOOLTIP_TEXT_ALIGNS];
|
|
7
|
+
export type TooltipTextAlign = (typeof TOOLTIP_TEXT_ALIGNS)[keyof typeof TOOLTIP_TEXT_ALIGNS];
|
|
8
8
|
export declare const TOOLTIP_SIZES: {
|
|
9
9
|
readonly XSMALL: "xsmall";
|
|
10
10
|
readonly SMALL: "small";
|
|
@@ -12,7 +12,7 @@ export declare const TOOLTIP_SIZES: {
|
|
|
12
12
|
readonly LARGE: "large";
|
|
13
13
|
readonly XLARGE: "xlarge";
|
|
14
14
|
};
|
|
15
|
-
export type TooltipSize = typeof TOOLTIP_SIZES[keyof typeof TOOLTIP_SIZES];
|
|
15
|
+
export type TooltipSize = (typeof TOOLTIP_SIZES)[keyof typeof TOOLTIP_SIZES];
|
|
16
16
|
export interface TooltipProps extends Omit<FloatingComponentBaseProps, 'isOpen' | 'size'> {
|
|
17
17
|
as?: ElementType;
|
|
18
18
|
className?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tooltip.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/tooltip.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,WAAW,EAAc,KAAK,SAAS,EAAY,MAAM,OAAO,CAAC;AAKnG,OAAO,EAAyB,KAAK,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAGtG,eAAO,MAAM,mBAAmB;;;CAGtB,CAAC;AAEX,MAAM,MAAM,gBAAgB,GAAG,CAAC,OAAO,mBAAmB,CAAC,CAAC,MAAM,OAAO,mBAAmB,CAAC,CAAC;AAE9F,eAAO,MAAM,aAAa;;;;;;CAMhB,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,OAAO,aAAa,CAAC,CAAC;AAE7E,MAAM,WAAW,YAAa,SAAQ,IAAI,CAAC,0BAA0B,EAAE,QAAQ,GAAG,MAAM,CAAC;IACrF,EAAE,CAAC,EAAE,WAAW,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,WAAW,CAAC;IACnB,SAAS,CAAC,EAAE,gBAAgB,CAAC;CAChC;AAED,UAAU,gBAAgB;IACtB,YAAY,CAAC,EAAE,YAAY,CAAC;CAC/B;AA0BD;;GAEG;AACH,eAAO,MAAM,OAAO,GAAI,oGAWrB,YAAY,KAAG,SA0CjB,CAAC;AAEF,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EACxF,SAAS,EAAE,aAAa,CAAC,MAAM,CAAC,sJAcnC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useFloating, useHover, useInteractions
|
|
2
|
+
import { useFloating, useHover, useInteractions } from '@floating-ui/react';
|
|
3
3
|
import { forwardRef, useState } from 'react';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { theme } from '../../design_system/theme.js';
|
|
@@ -14,8 +14,8 @@ export const TOOLTIP_SIZES = {
|
|
|
14
14
|
XSMALL: 'xsmall',
|
|
15
15
|
SMALL: 'small',
|
|
16
16
|
MEDIUM: 'medium',
|
|
17
|
-
LARGE: 'large'
|
|
18
|
-
XLARGE: 'xlarge'
|
|
17
|
+
LARGE: 'large' /* Previously WIDE */,
|
|
18
|
+
XLARGE: 'xlarge' /* Previously WIDER */,
|
|
19
19
|
};
|
|
20
20
|
// Using a styled component to get access to the `as` prop
|
|
21
21
|
const TooltipFocusArea = styled.span ``;
|
|
@@ -32,10 +32,11 @@ const StyledFloatingComponentBase = styled(FloatingComponentBase) `
|
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
34
|
|
|
35
|
-
${({ $isDarkTheme }) => $isDarkTheme &&
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
35
|
+
${({ $isDarkTheme }) => $isDarkTheme &&
|
|
36
|
+
css `
|
|
37
|
+
box-shadow: ${theme.shadow.shadow2};
|
|
38
|
+
border: 1px solid ${theme.color.neutral.smallTooltipBorder};
|
|
39
|
+
`}
|
|
39
40
|
`;
|
|
40
41
|
/**
|
|
41
42
|
* Tooltip appears on hover, for onclick use Popover
|
|
@@ -59,7 +60,7 @@ export const Tooltip = ({ as, className, delayShow = 500, delayHide = 50, shortc
|
|
|
59
60
|
const tooltipProps = {
|
|
60
61
|
isOpen: open,
|
|
61
62
|
...rest,
|
|
62
|
-
content: _jsx(TooltipContent, { content: tooltipSafeHtml(rest.content), shortcuts: shortcuts, imageUrl: imageUrl, subtleText: subtleText, size: size, textAlign: textAlign }),
|
|
63
|
+
content: (_jsx(TooltipContent, { content: tooltipSafeHtml(rest.content), shortcuts: shortcuts, imageUrl: imageUrl, subtleText: subtleText, size: size, textAlign: textAlign })),
|
|
63
64
|
};
|
|
64
65
|
return (_jsx(TooltipFocusArea, { as: as, className: className, ref: refs.setReference, ...getReferenceProps(), children: _jsx("div", { ref: refs.setFloating, ...getFloatingProps(), children: _jsx(StyledFloatingComponentBase, { ...tooltipProps, "$isDarkTheme": uiTheme === 'DARK' }) }) }));
|
|
65
66
|
};
|
|
@@ -67,7 +68,7 @@ export function withTooltip(Component) {
|
|
|
67
68
|
const Enhanced = forwardRef(({ tooltipProps, ...rest }, ref) => {
|
|
68
69
|
if (!tooltipProps)
|
|
69
70
|
return _jsx(Component, { ...rest, ref: ref });
|
|
70
|
-
return _jsx(Tooltip, { ...tooltipProps, children: _jsx(Component, { ...rest, ref: ref }) });
|
|
71
|
+
return (_jsx(Tooltip, { ...tooltipProps, children: _jsx(Component, { ...rest, ref: ref }) }));
|
|
71
72
|
});
|
|
72
73
|
Enhanced.displayName = `WithTooltip:${Component.displayName || Component.name}`;
|
|
73
74
|
return Enhanced;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip.js","sourceRoot":"","sources":["../../../../src/components/flo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AAG,YAAY,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC;AAkEnH,eAAO,MAAM,cAAc,GAAI,gEAO5B,YAAY,
|
|
1
|
+
{"version":3,"file":"tooltip_content.d.ts","sourceRoot":"","sources":["../../../../src/components/floating/tooltip_content.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,YAAY,EAAiC,MAAM,cAAc,CAAC;AAGhF,KAAK,YAAY,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,GAAG,YAAY,GAAG,MAAM,GAAG,WAAW,CAAC,CAAC;AAkEnH,eAAO,MAAM,cAAc,GAAI,gEAO5B,YAAY,4CAmBd,CAAC"}
|
|
@@ -39,13 +39,13 @@ const StyledContent = styled.div `
|
|
|
39
39
|
align-items: ${({ $textAlign }) => ($textAlign === 'center' ? 'center' : 'flex-start')};
|
|
40
40
|
|
|
41
41
|
/* When there is no child with subtleText class */
|
|
42
|
-
&:not(:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT})){
|
|
42
|
+
&:not(:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT})) {
|
|
43
43
|
flex-direction: row;
|
|
44
44
|
flex-wrap: wrap;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/* When there is a child with subtleText class */
|
|
48
|
-
&:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT}){
|
|
48
|
+
&:has(.${TOOLTIP_CLASSNAMES.SUBTLE_TEXT}) {
|
|
49
49
|
text-align: left;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -65,6 +65,6 @@ const StyledContent = styled.div `
|
|
|
65
65
|
}
|
|
66
66
|
`;
|
|
67
67
|
export const TooltipContent = ({ content, shortcuts = [], imageUrl, subtleText, size = TOOLTIP_SIZES.SMALL, textAlign = TOOLTIP_TEXT_ALIGNS.LEFT, }) => {
|
|
68
|
-
return (_jsxs(StyledContent, { "$size": size, "$textAlign": textAlign, children: [imageUrl &&
|
|
68
|
+
return (_jsxs(StyledContent, { "$size": size, "$textAlign": textAlign, children: [imageUrl && _jsx("img", { src: imageUrl, alt: "", className: TOOLTIP_CLASSNAMES.IMAGE }), _jsxs("div", { className: TOOLTIP_CLASSNAMES.TEXT_CONTENT, children: [content, subtleText && _jsx("div", { className: TOOLTIP_CLASSNAMES.SUBTLE_TEXT, children: subtleText }), shortcuts.length > 0 && (_jsx("div", { className: TOOLTIP_CLASSNAMES.SHORTCUT_CONTAINER, children: shortcuts.map((shortcut, index) => (_jsx(Shortcut, { dark: true, children: shortcut }, `${shortcut}-${index}`))) }))] })] }));
|
|
69
69
|
};
|
|
70
70
|
//# sourceMappingURL=tooltip_content.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tooltip_content.js","sourceRoot":"","sources":["../../../../src/components/floating/tooltip_content.tsx"],"names":[],"mappings":";AAAA,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,aAAa,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAIlE,MAAM,oBAAoB,GAAgC;IACtD,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,OAAO;IACd,MAAM,EAAE,OAAO;CAClB,CAAC;AAEF,MAAM,kBAAkB,GAAG;IACvB,KAAK,EAAE,eAAe;IACtB,YAAY,EAAE,qBAAqB;IACnC,WAAW,EAAE,oBAAoB;IACjC,kBAAkB,EAAE,2BAA2B;CACzC,CAAC;AAEX,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAsD;;;WAG3E,KAAK,CAAC,KAAK,CAAC,MAAM;;iBAEZ,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,GAAG,CAAA,QAAQ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BAAkB;;mBAE7B,KAAK,CAAC,KAAK,CAAC,MAAM;;;;;;;;CAQpC,CAAC;AAEF,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,EAC3B,OAAO,EACP,SAAS,GAAG,EAAE,EACd,QAAQ,EACR,UAAU,EACV,IAAI,GAAG,aAAa,CAAC,KAAK,EAC1B,SAAS,GAAG,mBAAmB,CAAC,IAAI,GACzB,EAAE,EAAE;IACf,OAAO,CACH,MAAC,aAAa,aAAQ,IAAI,gBAAc,SAAS,aAC5C,QAAQ,IAAI,cAAK,GAAG,EAAE,QAAQ,EAAE,GAAG,EAAC,EAAE,EAAC,SAAS,EAAE,kBAAkB,CAAC,KAAK,GAAI,EAC/E,eAAK,SAAS,EAAE,kBAAkB,CAAC,YAAY,aAC1C,OAAO,EACP,UAAU,IAAI,cAAK,SAAS,EAAE,kBAAkB,CAAC,WAAW,YAAG,UAAU,GAAO,EAChF,SAAS,CAAC,MAAM,GAAG,CAAC,IAAI,CACrB,cAAK,SAAS,EAAE,kBAAkB,CAAC,kBAAkB,YAChD,SAAS,CAAC,GAAG,CAAC,CAAC,QAAQ,EAAE,KAAK,EAAE,EAAE,CAAC,CAChC,KAAC,QAAQ,IAA8B,IAAI,kBACtC,QAAQ,IADE,GAAG,QAAQ,IAAI,KAAK,EAAE,CAE1B,CACd,CAAC,GACA,CACT,IACC,IACM,CACnB,CAAC;AACN,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.d.ts","sourceRoot":"","sources":["../../../src/components/icon_button.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAY,MAAM,iBAAiB,CAAC;AAE/D,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"icon_button.d.ts","sourceRoot":"","sources":["../../../src/components/icon_button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CAAC;AAErE;;;GAGG;AACH,eAAO,MAAM,UAAU;;;;;;;;;;cAZL,oBAAoB;UACxB,aAAa;eACR,OAAO;gBACN,OAAO;YACX,MAAM;mBACC,OAAO;2IAoD7B,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { forwardRef } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { theme } from '../design_system/theme.js';
|
|
5
|
-
import { Button, BUTTON_SIZE_VARIANTS_CSS } from './button.js';
|
|
5
|
+
import { Button, BUTTON_SIZE_VARIANTS_CSS, } from './button.js';
|
|
6
6
|
import { Tooltip } from './floating/tooltip.js';
|
|
7
7
|
import { Link } from './link.js';
|
|
8
8
|
import { InlineSpinner, spinnerClassNames } from './spinner.js';
|
|
@@ -103,10 +103,12 @@ const getIconButtonColorStyles = (variant) => {
|
|
|
103
103
|
&:hover {
|
|
104
104
|
${backgroundHoverGradient
|
|
105
105
|
? css `
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
: css `
|
|
106
|
+
background-image: ${backgroundHoverGradient};
|
|
107
|
+
background-color: ${backgroundColor};
|
|
108
|
+
`
|
|
109
|
+
: css `
|
|
110
|
+
background-color: ${backgroundHoverColor};
|
|
111
|
+
`}
|
|
110
112
|
border-color: ${borderHoverColor || borderColor};
|
|
111
113
|
color: ${iconColor};
|
|
112
114
|
}
|
|
@@ -135,7 +137,7 @@ const StyledButton = styled(Button) `
|
|
|
135
137
|
|
|
136
138
|
/* Override default button styles */
|
|
137
139
|
box-sizing: border-box;
|
|
138
|
-
width: ${({ $size }) =>
|
|
140
|
+
width: ${({ $size }) => BUTTON_SIZE_VARIANTS_CSS[$size].size}px;
|
|
139
141
|
padding: 0;
|
|
140
142
|
|
|
141
143
|
.${spinnerClassNames.SPINNER} .path {
|
|
@@ -150,10 +152,10 @@ export const IconButton = forwardRef(({ variant = ICON_BUTTON_VARIANTS.DEFAULT,
|
|
|
150
152
|
const otherProps = { ...passThroughProps, size };
|
|
151
153
|
const component = as === 'a' ? Link : as;
|
|
152
154
|
const { iconSize, spinnerSize } = iconButtonSizeConfig[size];
|
|
153
|
-
const button = (_jsx(StyledButton, { forwardedAs: component, ref: ref, disabled: disabled || isLoading, type:
|
|
155
|
+
const button = (_jsx(StyledButton, { forwardedAs: component, ref: ref, disabled: disabled || isLoading, type: "button", "aria-label": title, LeftIcon: isLoading ? () => _jsx(InlineSpinner, { size: spinnerSize }) : () => _jsx(Icon, { size: iconSize }),
|
|
154
156
|
// We apply our own styles to the button, so we need to override the default variant
|
|
155
157
|
variant: "tertiary", "$size": size, "$variant": variant, ...otherProps }));
|
|
156
|
-
return title ? (_jsx(Tooltip, { content: title, ...tooltipProps, children: button })) : button;
|
|
158
|
+
return title ? (_jsx(Tooltip, { content: title, ...tooltipProps, children: button })) : (button);
|
|
157
159
|
});
|
|
158
160
|
IconButton.displayName = 'IconButton';
|
|
159
161
|
//# sourceMappingURL=icon_button.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/components/icon_button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAMhD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,
|
|
1
|
+
{"version":3,"file":"icon_button.js","sourceRoot":"","sources":["../../../src/components/icon_button.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAMhD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EACH,MAAM,EACN,wBAAwB,GAI3B,MAAM,aAAa,CAAC;AACrB,OAAO,EA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,SAAS;+
|
|
1
|
+
{"version":3,"file":"image.d.ts","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAEtE,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAU9C,eAAO,MAAM,KAAK;SAPT,MAAM;UACL,MAAM;YACJ,MAAM;aACL,MAAM;cACL,OAAO,GAAG,MAAM,GAAG,SAAS;+FAMxC,CAAC"}
|
|
@@ -4,6 +4,6 @@ import { useSharedUiDependencies } from '../ui_dependency_provider.js';
|
|
|
4
4
|
import { Box } from './box.js';
|
|
5
5
|
export const Image = forwardRef((props, ref) => {
|
|
6
6
|
const { InternalImage } = useSharedUiDependencies();
|
|
7
|
-
return
|
|
7
|
+
return _jsx(Box, { ref: ref, ...props, as: InternalImage });
|
|
8
8
|
});
|
|
9
9
|
//# sourceMappingURL=image.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAU9C,MAAM,CAAC,MAAM,KAAK,GAAG,UAAU,CAAsD,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IAChG,MAAM,EAAE,aAAa,EAAE,GAAG,uBAAuB,EAAE,CAAC;IACpD,OAAO,
|
|
1
|
+
{"version":3,"file":"image.js","sourceRoot":"","sources":["../../../src/components/image.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGnC,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAU9C,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SAAS,GAAG,gBAAgB,GAAG,QAAQ,CAAC;AAEpD,eAAO,MAAM,IAAI,+EAyDhB,CAAC"}
|
|
@@ -11,7 +11,7 @@ import { Box } from './box.js';
|
|
|
11
11
|
* Checks if passed url is external
|
|
12
12
|
*/
|
|
13
13
|
export const isUrlExternal = (url, windowLocationHost) => {
|
|
14
|
-
if (!url || typeof
|
|
14
|
+
if (!url || typeof url !== 'string')
|
|
15
15
|
return false;
|
|
16
16
|
const domainMatch = url.match(/^https?:\/\/([^/?#]+)(?:[/?#]|$)/i);
|
|
17
17
|
return !!(domainMatch && domainMatch[1] !== windowLocationHost);
|
|
@@ -20,7 +20,7 @@ export const isUrlExternal = (url, windowLocationHost) => {
|
|
|
20
20
|
* Checks if passed url is email
|
|
21
21
|
*/
|
|
22
22
|
export const isUrlEmail = (url) => {
|
|
23
|
-
if (!url || typeof
|
|
23
|
+
if (!url || typeof url !== 'string')
|
|
24
24
|
return false;
|
|
25
25
|
return url.startsWith('mailto:');
|
|
26
26
|
};
|
|
@@ -76,7 +76,7 @@ export const StyledAsLink = styled(Box) `
|
|
|
76
76
|
}
|
|
77
77
|
`;
|
|
78
78
|
export const Link = forwardRef(({ to, children, rel, target, hideExternalIcon, showExternalIcon, onClick, trackingId, trackingData, tabIndex, ariaHidden, ariaLabel, ...rest }, ref) => {
|
|
79
|
-
const { windowLocationHost, isHrefTrusted, trackClick, InternalLink
|
|
79
|
+
const { windowLocationHost, isHrefTrusted, trackClick, InternalLink } = useSharedUiDependencies();
|
|
80
80
|
const isExternal = isUrlExternal(to, windowLocationHost);
|
|
81
81
|
const href = getHref(to, isExternal);
|
|
82
82
|
const isEmail = isUrlEmail(to);
|
|
@@ -91,13 +91,13 @@ export const Link = forwardRef(({ to, children, rel, target, hideExternalIcon, s
|
|
|
91
91
|
...(rel?.split(' ') || []),
|
|
92
92
|
isExternal && 'external',
|
|
93
93
|
(isExternal || target === '_blank') && 'noopener',
|
|
94
|
-
|
|
94
|
+
isExternal && !isTrusted && 'nofollow',
|
|
95
95
|
]);
|
|
96
96
|
const effectiveRel = clsx(Array.from(uniqRel));
|
|
97
97
|
return (_jsxs(StyledAsLink
|
|
98
98
|
// We use the InternalLink only for internal navigation
|
|
99
99
|
, {
|
|
100
100
|
// We use the InternalLink only for internal navigation
|
|
101
|
-
forwardedAs:
|
|
101
|
+
forwardedAs: isEmail || isExternal ? 'a' : InternalLink, href: href, rel: effectiveRel, target: target || (isExternal ? '_blank' : '_self'), onClick: trackedOnClick, ref: ref, tabIndex: tabIndex, "aria-hidden": ariaHidden, "aria-label": ariaLabel, ...rest, children: [children, ((isExternal && !hideExternalIcon) || showExternalIcon) && _jsx(ExternalLinkIcon, { size: "16" })] }));
|
|
102
102
|
});
|
|
103
103
|
//# sourceMappingURL=link.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/components/link.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAa,MAAM,SAAS,CAAC;AAEhD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AACnC,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAEnD,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAgB9C;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,GAAO,EAAE,kBAA0B,EAAE,EAAE;IACjE,IAAI,CAAC,GAAG,IAAI,OAAO,
|
|
1
|
+
{"version":3,"file":"link.js","sourceRoot":"","sources":["../../../src/components/link.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,UAAU,EAAa,MA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oot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,eAAO,MAAM,iBAAiB;;;;;;;;CAQ7B,CAAC;
|
|
1
|
+
{"version":3,"file":"message.d.ts","sourceRoot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,OAAO,KAAK,EAAE,aAAa,IAAI,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AAI1E,OAAO,EAAO,KAAK,QAAQ,EAAE,MAAM,UAAU,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAI/C,eAAO,MAAM,iBAAiB;;;;;;;;CAQ7B,CAAC;AA6GF,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,SAAS,GAAG,QAAQ,CAAC;AASpE,KAAK,iBAAiB,GAAG,IAAI,CAAC,WAAW,EAAE,UAAU,CAAC,GAAG;IACrD,KAAK,EAAE,SAAS,CAAC;CACpB,CAAC;AAEF,KAAK,YAAY,GAAG,QAAQ,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,sCAAsC;IACtC,IAAI,CAAC,EAAE,iBAAiB,CAAC;IACzB,IAAI,CAAC,EAAE,iBAAiB,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;IAC3B,OAAO,CAAC,EAAE,iBAAiB,EAAE,CAAC;CACjC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CA8D1C,CAAC;AAEF,KAAK,oBAAoB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,WAAW,GAAI,OAAO,oBAAoB,4CAAuC,CAAC;AAC/F,eAAO,MAAM,cAAc,GAAI,OAAO,oBAAoB,4CAA0C,CAAC;AACrG,eAAO,MAAM,cAAc,GAAI,OAAO,oBAAoB,4CAA0C,CAAC;AACrG,eAAO,MAAM,aAAa,GAAI,OAAO,oBAAoB,4CAAyC,CAAC"}
|
|
@@ -51,26 +51,26 @@ const StyledMessage = styled(Box) `
|
|
|
51
51
|
text-decoration: underline;
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
${({ $hasCaption }) =>
|
|
54
|
+
${({ $hasCaption }) => $hasCaption
|
|
55
55
|
? css `
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
56
|
+
grid-template-areas:
|
|
57
|
+
'iconArea captionArea'
|
|
58
|
+
'descriptionArea descriptionArea';
|
|
59
|
+
`
|
|
60
|
+
: css `
|
|
61
|
+
grid-template-areas: 'iconArea descriptionArea';
|
|
62
|
+
`}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
+
${({ $boxless }) => !$boxless &&
|
|
66
|
+
css `
|
|
67
|
+
/* the dismiss button is bigger than text so we apply smaller padding on wrapper & some on the content and icon */
|
|
68
|
+
padding: ${theme.space.space8} ${theme.space.space16};
|
|
65
69
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
.${messageClassNames.content} {
|
|
71
|
-
padding: ${theme.space.space4} 0;
|
|
72
|
-
}
|
|
73
|
-
`)}
|
|
70
|
+
.${messageClassNames.content} {
|
|
71
|
+
padding: ${theme.space.space4} 0;
|
|
72
|
+
}
|
|
73
|
+
`}
|
|
74
74
|
|
|
75
75
|
.${messageClassNames.actionsWrapper} {
|
|
76
76
|
display: flex;
|
|
@@ -131,11 +131,11 @@ const typeToIcon = {
|
|
|
131
131
|
export const Message = ({ className, Icon, icon, caption, children, onDismissClick, type = 'warning', borderless = false, boxless = false, dismissTrackingId, actions = [], as, ...rest }) => {
|
|
132
132
|
const IconComponent = icon || Icon || typeToIcon[type];
|
|
133
133
|
const hasCaption = !!caption && !!children;
|
|
134
|
-
return (_jsxs(StyledMessage, { className: clsx(className, messageClassNames.main, type, borderless && 'borderless'), mb: boxless ? 'space8' : 'space16', forwardedAs: as, "$boxless": boxless, "$hasCaption": hasCaption, ...rest, children: [_jsxs("div", { className: messageClassNames.content, children: [_jsx(IconComponent, { className: messageClassNames.icon, size:
|
|
134
|
+
return (_jsxs(StyledMessage, { className: clsx(className, messageClassNames.main, type, borderless && 'borderless'), mb: boxless ? 'space8' : 'space16', forwardedAs: as, "$boxless": boxless, "$hasCaption": hasCaption, ...rest, children: [_jsxs("div", { className: messageClassNames.content, children: [_jsx(IconComponent, { className: messageClassNames.icon, size: "16" }), hasCaption && (_jsx(Text, { weight: "bold", className: messageClassNames.caption, children: caption })), _jsx("div", { className: messageClassNames.description, children: children })] }), (actions.length > 0 || onDismissClick) && (_jsxs("div", { className: messageClassNames.actionsWrapper, children: [actions.length > 0 && (_jsx(_Fragment, { children: actions.map(({ label, ...action }, index) => (_jsx(Button, { size: "small", variant: "primary", ...action, children: label }, index))) })), onDismissClick && (_jsx(Button, { size: "small", variant: "tertiary", trackingId: dismissTrackingId, onClick: onDismissClick, className: messageClassNames.dismiss, children: _jsx(CrossIcon, { size: "16", color: theme.color.neutral.icon }) }))] }))] }));
|
|
135
135
|
};
|
|
136
136
|
// Semantic classes for all the message types
|
|
137
|
-
export const InfoMessage = (props) =>
|
|
138
|
-
export const WarningMessage = (props) =>
|
|
139
|
-
export const SuccessMessage = (props) =>
|
|
140
|
-
export const DangerMessage = (props) =>
|
|
137
|
+
export const InfoMessage = (props) => _jsx(Message, { ...props, type: "info" });
|
|
138
|
+
export const WarningMessage = (props) => _jsx(Message, { ...props, type: "warning" });
|
|
139
|
+
export const SuccessMessage = (props) => _jsx(Message, { ...props, type: "success" });
|
|
140
|
+
export const DangerMessage = (props) => _jsx(Message, { ...props, type: "danger" });
|
|
141
141
|
//# sourceMappingURL=message.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"message.js","sourceRoot":"","sources":["../../../src/components/message.tsx"],"names":[],"mappings":";AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AAGxB,OAAO,MAAM,EAAE,EAAE,GAAG,EAAE,MAAM,mBAAmB,CAAC;AAGhD,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAEnG,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAClD,OAAO,EAAE,GAAG,EAAiB,MAAM,UAAU,CAAC;AAE9C,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAEvC,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC7B,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,aAAa;IAC1B,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;CACnC,CAAC;AAEF,MAAM,aAAa,GAAG,MAAM,CAAC,GAAG,CAAC,CAA+C;;;WAGrE,KAAK,CAAC,KA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AAK,KAAK,EAAE,IAAI,EAAC,SAAS,GAAG,CAAC;AACrG,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,KAAC,OAAO,OAAK,KAAK,EAAE,IAAI,EAAC,SAAS,GAAG,CAAC;AACrG,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,KAA2B,EAAE,EAAE,CAAC,KAAC,OAAO,OAAK,KAAK,EAAE,IAAI,EAAC,QAAQ,GAAG,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../../src/components/rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIzC,KAAK,gBAAgB,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,
|
|
1
|
+
{"version":3,"file":"rating.d.ts","sourceRoot":"","sources":["../../../src/components/rating.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAMhC,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAG1D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAIzC,KAAK,gBAAgB,GAAG;IACpB,WAAW,EAAE,MAAM,CAAC,YAAY,EAAE,MAAM,CAAC,CAAC;CAC7C,CAAC;AAyCF,KAAK,qBAAqB,GAAG,QAAQ,GAAG;IACpC,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,EAAE,CAAC,qBAAqB,CAMtD,CAAC;AAGF,KAAK,WAAW,GAAG,QAAQ,GAAG;IAC1B,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,EAAE,CAAC,WAAW,CAiBlC,CAAC;AAEF,eAAO,MAAM,WAAW,EAAE,EAAE,CAAC,gBAAgB,GAAG,QAAQ,CAqBvD,CAAC"}
|
|
@@ -30,7 +30,7 @@ const StyledRatingBar = styled(Box) `
|
|
|
30
30
|
overflow: hidden;
|
|
31
31
|
|
|
32
32
|
&::after {
|
|
33
|
-
content:
|
|
33
|
+
content: '';
|
|
34
34
|
position: absolute;
|
|
35
35
|
display: block;
|
|
36
36
|
height: 100%;
|
|
@@ -39,7 +39,6 @@ const StyledRatingBar = styled(Box) `
|
|
|
39
39
|
border-radius: 10px;
|
|
40
40
|
background: ${theme.color.neutral.icon};
|
|
41
41
|
width: ${({ $widthPercent }) => $widthPercent}%;
|
|
42
|
-
|
|
43
42
|
}
|
|
44
43
|
`;
|
|
45
44
|
export const SingleStarRating = ({ color = theme.color.neutral.icon, ...rest }) => {
|
|
@@ -55,14 +54,14 @@ export const Rating = ({ rating = 0, color = theme.color.neutral.icon, ...rest }
|
|
|
55
54
|
return _jsx(StarHalfIcon, { size: "12", color: color }, rate);
|
|
56
55
|
return _jsx(StarEmptyIcon, { size: "12", color: color }, rate);
|
|
57
56
|
}), [rating, color]);
|
|
58
|
-
return
|
|
57
|
+
return _jsx(StyledRating, { ...rest, children: ratingStatsContent });
|
|
59
58
|
};
|
|
60
59
|
export const RatingStats = ({ ratingStats, ...rest }) => {
|
|
61
60
|
const totalRates = ratingStats[1] + ratingStats[2] + ratingStats[3] + ratingStats[4] + ratingStats[5];
|
|
62
61
|
const ratingStatsContent = useMemo(() => [5, 4, 3, 2, 1].map((rate) => {
|
|
63
|
-
const widthPercent = totalRates > 0 ? (
|
|
64
|
-
return (_jsxs(Fragment, { children: [_jsx(Text, { align:
|
|
62
|
+
const widthPercent = totalRates > 0 ? (ratingStats[rate] / totalRates) * 100 : 0;
|
|
63
|
+
return (_jsxs(Fragment, { children: [_jsx(Text, { align: "center", color: theme.color.neutral.textSubtle, children: rate }), _jsx(StyledRatingBar, { "$widthPercent": widthPercent })] }, rate));
|
|
65
64
|
}), [totalRates, ratingStats]);
|
|
66
|
-
return
|
|
65
|
+
return _jsx(StyledRatingStats, { ...rest, children: ratingStatsContent });
|
|
67
66
|
};
|
|
68
67
|
//# sourceMappingURL=rating.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../../src/components/rating.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,MAAM,MAAM,mBAAmB,CAAC;AAEvC,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAI5E,OAAO,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAC;AAElD,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAC/B,OAAO,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAC;AAMvC,MAAM,YAAY,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;CAG/B,CAAC;AAEF,MAAM,iBAAiB,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;;;;eAItB,KAAK,CAAC,KAAK,CAAC,MAAM;;;;;;;;CAQhC,CAAC;AAEF,MAAM,eAAe,GAAG,MAAM,CAAC,GAAG,CAAC,CAA2B;;;kBAG5C,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ;;;;;;;;;;;;sBAYxB,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;iBAC7B,CAAC,EAAE,aAAa,EAAE,EAAE,EAAE,CAAC,aAAa
|
|
1
|
+
{"version":3,"file":"rating.js","sourceRoot":"","sources":["../../../src/components/rating.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MA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,CAAC,IAAI,EAAE,EAAE;QACpC,MAAM,YAAY,GAAG,UAAU,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,IAAI,CAAC,GAAG,UAAU,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QAEjF,OAAO,CACH,MAAC,QAAQ,eACL,KAAC,IAAI,IAAC,KAAK,EAAC,QAAQ,EAAC,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,YACrD,IAAI,GACF,EACP,KAAC,eAAe,qBAAgB,YAAY,GAAI,KAJrC,IAAI,CAKR,CACd,CAAC;IACN,CAAC,CAAC,EACN,CAAC,UAAU,EAAE,WAAW,CAAC,CAC5B,CAAC;IAEF,OAAO,KAAC,iBAAiB,OAAK,IAAI,YAAG,kBAAkB,GAAqB,CAAC;AACjF,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pythonize_value.d.ts","sourceRoot":"","sources":["../../../../src/components/readme_renderer/pythonize_value.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,cAAS,KAAG,MAAM,GAAG,
|
|
1
|
+
{"version":3,"file":"pythonize_value.d.ts","sourceRoot":"","sources":["../../../../src/components/readme_renderer/pythonize_value.ts"],"names":[],"mappings":"AAoCA,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,OAAO,CAAC,EAAE,cAAS,KAAG,MAAM,GAAG,CAmDhE,CAAC"}
|
|
@@ -59,9 +59,10 @@ export const pythonizeValue = (value, depth = 0) => {
|
|
|
59
59
|
return '[]';
|
|
60
60
|
if (value.length === 1)
|
|
61
61
|
return '[' + pythonizeValue(value[0], depth + 1) + ']';
|
|
62
|
-
return '[\n'
|
|
63
|
-
|
|
64
|
-
|
|
62
|
+
return ('[\n' +
|
|
63
|
+
value.map((v) => INDENT.repeat(depth + 1) + pythonizeValue(v, depth + 1) + ',\n').join('') +
|
|
64
|
+
INDENT.repeat(depth) +
|
|
65
|
+
']');
|
|
65
66
|
}
|
|
66
67
|
// Object values
|
|
67
68
|
if (typeof value === 'object') {
|
|
@@ -70,9 +71,12 @@ export const pythonizeValue = (value, depth = 0) => {
|
|
|
70
71
|
return '{}';
|
|
71
72
|
if (entries.length === 1)
|
|
72
73
|
return '{ ' + pythonQuoteString(entries[0][0]) + ': ' + pythonizeValue(entries[0][1], depth + 1) + ' }';
|
|
73
|
-
return '{\n'
|
|
74
|
-
|
|
75
|
-
|
|
74
|
+
return ('{\n' +
|
|
75
|
+
entries
|
|
76
|
+
.map(([k, v]) => INDENT.repeat(depth + 1) + pythonQuoteString(k) + ': ' + pythonizeValue(v, depth + 1) + ',\n')
|
|
77
|
+
.join('') +
|
|
78
|
+
INDENT.repeat(depth) +
|
|
79
|
+
'}');
|
|
76
80
|
}
|
|
77
81
|
// This should never happen, if it did, something went wrong
|
|
78
82
|
return 'UNSUPPORTED VALUE';
|