@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.
Files changed (339) hide show
  1. package/README.md +3 -3
  2. package/dist/src/components/action_link.d.ts.map +1 -1
  3. package/dist/src/components/action_link.js +3 -3
  4. package/dist/src/components/action_link.js.map +1 -1
  5. package/dist/src/components/actor_template_card.d.ts.map +1 -1
  6. package/dist/src/components/actor_template_card.js +3 -3
  7. package/dist/src/components/actor_template_card.js.map +1 -1
  8. package/dist/src/components/avatar/actor_avatar.d.ts.map +1 -1
  9. package/dist/src/components/avatar/actor_avatar.js +3 -3
  10. package/dist/src/components/avatar/actor_avatar.js.map +1 -1
  11. package/dist/src/components/avatar/boring_avatar.d.ts.map +1 -1
  12. package/dist/src/components/avatar/boring_avatar.js +8 -7
  13. package/dist/src/components/avatar/boring_avatar.js.map +1 -1
  14. package/dist/src/components/avatar/user_avatar.d.ts.map +1 -1
  15. package/dist/src/components/avatar/user_avatar.js +1 -1
  16. package/dist/src/components/avatar/user_avatar.js.map +1 -1
  17. package/dist/src/components/badge.d.ts.map +1 -1
  18. package/dist/src/components/badge.js +10 -3
  19. package/dist/src/components/badge.js.map +1 -1
  20. package/dist/src/components/banner.d.ts.map +1 -1
  21. package/dist/src/components/banner.js +4 -3
  22. package/dist/src/components/banner.js.map +1 -1
  23. package/dist/src/components/blog_article.d.ts.map +1 -1
  24. package/dist/src/components/blog_article.js +2 -3
  25. package/dist/src/components/blog_article.js.map +1 -1
  26. package/dist/src/components/box.d.ts.map +1 -1
  27. package/dist/src/components/box.js +32 -24
  28. package/dist/src/components/box.js.map +1 -1
  29. package/dist/src/components/breadcrumb/breadcrumb.d.ts.map +1 -1
  30. package/dist/src/components/breadcrumb/breadcrumb.js +1 -1
  31. package/dist/src/components/breadcrumb/breadcrumb.js.map +1 -1
  32. package/dist/src/components/button.d.ts.map +1 -1
  33. package/dist/src/components/button.js +12 -9
  34. package/dist/src/components/button.js.map +1 -1
  35. package/dist/src/components/card_container.d.ts.map +1 -1
  36. package/dist/src/components/card_container.js +5 -3
  37. package/dist/src/components/card_container.js.map +1 -1
  38. package/dist/src/components/checkbox/checkbox.d.ts.map +1 -1
  39. package/dist/src/components/checkbox/checkbox.js +1 -1
  40. package/dist/src/components/checkbox/checkbox.js.map +1 -1
  41. package/dist/src/components/checkbox/checkbox.style.d.ts.map +1 -1
  42. package/dist/src/components/checkbox/checkbox.style.js +7 -4
  43. package/dist/src/components/checkbox/checkbox.style.js.map +1 -1
  44. package/dist/src/components/chip.d.ts.map +1 -1
  45. package/dist/src/components/chip.js +1 -1
  46. package/dist/src/components/chip.js.map +1 -1
  47. package/dist/src/components/code/action_button.d.ts.map +1 -1
  48. package/dist/src/components/code/action_button.js +5 -5
  49. package/dist/src/components/code/action_button.js.map +1 -1
  50. package/dist/src/components/code/code_block/code_block.d.ts.map +1 -1
  51. package/dist/src/components/code/code_block/code_block.js +19 -8
  52. package/dist/src/components/code/code_block/code_block.js.map +1 -1
  53. package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -1
  54. package/dist/src/components/code/code_block/code_block.styled.js +18 -15
  55. package/dist/src/components/code/code_block/code_block.styled.js.map +1 -1
  56. package/dist/src/components/code/code_block/code_block_with_tabs.d.ts.map +1 -1
  57. package/dist/src/components/code/code_block/code_block_with_tabs.js +10 -8
  58. package/dist/src/components/code/code_block/code_block_with_tabs.js.map +1 -1
  59. package/dist/src/components/code/code_block/utils.d.ts.map +1 -1
  60. package/dist/src/components/code/code_block/utils.js.map +1 -1
  61. package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -1
  62. package/dist/src/components/code/inline_code/inline_code.js +2 -2
  63. package/dist/src/components/code/inline_code/inline_code.js.map +1 -1
  64. package/dist/src/components/code/one_light_theme.d.ts.map +1 -1
  65. package/dist/src/components/code/one_light_theme.js +2 -17
  66. package/dist/src/components/code/one_light_theme.js.map +1 -1
  67. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -1
  68. package/dist/src/components/code/one_line_code/one_line_code.js +11 -14
  69. package/dist/src/components/code/one_line_code/one_line_code.js.map +1 -1
  70. package/dist/src/components/code/prism_highlighter.d.ts.map +1 -1
  71. package/dist/src/components/code/prism_highlighter.js +35 -27
  72. package/dist/src/components/code/prism_highlighter.js.map +1 -1
  73. package/dist/src/components/code/prism_python.js.map +1 -1
  74. package/dist/src/components/collapsible_card/collapsible_card.d.ts.map +1 -1
  75. package/dist/src/components/collapsible_card/collapsible_card.js +7 -6
  76. package/dist/src/components/collapsible_card/collapsible_card.js.map +1 -1
  77. package/dist/src/components/color_wheel_gradient.d.ts.map +1 -1
  78. package/dist/src/components/color_wheel_gradient.js +4 -2
  79. package/dist/src/components/color_wheel_gradient.js.map +1 -1
  80. package/dist/src/components/floating/floating_component_base.d.ts +1 -1
  81. package/dist/src/components/floating/floating_component_base.d.ts.map +1 -1
  82. package/dist/src/components/floating/floating_component_base.js +3 -5
  83. package/dist/src/components/floating/floating_component_base.js.map +1 -1
  84. package/dist/src/components/floating/menu.d.ts.map +1 -1
  85. package/dist/src/components/floating/menu.js +11 -5
  86. package/dist/src/components/floating/menu.js.map +1 -1
  87. package/dist/src/components/floating/menu_common.d.ts +4 -4
  88. package/dist/src/components/floating/menu_common.d.ts.map +1 -1
  89. package/dist/src/components/floating/menu_common.js +1 -1
  90. package/dist/src/components/floating/menu_common.js.map +1 -1
  91. package/dist/src/components/floating/menu_components.d.ts.map +1 -1
  92. package/dist/src/components/floating/menu_components.js +9 -7
  93. package/dist/src/components/floating/menu_components.js.map +1 -1
  94. package/dist/src/components/floating/tooltip.d.ts +2 -2
  95. package/dist/src/components/floating/tooltip.d.ts.map +1 -1
  96. package/dist/src/components/floating/tooltip.js +10 -9
  97. package/dist/src/components/floating/tooltip.js.map +1 -1
  98. package/dist/src/components/floating/tooltip_content.d.ts.map +1 -1
  99. package/dist/src/components/floating/tooltip_content.js +3 -3
  100. package/dist/src/components/floating/tooltip_content.js.map +1 -1
  101. package/dist/src/components/icon_button.d.ts.map +1 -1
  102. package/dist/src/components/icon_button.js +10 -8
  103. package/dist/src/components/icon_button.js.map +1 -1
  104. package/dist/src/components/image.d.ts.map +1 -1
  105. package/dist/src/components/image.js +1 -1
  106. package/dist/src/components/image.js.map +1 -1
  107. package/dist/src/components/link.d.ts.map +1 -1
  108. package/dist/src/components/link.js +5 -5
  109. package/dist/src/components/link.js.map +1 -1
  110. package/dist/src/components/message.d.ts.map +1 -1
  111. package/dist/src/components/message.js +21 -21
  112. package/dist/src/components/message.js.map +1 -1
  113. package/dist/src/components/rating.d.ts.map +1 -1
  114. package/dist/src/components/rating.js +5 -6
  115. package/dist/src/components/rating.js.map +1 -1
  116. package/dist/src/components/readme_renderer/pythonize_value.d.ts.map +1 -1
  117. package/dist/src/components/readme_renderer/pythonize_value.js +10 -6
  118. package/dist/src/components/readme_renderer/pythonize_value.js.map +1 -1
  119. package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -1
  120. package/dist/src/components/readme_renderer/table_of_contents.js +16 -15
  121. package/dist/src/components/readme_renderer/table_of_contents.js.map +1 -1
  122. package/dist/src/components/readme_renderer/utils.d.ts.map +1 -1
  123. package/dist/src/components/readme_renderer/utils.js +6 -6
  124. package/dist/src/components/readme_renderer/utils.js.map +1 -1
  125. package/dist/src/components/select/select.d.ts.map +1 -1
  126. package/dist/src/components/select/select.js +14 -13
  127. package/dist/src/components/select/select.js.map +1 -1
  128. package/dist/src/components/shortcut.d.ts +1 -1
  129. package/dist/src/components/shortcut.d.ts.map +1 -1
  130. package/dist/src/components/shortcut.js +2 -2
  131. package/dist/src/components/shortcut.js.map +1 -1
  132. package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -1
  133. package/dist/src/components/simple_markdown/simple_markdown.js +32 -35
  134. package/dist/src/components/simple_markdown/simple_markdown.js.map +1 -1
  135. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -1
  136. package/dist/src/components/simple_markdown/simple_markdown_components.js +26 -12
  137. package/dist/src/components/simple_markdown/simple_markdown_components.js.map +1 -1
  138. package/dist/src/components/spinner.d.ts.map +1 -1
  139. package/dist/src/components/spinner.js +3 -1
  140. package/dist/src/components/spinner.js.map +1 -1
  141. package/dist/src/components/store/store_actor_header.d.ts.map +1 -1
  142. package/dist/src/components/store/store_actor_header.js +1 -1
  143. package/dist/src/components/store/store_actor_header.js.map +1 -1
  144. package/dist/src/components/switch/switch.d.ts.map +1 -1
  145. package/dist/src/components/switch/switch.js +1 -1
  146. package/dist/src/components/switch/switch.js.map +1 -1
  147. package/dist/src/components/switch/switch.style.d.ts.map +1 -1
  148. package/dist/src/components/switch/switch.style.js +5 -3
  149. package/dist/src/components/switch/switch.style.js.map +1 -1
  150. package/dist/src/components/table/table.styled.js +3 -3
  151. package/dist/src/components/table/table.styled.js.map +1 -1
  152. package/dist/src/components/table/table_error_row.d.ts.map +1 -1
  153. package/dist/src/components/table/table_error_row.js +1 -1
  154. package/dist/src/components/table/table_error_row.js.map +1 -1
  155. package/dist/src/components/table/table_row.d.ts.map +1 -1
  156. package/dist/src/components/table/table_row.js +1 -1
  157. package/dist/src/components/table/table_row.js.map +1 -1
  158. package/dist/src/components/table/table_wrapper.d.ts.map +1 -1
  159. package/dist/src/components/table/table_wrapper.js +3 -3
  160. package/dist/src/components/table/table_wrapper.js.map +1 -1
  161. package/dist/src/components/tabs/tab.d.ts.map +1 -1
  162. package/dist/src/components/tabs/tab.js +7 -5
  163. package/dist/src/components/tabs/tab.js.map +1 -1
  164. package/dist/src/components/tabs/tabs.d.ts.map +1 -1
  165. package/dist/src/components/tabs/tabs.js +3 -3
  166. package/dist/src/components/tabs/tabs.js.map +1 -1
  167. package/dist/src/components/tag.d.ts +1 -1
  168. package/dist/src/components/tag.d.ts.map +1 -1
  169. package/dist/src/components/tag.js +1 -1
  170. package/dist/src/components/tag.js.map +1 -1
  171. package/dist/src/components/text/heading_content.d.ts.map +1 -1
  172. package/dist/src/components/text/heading_content.js +1 -1
  173. package/dist/src/components/text/heading_content.js.map +1 -1
  174. package/dist/src/components/text/heading_marketing.d.ts.map +1 -1
  175. package/dist/src/components/text/heading_marketing.js +1 -1
  176. package/dist/src/components/text/heading_marketing.js.map +1 -1
  177. package/dist/src/components/text/heading_shared.d.ts.map +1 -1
  178. package/dist/src/components/text/heading_shared.js +1 -1
  179. package/dist/src/components/text/heading_shared.js.map +1 -1
  180. package/dist/src/components/text/index.d.ts +1 -1
  181. package/dist/src/components/text/index.d.ts.map +1 -1
  182. package/dist/src/components/text/text_base.d.ts.map +1 -1
  183. package/dist/src/components/text/text_base.js +16 -12
  184. package/dist/src/components/text/text_base.js.map +1 -1
  185. package/dist/src/components/text/text_content.d.ts.map +1 -1
  186. package/dist/src/components/text/text_content.js +1 -1
  187. package/dist/src/components/text/text_content.js.map +1 -1
  188. package/dist/src/components/text/text_marketing.d.ts.map +1 -1
  189. package/dist/src/components/text/text_marketing.js +1 -1
  190. package/dist/src/components/text/text_marketing.js.map +1 -1
  191. package/dist/src/components/text/text_shared.d.ts +1 -1
  192. package/dist/src/components/text/text_shared.d.ts.map +1 -1
  193. package/dist/src/components/text/text_shared.js +1 -1
  194. package/dist/src/components/text/text_shared.js.map +1 -1
  195. package/dist/src/components/tile/horizontal_tile.d.ts.map +1 -1
  196. package/dist/src/components/tile/horizontal_tile.js +3 -2
  197. package/dist/src/components/tile/horizontal_tile.js.map +1 -1
  198. package/dist/src/components/tile/shared.d.ts +1 -1
  199. package/dist/src/components/tile/shared.d.ts.map +1 -1
  200. package/dist/src/components/tile/vertical_tile.d.ts.map +1 -1
  201. package/dist/src/components/tile/vertical_tile.js +3 -2
  202. package/dist/src/components/tile/vertical_tile.js.map +1 -1
  203. package/dist/src/components/to_consolidate/card.d.ts.map +1 -1
  204. package/dist/src/components/to_consolidate/card.js +20 -15
  205. package/dist/src/components/to_consolidate/card.js.map +1 -1
  206. package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -1
  207. package/dist/src/components/to_consolidate/markdown.js +36 -20
  208. package/dist/src/components/to_consolidate/markdown.js.map +1 -1
  209. package/dist/src/components/to_consolidate/pagination.d.ts.map +1 -1
  210. package/dist/src/components/to_consolidate/pagination.js +6 -6
  211. package/dist/src/components/to_consolidate/pagination.js.map +1 -1
  212. package/dist/src/components/to_consolidate/tab_number_chip.d.ts.map +1 -1
  213. package/dist/src/components/to_consolidate/tab_number_chip.js +1 -1
  214. package/dist/src/components/to_consolidate/tab_number_chip.js.map +1 -1
  215. package/dist/src/design_system/theme.d.ts.map +1 -1
  216. package/dist/src/design_system/theme.js +1 -1
  217. package/dist/src/design_system/theme.js.map +1 -1
  218. package/dist/src/design_system/typography_theme.d.ts.map +1 -1
  219. package/dist/src/design_system/typography_theme.js.map +1 -1
  220. package/dist/src/ui_dependency_provider.d.ts.map +1 -1
  221. package/dist/src/ui_dependency_provider.js +2 -2
  222. package/dist/src/ui_dependency_provider.js.map +1 -1
  223. package/dist/tsconfig.build.tsbuildinfo +1 -1
  224. package/package.json +8 -6
  225. package/src/codemods/generate_typograpy_tokens_files.mjs +23 -28
  226. package/src/components/action_link.tsx +13 -23
  227. package/src/components/actor_template_card.stories.tsx +20 -14
  228. package/src/components/actor_template_card.tsx +4 -21
  229. package/src/components/avatar/actor_avatar.tsx +3 -4
  230. package/src/components/avatar/boring_avatar.tsx +134 -167
  231. package/src/components/avatar/user_avatar.stories.tsx +1 -5
  232. package/src/components/avatar/user_avatar.tsx +6 -20
  233. package/src/components/badge.stories.jsx +26 -40
  234. package/src/components/badge.tsx +37 -26
  235. package/src/components/banner.stories.tsx +10 -28
  236. package/src/components/banner.tsx +11 -14
  237. package/src/components/blog_article.tsx +6 -4
  238. package/src/components/box.tsx +90 -89
  239. package/src/components/breadcrumb/breadcrumb.stories.tsx +2 -8
  240. package/src/components/breadcrumb/breadcrumb.tsx +7 -5
  241. package/src/components/button.stories.tsx +70 -66
  242. package/src/components/button.tsx +33 -39
  243. package/src/components/card_container.stories.tsx +28 -29
  244. package/src/components/card_container.tsx +15 -10
  245. package/src/components/checkbox/checkbox.stories.tsx +52 -17
  246. package/src/components/checkbox/checkbox.style.ts +7 -4
  247. package/src/components/checkbox/checkbox.tsx +6 -9
  248. package/src/components/chip.stories.tsx +15 -5
  249. package/src/components/chip.tsx +26 -16
  250. package/src/components/code/action_button.tsx +10 -12
  251. package/src/components/code/code_block/code_block.stories.jsx +7 -25
  252. package/src/components/code/code_block/code_block.styled.tsx +26 -19
  253. package/src/components/code/code_block/code_block.tsx +26 -24
  254. package/src/components/code/code_block/code_block_with_tabs.stories.tsx +12 -18
  255. package/src/components/code/code_block/code_block_with_tabs.tsx +30 -16
  256. package/src/components/code/code_block/utils.tsx +23 -15
  257. package/src/components/code/inline_code/inline_code.stories.tsx +18 -10
  258. package/src/components/code/inline_code/inline_code.tsx +16 -21
  259. package/src/components/code/one_light_theme.ts +2 -17
  260. package/src/components/code/one_line_code/one_line_code.stories.tsx +31 -19
  261. package/src/components/code/one_line_code/one_line_code.tsx +19 -30
  262. package/src/components/code/prism_highlighter.tsx +117 -109
  263. package/src/components/code/prism_python.ts +4 -2
  264. package/src/components/collapsible_card/collapsible_card.stories.tsx +2 -1
  265. package/src/components/collapsible_card/collapsible_card.tsx +30 -15
  266. package/src/components/color_wheel_gradient.tsx +9 -7
  267. package/src/components/floating/floating_component_base.tsx +16 -9
  268. package/src/components/floating/menu.tsx +37 -46
  269. package/src/components/floating/menu_common.tsx +24 -30
  270. package/src/components/floating/menu_components.tsx +24 -24
  271. package/src/components/floating/tooltip.stories.jsx +85 -68
  272. package/src/components/floating/tooltip.tsx +32 -39
  273. package/src/components/floating/tooltip_content.tsx +8 -16
  274. package/src/components/icon_button.stories.tsx +176 -188
  275. package/src/components/icon_button.tsx +72 -58
  276. package/src/components/image.tsx +5 -11
  277. package/src/components/link.stories.tsx +4 -2
  278. package/src/components/link.tsx +70 -70
  279. package/src/components/message.stories.jsx +35 -33
  280. package/src/components/message.tsx +45 -45
  281. package/src/components/rating.tsx +37 -44
  282. package/src/components/readme_renderer/pythonize_value.ts +19 -7
  283. package/src/components/readme_renderer/table_of_contents.stories.tsx +40 -15
  284. package/src/components/readme_renderer/table_of_contents.tsx +87 -85
  285. package/src/components/readme_renderer/utils.tsx +17 -13
  286. package/src/components/select/select.stories.tsx +19 -46
  287. package/src/components/select/select.tsx +103 -101
  288. package/src/components/shortcut.stories.jsx +23 -14
  289. package/src/components/shortcut.tsx +2 -13
  290. package/src/components/simple_markdown/simple_markdown.stories.tsx +5 -10
  291. package/src/components/simple_markdown/simple_markdown.tsx +152 -55
  292. package/src/components/simple_markdown/simple_markdown_components.tsx +49 -59
  293. package/src/components/spinner.stories.tsx +14 -8
  294. package/src/components/spinner.tsx +5 -3
  295. package/src/components/store/store_actor_header.stories.tsx +2 -11
  296. package/src/components/store/store_actor_header.tsx +20 -16
  297. package/src/components/switch/switch.stories.jsx +4 -12
  298. package/src/components/switch/switch.style.ts +5 -3
  299. package/src/components/switch/switch.tsx +3 -13
  300. package/src/components/table/table.stories.tsx +5 -2
  301. package/src/components/table/table.styled.ts +3 -3
  302. package/src/components/table/table_error_row.tsx +5 -1
  303. package/src/components/table/table_row.tsx +1 -5
  304. package/src/components/table/table_wrapper.tsx +12 -12
  305. package/src/components/tabs/tab.stories.tsx +1 -5
  306. package/src/components/tabs/tab.tsx +33 -13
  307. package/src/components/tabs/tabs.tsx +14 -18
  308. package/src/components/tag.stories.jsx +35 -45
  309. package/src/components/tag.tsx +18 -22
  310. package/src/components/text/heading_content.stories.tsx +13 -24
  311. package/src/components/text/heading_content.tsx +3 -7
  312. package/src/components/text/heading_marketing.stories.tsx +4 -3
  313. package/src/components/text/heading_marketing.tsx +12 -8
  314. package/src/components/text/heading_shared.stories.tsx +3 -2
  315. package/src/components/text/heading_shared.tsx +3 -7
  316. package/src/components/text/index.ts +1 -3
  317. package/src/components/text/text_base.tsx +29 -35
  318. package/src/components/text/text_content.stories.tsx +17 -13
  319. package/src/components/text/text_content.tsx +20 -23
  320. package/src/components/text/text_marketing.stories.tsx +4 -3
  321. package/src/components/text/text_marketing.tsx +20 -23
  322. package/src/components/text/text_shared.stories.tsx +4 -3
  323. package/src/components/text/text_shared.tsx +23 -27
  324. package/src/components/tile/horizontal_tile.stories.tsx +6 -2
  325. package/src/components/tile/horizontal_tile.tsx +5 -15
  326. package/src/components/tile/shared.ts +5 -5
  327. package/src/components/tile/vertical_tile.stories.tsx +10 -18
  328. package/src/components/tile/vertical_tile.tsx +4 -9
  329. package/src/components/to_consolidate/card.stories.tsx +3 -1
  330. package/src/components/to_consolidate/card.tsx +67 -58
  331. package/src/components/to_consolidate/markdown.tsx +76 -62
  332. package/src/components/to_consolidate/pagination.tsx +11 -15
  333. package/src/components/to_consolidate/tab_number_chip.tsx +5 -6
  334. package/src/design_system/colors/build_color_tokens.js +7 -15
  335. package/src/design_system/theme.ts +1 -8
  336. package/src/design_system/tokens/radiuses.stories.tsx +9 -1
  337. package/src/design_system/tokens/shadows.stories.tsx +3 -1
  338. package/src/design_system/typography_theme.ts +78 -39
  339. package/src/ui_dependency_provider.tsx +16 -23
