@apify/ui-library 0.51.6-featurepublishuilibrary-0a4729.38266

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (349) hide show
  1. package/.eslintrc +39 -0
  2. package/.stylelintrc +12 -0
  3. package/CHANGELOG.md +2804 -0
  4. package/README.md +15 -0
  5. package/dist/src/components/action_link.d.ts +5 -0
  6. package/dist/src/components/action_link.d.ts.map +1 -0
  7. package/dist/src/components/action_link.jsx +35 -0
  8. package/dist/src/components/action_link.jsx.map +1 -0
  9. package/dist/src/components/actor_template_card.d.ts +10 -0
  10. package/dist/src/components/actor_template_card.d.ts.map +1 -0
  11. package/dist/src/components/actor_template_card.jsx +73 -0
  12. package/dist/src/components/actor_template_card.jsx.map +1 -0
  13. package/dist/src/components/badge.d.ts +26 -0
  14. package/dist/src/components/badge.d.ts.map +1 -0
  15. package/dist/src/components/badge.jsx +96 -0
  16. package/dist/src/components/badge.jsx.map +1 -0
  17. package/dist/src/components/banner.d.ts +11 -0
  18. package/dist/src/components/banner.d.ts.map +1 -0
  19. package/dist/src/components/banner.jsx +73 -0
  20. package/dist/src/components/banner.jsx.map +1 -0
  21. package/dist/src/components/blog_article.d.ts +9 -0
  22. package/dist/src/components/blog_article.d.ts.map +1 -0
  23. package/dist/src/components/blog_article.jsx +73 -0
  24. package/dist/src/components/blog_article.jsx.map +1 -0
  25. package/dist/src/components/box.d.ts +41 -0
  26. package/dist/src/components/box.d.ts.map +1 -0
  27. package/dist/src/components/box.jsx +48 -0
  28. package/dist/src/components/box.jsx.map +1 -0
  29. package/dist/src/components/button.d.ts +35 -0
  30. package/dist/src/components/button.d.ts.map +1 -0
  31. package/dist/src/components/button.jsx +193 -0
  32. package/dist/src/components/button.jsx.map +1 -0
  33. package/dist/src/components/chip.d.ts +52 -0
  34. package/dist/src/components/chip.d.ts.map +1 -0
  35. package/dist/src/components/chip.jsx +89 -0
  36. package/dist/src/components/chip.jsx.map +1 -0
  37. package/dist/src/components/code/action_button.d.ts +11 -0
  38. package/dist/src/components/code/action_button.d.ts.map +1 -0
  39. package/dist/src/components/code/action_button.jsx +67 -0
  40. package/dist/src/components/code/action_button.jsx.map +1 -0
  41. package/dist/src/components/code/code_block/code_block.d.ts +38 -0
  42. package/dist/src/components/code/code_block/code_block.d.ts.map +1 -0
  43. package/dist/src/components/code/code_block/code_block.jsx +99 -0
  44. package/dist/src/components/code/code_block/code_block.jsx.map +1 -0
  45. package/dist/src/components/code/code_block/code_block.styled.d.ts +13 -0
  46. package/dist/src/components/code/code_block/code_block.styled.d.ts.map +1 -0
  47. package/dist/src/components/code/code_block/code_block.styled.jsx +215 -0
  48. package/dist/src/components/code/code_block/code_block.styled.jsx.map +1 -0
  49. package/dist/src/components/code/code_block/utils.d.ts +2 -0
  50. package/dist/src/components/code/code_block/utils.d.ts.map +1 -0
  51. package/dist/src/components/code/code_block/utils.js +20 -0
  52. package/dist/src/components/code/code_block/utils.js.map +1 -0
  53. package/dist/src/components/code/index.d.ts +4 -0
  54. package/dist/src/components/code/index.d.ts.map +1 -0
  55. package/dist/src/components/code/index.js +4 -0
  56. package/dist/src/components/code/index.js.map +1 -0
  57. package/dist/src/components/code/inline_code/inline_code.d.ts +11 -0
  58. package/dist/src/components/code/inline_code/inline_code.d.ts.map +1 -0
  59. package/dist/src/components/code/inline_code/inline_code.jsx +24 -0
  60. package/dist/src/components/code/inline_code/inline_code.jsx.map +1 -0
  61. package/dist/src/components/code/one_line_code/one_line_code.d.ts +27 -0
  62. package/dist/src/components/code/one_line_code/one_line_code.d.ts.map +1 -0
  63. package/dist/src/components/code/one_line_code/one_line_code.jsx +157 -0
  64. package/dist/src/components/code/one_line_code/one_line_code.jsx.map +1 -0
  65. package/dist/src/components/code/syntax_highlighter.d.ts +16 -0
  66. package/dist/src/components/code/syntax_highlighter.d.ts.map +1 -0
  67. package/dist/src/components/code/syntax_highlighter.jsx +94 -0
  68. package/dist/src/components/code/syntax_highlighter.jsx.map +1 -0
  69. package/dist/src/components/color_wheel_gradient.d.ts +9 -0
  70. package/dist/src/components/color_wheel_gradient.d.ts.map +1 -0
  71. package/dist/src/components/color_wheel_gradient.jsx +23 -0
  72. package/dist/src/components/color_wheel_gradient.jsx.map +1 -0
  73. package/dist/src/components/floating/index.d.ts +4 -0
  74. package/dist/src/components/floating/index.d.ts.map +1 -0
  75. package/dist/src/components/floating/index.js +4 -0
  76. package/dist/src/components/floating/index.js.map +1 -0
  77. package/dist/src/components/floating/menu.d.ts +33 -0
  78. package/dist/src/components/floating/menu.d.ts.map +1 -0
  79. package/dist/src/components/floating/menu.jsx +95 -0
  80. package/dist/src/components/floating/menu.jsx.map +1 -0
  81. package/dist/src/components/floating/menu_common.d.ts +42 -0
  82. package/dist/src/components/floating/menu_common.d.ts.map +1 -0
  83. package/dist/src/components/floating/menu_common.jsx +20 -0
  84. package/dist/src/components/floating/menu_common.jsx.map +1 -0
  85. package/dist/src/components/floating/menu_components.d.ts +29 -0
  86. package/dist/src/components/floating/menu_components.d.ts.map +1 -0
  87. package/dist/src/components/floating/menu_components.jsx +73 -0
  88. package/dist/src/components/floating/menu_components.jsx.map +1 -0
  89. package/dist/src/components/image.d.ts +12 -0
  90. package/dist/src/components/image.d.ts.map +1 -0
  91. package/dist/src/components/image.jsx +8 -0
  92. package/dist/src/components/image.jsx.map +1 -0
  93. package/dist/src/components/index.d.ts +21 -0
  94. package/dist/src/components/index.d.ts.map +1 -0
  95. package/dist/src/components/index.js +21 -0
  96. package/dist/src/components/index.js.map +1 -0
  97. package/dist/src/components/link.d.ts +24 -0
  98. package/dist/src/components/link.d.ts.map +1 -0
  99. package/dist/src/components/link.jsx +67 -0
  100. package/dist/src/components/link.jsx.map +1 -0
  101. package/dist/src/components/message.d.ts +31 -0
  102. package/dist/src/components/message.d.ts.map +1 -0
  103. package/dist/src/components/message.jsx +105 -0
  104. package/dist/src/components/message.jsx.map +1 -0
  105. package/dist/src/components/readme_renderer/index.d.ts +4 -0
  106. package/dist/src/components/readme_renderer/index.d.ts.map +1 -0
  107. package/dist/src/components/readme_renderer/index.js +4 -0
  108. package/dist/src/components/readme_renderer/index.js.map +1 -0
  109. package/dist/src/components/readme_renderer/pythonize_value.d.ts +3 -0
  110. package/dist/src/components/readme_renderer/pythonize_value.d.ts.map +1 -0
  111. package/dist/src/components/readme_renderer/pythonize_value.js +81 -0
  112. package/dist/src/components/readme_renderer/pythonize_value.js.map +1 -0
  113. package/dist/src/components/readme_renderer/table_of_contents.d.ts +10 -0
  114. package/dist/src/components/readme_renderer/table_of_contents.d.ts.map +1 -0
  115. package/dist/src/components/readme_renderer/table_of_contents.jsx +197 -0
  116. package/dist/src/components/readme_renderer/table_of_contents.jsx.map +1 -0
  117. package/dist/src/components/readme_renderer/utils.d.ts +6 -0
  118. package/dist/src/components/readme_renderer/utils.d.ts.map +1 -0
  119. package/dist/src/components/readme_renderer/utils.jsx +42 -0
  120. package/dist/src/components/readme_renderer/utils.jsx.map +1 -0
  121. package/dist/src/components/simple_markdown/index.d.ts +3 -0
  122. package/dist/src/components/simple_markdown/index.d.ts.map +1 -0
  123. package/dist/src/components/simple_markdown/index.jsx +3 -0
  124. package/dist/src/components/simple_markdown/index.jsx.map +1 -0
  125. package/dist/src/components/simple_markdown/simple_markdown.d.ts +16 -0
  126. package/dist/src/components/simple_markdown/simple_markdown.d.ts.map +1 -0
  127. package/dist/src/components/simple_markdown/simple_markdown.jsx +137 -0
  128. package/dist/src/components/simple_markdown/simple_markdown.jsx.map +1 -0
  129. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts +26 -0
  130. package/dist/src/components/simple_markdown/simple_markdown_components.d.ts.map +1 -0
  131. package/dist/src/components/simple_markdown/simple_markdown_components.jsx +193 -0
  132. package/dist/src/components/simple_markdown/simple_markdown_components.jsx.map +1 -0
  133. package/dist/src/components/tag.d.ts +38 -0
  134. package/dist/src/components/tag.d.ts.map +1 -0
  135. package/dist/src/components/tag.jsx +126 -0
  136. package/dist/src/components/tag.jsx.map +1 -0
  137. package/dist/src/components/text/heading_content.d.ts +10 -0
  138. package/dist/src/components/text/heading_content.d.ts.map +1 -0
  139. package/dist/src/components/text/heading_content.jsx +31 -0
  140. package/dist/src/components/text/heading_content.jsx.map +1 -0
  141. package/dist/src/components/text/heading_marketing.d.ts +10 -0
  142. package/dist/src/components/text/heading_marketing.d.ts.map +1 -0
  143. package/dist/src/components/text/heading_marketing.jsx +31 -0
  144. package/dist/src/components/text/heading_marketing.jsx.map +1 -0
  145. package/dist/src/components/text/heading_shared.d.ts +10 -0
  146. package/dist/src/components/text/heading_shared.d.ts.map +1 -0
  147. package/dist/src/components/text/heading_shared.jsx +32 -0
  148. package/dist/src/components/text/heading_shared.jsx.map +1 -0
  149. package/dist/src/components/text/index.d.ts +12 -0
  150. package/dist/src/components/text/index.d.ts.map +1 -0
  151. package/dist/src/components/text/index.js +11 -0
  152. package/dist/src/components/text/index.js.map +1 -0
  153. package/dist/src/components/text/text_base.d.ts +13 -0
  154. package/dist/src/components/text/text_base.d.ts.map +1 -0
  155. package/dist/src/components/text/text_base.jsx +23 -0
  156. package/dist/src/components/text/text_base.jsx.map +1 -0
  157. package/dist/src/components/text/text_content.d.ts +11 -0
  158. package/dist/src/components/text/text_content.d.ts.map +1 -0
  159. package/dist/src/components/text/text_content.jsx +68 -0
  160. package/dist/src/components/text/text_content.jsx.map +1 -0
  161. package/dist/src/components/text/text_marketing.d.ts +11 -0
  162. package/dist/src/components/text/text_marketing.d.ts.map +1 -0
  163. package/dist/src/components/text/text_marketing.jsx +116 -0
  164. package/dist/src/components/text/text_marketing.jsx.map +1 -0
  165. package/dist/src/components/text/text_shared.d.ts +14 -0
  166. package/dist/src/components/text/text_shared.d.ts.map +1 -0
  167. package/dist/src/components/text/text_shared.jsx +55 -0
  168. package/dist/src/components/text/text_shared.jsx.map +1 -0
  169. package/dist/src/components/tile/horizontal_tile.d.ts +9 -0
  170. package/dist/src/components/tile/horizontal_tile.d.ts.map +1 -0
  171. package/dist/src/components/tile/horizontal_tile.jsx +43 -0
  172. package/dist/src/components/tile/horizontal_tile.jsx.map +1 -0
  173. package/dist/src/components/tile/index.d.ts +3 -0
  174. package/dist/src/components/tile/index.d.ts.map +1 -0
  175. package/dist/src/components/tile/index.js +3 -0
  176. package/dist/src/components/tile/index.js.map +1 -0
  177. package/dist/src/components/tile/shared.d.ts +17 -0
  178. package/dist/src/components/tile/shared.d.ts.map +1 -0
  179. package/dist/src/components/tile/shared.js +12 -0
  180. package/dist/src/components/tile/shared.js.map +1 -0
  181. package/dist/src/components/tile/vertical_tile.d.ts +10 -0
  182. package/dist/src/components/tile/vertical_tile.d.ts.map +1 -0
  183. package/dist/src/components/tile/vertical_tile.jsx +32 -0
  184. package/dist/src/components/tile/vertical_tile.jsx.map +1 -0
  185. package/dist/src/components/to_consolidate/card.d.ts +27 -0
  186. package/dist/src/components/to_consolidate/card.d.ts.map +1 -0
  187. package/dist/src/components/to_consolidate/card.jsx +93 -0
  188. package/dist/src/components/to_consolidate/card.jsx.map +1 -0
  189. package/dist/src/components/to_consolidate/index.d.ts +5 -0
  190. package/dist/src/components/to_consolidate/index.d.ts.map +1 -0
  191. package/dist/src/components/to_consolidate/index.js +5 -0
  192. package/dist/src/components/to_consolidate/index.js.map +1 -0
  193. package/dist/src/components/to_consolidate/markdown.d.ts +40 -0
  194. package/dist/src/components/to_consolidate/markdown.d.ts.map +1 -0
  195. package/dist/src/components/to_consolidate/markdown.jsx +454 -0
  196. package/dist/src/components/to_consolidate/markdown.jsx.map +1 -0
  197. package/dist/src/components/to_consolidate/pagination.d.ts +8 -0
  198. package/dist/src/components/to_consolidate/pagination.d.ts.map +1 -0
  199. package/dist/src/components/to_consolidate/pagination.jsx +88 -0
  200. package/dist/src/components/to_consolidate/pagination.jsx.map +1 -0
  201. package/dist/src/components/to_consolidate/tab_number_chip.d.ts +7 -0
  202. package/dist/src/components/to_consolidate/tab_number_chip.d.ts.map +1 -0
  203. package/dist/src/components/to_consolidate/tab_number_chip.jsx +22 -0
  204. package/dist/src/components/to_consolidate/tab_number_chip.jsx.map +1 -0
  205. package/dist/src/design_system/colors_theme.d.ts +213 -0
  206. package/dist/src/design_system/colors_theme.d.ts.map +1 -0
  207. package/dist/src/design_system/colors_theme.js +213 -0
  208. package/dist/src/design_system/colors_theme.js.map +1 -0
  209. package/dist/src/design_system/properties_theme.d.ts +175 -0
  210. package/dist/src/design_system/properties_theme.d.ts.map +1 -0
  211. package/dist/src/design_system/properties_theme.js +315 -0
  212. package/dist/src/design_system/properties_theme.js.map +1 -0
  213. package/dist/src/design_system/theme.d.ts +630 -0
  214. package/dist/src/design_system/theme.d.ts.map +1 -0
  215. package/dist/src/design_system/theme.js +17 -0
  216. package/dist/src/design_system/theme.js.map +1 -0
  217. package/dist/src/design_system/tokens/index.d.ts +6 -0
  218. package/dist/src/design_system/tokens/index.d.ts.map +1 -0
  219. package/dist/src/design_system/tokens/index.js +6 -0
  220. package/dist/src/design_system/tokens/index.js.map +1 -0
  221. package/dist/src/design_system/tokens/layouts.d.ts +29 -0
  222. package/dist/src/design_system/tokens/layouts.d.ts.map +1 -0
  223. package/dist/src/design_system/tokens/layouts.js +29 -0
  224. package/dist/src/design_system/tokens/layouts.js.map +1 -0
  225. package/dist/src/design_system/tokens/radiuses.d.ts +23 -0
  226. package/dist/src/design_system/tokens/radiuses.d.ts.map +1 -0
  227. package/dist/src/design_system/tokens/radiuses.js +23 -0
  228. package/dist/src/design_system/tokens/radiuses.js.map +1 -0
  229. package/dist/src/design_system/tokens/shadows.d.ts +23 -0
  230. package/dist/src/design_system/tokens/shadows.d.ts.map +1 -0
  231. package/dist/src/design_system/tokens/shadows.js +23 -0
  232. package/dist/src/design_system/tokens/shadows.js.map +1 -0
  233. package/dist/src/design_system/tokens/spaces.d.ts +15 -0
  234. package/dist/src/design_system/tokens/spaces.d.ts.map +1 -0
  235. package/dist/src/design_system/tokens/spaces.js +14 -0
  236. package/dist/src/design_system/tokens/spaces.js.map +1 -0
  237. package/dist/src/design_system/tokens/transitions.d.ts +20 -0
  238. package/dist/src/design_system/tokens/transitions.d.ts.map +1 -0
  239. package/dist/src/design_system/tokens/transitions.js +20 -0
  240. package/dist/src/design_system/tokens/transitions.js.map +1 -0
  241. package/dist/src/design_system/typography_theme.d.ts +189 -0
  242. package/dist/src/design_system/typography_theme.d.ts.map +1 -0
  243. package/dist/src/design_system/typography_theme.js +190 -0
  244. package/dist/src/design_system/typography_theme.js.map +1 -0
  245. package/dist/src/index.d.ts +7 -0
  246. package/dist/src/index.d.ts.map +1 -0
  247. package/dist/src/index.js +7 -0
  248. package/dist/src/index.js.map +1 -0
  249. package/dist/src/type_utils.d.ts +6 -0
  250. package/dist/src/type_utils.d.ts.map +1 -0
  251. package/dist/src/type_utils.js +2 -0
  252. package/dist/src/type_utils.js.map +1 -0
  253. package/dist/src/ui_dependency_provider.d.ts +29 -0
  254. package/dist/src/ui_dependency_provider.d.ts.map +1 -0
  255. package/dist/src/ui_dependency_provider.jsx +14 -0
  256. package/dist/src/ui_dependency_provider.jsx.map +1 -0
  257. package/dist/src/utils/copy_to_clipboard.d.ts +7 -0
  258. package/dist/src/utils/copy_to_clipboard.d.ts.map +1 -0
  259. package/dist/src/utils/copy_to_clipboard.js +16 -0
  260. package/dist/src/utils/copy_to_clipboard.js.map +1 -0
  261. package/dist/src/utils/image_color.d.ts +7 -0
  262. package/dist/src/utils/image_color.d.ts.map +1 -0
  263. package/dist/src/utils/image_color.js +35 -0
  264. package/dist/src/utils/image_color.js.map +1 -0
  265. package/dist/src/utils/index.d.ts +4 -0
  266. package/dist/src/utils/index.d.ts.map +1 -0
  267. package/dist/src/utils/index.js +4 -0
  268. package/dist/src/utils/index.js.map +1 -0
  269. package/dist/src/utils/sanitization.d.ts +11 -0
  270. package/dist/src/utils/sanitization.d.ts.map +1 -0
  271. package/dist/src/utils/sanitization.js +16 -0
  272. package/dist/src/utils/sanitization.js.map +1 -0
  273. package/dist/tsconfig.build.tsbuildinfo +1 -0
  274. package/package.json +71 -0
  275. package/src/codemods/generate_color_property_tokens.mjs +97 -0
  276. package/src/codemods/generate_color_theme_files.mjs +46 -0
  277. package/src/codemods/generate_typograpy_tokens_files.mjs +136 -0
  278. package/src/components/action_link.tsx +59 -0
  279. package/src/components/actor_template_card.tsx +99 -0
  280. package/src/components/badge.tsx +144 -0
  281. package/src/components/banner.tsx +95 -0
  282. package/src/components/blog_article.tsx +85 -0
  283. package/src/components/box.tsx +127 -0
  284. package/src/components/button.tsx +303 -0
  285. package/src/components/chip.tsx +121 -0
  286. package/src/components/code/action_button.tsx +96 -0
  287. package/src/components/code/code_block/code_block.styled.tsx +228 -0
  288. package/src/components/code/code_block/code_block.tsx +235 -0
  289. package/src/components/code/code_block/utils.ts +19 -0
  290. package/src/components/code/index.ts +3 -0
  291. package/src/components/code/inline_code/inline_code.tsx +44 -0
  292. package/src/components/code/one_line_code/one_line_code.tsx +232 -0
  293. package/src/components/code/syntax_highlighter.tsx +125 -0
  294. package/src/components/color_wheel_gradient.tsx +31 -0
  295. package/src/components/floating/index.ts +3 -0
  296. package/src/components/floating/menu.tsx +191 -0
  297. package/src/components/floating/menu_common.tsx +31 -0
  298. package/src/components/floating/menu_components.tsx +94 -0
  299. package/src/components/image.tsx +23 -0
  300. package/src/components/index.ts +20 -0
  301. package/src/components/link.tsx +114 -0
  302. package/src/components/message.tsx +157 -0
  303. package/src/components/readme_renderer/index.ts +3 -0
  304. package/src/components/readme_renderer/pythonize_value.ts +78 -0
  305. package/src/components/readme_renderer/table_of_contents.tsx +257 -0
  306. package/src/components/readme_renderer/utils.tsx +46 -0
  307. package/src/components/simple_markdown/index.tsx +2 -0
  308. package/src/components/simple_markdown/simple_markdown.tsx +181 -0
  309. package/src/components/simple_markdown/simple_markdown_components.tsx +295 -0
  310. package/src/components/tag.tsx +185 -0
  311. package/src/components/text/heading_content.tsx +56 -0
  312. package/src/components/text/heading_marketing.tsx +55 -0
  313. package/src/components/text/heading_shared.tsx +57 -0
  314. package/src/components/text/index.ts +18 -0
  315. package/src/components/text/text_base.tsx +52 -0
  316. package/src/components/text/text_content.tsx +104 -0
  317. package/src/components/text/text_marketing.tsx +152 -0
  318. package/src/components/text/text_shared.tsx +96 -0
  319. package/src/components/tile/horizontal_tile.tsx +76 -0
  320. package/src/components/tile/index.ts +2 -0
  321. package/src/components/tile/shared.ts +27 -0
  322. package/src/components/tile/vertical_tile.tsx +58 -0
  323. package/src/components/to_consolidate/card.tsx +141 -0
  324. package/src/components/to_consolidate/index.ts +4 -0
  325. package/src/components/to_consolidate/markdown.tsx +593 -0
  326. package/src/components/to_consolidate/pagination.tsx +139 -0
  327. package/src/components/to_consolidate/tab_number_chip.tsx +31 -0
  328. package/src/design_system/colors_theme.ts +213 -0
  329. package/src/design_system/generate_color_definitions.js +43 -0
  330. package/src/design_system/properties_theme.ts +453 -0
  331. package/src/design_system/supernova_color_tokens.json +1766 -0
  332. package/src/design_system/supernova_typography_tokens.json +657 -0
  333. package/src/design_system/theme.ts +26 -0
  334. package/src/design_system/tokens/index.ts +5 -0
  335. package/src/design_system/tokens/layouts.ts +29 -0
  336. package/src/design_system/tokens/radiuses.ts +22 -0
  337. package/src/design_system/tokens/shadows.ts +22 -0
  338. package/src/design_system/tokens/spaces.ts +15 -0
  339. package/src/design_system/tokens/transitions.ts +19 -0
  340. package/src/design_system/typography_theme.ts +197 -0
  341. package/src/index.ts +7 -0
  342. package/src/type_utils.ts +7 -0
  343. package/src/ui_dependency_provider.tsx +50 -0
  344. package/src/utils/copy_to_clipboard.ts +24 -0
  345. package/src/utils/image_color.ts +44 -0
  346. package/src/utils/index.ts +3 -0
  347. package/src/utils/sanitization.ts +14 -0
  348. package/tsconfig.build.json +18 -0
  349. package/tsconfig.json +10 -0
