@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
@@ -54,25 +54,14 @@ function generateProperties(name: string, colors: string[]) {
54
54
  return elementsProperties;
55
55
  }
56
56
 
57
- function generateFill(
58
- properties: ReturnType<typeof generateProperties>,
59
- name: string,
60
- ) {
61
- const {
62
- translateX: translateX1,
63
- translateY: translateY1,
64
- rotate: rotate1,
65
- } = properties[1];
66
- const {
67
- translateX: translateX2,
68
- translateY: translateY2,
69
- rotate: rotate2,
70
- scale,
71
- } = properties[2];
57
+ function generateFill(properties: ReturnType<typeof generateProperties>, name: string) {
58
+ const { translateX: translateX1, translateY: translateY1, rotate: rotate1 } = properties[1];
59
+ const { translateX: translateX2, translateY: translateY2, rotate: rotate2, scale } = properties[2];
72
60
 
73
61
  let nameParts = name
74
62
  .replace(emojiRegexPattern, ' ') // Remove emojis from the name
75
- .trim().replace(/\s+/g, ' ') // Remove multiple spaces
63
+ .trim()
64
+ .replace(/\s+/g, ' ') // Remove multiple spaces
76
65
  .toUpperCase()
77
66
  .split(' '); // Ideally if the Actor has a name with spaces, we take words separated by spaces
78
67
 
@@ -82,7 +71,9 @@ function generateFill(
82
71
  if (nameParts.length <= 1) nameParts = nameParts[0].split(''); // In the end we take the first word and separate it by letter
83
72
 
84
73
  // Nice to have: remove ignored words from the name if the name has more than 2 words
85
- if (nameParts.length > 2) { nameParts = nameParts.filter((part) => !IGNORED_WORDS.includes(part)); }
74
+ if (nameParts.length > 2) {
75
+ nameParts = nameParts.filter((part) => !IGNORED_WORDS.includes(part));
76
+ }
86
77
 
87
78
  return {
88
79
  fill0: properties[0].color,
@@ -104,159 +95,135 @@ interface BoringAvatarProps {
104
95
  alt?: string;
105
96
  }
106
97
 
107
- export const BoringAvatarMarble = React.memo(({
108
- name = '',
109
- colors = ['#12966F', '#5D85E1', '#E44467', '#F0B21B', '#FA8136', '#30C0BB'],
110
- square = false,
111
- className,
112
- size = 24,
113
- alt = 'Avatar image',
114
- }: BoringAvatarProps) => {
115
- const fill = useMemo(() => {
116
- const properties = generateProperties(name ?? '', colors);
117
- return generateFill(properties, name ?? '');
118
- }, [name, colors]);
119
-
120
- return (
121
- <svg
122
- viewBox={`0 0 ${SIZE} ${SIZE}`}
123
- fill="none"
124
- role="img"
125
- xmlns="http://www.w3.org/2000/svg"
126
- width={size}
127
- height={size}
128
- className={className}
129
- aria-label={alt}
130
- >
131
- <mask
132
- id="mask__marble"
133
- maskUnits="userSpaceOnUse"
134
- x={0}
135
- y={0}
136
- width={SIZE}
137
- height={SIZE}
98
+ export const BoringAvatarMarble = React.memo(
99
+ ({
100
+ name = '',
101
+ colors = ['#12966F', '#5D85E1', '#E44467', '#F0B21B', '#FA8136', '#30C0BB'],
102
+ square = false,
103
+ className,
104
+ size = 24,
105
+ alt = 'Avatar image',
106
+ }: BoringAvatarProps) => {
107
+ const fill = useMemo(() => {
108
+ const properties = generateProperties(name ?? '', colors);
109
+ return generateFill(properties, name ?? '');
110
+ }, [name, colors]);
111
+
112
+ return (
113
+ <svg
114
+ viewBox={`0 0 ${SIZE} ${SIZE}`}
115
+ fill="none"
116
+ role="img"
117
+ xmlns="http://www.w3.org/2000/svg"
118
+ width={size}
119
+ height={size}
120
+ className={className}
121
+ aria-label={alt}
138
122
  >
139
- <rect
140
- width={SIZE}
141
- height={SIZE}
142
- rx={square ? undefined : SIZE * 2}
143
- fill="#FFFFFF"
144
- />
145
- </mask>
146
- <g mask="url(#mask__marble)">
147
- <rect width={SIZE} height={SIZE} fill={fill.fill0} />
148
- <path
149
- filter="url(#prefix__filter0_f)"
150
- d="M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z"
151
- fill={fill.fill1}
152
- transform={fill.transform1}
153
- />
154
- <path
155
- filter="url(#prefix__filter0_f)"
156
- style={{
157
- mixBlendMode: 'overlay',
158
- }}
159
- d="M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z"
160
- fill={fill.fill2}
161
- transform={fill.transform2}
162
- />
163
- </g>
164
- <g>
165
- {fill.letter1 && (
166
- <text
167
- style={{ fontSize: '50px' }}
168
- x="50"
169
- y="50"
170
- dy="7"
171
- textAnchor="middle"
172
- alignmentBaseline="middle"
173
- dominantBaseline="middle"
174
- >
175
- {fill.letter1}
176
- {fill.letter2}
177
- </text>
178
- )}
179
- </g>
180
- <defs>
181
- <filter
182
- id="prefix__filter0_f"
183
- filterUnits="userSpaceOnUse"
184
- colorInterpolationFilters="sRGB"
185
- >
186
- <feFlood floodOpacity={0} result="BackgroundImageFix" />
187
- <feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
188
- <feGaussianBlur stdDeviation={7} result="effect1_foregroundBlur" />
189
- </filter>
190
- </defs>
191
- </svg>
192
- );
193
- });
194
-
195
- export const BoringAvatarSolid = React.memo(({
196
- name = '',
197
- alt = 'Avatar image',
198
- colors = ['#B8487B', '#E5B557', '#58BCC4', '#6D85CA', '#8690BF', '#F08848', '#8148C9', '#439274'],
199
- square = false,
200
- className,
201
- size = 24,
202
- }: BoringAvatarProps) => {
203
- /**
123
+ <mask id="mask__marble" maskUnits="userSpaceOnUse" x={0} y={0} width={SIZE} height={SIZE}>
124
+ <rect width={SIZE} height={SIZE} rx={square ? undefined : SIZE * 2} fill="#FFFFFF" />
125
+ </mask>
126
+ <g mask="url(#mask__marble)">
127
+ <rect width={SIZE} height={SIZE} fill={fill.fill0} />
128
+ <path
129
+ filter="url(#prefix__filter0_f)"
130
+ d="M32.414 59.35L50.376 70.5H72.5v-71H33.728L26.5 13.381l19.057 27.08L32.414 59.35z"
131
+ fill={fill.fill1}
132
+ transform={fill.transform1}
133
+ />
134
+ <path
135
+ filter="url(#prefix__filter0_f)"
136
+ style={{
137
+ mixBlendMode: 'overlay',
138
+ }}
139
+ d="M22.216 24L0 46.75l14.108 38.129L78 86l-3.081-59.276-22.378 4.005 12.972 20.186-23.35 27.395L22.215 24z"
140
+ fill={fill.fill2}
141
+ transform={fill.transform2}
142
+ />
143
+ </g>
144
+ <g>
145
+ {fill.letter1 && (
146
+ <text
147
+ style={{ fontSize: '50px' }}
148
+ x="50"
149
+ y="50"
150
+ dy="7"
151
+ textAnchor="middle"
152
+ alignmentBaseline="middle"
153
+ dominantBaseline="middle"
154
+ >
155
+ {fill.letter1}
156
+ {fill.letter2}
157
+ </text>
158
+ )}
159
+ </g>
160
+ <defs>
161
+ <filter id="prefix__filter0_f" filterUnits="userSpaceOnUse" colorInterpolationFilters="sRGB">
162
+ <feFlood floodOpacity={0} result="BackgroundImageFix" />
163
+ <feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape" />
164
+ <feGaussianBlur stdDeviation={7} result="effect1_foregroundBlur" />
165
+ </filter>
166
+ </defs>
167
+ </svg>
168
+ );
169
+ },
170
+ );
171
+
172
+ export const BoringAvatarSolid = React.memo(
173
+ ({
174
+ name = '',
175
+ alt = 'Avatar image',
176
+ colors = ['#B8487B', '#E5B557', '#58BCC4', '#6D85CA', '#8690BF', '#F08848', '#8148C9', '#439274'],
177
+ square = false,
178
+ className,
179
+ size = 24,
180
+ }: BoringAvatarProps) => {
181
+ /**
204
182
  * Name must be lowercased to avoid irregularities caused by caps.
205
183
  * This is an issue in the Actor detail header, where the username comes from the Actor object,
206
184
  * while in the user selector it comes from the user object, where it can have capitals.
207
185
  */
208
- const nameLowercase = name.toLowerCase();
209
-
210
- const fill = useMemo(() => {
211
- const properties = generateProperties(nameLowercase, colors);
212
- return generateFill(properties, nameLowercase);
213
- }, [nameLowercase, colors]);
214
-
215
- return (
216
- <svg
217
- viewBox={`0 0 ${SIZE} ${SIZE}`}
218
- fill="none"
219
- role="img"
220
- xmlns="http://www.w3.org/2000/svg"
221
- width={size}
222
- height={size}
223
- className={className}
224
- aria-label={alt}
225
- >
226
- <mask
227
- id="mask__solid"
228
- maskUnits="userSpaceOnUse"
229
- x={0}
230
- y={0}
231
- width={SIZE}
232
- height={SIZE}
186
+ const nameLowercase = name.toLowerCase();
187
+
188
+ const fill = useMemo(() => {
189
+ const properties = generateProperties(nameLowercase, colors);
190
+ return generateFill(properties, nameLowercase);
191
+ }, [nameLowercase, colors]);
192
+
193
+ return (
194
+ <svg
195
+ viewBox={`0 0 ${SIZE} ${SIZE}`}
196
+ fill="none"
197
+ role="img"
198
+ xmlns="http://www.w3.org/2000/svg"
199
+ width={size}
200
+ height={size}
201
+ className={className}
202
+ aria-label={alt}
233
203
  >
234
- <rect
235
- width={SIZE}
236
- height={SIZE}
237
- rx={square ? undefined : SIZE * 2}
238
- fill="#FFFFFF"
239
- />
240
- </mask>
241
- <g mask="url(#mask__solid)">
242
- <rect width={SIZE} height={SIZE} fill={fill.fill0} />
243
- </g>
244
- <g>
245
- {fill.letter1 && (
246
- <text
247
- style={{ fontSize: '50px' }}
248
- x="50"
249
- y="50"
250
- dy="7"
251
- textAnchor="middle"
252
- alignmentBaseline="middle"
253
- dominantBaseline="middle"
254
- >
255
- {fill.letter1}
256
- {fill.letter2}
257
- </text>
258
- )}
259
- </g>
260
- </svg>
261
- );
262
- });
204
+ <mask id="mask__solid" maskUnits="userSpaceOnUse" x={0} y={0} width={SIZE} height={SIZE}>
205
+ <rect width={SIZE} height={SIZE} rx={square ? undefined : SIZE * 2} fill="#FFFFFF" />
206
+ </mask>
207
+ <g mask="url(#mask__solid)">
208
+ <rect width={SIZE} height={SIZE} fill={fill.fill0} />
209
+ </g>
210
+ <g>
211
+ {fill.letter1 && (
212
+ <text
213
+ style={{ fontSize: '50px' }}
214
+ x="50"
215
+ y="50"
216
+ dy="7"
217
+ textAnchor="middle"
218
+ alignmentBaseline="middle"
219
+ dominantBaseline="middle"
220
+ >
221
+ {fill.letter1}
222
+ {fill.letter2}
223
+ </text>
224
+ )}
225
+ </g>
226
+ </svg>
227
+ );
228
+ },
229
+ );
@@ -90,11 +90,7 @@ export const WithImageUrl: Story = {
90
90
  <small>With image</small>
91
91
  </div>
92
92
  <div>
93
- <UserAvatar
94
- name="John Doe"
95
- url="https://wrong-url-to-trigger-error.com/avatar.png"
96
- size={64}
97
- />
93
+ <UserAvatar name="John Doe" url="https://wrong-url-to-trigger-error.com/avatar.png" size={64} />
98
94
  <small>With broken image URL</small>
99
95
  </div>
100
96
  <div>
@@ -49,15 +49,7 @@ interface UserAvatarProps extends React.ImgHTMLAttributes<HTMLImageElement> {
49
49
  asOrganization?: boolean;
50
50
  }
51
51
 
52
- const UserAvatarInner: FC<UserAvatarProps> = ({
53
- name,
54
- className,
55
- url,
56
- size,
57
- alt,
58
- asOrganization,
59
- ...rest
60
- }) => {
52
+ const UserAvatarInner: FC<UserAvatarProps> = ({ name, className, url, size, alt, asOrganization, ...rest }) => {
61
53
  const [imgError, setImgError] = React.useState(false);
62
54
  const { generateProxyImageUrl } = useSharedUiDependencies();
63
55
 
@@ -86,9 +78,10 @@ const UserAvatarInner: FC<UserAvatarProps> = ({
86
78
  return (
87
79
  <StyledImg
88
80
  className={fullClassName}
89
- src={generateProxyImageUrl
90
- ? generateProxyImageUrl(url, { resize: { height: size * 2, width: size * 2 } })
91
- : url
81
+ src={
82
+ generateProxyImageUrl
83
+ ? generateProxyImageUrl(url, { resize: { height: size * 2, width: size * 2 } })
84
+ : url
92
85
  }
93
86
  width={size}
94
87
  height={size}
@@ -98,14 +91,7 @@ const UserAvatarInner: FC<UserAvatarProps> = ({
98
91
  />
99
92
  );
100
93
  }
101
- return (
102
- <StyledBoringAvatarSolid
103
- alt={altText}
104
- size={size}
105
- className={fullClassName}
106
- name={name}
107
- />
108
- );
94
+ return <StyledBoringAvatarSolid alt={altText} size={size} className={fullClassName} name={name} />;
109
95
  };
110
96
 
111
97
  export const UserAvatar = React.memo(UserAvatarInner);
@@ -21,7 +21,7 @@ export default {
21
21
 
22
22
  const Table = styled.table`
23
23
  td {
24
- padding: 8px
24
+ padding: 8px;
25
25
  }
26
26
  `;
27
27
 
@@ -29,53 +29,39 @@ export const Default = () => {
29
29
  return (
30
30
  <Table>
31
31
  <tbody>
32
- {BADGE_VARIANTS.map((variant) => <tr key={variant}>
33
- {BADGE_SIZES.map((size) => {
34
- return (
35
- <React.Fragment key={size}>
36
- <td>
37
- <Badge
38
- size={size}
39
- variant={variant}
40
- LeadingIcon={PeopleIcon}
41
- >
32
+ {BADGE_VARIANTS.map((variant) => (
33
+ <tr key={variant}>
34
+ {BADGE_SIZES.map((size) => {
35
+ return (
36
+ <React.Fragment key={size}>
37
+ <td>
38
+ <Badge size={size} variant={variant} LeadingIcon={PeopleIcon}>
42
39
  Badge
43
- </Badge>
44
- </td>
45
- </React.Fragment>
46
- );
47
- })}
48
- {BADGE_SIZES.map((size) => {
49
- return (
50
- <React.Fragment key={`code-${size}`}>
51
- <td>
52
- <Badge
53
- size={size}
54
- type="code"
55
- variant={variant}
56
- LeadingIcon={PeopleIcon}
57
- >
40
+ </Badge>
41
+ </td>
42
+ </React.Fragment>
43
+ );
44
+ })}
45
+ {BADGE_SIZES.map((size) => {
46
+ return (
47
+ <React.Fragment key={`code-${size}`}>
48
+ <td>
49
+ <Badge size={size} type="code" variant={variant} LeadingIcon={PeopleIcon}>
58
50
  Badge
59
- </Badge>
60
- </td>
61
- </React.Fragment>
62
- );
63
- })}
64
- </tr>,
65
- )}
51
+ </Badge>
52
+ </td>
53
+ </React.Fragment>
54
+ );
55
+ })}
56
+ </tr>
57
+ ))}
66
58
  </tbody>
67
59
  </Table>
68
60
  );
69
61
  };
70
62
 
71
63
  export const Playground = ({ size, LeadingIcon, ...props }) => {
72
- return (
73
- <Badge
74
- size={size}
75
- LeadingIcon={LeadingIcon ? PeopleIcon : undefined}
76
- {...props}
77
- />
78
- );
64
+ return <Badge size={size} LeadingIcon={LeadingIcon ? PeopleIcon : undefined} {...props} />;
79
65
  };
80
66
 
81
67
  Playground.propTypes = {
@@ -28,9 +28,24 @@ const BADGE_TEXT_SIZES = {
28
28
  extra_small: 'small',
29
29
  } satisfies Record<BadgeSize, SharedTextSize>;
30
30
 
31
- export type BadgeVariant = 'neutral' | 'neutral_muted' | 'neutral_subtle' | 'primary_black' | 'primary_blue' | 'success' | 'warning' | 'danger';
31
+ export type BadgeVariant =
32
+ | 'neutral'
33
+ | 'neutral_muted'
34
+ | 'neutral_subtle'
35
+ | 'primary_black'
36
+ | 'primary_blue'
37
+ | 'success'
38
+ | 'warning'
39
+ | 'danger';
32
40
  export const BADGE_VARIANTS: BadgeVariant[] = [
33
- 'neutral', 'neutral_muted', 'neutral_subtle', 'primary_black', 'primary_blue', 'success', 'warning', 'danger',
41
+ 'neutral',
42
+ 'neutral_muted',
43
+ 'neutral_subtle',
44
+ 'primary_black',
45
+ 'primary_blue',
46
+ 'success',
47
+ 'warning',
48
+ 'danger',
34
49
  ] as const;
35
50
 
36
51
  type SharedBadgeProps = Omit<RegularBoxProps, 'as' | 'onClick'> & MarginSpacingProps;
@@ -108,15 +123,13 @@ const badgeVariantStyle = {
108
123
  `,
109
124
  } satisfies Record<BadgeVariant, FlattenSimpleInterpolation>;
110
125
 
111
- type StyledBadgeProps = WithTransientProps<
112
- Required<Pick<BadgeProps, 'size' | 'variant' | 'inline'>>
113
- >;
126
+ type StyledBadgeProps = WithTransientProps<Required<Pick<BadgeProps, 'size' | 'variant' | 'inline'>>>;
114
127
 
115
128
  const StyledBadge = styled(Box)<StyledBadgeProps>`
116
129
  ${({ $size }) => badgeSizeStyle[$size]};
117
130
  ${({ $variant }) => badgeVariantStyle[$variant]};
118
131
 
119
- /* Static styles */
132
+ /* Static styles */
120
133
  width: fit-content;
121
134
  border: none;
122
135
  outline: none;
@@ -136,29 +149,27 @@ const StyledBadge = styled(Box)<StyledBadgeProps>`
136
149
  * Component for displaying non-interactive chip descendant.
137
150
  */
138
151
  export const Badge = forwardRef(
139
- ({
140
- size = 'small',
141
- type = 'body',
142
- variant = 'neutral',
143
- inline = false,
144
- LeadingIcon,
145
- TrailingIcon,
146
- children,
147
- ...props
148
- }: BadgeProps,
149
- ref,
152
+ (
153
+ {
154
+ size = 'small',
155
+ type = 'body',
156
+ variant = 'neutral',
157
+ inline = false,
158
+ LeadingIcon,
159
+ TrailingIcon,
160
+ children,
161
+ ...props
162
+ }: BadgeProps,
163
+ ref,
150
164
  ) => {
151
165
  return (
152
- <StyledBadge
153
- ref={ref}
154
- $size={size}
155
- $variant={variant}
156
- $inline={inline}
157
- forwardedAs='span'
158
- {...props}
159
- >
166
+ <StyledBadge ref={ref} $size={size} $variant={variant} $inline={inline} forwardedAs="span" {...props}>
160
167
  {LeadingIcon && <LeadingIcon size={BADGE_ICON_SIZES[size]} />}
161
- {children && (<Text size={BADGE_TEXT_SIZES[size]} type={type} weight="medium" as='span'>{children}</Text>)}
168
+ {children && (
169
+ <Text size={BADGE_TEXT_SIZES[size]} type={type} weight="medium" as="span">
170
+ {children}
171
+ </Text>
172
+ )}
162
173
  {TrailingIcon && <TrailingIcon size={BADGE_ICON_SIZES[size]} />}
163
174
  </StyledBadge>
164
175
  );