@@ -12,23 +12,23 @@ import { Box, type BoxProps } from './box.js';
12
12
 
13
13
  export type To = string | Partial<Path>;
14
14
  export interface RegularLinkProps {
15
- to: To,
16
- hideExternalIcon?: boolean,
17
- showExternalIcon?: boolean,
18
- rel?: string,
19
- target?: string,
20
- trackingId?: string,
21
- trackingData?: object,
22
- tabIndex?: number,
23
- ariaHidden?: boolean,
24
- ariaLabel?: string,
15
+ to: To;
16
+ hideExternalIcon?: boolean;
17
+ showExternalIcon?: boolean;
18
+ rel?: string;
19
+ target?: string;
20
+ trackingId?: string;
21
+ trackingData?: object;
22
+ tabIndex?: number;
23
+ ariaHidden?: boolean;
24
+ ariaLabel?: string;
25
25
  }
26
26
 
27
27
  /**
28
28
  * Checks if passed url is external
29
29
  */
30
30
  export const isUrlExternal = (url: To, windowLocationHost: string) => {
31
- if (!url || typeof (url) !== 'string') return false;
31
+ if (!url || typeof url !== 'string') return false;
32
32
  const domainMatch = url.match(/^https?:\/\/([^/?#]+)(?:[/?#]|$)/i);
33
33
  return !!(domainMatch && domainMatch[1] !== windowLocationHost);
34
34
  };
@@ -37,7 +37,7 @@ export const isUrlExternal = (url: To, windowLocationHost: string) => {
37
37
  * Checks if passed url is email
38
38
  */
39
39
  export const isUrlEmail = (url: To) => {
40
- if (!url || typeof (url) !== 'string') return false;
40
+ if (!url || typeof url !== 'string') return false;
41
41
  return url.startsWith('mailto:');
42
42
  };
43
43
  /**
@@ -97,61 +97,61 @@ export const StyledAsLink = styled(Box)`
97
97
 
98
98
  export type LinkProps = RegularLinkProps & BoxProps;
99
99
 
100
- export const Link = forwardRef<HTMLElement, LinkProps>(({
101
- to,
102
- children,
103
- rel,
104
- target,
105
- hideExternalIcon,
106
- showExternalIcon,
107
- onClick,
108
- trackingId,
109
- trackingData,
110
- tabIndex,
111
- ariaHidden,
112
- ariaLabel,
113
- ...rest
114
- }, ref) => {
115
- const {
116
- windowLocationHost,
117
- isHrefTrusted,
118
- trackClick,
119
- InternalLink,
120
- } = useSharedUiDependencies();
121
- const isExternal = isUrlExternal(to, windowLocationHost);
122
- const href = getHref(to, isExternal);
123
- const isEmail = isUrlEmail(to);
124
- const isTrusted = isHrefTrusted(href);
125
-
126
- const trackedOnClick = (e: React.MouseEvent) => {
127
- if (trackingId && trackClick) trackClick(trackingId, trackingData);
128
- if (onClick) onClick(e);
129
- };
130
-
131
- const uniqRel = new Set([
132
- ...(rel?.split(' ') || []),
133
- isExternal && 'external',
134
- (isExternal || target === '_blank') && 'noopener',
135
- (isExternal && !isTrusted) && 'nofollow',
136
- ]);
137
- const effectiveRel = clsx(Array.from(uniqRel));
138
-
139
- return (
140
- <StyledAsLink
141
- // We use the InternalLink only for internal navigation
142
- forwardedAs={(isEmail || isExternal) ? 'a' : InternalLink}
143
- href={href}
144
- rel={effectiveRel}
145
- target={target || (isExternal ? '_blank' : '_self')}
146
- onClick={trackedOnClick}
147
- ref={ref}
148
- tabIndex={tabIndex}
149
- aria-hidden={ariaHidden}
150
- aria-label={ariaLabel}
151
- {...rest}
152
- >
153
- {children}
154
- {((isExternal && !hideExternalIcon) || showExternalIcon) && <ExternalLinkIcon size="16" />}
155
- </StyledAsLink>
156
- );
157
- });
100
+ export const Link = forwardRef<HTMLElement, LinkProps>(
101
+ (
102
+ {
103
+ to,
104
+ children,
105
+ rel,
106
+ target,
107
+ hideExternalIcon,
108
+ showExternalIcon,
109
+ onClick,
110
+ trackingId,
111
+ trackingData,
112
+ tabIndex,
113
+ ariaHidden,
114
+ ariaLabel,
115
+ ...rest
116
+ },
117
+ ref,
118
+ ) => {
119
+ const { windowLocationHost, isHrefTrusted, trackClick, InternalLink } = useSharedUiDependencies();
120
+ const isExternal = isUrlExternal(to, windowLocationHost);
121
+ const href = getHref(to, isExternal);
122
+ const isEmail = isUrlEmail(to);
123
+ const isTrusted = isHrefTrusted(href);
124
+
125
+ const trackedOnClick = (e: React.MouseEvent) => {
126
+ if (trackingId && trackClick) trackClick(trackingId, trackingData);
127
+ if (onClick) onClick(e);
128
+ };
129
+
130
+ const uniqRel = new Set([
131
+ ...(rel?.split(' ') || []),
132
+ isExternal && 'external',
133
+ (isExternal || target === '_blank') && 'noopener',
134
+ isExternal && !isTrusted && 'nofollow',
135
+ ]);
136
+ const effectiveRel = clsx(Array.from(uniqRel));
137
+
138
+ return (
139
+ <StyledAsLink
140
+ // We use the InternalLink only for internal navigation
141
+ forwardedAs={isEmail || isExternal ? 'a' : InternalLink}
142
+ href={href}
143
+ rel={effectiveRel}
144
+ target={target || (isExternal ? '_blank' : '_self')}
145
+ onClick={trackedOnClick}
146
+ ref={ref}
147
+ tabIndex={tabIndex}
148
+ aria-hidden={ariaHidden}
149
+ aria-label={ariaLabel}
150
+ {...rest}
151
+ >
152
+ {children}
153
+ {((isExternal && !hideExternalIcon) || showExternalIcon) && <ExternalLinkIcon size="16" />}
154
+ </StyledAsLink>
155
+ );
156
+ },
157
+ );
@@ -35,40 +35,39 @@ export default {
35
35
  },
36
36
  };
37
37
 
38
- const Template = (args) => <StyledWrapper>
39
- {MESSAGE_TYPES.map((type) => <Fragment key={type}>
40
- <Message {...args} type={type} />
41
- </Fragment>)}
42
- </StyledWrapper>;
38
+ const Template = (args) => (
39
+ <StyledWrapper>
40
+ {MESSAGE_TYPES.map((type) => (
41
+ <Fragment key={type}>
42
+ <Message {...args} type={type} />
43
+ </Fragment>
44
+ ))}
45
+ </StyledWrapper>
46
+ );
43
47
 
44
48
  const StyledWrapper = styled.div`
45
49
  display: flex;
46
50
  flex-direction: column;
47
51
  `;
48
52
 
49
- export const Index = (args) => <StyledWrapper>
50
- {MESSAGE_TYPES.map((type) => <Fragment key={type}>
51
- <Message {...args} type={type} />
52
- <Message {...args} caption="" type={type} />
53
- <Message
54
- {...args}
55
- type={type}
56
- onDismissClick={() => console.log('dismiss clicked')}
57
- />
58
- <Message
59
- {...args}
60
- type={type}
61
- caption=""
62
- onDismissClick={() => console.log('dismiss clicked')}
63
- />
64
- <Message
65
- {...args}
66
- type={type}
67
- onDismissClick={() => console.log('dismiss clicked')}
68
- actions={[{ label: 'Action', onClick: () => console.log('Action clicked') }]}
69
- />
70
- </Fragment>)}
71
- </StyledWrapper>;
53
+ export const Index = (args) => (
54
+ <StyledWrapper>
55
+ {MESSAGE_TYPES.map((type) => (
56
+ <Fragment key={type}>
57
+ <Message {...args} type={type} />
58
+ <Message {...args} caption="" type={type} />
59
+ <Message {...args} type={type} onDismissClick={() => console.log('dismiss clicked')} />
60
+ <Message {...args} type={type} caption="" onDismissClick={() => console.log('dismiss clicked')} />
61
+ <Message
62
+ {...args}
63
+ type={type}
64
+ onDismissClick={() => console.log('dismiss clicked')}
65
+ actions={[{ label: 'Action', onClick: () => console.log('Action clicked') }]}
66
+ />
67
+ </Fragment>
68
+ ))}
69
+ </StyledWrapper>
70
+ );
72
71
 
73
72
  export const OneLine = Template.bind({});
74
73
  OneLine.args = {
@@ -77,11 +76,14 @@ OneLine.args = {
77
76
 
78
77
  export const MultiLine = Template.bind({});
79
78
  MultiLine.args = {
80
- children: <>
81
- Hello, friends, <br />
82
- I am a very very very very very very very very very very very very very very long message<br />
83
- and I have some <Link to="https://www.youtube.com/watch?v=dQw4w9WgXcQ">and links!</Link>
84
- </>,
79
+ children: (
80
+ <>
81
+ Hello, friends, <br />
82
+ I am a very very very very very very very very very very very very very very long message
83
+ <br />
84
+ and I have some <Link to="https://www.youtube.com/watch?v=dQw4w9WgXcQ">and links!</Link>
85
+ </>
86
+ ),
85
87
  };
86
88
 
87
89
  export const CustomIcon = Template.bind({});
@@ -22,7 +22,7 @@ export const messageClassNames = {
22
22
  actionsWrapper: 'actionsWrapper',
23
23
  };
24
24
 
25
- const StyledMessage = styled(Box)<{ $boxless?: boolean, $hasCaption?: boolean }>`
25
+ const StyledMessage = styled(Box)<{ $boxless?: boolean; $hasCaption?: boolean }>`
26
26
  display: flex;
27
27
  align-items: center;
28
28
  gap: ${theme.space.space8};
@@ -58,26 +58,28 @@ const StyledMessage = styled(Box)<{ $boxless?: boolean, $hasCaption?: boolean }>
58
58
  text-decoration: underline;
59
59
  }
60
60
 
61
- ${({ $hasCaption }) => ($hasCaption
62
- ? css`
63
- grid-template-areas:
64
- 'iconArea captionArea'
65
- 'descriptionArea descriptionArea';
66
- ` : css`
67
- grid-template-areas:
68
- 'iconArea descriptionArea';
69
- `)}
61
+ ${({ $hasCaption }) =>
62
+ $hasCaption
63
+ ? css`
64
+ grid-template-areas:
65
+ 'iconArea captionArea'
66
+ 'descriptionArea descriptionArea';
67
+ `
68
+ : css`
69
+ grid-template-areas: 'iconArea descriptionArea';
70
+ `}
70
71
  }
71
72
 
73
+ ${({ $boxless }) =>
74
+ !$boxless &&
75
+ css`
76
+ /* the dismiss button is bigger than text so we apply smaller padding on wrapper & some on the content and icon */
77
+ padding: ${theme.space.space8} ${theme.space.space16};
72
78
 
73
- ${({ $boxless }) => (!$boxless && css`
74
- /* the dismiss button is bigger than text so we apply smaller padding on wrapper & some on the content and icon */
75
- padding: ${theme.space.space8} ${theme.space.space16};
76
-
77
- .${messageClassNames.content} {
78
- padding: ${theme.space.space4} 0;
79
- }
80
- `)}
79
+ .${messageClassNames.content} {
80
+ padding: ${theme.space.space4} 0;
81
+ }
82
+ `}
81
83
 
82
84
  .${messageClassNames.actionsWrapper} {
83
85
  display: flex;
@@ -137,21 +139,21 @@ const typeToIcon: { [key in MessageType]: React.ElementType } = {
137
139
  };
138
140
 
139
141
  type ActionButtonProps = Omit<ButtonProps, 'children'> & {
140
- label: ReactNode,
142
+ label: ReactNode;
141
143
  };
142
144
 
143
145
  type MessageProps = BoxProps & {
144
- type: MessageType,
145
- caption?: string,
146
+ type: MessageType;
147
+ caption?: string;
146
148
  /** @deprecated Use `Icon` instead. */
147
- icon?: IconComponentType,
148
- Icon?: IconComponentType,
149
- onDismissClick?: () => void,
150
- borderless?: boolean,
151
- boxless?: boolean,
152
- as?: React.ElementType,
153
- dismissTrackingId?: string,
154
- actions?: ActionButtonProps[],
149
+ icon?: IconComponentType;
150
+ Icon?: IconComponentType;
151
+ onDismissClick?: () => void;
152
+ borderless?: boolean;
153
+ boxless?: boolean;
154
+ as?: React.ElementType;
155
+ dismissTrackingId?: string;
156
+ actions?: ActionButtonProps[];
155
157
  };
156
158
 
157
159
  /**
@@ -185,8 +187,12 @@ export const Message: React.FC<MessageProps> = ({
185
187
  {...rest}
186
188
  >
187
189
  <div className={messageClassNames.content}>
188
- <IconComponent className={messageClassNames.icon} size='16' />
189
- {hasCaption && <Text weight='bold' className={messageClassNames.caption}>{caption}</Text>}
190
+ <IconComponent className={messageClassNames.icon} size="16" />
191
+ {hasCaption && (
192
+ <Text weight="bold" className={messageClassNames.caption}>
193
+ {caption}
194
+ </Text>
195
+ )}
190
196
  <div className={messageClassNames.description}>{children}</div>
191
197
  </div>
192
198
  {(actions.length > 0 || onDismissClick) && (
@@ -194,12 +200,7 @@ export const Message: React.FC<MessageProps> = ({
194
200
  {actions.length > 0 && (
195
201
  <>
196
202
  {actions.map(({ label, ...action }, index) => (
197
- <Button
198
- key={index}
199
- size='small'
200
- variant='primary'
201
- {...action}
202
- >
203
+ <Button key={index} size="small" variant="primary" {...action}>
203
204
  {label}
204
205
  </Button>
205
206
  ))}
@@ -207,16 +208,15 @@ export const Message: React.FC<MessageProps> = ({
207
208
  )}
208
209
  {onDismissClick && (
209
210
  <Button
210
- size='small'
211
- variant='tertiary'
211
+ size="small"
212
+ variant="tertiary"
212
213
  trackingId={dismissTrackingId}
213
214
  onClick={onDismissClick}
214
215
  className={messageClassNames.dismiss}
215
216
  >
216
- <CrossIcon size="16" color={theme.color.neutral.icon}/>
217
+ <CrossIcon size="16" color={theme.color.neutral.icon} />
217
218
  </Button>
218
219
  )}
219
-
220
220
  </div>
221
221
  )}
222
222
  </StyledMessage>
@@ -225,7 +225,7 @@ export const Message: React.FC<MessageProps> = ({
225
225
 
226
226
  type SpecificMessageProps = Omit<MessageProps, 'type'>;
227
227
  // Semantic classes for all the message types
228
- export const InfoMessage = (props: SpecificMessageProps) => (<Message {...props} type='info' />);
229
- export const WarningMessage = (props: SpecificMessageProps) => (<Message {...props} type='warning' />);
230
- export const SuccessMessage = (props: SpecificMessageProps) => (<Message {...props} type='success' />);
231
- export const DangerMessage = (props: SpecificMessageProps) => (<Message {...props} type='danger' />);
228
+ export const InfoMessage = (props: SpecificMessageProps) => <Message {...props} type="info" />;
229
+ export const WarningMessage = (props: SpecificMessageProps) => <Message {...props} type="warning" />;
230
+ export const SuccessMessage = (props: SpecificMessageProps) => <Message {...props} type="success" />;
231
+ export const DangerMessage = (props: SpecificMessageProps) => <Message {...props} type="danger" />;
@@ -12,7 +12,7 @@ import { Box } from './box.js';
12
12
  import { Text } from './text/index.js';
13
13
 
14
14
  type RatingStatsProps = {
15
- ratingStats: Record<ReviewRating, number>
15
+ ratingStats: Record<ReviewRating, number>;
16
16
  };
17
17
 
18
18
  const StyledRating = styled(Box)`
@@ -42,7 +42,7 @@ const StyledRatingBar = styled(Box)<{ $widthPercent: number }>`
42
42
  overflow: hidden;
43
43
 
44
44
  &::after {
45
- content: "";
45
+ content: '';
46
46
  position: absolute;
47
47
  display: block;
48
48
  height: 100%;
@@ -51,7 +51,6 @@ const StyledRatingBar = styled(Box)<{ $widthPercent: number }>`
51
51
  border-radius: 10px;
52
52
  background: ${theme.color.neutral.icon};
53
53
  width: ${({ $widthPercent }) => $widthPercent}%;
54
-
55
54
  }
56
55
  `;
57
56
 
@@ -59,10 +58,7 @@ type SingleStarRatingProps = BoxProps & {
59
58
  color?: string;
60
59
  };
61
60
 
62
- export const SingleStarRating: FC<SingleStarRatingProps> = ({
63
- color = theme.color.neutral.icon,
64
- ...rest
65
- }) => {
61
+ export const SingleStarRating: FC<SingleStarRatingProps> = ({ color = theme.color.neutral.icon, ...rest }) => {
66
62
  return (
67
63
  <StyledRating {...rest}>
68
64
  <StarFullIcon size="12" color={color} />
@@ -76,47 +72,44 @@ type RatingProps = BoxProps & {
76
72
  color?: string;
77
73
  };
78
74
 
79
- export const Rating: FC<RatingProps> = ({
80
- rating = 0,
81
- color = theme.color.neutral.icon,
82
- ...rest
83
- }) => {
84
- const ratingStatsContent = useMemo(() => [1, 2, 3, 4, 5].map((rate) => {
85
- const ratingFloor = Math.floor(rating);
86
- const ratingDecimals = rating % 1;
87
-
88
- if (ratingFloor >= rate || (ratingFloor === rate - 1 && ratingDecimals > 0.75)) return <StarFullIcon size="12" color={color} key={rate} />;
89
- if (ratingFloor === rate - 1 && ratingDecimals > 0.25) return <StarHalfIcon size="12" color={color} key={rate} />;
90
- return <StarEmptyIcon size="12" color={color} key={rate} />;
91
- }), [rating, color]);
92
-
93
- return (
94
- <StyledRating {...rest}>
95
- {ratingStatsContent}
96
- </StyledRating>
75
+ export const Rating: FC<RatingProps> = ({ rating = 0, color = theme.color.neutral.icon, ...rest }) => {
76
+ const ratingStatsContent = useMemo(
77
+ () =>
78
+ [1, 2, 3, 4, 5].map((rate) => {
79
+ const ratingFloor = Math.floor(rating);
80
+ const ratingDecimals = rating % 1;
81
+
82
+ if (ratingFloor >= rate || (ratingFloor === rate - 1 && ratingDecimals > 0.75))
83
+ return <StarFullIcon size="12" color={color} key={rate} />;
84
+ if (ratingFloor === rate - 1 && ratingDecimals > 0.25)
85
+ return <StarHalfIcon size="12" color={color} key={rate} />;
86
+ return <StarEmptyIcon size="12" color={color} key={rate} />;
87
+ }),
88
+ [rating, color],
97
89
  );
90
+
91
+ return <StyledRating {...rest}>{ratingStatsContent}</StyledRating>;
98
92
  };
99
93
 
100
- export const RatingStats: FC<RatingStatsProps & BoxProps> = ({
101
- ratingStats,
102
- ...rest
103
- }) => {
94
+ export const RatingStats: FC<RatingStatsProps & BoxProps> = ({ ratingStats, ...rest }) => {
104
95
  const totalRates = ratingStats[1] + ratingStats[2] + ratingStats[3] + ratingStats[4] + ratingStats[5];
105
96
 
106
- const ratingStatsContent = useMemo(() => ([5, 4, 3, 2, 1] as const).map((rate) => {
107
- const widthPercent = totalRates > 0 ? ((ratingStats[rate] / totalRates) * 100) : 0;
108
-
109
- return (
110
- <Fragment key={rate}>
111
- <Text align='center' color={theme.color.neutral.textSubtle}>{rate}</Text>
112
- <StyledRatingBar $widthPercent={widthPercent}/>
113
- </Fragment>
114
- );
115
- }), [totalRates, ratingStats]);
116
-
117
- return (
118
- <StyledRatingStats {...rest}>
119
- {ratingStatsContent}
120
- </StyledRatingStats>
97
+ const ratingStatsContent = useMemo(
98
+ () =>
99
+ ([5, 4, 3, 2, 1] as const).map((rate) => {
100
+ const widthPercent = totalRates > 0 ? (ratingStats[rate] / totalRates) * 100 : 0;
101
+
102
+ return (
103
+ <Fragment key={rate}>
104
+ <Text align="center" color={theme.color.neutral.textSubtle}>
105
+ {rate}
106
+ </Text>
107
+ <StyledRatingBar $widthPercent={widthPercent} />
108
+ </Fragment>
109
+ );
110
+ }),
111
+ [totalRates, ratingStats],
121
112
  );
113
+
114
+ return <StyledRatingStats {...rest}>{ratingStatsContent}</StyledRatingStats>;
122
115
  };
@@ -56,19 +56,31 @@ export const pythonizeValue = <T>(value: T, depth = 0): string | T => {
56
56
  if (Array.isArray(value)) {
57
57
  if (value.length === 0) return '[]';
58
58
  if (value.length === 1) return '[' + pythonizeValue(value[0], depth + 1) + ']';
59
- return '[\n'
60
- + value.map((v) => INDENT.repeat(depth + 1) + pythonizeValue(v, depth + 1) + ',\n').join('')
61
- + INDENT.repeat(depth) + ']';
59
+ return (
60
+ '[\n' +
61
+ value.map((v) => INDENT.repeat(depth + 1) + pythonizeValue(v, depth + 1) + ',\n').join('') +
62
+ INDENT.repeat(depth) +
63
+ ']'
64
+ );
62
65
  }
63
66
 
64
67
  // Object values
65
68
  if (typeof value === 'object') {
66
69
  const entries = Object.entries(value);
67
70
  if (entries.length === 0) return '{}';
68
- if (entries.length === 1) return '{ ' + pythonQuoteString(entries[0][0]) + ': ' + pythonizeValue(entries[0][1], depth + 1) + ' }';
69
- return '{\n'
70
- + entries.map(([k, v]) => INDENT.repeat(depth + 1) + pythonQuoteString(k) + ': ' + pythonizeValue(v, depth + 1) + ',\n').join('')
71
- + INDENT.repeat(depth) + '}';
71
+ if (entries.length === 1)
72
+ return '{ ' + pythonQuoteString(entries[0][0]) + ': ' + pythonizeValue(entries[0][1], depth + 1) + ' }';
73
+ return (
74
+ '{\n' +
75
+ entries
76
+ .map(
77
+ ([k, v]) =>
78
+ INDENT.repeat(depth + 1) + pythonQuoteString(k) + ': ' + pythonizeValue(v, depth + 1) + ',\n',
79
+ )
80
+ .join('') +
81
+ INDENT.repeat(depth) +
82
+ '}'
83
+ );
72
84
  }
73
85
 
74
86
  // This should never happen, if it did, something went wrong