package/package.json ADDED
@@ -0,0 +1,71 @@
1
+ {
2
+ "name": "@apify/ui-library",
3
+ "version": "0.51.6-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
4
+ "description": "React components shared between Apify app and web",
5
+ "license": "UNLICENSED",
6
+ "repository": "https://github.com/apify-packages/meta-package-repo",
7
+ "type": "module",
8
+ "main": "dist/src/index.js",
9
+ "types": "dist/src/index.d.ts",
10
+ "publishConfig": {
11
+ "registry": "https://registry.npmjs.org",
12
+ "access": "public"
13
+ },
14
+ "scripts": {
15
+ "test": "echo \"Warning: no test specified\" && exit 0",
16
+ "lint": "eslint . --ext .ts,.tsx",
17
+ "lint:fix": "eslint . --ext .ts,.tsx --fix",
18
+ "build": "npm run clean && npm run compile",
19
+ "clean": "rimraf ./dist",
20
+ "compile": "tsc -p tsconfig.build.json",
21
+ "generate-theme": "node ./src/codemods/generate_color_theme_files.mjs && node src/codemods/generate_color_property_tokens.mjs && node src/codemods/generate_typograpy_tokens_files.mjs && npm run lint:fix",
22
+ "generate-color-definition": "node ./src/design_system/generate_color_definitions.js",
23
+ "postpublish": "npm run clean"
24
+ },
25
+ "//": [
26
+ "Storybook for the components lives in a separate package components-storybook.",
27
+ "It's not nice, but helps us to get around the problem of multiple react instances."
28
+ ],
29
+ "dependencies": {
30
+ "@apify/icons": "^0.40.5-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
31
+ "@apify/log": "^2.5.11",
32
+ "@apify/ui-icons": "^0.2.2-featurepublishuilibrary-0a4729.38266+7412d8cbd3",
33
+ "@floating-ui/react": "^0.26.2",
34
+ "clsx": "^2.0.0",
35
+ "dayjs": "1.11.9",
36
+ "fast-average-color": "^9.4.0",
37
+ "history": "^5.3.0",
38
+ "lodash": "^4.17.21",
39
+ "query-string": "^8.1.0",
40
+ "react-markdown": "^8.0.5",
41
+ "react-syntax-highlighter": "^15.5.0",
42
+ "rehype-raw": "^6.1.1",
43
+ "rehype-sanitize": "^6.0.0",
44
+ "remark-gfm": "^3.0.1",
45
+ "remark-toc": "8.0.1",
46
+ "slugify": "^1.6.6"
47
+ },
48
+ "peerDependencies": {
49
+ "react": "17.x || 18.x",
50
+ "react-dom": "17.x || 18.x",
51
+ "styled-components": "^5.3.3"
52
+ },
53
+ "devDependencies": {
54
+ "@apify/eslint-config-ts": "^0.4.1",
55
+ "@types/lodash": "^4.14.200",
56
+ "@types/node": "^22.10.5",
57
+ "@types/react": "^18.2.74",
58
+ "@types/react-syntax-highlighter": "^15.5.9",
59
+ "@types/styled-components": "^5.1.34",
60
+ "@typescript-eslint/eslint-plugin": "^5.62.0",
61
+ "@typescript-eslint/parser": "^5.62.0",
62
+ "eslint": "^8.45.0",
63
+ "eslint-plugin-import": "2.26.0",
64
+ "eslint-plugin-react": "^7.32.2",
65
+ "eslint-plugin-react-hooks": "^4.6.0",
66
+ "eslint-plugin-sonarjs": "^1.0.3",
67
+ "recast": "^0.23.9",
68
+ "typescript": "^5.1.6"
69
+ },
70
+ "gitHead": "7412d8cbd301449ad5fa482fe4e558a053396ad5"
71
+ }
@@ -0,0 +1,97 @@
1
+ import { readFileSync, writeFileSync } from 'fs';
2
+
3
+ import { print, types } from 'recast';
4
+
5
+ const { builders } = types;
6
+
7
+ const code = readFileSync('./src/design_system/supernova_color_tokens.json', 'utf-8');
8
+
9
+ const lightColorTokens = JSON.parse(code).light;
10
+
11
+ const getObjectValueByPath = (obj, path) => {
12
+ return path.split('.').reduce((acc, part) => acc && acc[part], obj);
13
+ };
14
+
15
+ const getColorPropertyName = (semanticCategory, property) => {
16
+ const semanticColorName = `${property.split(/[_ ]/).map((semanticPartName) => semanticPartName.toLowerCase()).join('-')}`;
17
+
18
+ // lower case and replace spaces with dashes
19
+ const semanticCategoryName = semanticCategory.toLowerCase().split(' ').join('-');
20
+
21
+ return `--color-${semanticCategoryName}-${semanticColorName}`;
22
+ };
23
+
24
+ const generateColorPropertyTokens = (supernovaColorsDefinitions) => {
25
+ const mergedPalettes = { ...supernovaColorsDefinitions.Semantic, ...supernovaColorsDefinitions.Decorative };
26
+
27
+ const colorTheme = {};
28
+ for (const [category, palette] of Object.entries(mergedPalettes)) {
29
+ // convert to camelCase if there are multiple words in the category name
30
+ const categoryName = category
31
+ .split(' ')
32
+ .map((word, i) => (i === 0
33
+ ? word.toLocaleLowerCase()
34
+ : `${word.charAt(0).toUpperCase()}${word.slice(1)}`),
35
+ )
36
+ .join('');
37
+ colorTheme[categoryName] = {};
38
+
39
+ for (const [key, { value }] of Object.entries(palette)) {
40
+ const [firstPart, ...rest] = key.split(' ');
41
+ const propertyName = `${firstPart.toLowerCase()}${rest.join('')}`;
42
+
43
+ const hexLocator = value.slice(1, -1);
44
+ const hex = value.startsWith('#') ? value : getObjectValueByPath(supernovaColorsDefinitions, hexLocator)?.value;
45
+
46
+ colorTheme[categoryName][propertyName] = {
47
+ variable: `var(${getColorPropertyName(category, key)})`,
48
+ hex,
49
+ };
50
+ }
51
+ }
52
+
53
+ return colorTheme;
54
+ };
55
+
56
+ const createPropertyDeclaration = (tokens) => {
57
+ const paletteArray = [];
58
+
59
+ for (const [paletteName, paletteProps] of [...Object.entries(tokens)]) {
60
+ const paletteItemsArray = [];
61
+
62
+ for (const [paletteItemName, { variable, hex }] of Object.entries(paletteProps)) {
63
+ const objectPropertyItem = builders.property(
64
+ 'init',
65
+ builders.identifier(paletteItemName),
66
+ builders.literal(variable),
67
+ );
68
+
69
+ objectPropertyItem.comments = [builders.commentBlock(` ${hex} `)];
70
+
71
+ paletteItemsArray.push(objectPropertyItem);
72
+ }
73
+
74
+ paletteArray.push(builders.property(
75
+ 'init',
76
+ builders.identifier(paletteName),
77
+ builders.objectExpression(paletteItemsArray),
78
+ ));
79
+ }
80
+
81
+ return builders.exportNamedDeclaration(
82
+ builders.variableDeclaration('const', [
83
+ builders.variableDeclarator(
84
+ builders.identifier('colorProperties'),
85
+ builders.tsAsExpression(builders.objectExpression(paletteArray), builders.tsTypeReference(builders.identifier('const'))),
86
+ )]),
87
+ [],
88
+ );
89
+ };
90
+
91
+ const generatedTokens = generateColorPropertyTokens(lightColorTokens);
92
+
93
+ const lightThemeDeclaration = createPropertyDeclaration(generatedTokens);
94
+
95
+ const printedCode = print(builders.program([lightThemeDeclaration])).code;
96
+
97
+ writeFileSync('./src/design_system/properties_theme.ts', printedCode);
@@ -0,0 +1,46 @@
1
+ import { readFileSync, writeFileSync } from 'fs';
2
+
3
+ import { print, types } from 'recast';
4
+
5
+ const { builders } = types;
6
+
7
+ const code = readFileSync('./src/design_system/supernova_color_tokens.json', 'utf-8');
8
+
9
+ const colorTokens = JSON.parse(code);
10
+
11
+ const lightThemeProperty = colorTokens.light;
12
+ const darkThemeProperty = colorTokens.dark;
13
+
14
+ function createThemeDeclaration(themeProperty, variableName) {
15
+ const paletteArray = [];
16
+
17
+ const { Decorative, Palette } = themeProperty;
18
+
19
+ for (const [paletteName, paletteProps] of [...Object.entries(Palette), ...Object.entries(Decorative)]) {
20
+ for (const [paletteItemName, paletteItem] of Object.entries(paletteProps)) {
21
+ paletteArray.push(
22
+ builders.property(
23
+ 'init',
24
+ builders.identifier(`${paletteName.toLowerCase()}${paletteItemName}`),
25
+ builders.literal(paletteItem.value),
26
+ ),
27
+ );
28
+ }
29
+ }
30
+
31
+ return builders.exportNamedDeclaration(
32
+ builders.variableDeclaration('const', [
33
+ builders.variableDeclarator(
34
+ builders.identifier(variableName),
35
+ builders.tsAsExpression(builders.objectExpression(paletteArray), builders.tsTypeReference(builders.identifier('const'))),
36
+ )]),
37
+ [],
38
+ );
39
+ }
40
+
41
+ const lightThemeDeclaration = createThemeDeclaration(lightThemeProperty, 'lightTheme');
42
+ const darkThemeDeclaration = createThemeDeclaration(darkThemeProperty, 'darkTheme');
43
+
44
+ const printedCode = print(builders.program([lightThemeDeclaration, darkThemeDeclaration])).code;
45
+
46
+ writeFileSync('./src/design_system/colors_theme.ts', printedCode);
@@ -0,0 +1,136 @@
1
+ import { readFileSync, writeFileSync } from 'fs';
2
+
3
+ import { print, types } from 'recast';
4
+
5
+ const { builders } = types;
6
+
7
+ const code = readFileSync('./src/design_system/supernova_typography_tokens.json', 'utf-8');
8
+
9
+ const fontFamilies = {
10
+ inter: `Inter, sans-serif`,
11
+ gtWalsheim: `'GT-Walsheim-Regular', sans-serif`,
12
+ sfPro: `-apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'`,
13
+ ibmPlexMono: "'IBM Plex Mono', Consolas, 'Liberation Mono', Menlo, monospace",
14
+ };
15
+
16
+ const transformTokenProperties = (token) => {
17
+ const {
18
+ fontWeight,
19
+ fontSize,
20
+ lineHeight,
21
+ fontFamily,
22
+ } = token.value;
23
+
24
+ // Convert font family name to font family value
25
+ let fontFamilyValue;
26
+ const fontFamilyNameParts = fontFamily.split(' '); // each word in font family name is a separate part
27
+
28
+ if (fontFamilyNameParts.length === 1) {
29
+ fontFamilyValue = fontFamilies[fontFamilyNameParts[0].toLowerCase()];
30
+ } else {
31
+ const fontFamilyIndex = fontFamilyNameParts.map((fontFamilyNamePart, i) => {
32
+ if (i === 0) return fontFamilyNamePart.toLowerCase();
33
+ return fontFamilyNamePart;
34
+ }).join('');
35
+
36
+ fontFamilyValue = fontFamilies[fontFamilyIndex];
37
+ }
38
+
39
+ return `font-size: ${Number(fontSize) / 10}rem; line-height: ${Number(lineHeight) / 10}rem; font-weight: ${fontWeight}; font-family: ${fontFamilyValue};`;
40
+ };
41
+
42
+ const transformTokenName = (tokenName) => {
43
+ const [token, variant] = tokenName.split('-');
44
+ return (variant ? `${token}${variant.charAt(0).toUpperCase() + variant.slice(1)}` : token);
45
+ };
46
+
47
+ const extractDeviceTokensDefinitions = (tokens) => {
48
+ return Object.keys(tokens).reduce((acc, tokenName) => {
49
+ const properTokenName = transformTokenName(tokenName);
50
+ acc[properTokenName] = transformTokenProperties(tokens[tokenName], fontFamilies);
51
+ return acc;
52
+ }, {});
53
+ };
54
+
55
+ const extractTokensDefinitions = (sharedTokens) => {
56
+ const sharedTokensDefinition = {
57
+ mobile: {},
58
+ tablet: {},
59
+ desktop: {},
60
+ };
61
+
62
+ Object.entries(sharedTokens).forEach(([tokenName, tokenValue]) => {
63
+ if ((tokenName === 'mobile' || tokenName === 'tablet') && typeof tokenValue !== 'string') {
64
+ sharedTokensDefinition[tokenName] = extractDeviceTokensDefinitions(tokenValue, fontFamilies);
65
+ return;
66
+ }
67
+
68
+ const properTokenName = transformTokenName(tokenName);
69
+ const transformedTokenProperties = transformTokenProperties(tokenValue, fontFamilies);
70
+ sharedTokensDefinition.desktop[properTokenName] = transformedTokenProperties;
71
+ sharedTokensDefinition.mobile[properTokenName] ||= transformedTokenProperties;
72
+ sharedTokensDefinition.tablet[properTokenName] ||= transformedTokenProperties;
73
+ });
74
+
75
+ return sharedTokensDefinition;
76
+ };
77
+
78
+ const globalTokens = JSON.parse(code).global;
79
+
80
+ const sharedTokens = extractTokensDefinitions(globalTokens.shared);
81
+ const marketingTokens = extractTokensDefinitions(globalTokens.marketing);
82
+ const contentTokens = extractTokensDefinitions(globalTokens.content);
83
+
84
+ const tokensForCodeGeneration = {
85
+ shared: sharedTokens,
86
+ marketing: marketingTokens,
87
+ content: contentTokens,
88
+ };
89
+
90
+ const createTokensCode = (tokens) => {
91
+ const variantsArray = [];
92
+ for (const [tokenVariant, tokenVariantItems] of Object.entries(tokens)) {
93
+ const devicesArray = [];
94
+
95
+ for (const [device, deviceTokens] of Object.entries(tokenVariantItems)) {
96
+ const deviceItemsArray = [];
97
+
98
+ for (const [tokenName, tokenValue] of Object.entries(deviceTokens)) {
99
+ deviceItemsArray.push(builders.property(
100
+ 'init',
101
+ builders.identifier(tokenName),
102
+ builders.literal(tokenValue),
103
+ ));
104
+ }
105
+ devicesArray.push(builders.property(
106
+ 'init',
107
+ builders.identifier(device),
108
+ builders.objectExpression(deviceItemsArray),
109
+ ));
110
+ }
111
+
112
+ variantsArray.push(builders.property(
113
+ 'init',
114
+ builders.identifier(tokenVariant),
115
+ builders.objectExpression(devicesArray),
116
+ ));
117
+ }
118
+
119
+ const exportDeclaration = builders.exportNamedDeclaration(
120
+ builders.variableDeclaration('const', [
121
+ builders.variableDeclarator(
122
+ builders.identifier('typographyTokens'),
123
+ builders.tsAsExpression(builders.objectExpression(variantsArray), builders.tsTypeReference(builders.identifier('const'))),
124
+ )]),
125
+ [],
126
+ );
127
+
128
+ // Add a comment to the export declaration
129
+ exportDeclaration.comments = [builders.commentBlock(' eslint-disable max-len ')];
130
+
131
+ return exportDeclaration;
132
+ };
133
+
134
+ const printedCode = print(builders.program([createTokensCode(tokensForCodeGeneration)])).code;
135
+
136
+ writeFileSync('./src/design_system/typography_theme.ts', printedCode);
@@ -0,0 +1,59 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { ArrowLeft16, ArrowRight16 } from '@apify/icons';
5
+
6
+ import { theme } from '../design_system/theme';
7
+ import { Box } from './box';
8
+ import { Link, type LinkProps } from './link';
9
+ import { Heading } from './text';
10
+
11
+ const StyledGuidepost = styled(Box)<{ $isBackLink: boolean }>`
12
+ display: inline-flex;
13
+ align-items: center;
14
+ color: ${theme.color.neutral.text};
15
+
16
+ svg {
17
+ transition: transform 0.2s ease-in-out;
18
+ }
19
+
20
+ &:hover {
21
+ svg {
22
+ transform: translate(${({ $isBackLink }) => ($isBackLink ? -3 : 3)}px, 0);
23
+ }
24
+ }
25
+ `;
26
+
27
+ export const ActionLink: React.FC<LinkProps> = ({
28
+ children,
29
+ as,
30
+ ...rest
31
+ }) => {
32
+ return (
33
+ <StyledGuidepost
34
+ forwardedAs={as || Link}
35
+ $isBackLink={false}
36
+ {...rest}
37
+ >
38
+ <Heading as='span' type='titleM'>{children}</Heading>
39
+ <ArrowRight16 />
40
+ </StyledGuidepost>
41
+ );
42
+ };
43
+
44
+ export const BackLink: React.FC<LinkProps> = ({
45
+ children,
46
+ as,
47
+ ...rest
48
+ }) => {
49
+ return (
50
+ <StyledGuidepost
51
+ forwardedAs={as || Link}
52
+ $isBackLink={true}
53
+ {...rest}
54
+ >
55
+ <ArrowLeft16 />
56
+ <Heading as='span' type='titleM'>{children}</Heading>
57
+ </StyledGuidepost>
58
+ );
59
+ };
@@ -0,0 +1,99 @@
1
+ import React from 'react';
2
+ import styled from 'styled-components';
3
+
4
+ import { theme } from '../design_system/theme';
5
+ import { TextBaseComponent } from './text/text_base';
6
+ import { VerticalTile } from './tile';
7
+
8
+ interface ActorTemplateCardProps {
9
+ id: string;
10
+ label: string;
11
+ description: string;
12
+ icons: React.ReactNode[];
13
+ }
14
+
15
+ const WrapperClasses = {
16
+ TEMPLATE_CARD_IMAGES: 'TemplateCard-Images',
17
+ TEMPLATE_CARD_TEXT: 'TemplateCard-Text',
18
+ };
19
+
20
+ const Text = styled(TextBaseComponent)`
21
+ ${theme.typography.marketing.mobile.bodyM}
22
+ color: ${theme.color.neutral.textMuted};
23
+ overflow: hidden;
24
+ text-overflow: ellipsis;
25
+ display: -webkit-box;
26
+ -webkit-line-clamp: 3;
27
+ -webkit-box-orient: vertical;
28
+
29
+ @media ${theme.layout.tablet} {
30
+ ${theme.typography.marketing.tablet.bodyM}
31
+ }
32
+
33
+ @media ${theme.layout.desktop} {
34
+ ${theme.typography.marketing.desktop.bodyM}
35
+ }
36
+ `;
37
+
38
+ const Heading = styled(TextBaseComponent)`
39
+ ${theme.typography.marketing.mobile.titleXs}
40
+ color: ${theme.color.neutral.text};
41
+
42
+ @media ${theme.layout.tablet} {
43
+ ${theme.typography.marketing.tablet.titleXs}
44
+ }
45
+
46
+ @media ${theme.layout.desktop} {
47
+ ${theme.typography.marketing.desktop.titleXs}
48
+ }
49
+ `;
50
+
51
+ const TemplateCardContentWrapper = styled.div`
52
+ display: flex;
53
+ flex-direction: column;
54
+ align-items: flex-start;
55
+ align-self: stretch;
56
+ flex: 1 0 0;
57
+ gap: ${theme.space.space16};
58
+
59
+ .${WrapperClasses.TEMPLATE_CARD_IMAGES} {
60
+ display: flex;
61
+ align-items: flex-start;
62
+ gap: ${theme.space.space16};
63
+ }
64
+
65
+ .${WrapperClasses.TEMPLATE_CARD_TEXT} {
66
+ display: flex;
67
+ flex-direction: column;
68
+ align-items: flex-start;
69
+ align-self: stretch;
70
+ gap: ${theme.space.space4};
71
+ }
72
+ `;
73
+
74
+ export const ActorTemplateCard: React.FC<ActorTemplateCardProps> = ({
75
+ id,
76
+ label,
77
+ description,
78
+ icons,
79
+ }) => {
80
+ const templateCardContent = (
81
+ <TemplateCardContentWrapper>
82
+ <div className={WrapperClasses.TEMPLATE_CARD_IMAGES}>
83
+ {icons}
84
+ </div>
85
+ <div className={WrapperClasses.TEMPLATE_CARD_TEXT}>
86
+ <Heading>{label}</Heading>
87
+ <Text>{description}</Text>
88
+ </div>
89
+ </TemplateCardContentWrapper>
90
+ );
91
+
92
+ return (
93
+ <VerticalTile
94
+ id={`actor-template-card-${id}`}
95
+ content={templateCardContent}
96
+ isClickable
97
+ />
98
+ );
99
+ };
@@ -0,0 +1,144 @@
1
+ import React, { forwardRef } from 'react';
2
+ import styled, { css, type FlattenSimpleInterpolation } from 'styled-components';
3
+
4
+ import type { IconComponent, IconSize } from '@apify/ui-icons';
5
+
6
+ import { theme } from '../design_system/theme';
7
+ import type { WithTransientProps } from '../type_utils';
8
+ import { type RegularBoxProps, type MarginSpacingProps, Box } from './box';
9
+
10
+ type BadgeSize = typeof BADGE_SIZES[number];
11
+
12
+ export const BADGE_SIZES = ['medium', 'small'] as const;
13
+
14
+ const BADGE_ICON_SIZES = {
15
+ medium: '16',
16
+ small: '12',
17
+ } satisfies Record<BadgeSize, IconSize>;
18
+
19
+ const badgeSizeStyle = {
20
+ medium: ($code) => css`
21
+ padding: ${theme.space.space4} ${theme.space.space8};
22
+ border-radius: ${theme.radius.radius6};
23
+ ${$code
24
+ ? theme.typography.shared.desktop.codeMMedium
25
+ : theme.typography.shared.desktop.bodyMMedium
26
+ }
27
+ `,
28
+ small: ($code) => css`
29
+ height: 2rem;
30
+ padding: ${theme.space.space2} ${theme.space.space6};
31
+ border-radius: ${theme.radius.radius4};
32
+ ${$code
33
+ ? theme.typography.shared.desktop.codeSMedium
34
+ : theme.typography.shared.desktop.bodySMedium
35
+ }
36
+ `,
37
+ } satisfies Record<BadgeSize, (code: boolean) => FlattenSimpleInterpolation>;
38
+
39
+ type BadgeVariant = typeof BADGE_VARIANTS[number];
40
+
41
+ export const BADGE_VARIANTS = ['neutral', 'neutral_muted', 'neutral_subtle', 'primary_black', 'primary_blue', 'success', 'warning', 'danger'] as const;
42
+
43
+ const badgeVariantStyle = {
44
+ neutral: css`
45
+ color: ${theme.color.neutral.text};
46
+ fill: ${theme.color.neutral.text};
47
+ background: ${theme.color.neutral.background};
48
+ box-shadow: inset 0 0 0 1px ${theme.color.neutral.border};
49
+ `,
50
+ neutral_muted: css`
51
+ color: ${theme.color.neutral.text};
52
+ fill: ${theme.color.neutral.text};
53
+ background: ${theme.color.neutral.chipBackground};
54
+ `,
55
+ neutral_subtle: css`
56
+ color: ${theme.color.neutral.textSubtle};
57
+ fill: ${theme.color.neutral.textSubtle};
58
+ background: ${theme.color.neutral.backgroundSubtle};
59
+ `,
60
+ primary_black: css`
61
+ color: ${theme.color.primaryBlack.chipText};
62
+ fill: ${theme.color.primaryBlack.chipText};
63
+ background: ${theme.color.primaryBlack.background};
64
+ `,
65
+ primary_blue: css`
66
+ color: ${theme.color.primary.chipText};
67
+ fill: ${theme.color.primaryBlack.chipText};
68
+ background: ${theme.color.primary.background};
69
+ `,
70
+ success: css`
71
+ color: ${theme.color.success.chipText};
72
+ fill: ${theme.color.success.chipText};
73
+ background: ${theme.color.success.background};
74
+ `,
75
+ warning: css`
76
+ color: ${theme.color.warning.chipText};
77
+ fill: ${theme.color.warning.chipText};
78
+ background: ${theme.color.warning.background};
79
+ `,
80
+ danger: css`
81
+ color: ${theme.color.danger.chipText};
82
+ fill: ${theme.color.danger.chipText};
83
+ background: ${theme.color.danger.background};
84
+ `,
85
+ } satisfies Record<BadgeVariant, FlattenSimpleInterpolation>;
86
+
87
+ type StyledBadgeProps = WithTransientProps<
88
+ Required<Pick<BadgeProps, 'size' | 'variant' | 'code'>>
89
+ >;
90
+
91
+ const StyledBadge = styled(Box)<StyledBadgeProps>`
92
+ ${({ $size, $code }) => badgeSizeStyle[$size]($code)};
93
+ ${({ $variant }) => badgeVariantStyle[$variant]};
94
+
95
+ /* Static styles */
96
+ width: fit-content;
97
+ border: none;
98
+ outline: none;
99
+ display: flex;
100
+ flex-direction: row;
101
+ justify-content: center;
102
+ align-items: center;
103
+ white-space: nowrap;
104
+ gap: ${theme.space.space4};
105
+ `;
106
+
107
+ export type BadgeProps = Omit<RegularBoxProps, 'onClick'> & MarginSpacingProps & {
108
+ as?: Exclude<React.ElementType, 'a' | 'button'>;
109
+ size?: BadgeSize;
110
+ variant?: BadgeVariant;
111
+ LeadingIcon?: IconComponent;
112
+ code?: boolean;
113
+ };
114
+
115
+ /**
116
+ * Component for displaying non-interactive chip descendant.
117
+ */
118
+ export const Badge = forwardRef(
119
+ ({
120
+ size = 'small',
121
+ variant = 'neutral',
122
+ LeadingIcon,
123
+ children,
124
+ code = false,
125
+ ...props
126
+ }: BadgeProps,
127
+ ref,
128
+ ) => {
129
+ return (
130
+ <StyledBadge
131
+ ref={ref}
132
+ $size={size}
133
+ $variant={variant}
134
+ $code={code}
135
+ {...props}
136
+ >
137
+ {LeadingIcon && <LeadingIcon size={BADGE_ICON_SIZES[size]} />}
138
+ {children}
139
+ </StyledBadge>
140
+ );
141
+ },
142
+ );
143
+
144
+ Badge.displayName = 'Badge';