@saleor/macaw-ui 0.5.2 → 0.6.2

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 (484) hide show
  1. package/dist/cjs/index.js +2 -2
  2. package/dist/cjs/index.js.map +3 -3
  3. package/dist/esm/index.js +2 -2
  4. package/dist/esm/index.js.map +3 -3
  5. package/dist/types/CircleIndicator/CircleIndicator.d.ts +2 -0
  6. package/dist/types/Indicator/Circle.d.ts +5 -0
  7. package/dist/types/Indicator/CircleFilled.d.ts +8 -0
  8. package/dist/types/Indicator/CircleOutline.d.ts +8 -0
  9. package/dist/types/Indicator/Indicator.d.ts +14 -0
  10. package/dist/types/Indicator/Indicator.stories.d.ts +11 -0
  11. package/dist/types/Indicator/IndicatorCircle.d.ts +7 -0
  12. package/dist/types/Indicator/IndicatorCircle.stories.d.ts +7 -0
  13. package/dist/types/Indicator/IndicatorOutlined.d.ts +9 -0
  14. package/dist/types/Indicator/IndicatorOutlined.stories.d.ts +18 -0
  15. package/dist/types/Indicator/index.d.ts +3 -0
  16. package/dist/types/Indicator/styles.d.ts +5 -0
  17. package/dist/types/Pagination/Pagination.d.ts +5 -2
  18. package/dist/types/Pagination/PaginationActions.d.ts +16 -5
  19. package/dist/types/Tooltip/Arrow.d.ts +11 -0
  20. package/dist/types/Tooltip/Tooltip.d.ts +17 -3
  21. package/dist/types/Tooltip/Tooltip.stories.d.ts +7 -5
  22. package/dist/types/Tooltip/TooltipMountWrapper.d.ts +8 -0
  23. package/dist/types/Tooltip/index.d.ts +1 -0
  24. package/dist/types/Tooltip/styles.d.ts +10 -1
  25. package/dist/types/icons/20x20/BackSmallIcon.d.ts +10 -0
  26. package/dist/types/icons/20x20/BookmarksSmallIcon.d.ts +10 -0
  27. package/dist/types/icons/20x20/CheckboxSmallIcon.d.ts +10 -0
  28. package/dist/types/icons/20x20/ChevronSmallIcon.d.ts +10 -0
  29. package/dist/types/icons/20x20/CloseSmallIcon.d.ts +10 -0
  30. package/dist/types/icons/20x20/DragSmallIcon.d.ts +10 -0
  31. package/dist/types/icons/20x20/FilterSmallIcon.d.ts +10 -0
  32. package/dist/types/icons/20x20/MinusSmallIcon.d.ts +10 -0
  33. package/dist/types/icons/20x20/MoreSmallIcon.d.ts +10 -0
  34. package/dist/types/icons/20x20/NextSmallIcon.d.ts +10 -0
  35. package/dist/types/icons/20x20/PlusSmallIcon.d.ts +10 -0
  36. package/dist/types/icons/20x20/SearchSmallIcon.d.ts +10 -0
  37. package/dist/types/icons/20x20/SortBigSmallIcon.d.ts +10 -0
  38. package/dist/types/icons/20x20/SortSmallSmallIcon.d.ts +10 -0
  39. package/dist/types/icons/20x20/index.d.ts +14 -0
  40. package/dist/types/icons/24x24/AddEnvironmentIcon.d.ts +10 -0
  41. package/dist/types/icons/24x24/AppsIcon.d.ts +10 -0
  42. package/dist/types/icons/24x24/ArrowRightIcon.d.ts +10 -0
  43. package/dist/types/icons/24x24/BackspaceIcon.d.ts +10 -0
  44. package/dist/types/icons/24x24/BagIcon.d.ts +10 -0
  45. package/dist/types/icons/24x24/BillingIcon.d.ts +10 -0
  46. package/dist/types/icons/24x24/BookmarkIcon.d.ts +10 -0
  47. package/dist/types/icons/24x24/CalendarIcon.d.ts +10 -0
  48. package/dist/types/icons/24x24/CheckIcon.d.ts +10 -0
  49. package/dist/types/icons/24x24/ChevronIcon.d.ts +10 -0
  50. package/dist/types/icons/24x24/Close2Icon.d.ts +10 -0
  51. package/dist/types/icons/24x24/CloseIcon.d.ts +10 -0
  52. package/dist/types/icons/24x24/CodeIcon.d.ts +10 -0
  53. package/dist/types/icons/24x24/ColumnsIcon.d.ts +10 -0
  54. package/dist/types/icons/24x24/CopyIcon.d.ts +10 -0
  55. package/dist/types/icons/24x24/CustomersIcon.d.ts +10 -0
  56. package/dist/types/icons/24x24/DashboardIcon.d.ts +10 -0
  57. package/dist/types/icons/24x24/DeleteIcon.d.ts +10 -0
  58. package/dist/types/icons/24x24/DeveloperIcon.d.ts +10 -0
  59. package/dist/types/icons/24x24/DiscountsIcon.d.ts +10 -0
  60. package/dist/types/icons/24x24/DownloadIcon.d.ts +10 -0
  61. package/dist/types/icons/24x24/DragIcon.d.ts +10 -0
  62. package/dist/types/icons/24x24/EditIcon.d.ts +10 -0
  63. package/dist/types/icons/24x24/EnvironmentIcon.d.ts +10 -0
  64. package/dist/types/icons/24x24/ExpandIcon.d.ts +10 -0
  65. package/dist/types/icons/24x24/ExpendableIcon.d.ts +10 -0
  66. package/dist/types/icons/24x24/EyeClosedIcon.d.ts +10 -0
  67. package/dist/types/icons/24x24/EyeIcon.d.ts +10 -0
  68. package/dist/types/icons/24x24/FilteringIcon.d.ts +10 -0
  69. package/dist/types/icons/24x24/GenerateIcon.d.ts +10 -0
  70. package/dist/types/icons/24x24/GithubIcon.d.ts +10 -0
  71. package/dist/types/icons/24x24/GridIcon.d.ts +10 -0
  72. package/dist/types/icons/24x24/HelpIcon.d.ts +10 -0
  73. package/dist/types/icons/24x24/HowToIcon.d.ts +10 -0
  74. package/dist/types/icons/24x24/LinkIcon.d.ts +10 -0
  75. package/dist/types/icons/24x24/ListIcon.d.ts +10 -0
  76. package/dist/types/icons/24x24/MailIcon.d.ts +10 -0
  77. package/dist/types/icons/24x24/MigrateIcon.d.ts +10 -0
  78. package/dist/types/icons/24x24/MinusIcon.d.ts +10 -0
  79. package/dist/types/icons/24x24/ModelsIcon.d.ts +10 -0
  80. package/dist/types/icons/24x24/MoreHorizontalIcon.d.ts +10 -0
  81. package/dist/types/icons/24x24/NavigationIcon.d.ts +10 -0
  82. package/dist/types/icons/24x24/NavigatorIcon.d.ts +10 -0
  83. package/dist/types/icons/24x24/NextIcon.d.ts +10 -0
  84. package/dist/types/icons/24x24/NoConnectionIcon.d.ts +10 -0
  85. package/dist/types/icons/24x24/NotificationsIcon.d.ts +10 -0
  86. package/dist/types/icons/24x24/OrdersIcon.d.ts +10 -0
  87. package/dist/types/icons/24x24/PagesIcon.d.ts +10 -0
  88. package/dist/types/icons/24x24/PermissionsIcon.d.ts +10 -0
  89. package/dist/types/icons/24x24/PhotoIcon.d.ts +10 -0
  90. package/dist/types/icons/24x24/PlayIcon.d.ts +10 -0
  91. package/dist/types/icons/24x24/PlusIcon.d.ts +10 -0
  92. package/dist/types/icons/24x24/PresetIcon.d.ts +10 -0
  93. package/dist/types/icons/24x24/PreviousIcon.d.ts +10 -0
  94. package/dist/types/icons/24x24/PrinterIcon.d.ts +10 -0
  95. package/dist/types/icons/24x24/PrivacyIcon.d.ts +10 -0
  96. package/dist/types/icons/24x24/ProcessIcon.d.ts +10 -0
  97. package/dist/types/icons/24x24/ProductIcon.d.ts +10 -0
  98. package/dist/types/icons/24x24/RefreshIcon.d.ts +10 -0
  99. package/dist/types/icons/24x24/RemoveMemberIcon.d.ts +10 -0
  100. package/dist/types/icons/24x24/ReplyIcon.d.ts +10 -0
  101. package/dist/types/icons/24x24/SearchIcon.d.ts +10 -0
  102. package/dist/types/icons/24x24/SettingsIcon.d.ts +10 -0
  103. package/dist/types/icons/24x24/SnapshotsIcon.d.ts +10 -0
  104. package/dist/types/icons/24x24/SortDownIcon.d.ts +10 -0
  105. package/dist/types/icons/24x24/SortUpIcon.d.ts +10 -0
  106. package/dist/types/icons/24x24/TasksIcon.d.ts +10 -0
  107. package/dist/types/icons/24x24/TimeIcon.d.ts +10 -0
  108. package/dist/types/icons/24x24/ToIcon.d.ts +10 -0
  109. package/dist/types/icons/24x24/TransferIcon.d.ts +10 -0
  110. package/dist/types/icons/24x24/TranslateIcon.d.ts +10 -0
  111. package/dist/types/icons/24x24/TranslationIcon.d.ts +10 -0
  112. package/dist/types/icons/24x24/WebsiteIcon.d.ts +10 -0
  113. package/dist/types/icons/24x24/WifiIcon.d.ts +10 -0
  114. package/dist/types/icons/24x24/index.d.ts +74 -0
  115. package/dist/types/icons/32x32/AttributesLargeIcon.d.ts +10 -0
  116. package/dist/types/icons/32x32/CustomerLargeIcon.d.ts +10 -0
  117. package/dist/types/icons/32x32/DigitalLargeIcon.d.ts +10 -0
  118. package/dist/types/icons/32x32/DiscountLargeIcon.d.ts +10 -0
  119. package/dist/types/icons/32x32/FilteringLargeIcon.d.ts +10 -0
  120. package/dist/types/icons/32x32/GiftCardLargeIcon.d.ts +10 -0
  121. package/dist/types/icons/32x32/NavigationLargeIcon.d.ts +10 -0
  122. package/dist/types/icons/32x32/NotesLargeIcon.d.ts +10 -0
  123. package/dist/types/icons/32x32/OmnichannelLargeIcon.d.ts +10 -0
  124. package/dist/types/icons/32x32/PermissionLargeIcon.d.ts +10 -0
  125. package/dist/types/icons/32x32/ProductLargeIcon.d.ts +10 -0
  126. package/dist/types/icons/32x32/SearchLargeIcon.d.ts +10 -0
  127. package/dist/types/icons/32x32/ShippingLargeIcon.d.ts +10 -0
  128. package/dist/types/icons/32x32/SiteSettingsLargeIcon.d.ts +10 -0
  129. package/dist/types/icons/32x32/StaffMembersLargeIcon.d.ts +10 -0
  130. package/dist/types/icons/32x32/TaxesLargeIcon.d.ts +10 -0
  131. package/dist/types/icons/32x32/TokenLargeIcon.d.ts +10 -0
  132. package/dist/types/icons/32x32/WarehouseLargeIcon.d.ts +10 -0
  133. package/dist/types/icons/32x32/WifiLargeIcon.d.ts +10 -0
  134. package/dist/types/icons/32x32/index.d.ts +19 -0
  135. package/dist/types/icons/index.d.ts +9 -67
  136. package/dist/types/icons/indicator/index.d.ts +2 -0
  137. package/dist/types/icons/indicator/regular/ErrorIndicatorIcon.d.ts +2 -0
  138. package/dist/types/icons/indicator/regular/FailIndicatorIcon.d.ts +2 -0
  139. package/dist/types/icons/indicator/regular/FailOutlineIndicatorIcon.d.ts +2 -0
  140. package/dist/types/icons/indicator/regular/HelpIndicatorIcon.d.ts +2 -0
  141. package/dist/types/icons/indicator/regular/SuccessIndicatorIcon.d.ts +2 -0
  142. package/dist/types/icons/indicator/regular/WarningIndicatorIcon.d.ts +2 -0
  143. package/dist/types/icons/indicator/regular/index.d.ts +6 -0
  144. package/dist/types/icons/indicator/small/ErrorSmallIndicatorIcon.d.ts +2 -0
  145. package/dist/types/icons/indicator/small/SuccessSmallIndicatorIcon.d.ts +2 -0
  146. package/dist/types/icons/indicator/small/WarningSmallIndicatorIcon.d.ts +2 -0
  147. package/dist/types/icons/indicator/small/index.d.ts +3 -0
  148. package/dist/types/icons/styles.d.ts +1 -0
  149. package/dist/types/icons/types.d.ts +3 -0
  150. package/dist/types/index.d.ts +1 -0
  151. package/dist/types/utils/mergeRefs.d.ts +1 -1
  152. package/package.json +21 -8
  153. package/src/CircleIndicator/CircleIndicator.tsx +2 -0
  154. package/src/Filter/FilterField/MultipleValueAutocompleteFilterField.tsx +42 -41
  155. package/src/Indicator/Circle.tsx +17 -0
  156. package/src/Indicator/CircleFilled.tsx +16 -0
  157. package/src/Indicator/CircleOutline.tsx +34 -0
  158. package/src/Indicator/Indicator.stories.tsx +49 -0
  159. package/src/Indicator/Indicator.tsx +65 -0
  160. package/src/Indicator/IndicatorCircle.stories.tsx +28 -0
  161. package/src/Indicator/IndicatorCircle.tsx +45 -0
  162. package/src/Indicator/IndicatorOutlined.stories.tsx +86 -0
  163. package/src/Indicator/IndicatorOutlined.tsx +63 -0
  164. package/src/Indicator/index.ts +3 -0
  165. package/src/Indicator/styles.ts +61 -0
  166. package/src/MultipleValueAutocomplete/MultipleValueAutocomplete.tsx +134 -133
  167. package/src/Pagination/Pagination.tsx +6 -4
  168. package/src/Pagination/PaginationActions.tsx +16 -9
  169. package/src/Pagination/PaginationRowNumberSelect.tsx +35 -34
  170. package/src/Tooltip/Arrow.tsx +54 -0
  171. package/src/Tooltip/Tooltip.stories.tsx +71 -8
  172. package/src/Tooltip/Tooltip.tsx +156 -15
  173. package/src/Tooltip/TooltipMountWrapper.tsx +25 -0
  174. package/src/Tooltip/index.ts +1 -0
  175. package/src/Tooltip/styles.ts +133 -9
  176. package/src/assets/icons/20x20/back_small_icon.svg +1 -0
  177. package/src/assets/icons/20x20/bookmarks_small_icon.svg +1 -0
  178. package/src/assets/icons/20x20/checkbox_small_icon.svg +1 -0
  179. package/src/assets/icons/20x20/chevron_small_icon.svg +1 -0
  180. package/src/assets/icons/20x20/close_small_icon.svg +1 -0
  181. package/src/assets/icons/20x20/drag_small_icon.svg +1 -0
  182. package/src/assets/icons/20x20/filter_small_icon.svg +1 -0
  183. package/src/assets/icons/20x20/minus_small_icon.svg +1 -0
  184. package/src/assets/icons/20x20/more_small_icon.svg +1 -0
  185. package/src/assets/icons/20x20/next_small_icon.svg +1 -0
  186. package/src/assets/icons/20x20/plus_small_icon.svg +1 -0
  187. package/src/assets/icons/20x20/search_small_icon.svg +1 -0
  188. package/src/assets/icons/20x20/sort_big_small_icon.svg +1 -0
  189. package/src/assets/icons/20x20/sort_small_small_icon.svg +1 -0
  190. package/src/assets/icons/24x24/add_environment_icon.svg +1 -0
  191. package/src/assets/icons/24x24/apps_icon.svg +1 -0
  192. package/src/assets/icons/24x24/arrow_right_icon.svg +1 -0
  193. package/src/assets/icons/24x24/backspace_icon.svg +1 -0
  194. package/src/assets/icons/24x24/bag_icon.svg +1 -0
  195. package/src/assets/icons/24x24/billing_icon.svg +1 -0
  196. package/src/assets/icons/24x24/bookmark_icon.svg +1 -0
  197. package/src/assets/icons/24x24/calendar_icon.svg +1 -0
  198. package/src/assets/icons/24x24/check_icon.svg +1 -0
  199. package/src/assets/icons/24x24/chevron_icon.svg +1 -0
  200. package/src/assets/icons/24x24/close_2_icon.svg +1 -0
  201. package/src/assets/icons/24x24/close_icon.svg +1 -0
  202. package/src/assets/icons/24x24/code_icon.svg +1 -0
  203. package/src/assets/icons/24x24/columns_icon.svg +1 -0
  204. package/src/assets/icons/24x24/copy_icon.svg +1 -0
  205. package/src/assets/icons/24x24/customers_icon.svg +1 -0
  206. package/src/assets/icons/24x24/dashboard_icon.svg +1 -0
  207. package/src/assets/icons/24x24/delete_icon.svg +1 -0
  208. package/src/assets/icons/24x24/developer_icon.svg +1 -0
  209. package/src/assets/icons/24x24/discounts_icon.svg +1 -0
  210. package/src/assets/icons/24x24/download_icon.svg +1 -0
  211. package/src/assets/icons/24x24/drag_icon.svg +1 -0
  212. package/src/assets/icons/24x24/edit_icon.svg +1 -0
  213. package/src/assets/icons/24x24/environment_icon.svg +1 -0
  214. package/src/assets/icons/24x24/expand_icon.svg +1 -0
  215. package/src/assets/icons/24x24/expendable_icon.svg +1 -0
  216. package/src/assets/icons/24x24/eye_closed_icon.svg +1 -0
  217. package/src/assets/icons/24x24/eye_icon.svg +1 -0
  218. package/src/assets/icons/24x24/filtering_icon.svg +1 -0
  219. package/src/assets/icons/24x24/generate_icon.svg +1 -0
  220. package/src/assets/icons/24x24/github_icon.svg +1 -0
  221. package/src/assets/icons/24x24/grid_icon.svg +1 -0
  222. package/src/assets/icons/24x24/help_icon.svg +1 -0
  223. package/src/assets/icons/24x24/how to_icon.svg +1 -0
  224. package/src/assets/icons/24x24/link_icon.svg +1 -0
  225. package/src/assets/icons/24x24/list_icon.svg +1 -0
  226. package/src/assets/icons/24x24/mail_icon.svg +1 -0
  227. package/src/assets/icons/24x24/migrate_icon.svg +1 -0
  228. package/src/assets/icons/24x24/minus_icon.svg +1 -0
  229. package/src/assets/icons/24x24/models_icon.svg +1 -0
  230. package/src/assets/icons/24x24/more_horizontal_icon.svg +1 -0
  231. package/src/assets/icons/24x24/navigation_icon.svg +1 -0
  232. package/src/assets/icons/24x24/navigator_icon.svg +1 -0
  233. package/src/assets/icons/24x24/next_icon.svg +1 -0
  234. package/src/assets/icons/24x24/no_connection_icon.svg +1 -0
  235. package/src/assets/icons/24x24/notifications_icon.svg +1 -0
  236. package/src/assets/icons/24x24/orders_icon.svg +1 -0
  237. package/src/assets/icons/24x24/pages_icon.svg +1 -0
  238. package/src/assets/icons/24x24/permissions_icon.svg +1 -0
  239. package/src/assets/icons/24x24/photo_icon.svg +1 -0
  240. package/src/assets/icons/24x24/play_icon.svg +1 -0
  241. package/src/assets/icons/24x24/plus_icon.svg +1 -0
  242. package/src/assets/icons/24x24/preset_icon.svg +1 -0
  243. package/src/assets/icons/24x24/previous_icon.svg +1 -0
  244. package/src/assets/icons/24x24/printer_icon.svg +1 -0
  245. package/src/assets/icons/24x24/privacy_icon.svg +1 -0
  246. package/src/assets/icons/24x24/process_icon.svg +1 -0
  247. package/src/assets/icons/24x24/product_icon.svg +1 -0
  248. package/src/assets/icons/24x24/refresh_icon.svg +1 -0
  249. package/src/assets/icons/24x24/remove_member_icon.svg +1 -0
  250. package/src/assets/icons/24x24/reply_icon.svg +1 -0
  251. package/src/assets/icons/24x24/search_icon.svg +1 -0
  252. package/src/assets/icons/24x24/settings_icon.svg +1 -0
  253. package/src/assets/icons/24x24/snapshots_icon.svg +1 -0
  254. package/src/assets/icons/24x24/sort_down_icon.svg +1 -0
  255. package/src/assets/icons/24x24/sort_up_icon.svg +1 -0
  256. package/src/assets/icons/24x24/tasks_icon.svg +1 -0
  257. package/src/assets/icons/24x24/time_icon.svg +1 -0
  258. package/src/assets/icons/24x24/to_icon.svg +1 -0
  259. package/src/assets/icons/24x24/transfer_icon.svg +1 -0
  260. package/src/assets/icons/24x24/translate_icon.svg +1 -0
  261. package/src/assets/icons/24x24/translation_icon.svg +1 -0
  262. package/src/assets/icons/24x24/website_icon.svg +1 -0
  263. package/src/assets/icons/24x24/wifi_icon.svg +1 -0
  264. package/src/assets/icons/32x32/attributes_large_icon.svg +1 -0
  265. package/src/assets/icons/32x32/customer_large_icon.svg +1 -0
  266. package/src/assets/icons/32x32/digital_large_icon.svg +1 -0
  267. package/src/assets/icons/32x32/discount_large_icon.svg +1 -0
  268. package/src/assets/icons/32x32/filtering_large_icon.svg +1 -0
  269. package/src/assets/icons/32x32/gift card_large_icon.svg +1 -0
  270. package/src/assets/icons/32x32/navigation_large_icon.svg +1 -0
  271. package/src/assets/icons/32x32/notes_large_icon.svg +1 -0
  272. package/src/assets/icons/32x32/omnichannel_large_icon.svg +1 -0
  273. package/src/assets/icons/32x32/permission_large_icon.svg +1 -0
  274. package/src/assets/icons/32x32/product_large_icon.svg +1 -0
  275. package/src/assets/icons/32x32/search_large_icon.svg +1 -0
  276. package/src/assets/icons/32x32/shipping_large_icon.svg +1 -0
  277. package/src/assets/icons/32x32/site settings_large_icon.svg +1 -0
  278. package/src/assets/icons/32x32/staff members_large_icon.svg +1 -0
  279. package/src/assets/icons/32x32/taxes_large_icon.svg +1 -0
  280. package/src/assets/icons/32x32/token_large_icon.svg +1 -0
  281. package/src/assets/icons/32x32/warehouse_large_icon.svg +1 -0
  282. package/src/assets/icons/32x32/wifi_large_icon.svg +1 -0
  283. package/src/assets/icons/indicator/regular/error_indicator_icon.svg +1 -0
  284. package/src/assets/icons/indicator/regular/fail_indicator_icon.svg +1 -0
  285. package/src/assets/icons/indicator/regular/fail_outline_indicator_icon.svg +1 -0
  286. package/src/assets/icons/indicator/regular/help_indicator_icon.svg +1 -0
  287. package/src/assets/icons/indicator/regular/success_indicator_icon.svg +1 -0
  288. package/src/assets/icons/indicator/regular/warning_indicator_icon.svg +1 -0
  289. package/src/assets/icons/indicator/small/error_small_indicator_icon.svg +1 -0
  290. package/src/assets/icons/indicator/small/success_small_indicator_icon.svg +1 -0
  291. package/src/assets/icons/indicator/small/warning_small_indicator_icon.svg +1 -0
  292. package/src/icons/20x20/BackSmallIcon.tsx +32 -0
  293. package/src/icons/20x20/BookmarksSmallIcon.tsx +29 -0
  294. package/src/icons/20x20/CheckboxSmallIcon.tsx +32 -0
  295. package/src/icons/20x20/ChevronSmallIcon.tsx +32 -0
  296. package/src/icons/20x20/CloseSmallIcon.tsx +31 -0
  297. package/src/icons/20x20/DragSmallIcon.tsx +31 -0
  298. package/src/icons/20x20/FilterSmallIcon.tsx +31 -0
  299. package/src/icons/20x20/MinusSmallIcon.tsx +32 -0
  300. package/src/icons/20x20/MoreSmallIcon.tsx +31 -0
  301. package/src/icons/20x20/NextSmallIcon.tsx +32 -0
  302. package/src/icons/20x20/PlusSmallIcon.tsx +32 -0
  303. package/src/icons/20x20/SearchSmallIcon.tsx +31 -0
  304. package/src/icons/20x20/SortBigSmallIcon.tsx +31 -0
  305. package/src/icons/20x20/SortSmallSmallIcon.tsx +31 -0
  306. package/src/icons/20x20/index.ts +14 -0
  307. package/src/icons/24x24/AddEnvironmentIcon.tsx +32 -0
  308. package/src/icons/24x24/AppsIcon.tsx +31 -0
  309. package/src/icons/24x24/ArrowRightIcon.tsx +32 -0
  310. package/src/icons/24x24/BackspaceIcon.tsx +32 -0
  311. package/src/icons/24x24/BagIcon.tsx +29 -0
  312. package/src/icons/24x24/BillingIcon.tsx +32 -0
  313. package/src/icons/24x24/BookmarkIcon.tsx +29 -0
  314. package/src/icons/24x24/CalendarIcon.tsx +32 -0
  315. package/src/icons/24x24/CheckIcon.tsx +32 -0
  316. package/src/icons/24x24/ChevronIcon.tsx +32 -0
  317. package/src/icons/24x24/Close2Icon.tsx +39 -0
  318. package/src/icons/24x24/CloseIcon.tsx +31 -0
  319. package/src/icons/24x24/CodeIcon.tsx +38 -0
  320. package/src/icons/24x24/ColumnsIcon.tsx +30 -0
  321. package/src/icons/24x24/CopyIcon.tsx +39 -0
  322. package/src/icons/24x24/CustomersIcon.tsx +33 -0
  323. package/src/icons/24x24/DashboardIcon.tsx +30 -0
  324. package/src/icons/24x24/DeleteIcon.tsx +32 -0
  325. package/src/icons/24x24/DeveloperIcon.tsx +44 -0
  326. package/src/icons/24x24/DiscountsIcon.tsx +31 -0
  327. package/src/icons/24x24/DownloadIcon.tsx +32 -0
  328. package/src/icons/24x24/DragIcon.tsx +31 -0
  329. package/src/icons/24x24/EditIcon.tsx +36 -0
  330. package/src/icons/24x24/EnvironmentIcon.tsx +36 -0
  331. package/src/icons/24x24/ExpandIcon.tsx +39 -0
  332. package/src/icons/24x24/ExpendableIcon.tsx +34 -0
  333. package/src/icons/24x24/EyeClosedIcon.tsx +30 -0
  334. package/src/icons/24x24/EyeIcon.tsx +31 -0
  335. package/src/icons/24x24/FilteringIcon.tsx +32 -0
  336. package/src/icons/24x24/GenerateIcon.tsx +32 -0
  337. package/src/icons/24x24/GithubIcon.tsx +40 -0
  338. package/src/icons/24x24/GridIcon.tsx +61 -0
  339. package/src/icons/24x24/HelpIcon.tsx +35 -0
  340. package/src/icons/24x24/HowToIcon.tsx +39 -0
  341. package/src/icons/24x24/LinkIcon.tsx +32 -0
  342. package/src/icons/24x24/ListIcon.tsx +34 -0
  343. package/src/icons/24x24/MailIcon.tsx +31 -0
  344. package/src/icons/24x24/MigrateIcon.tsx +36 -0
  345. package/src/icons/24x24/MinusIcon.tsx +32 -0
  346. package/src/icons/24x24/ModelsIcon.tsx +38 -0
  347. package/src/icons/24x24/MoreHorizontalIcon.tsx +31 -0
  348. package/src/icons/24x24/NavigationIcon.tsx +31 -0
  349. package/src/icons/24x24/NavigatorIcon.tsx +32 -0
  350. package/src/icons/24x24/NextIcon.tsx +32 -0
  351. package/src/icons/24x24/NoConnectionIcon.tsx +36 -0
  352. package/src/icons/24x24/NotificationsIcon.tsx +32 -0
  353. package/src/icons/24x24/OrdersIcon.tsx +36 -0
  354. package/src/icons/24x24/PagesIcon.tsx +32 -0
  355. package/src/icons/24x24/PermissionsIcon.tsx +32 -0
  356. package/src/icons/24x24/PhotoIcon.tsx +32 -0
  357. package/src/icons/24x24/PlayIcon.tsx +31 -0
  358. package/src/icons/24x24/PlusIcon.tsx +32 -0
  359. package/src/icons/24x24/PresetIcon.tsx +35 -0
  360. package/src/icons/24x24/PreviousIcon.tsx +32 -0
  361. package/src/icons/24x24/PrinterIcon.tsx +32 -0
  362. package/src/icons/24x24/PrivacyIcon.tsx +39 -0
  363. package/src/icons/24x24/ProcessIcon.tsx +73 -0
  364. package/src/icons/24x24/ProductIcon.tsx +32 -0
  365. package/src/icons/24x24/RefreshIcon.tsx +32 -0
  366. package/src/icons/24x24/RemoveMemberIcon.tsx +34 -0
  367. package/src/icons/24x24/ReplyIcon.tsx +32 -0
  368. package/src/icons/24x24/SearchIcon.tsx +39 -0
  369. package/src/icons/24x24/SettingsIcon.tsx +34 -0
  370. package/src/icons/24x24/SnapshotsIcon.tsx +39 -0
  371. package/src/icons/24x24/SortDownIcon.tsx +31 -0
  372. package/src/icons/24x24/SortUpIcon.tsx +31 -0
  373. package/src/icons/24x24/TasksIcon.tsx +32 -0
  374. package/src/icons/24x24/TimeIcon.tsx +39 -0
  375. package/src/icons/24x24/ToIcon.tsx +32 -0
  376. package/src/icons/24x24/TransferIcon.tsx +32 -0
  377. package/src/icons/24x24/TranslateIcon.tsx +32 -0
  378. package/src/icons/24x24/TranslationIcon.tsx +33 -0
  379. package/src/icons/24x24/WebsiteIcon.tsx +53 -0
  380. package/src/icons/24x24/WifiIcon.tsx +32 -0
  381. package/src/icons/24x24/index.ts +74 -0
  382. package/src/icons/32x32/AttributesLargeIcon.tsx +36 -0
  383. package/src/icons/32x32/CustomerLargeIcon.tsx +38 -0
  384. package/src/icons/32x32/DigitalLargeIcon.tsx +31 -0
  385. package/src/icons/32x32/DiscountLargeIcon.tsx +35 -0
  386. package/src/icons/32x32/FilteringLargeIcon.tsx +32 -0
  387. package/src/icons/32x32/GiftCardLargeIcon.tsx +44 -0
  388. package/src/icons/32x32/NavigationLargeIcon.tsx +39 -0
  389. package/src/icons/32x32/NotesLargeIcon.tsx +53 -0
  390. package/src/icons/32x32/OmnichannelLargeIcon.tsx +64 -0
  391. package/src/icons/32x32/PermissionLargeIcon.tsx +39 -0
  392. package/src/icons/32x32/ProductLargeIcon.tsx +31 -0
  393. package/src/icons/32x32/SearchLargeIcon.tsx +39 -0
  394. package/src/icons/32x32/ShippingLargeIcon.tsx +32 -0
  395. package/src/icons/32x32/SiteSettingsLargeIcon.tsx +32 -0
  396. package/src/icons/32x32/StaffMembersLargeIcon.tsx +40 -0
  397. package/src/icons/32x32/TaxesLargeIcon.tsx +55 -0
  398. package/src/icons/32x32/TokenLargeIcon.tsx +38 -0
  399. package/src/icons/32x32/WarehouseLargeIcon.tsx +32 -0
  400. package/src/icons/32x32/WifiLargeIcon.tsx +32 -0
  401. package/src/icons/32x32/index.ts +19 -0
  402. package/src/icons/index.ts +12 -67
  403. package/src/icons/indicator/index.ts +2 -0
  404. package/src/icons/indicator/regular/ErrorIndicatorIcon.tsx +24 -0
  405. package/src/icons/indicator/regular/FailIndicatorIcon.tsx +31 -0
  406. package/src/icons/indicator/regular/FailOutlineIndicatorIcon.tsx +31 -0
  407. package/src/icons/indicator/regular/HelpIndicatorIcon.tsx +30 -0
  408. package/src/icons/indicator/regular/SuccessIndicatorIcon.tsx +24 -0
  409. package/src/icons/indicator/regular/WarningIndicatorIcon.tsx +23 -0
  410. package/src/icons/indicator/regular/index.ts +6 -0
  411. package/src/icons/indicator/small/ErrorSmallIndicatorIcon.tsx +24 -0
  412. package/src/icons/indicator/small/SuccessSmallIndicatorIcon.tsx +24 -0
  413. package/src/icons/indicator/small/WarningSmallIndicatorIcon.tsx +23 -0
  414. package/src/icons/indicator/small/index.ts +3 -0
  415. package/src/icons/styles.ts +10 -0
  416. package/src/icons/types.ts +3 -0
  417. package/src/index.tsx +1 -0
  418. package/src/utils/Decorator.tsx +1 -0
  419. package/src/utils/mergeRefs.ts +4 -4
  420. package/src/icons/AddEnvironmentIcon.tsx +0 -12
  421. package/src/icons/AppsIcon.tsx +0 -12
  422. package/src/icons/ArrowRightIcon.tsx +0 -12
  423. package/src/icons/AttributesLargeIcon.tsx +0 -15
  424. package/src/icons/BackspaceIcon.tsx +0 -12
  425. package/src/icons/BillingIcon.tsx +0 -12
  426. package/src/icons/CalendarIcon.tsx +0 -12
  427. package/src/icons/ChevronIcon.tsx +0 -14
  428. package/src/icons/Close2Icon.tsx +0 -12
  429. package/src/icons/CloseIcon.tsx +0 -12
  430. package/src/icons/ColumnsIcon.tsx +0 -12
  431. package/src/icons/CopyIcon.tsx +0 -12
  432. package/src/icons/CustomersIcon.tsx +0 -12
  433. package/src/icons/DashboardIcon.tsx +0 -12
  434. package/src/icons/DeleteIcon.tsx +0 -12
  435. package/src/icons/DeveloperIcon.tsx +0 -38
  436. package/src/icons/DigitalLargeIcon.tsx +0 -15
  437. package/src/icons/DiscountsIcon.tsx +0 -20
  438. package/src/icons/DiscountsLargeIcon.tsx +0 -26
  439. package/src/icons/DownloadIcon.tsx +0 -12
  440. package/src/icons/DragIcon.tsx +0 -12
  441. package/src/icons/EditIcon.tsx +0 -12
  442. package/src/icons/EnvironmentIcon.tsx +0 -12
  443. package/src/icons/ExpandIcon.tsx +0 -22
  444. package/src/icons/EyeIcon.tsx +0 -12
  445. package/src/icons/FilteringIcon.tsx +0 -12
  446. package/src/icons/FilteringLargeIcon.tsx +0 -15
  447. package/src/icons/HelpIcon.tsx +0 -12
  448. package/src/icons/LinkIcon.tsx +0 -12
  449. package/src/icons/MailIcon.tsx +0 -16
  450. package/src/icons/MinusIcon.tsx +0 -12
  451. package/src/icons/MoreHorizontalIcon.tsx +0 -12
  452. package/src/icons/NavigationIcon.tsx +0 -26
  453. package/src/icons/NavigationLargeIcon.tsx +0 -15
  454. package/src/icons/NavigatorIcon.tsx +0 -14
  455. package/src/icons/NextIcon.tsx +0 -14
  456. package/src/icons/NoConnectionIcon.tsx +0 -25
  457. package/src/icons/NotesLargeIcon.tsx +0 -38
  458. package/src/icons/NotificationsIcon.tsx +0 -12
  459. package/src/icons/OmnichannelLargeIcon.tsx +0 -15
  460. package/src/icons/OrdersIcon.tsx +0 -12
  461. package/src/icons/PagesIcon.tsx +0 -12
  462. package/src/icons/PermissionLargeIcon.tsx +0 -15
  463. package/src/icons/PhotoIcon.tsx +0 -12
  464. package/src/icons/PlusIcon.tsx +0 -12
  465. package/src/icons/PreviousIcon.tsx +0 -14
  466. package/src/icons/PrinterIcon.tsx +0 -15
  467. package/src/icons/PrivacyIcon.tsx +0 -15
  468. package/src/icons/ProductIcon.tsx +0 -12
  469. package/src/icons/ProductLargeIcon.tsx +0 -16
  470. package/src/icons/RefreshIcon.tsx +0 -14
  471. package/src/icons/ReplyIcon.tsx +0 -12
  472. package/src/icons/SearchIcon.tsx +0 -12
  473. package/src/icons/SettingsIcon.tsx +0 -15
  474. package/src/icons/ShippingLargeIcon.tsx +0 -15
  475. package/src/icons/SnapshotsIcon.tsx +0 -12
  476. package/src/icons/TaxesLargeIcon.tsx +0 -15
  477. package/src/icons/TimeIcon.tsx +0 -12
  478. package/src/icons/TokenLargeIcon.tsx +0 -17
  479. package/src/icons/TransferIcon.tsx +0 -22
  480. package/src/icons/TranslationIcon.tsx +0 -12
  481. package/src/icons/WarehouseLargeIcon.tsx +0 -15
  482. package/src/icons/WebsiteIcon.tsx +0 -22
  483. package/src/icons/WifiIcon.tsx +0 -23
  484. package/src/icons/WifiLargeIcon.tsx +0 -33
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.2",
2
+ "version": "0.6.2",
3
3
  "license": "CC-BY-4.0",
4
4
  "main": "dist/cjs/index.js",
5
5
  "module": "dist/esm/index.js",
@@ -34,7 +34,7 @@
34
34
  "start": "concurrently -n w: npm:watch-* --prefix-colors=green,blue",
35
35
  "build": "npm run build-esb && npm run build-tsc",
36
36
  "test": "jest",
37
- "lint": "npx eslint \"src/**/*.@(tsx|ts|jsx|js)\" --fix ; npx prettier --check \"src/**/*.@(tsx|ts|jsx|js)\" --write",
37
+ "lint": "eslint \"src/**/*.@(tsx|ts|jsx|js)\" --fix ; prettier --check \"src/**/*.@(tsx|ts|jsx|js)\" --write",
38
38
  "prepare": "npm run build",
39
39
  "size": "size-limit",
40
40
  "analyze": "size-limit --why",
@@ -42,6 +42,13 @@
42
42
  "build-storybook": "build-storybook",
43
43
  "release": "np",
44
44
  "chromatic": "npx chromatic --exit-zero-on-changes --skip 'dependabot/**'",
45
+ "generate-icons:32": "svgr --no-dimensions --no-prettier --out-dir src/icons/32x32 -- src/assets/icons/32x32/",
46
+ "generate-icons:24": "svgr --no-dimensions --no-prettier --out-dir src/icons/24x24 -- src/assets/icons/24x24/",
47
+ "generate-icons:20": "svgr --no-dimensions --no-prettier --out-dir src/icons/20x20 -- src/assets/icons/20x20/",
48
+ "generate-icons:indicator": "svgr --no-dimensions --no-prettier --config-file .svgrrc-nomaterial.js --out-dir src/icons/indicator -- src/assets/icons/indicator/",
49
+ "generate-icons": "npm run optimise-icons && npm run generate-icons:32 && npm run generate-icons:24 && npm run generate-icons:20 && npm run generate-icons:indicator && npm run lint",
50
+ "optimise-icons": "svgo -r -f src/assets/icons",
51
+ "optimise-icons:remove-color": "svgo --config svgo-colors.config.js",
45
52
  "generate-icon": "hygen icon new",
46
53
  "build-icons": "node scripts/icons.js"
47
54
  },
@@ -50,7 +57,8 @@
50
57
  "@material-ui/icons": "^4.11.2",
51
58
  "@material-ui/lab": "^4.0.0-alpha.58",
52
59
  "react": "^16.8.0 || ^17.0.0",
53
- "react-helmet": "^6.1.0"
60
+ "react-helmet": "^6.1.0",
61
+ "react-dom": "^16.8.0 || ^17.0.0"
54
62
  },
55
63
  "np": {
56
64
  "yarn": false
@@ -72,7 +80,7 @@
72
80
  "size-limit": [
73
81
  {
74
82
  "path": "dist/cjs/index.js",
75
- "limit": "85 KB"
83
+ "limit": "100 KB"
76
84
  },
77
85
  {
78
86
  "path": "dist/esm/index.js",
@@ -86,11 +94,14 @@
86
94
  "@material-ui/icons": "^4.11.2",
87
95
  "@material-ui/lab": "^4.0.0-alpha.58",
88
96
  "@size-limit/preset-small-lib": "^4.10.2",
97
+ "@storybook/addon-controls": "^6.4.22",
89
98
  "@storybook/addon-essentials": "^6.4.22",
90
99
  "@storybook/addon-info": "^5.3.21",
91
100
  "@storybook/addon-links": "^6.4.22",
101
+ "@storybook/addon-storysource": "^6.4.22",
92
102
  "@storybook/addons": "^6.4.22",
93
103
  "@storybook/react": "^6.4.22",
104
+ "@svgr/cli": "^6.2.1",
94
105
  "@types/fuzzaldrin": "^2.1.4",
95
106
  "@types/jest": "^27.0.2",
96
107
  "@types/lodash": "^4.14.170",
@@ -109,23 +120,25 @@
109
120
  "eslint-plugin-simple-import-sort": "^5.0.3",
110
121
  "eslint-plugin-storybook": "^0.5.10",
111
122
  "faker": "^5.5.3",
112
- "husky": "^7.0.0",
113
123
  "fuzzaldrin": "^2.1.0",
124
+ "husky": "^7.0.0",
114
125
  "hygen": "^6.1.0",
115
126
  "jest": "^27.2.4",
116
127
  "jest-file": "^1.0.0",
117
128
  "np": "^7.5.0",
118
- "prettier": "^2.4.1",
119
- "react": "^16.8.0 || ^17.0.0",
120
- "react-dom": "^16.8.0 || ^17.0.0",
129
+ "react": "^17.0.0",
130
+ "react-dom": "^17.0.0",
131
+ "prettier": "^2.6.2",
121
132
  "react-is": "^17.0.2",
122
133
  "size-limit": "^4.10.2",
123
134
  "storybook-dark-mode": "^1.0.9",
135
+ "svgo": "^2.8.0",
124
136
  "tslib": "^2.3.1",
125
137
  "typescript": "^4.2.4",
126
138
  "yargs": "^17.2.1"
127
139
  },
128
140
  "dependencies": {
141
+ "@floating-ui/react-dom-interactions": "^0.5.0",
129
142
  "clsx": "^1.1.1",
130
143
  "downshift": "^6.1.7",
131
144
  "lodash": "^4.17.21",
@@ -11,6 +11,8 @@ export interface CircleIndicatorProps {
11
11
  color: CircleIndicatorColor;
12
12
  }
13
13
 
14
+ /**
15
+ * @deprecated use IndicatorCircle component instead */
14
16
  export const CircleIndicator: React.FC<CircleIndicatorProps> = ({ color }) => {
15
17
  const { themeType } = useTheme();
16
18
  const classes = useStyles();
@@ -11,50 +11,51 @@ export interface FilterContentProps {
11
11
  filter: FilterData;
12
12
  }
13
13
 
14
- export const MultipleValueAutocompleteFilterField: React.FC<FilterContentProps> =
15
- ({ filter }) => {
16
- const classes = useStyles();
17
- const { onChange } = useFilters();
14
+ export const MultipleValueAutocompleteFilterField: React.FC<
15
+ FilterContentProps
16
+ > = ({ filter }) => {
17
+ const classes = useStyles();
18
+ const { onChange } = useFilters();
18
19
 
19
- const { name, options } = filter;
20
+ const { name, options } = filter;
20
21
 
21
- if (options.choices === undefined) {
22
- throw new Error("FilterType.Autocomplete must be used with choices prop");
23
- }
24
- if (options.onInputChange === undefined) {
25
- throw new Error(
26
- "FilterType.Autocomplete must be used with onInputChange prop"
27
- );
28
- }
22
+ if (options.choices === undefined) {
23
+ throw new Error("FilterType.Autocomplete must be used with choices prop");
24
+ }
25
+ if (options.onInputChange === undefined) {
26
+ throw new Error(
27
+ "FilterType.Autocomplete must be used with onInputChange prop"
28
+ );
29
+ }
29
30
 
30
- const handleChoiceChange = (event: SyntheticChangeEvent<string[]>) =>
31
- onChange(name, event.target.value);
31
+ const handleChoiceChange = (event: SyntheticChangeEvent<string[]>) =>
32
+ onChange(name, event.target.value);
32
33
 
33
- return (
34
- <MultipleValueAutocomplete
35
- className={classes.filterValue}
36
- choices={options.choices!}
37
- InputProps={{
38
- classes: {
39
- root: classes.filterMultipleValueInputInner,
40
- },
41
- }}
42
- onChange={handleChoiceChange}
43
- onInputChange={options.onInputChange}
44
- value={filter.values}
45
- >
46
- {({ choices: filteredChoices, getItemProps, highlightedIndex }) =>
47
- filteredChoices.map((choice, choiceIndex) => (
48
- <MenuItem
49
- selected={highlightedIndex === choiceIndex}
50
- {...getItemProps({ item: choice, index: choiceIndex })}
51
- >
52
- {choice.label}
53
- </MenuItem>
54
- ))
55
- }
56
- </MultipleValueAutocomplete>
57
- );
58
- };
34
+ return (
35
+ <MultipleValueAutocomplete
36
+ className={classes.filterValue}
37
+ choices={options.choices!}
38
+ InputProps={{
39
+ classes: {
40
+ root: classes.filterMultipleValueInputInner,
41
+ },
42
+ }}
43
+ onChange={handleChoiceChange}
44
+ onInputChange={options.onInputChange}
45
+ value={filter.values}
46
+ >
47
+ {({ choices: filteredChoices, getItemProps, highlightedIndex }) =>
48
+ filteredChoices.map((choice, choiceIndex) => (
49
+ <MenuItem
50
+ selected={highlightedIndex === choiceIndex}
51
+ {...getItemProps({ item: choice, index: choiceIndex })}
52
+ >
53
+ {choice.label}
54
+ </MenuItem>
55
+ ))
56
+ }
57
+ </MultipleValueAutocomplete>
58
+ );
59
+ };
59
60
  MultipleValueAutocompleteFilterField.displayName =
60
61
  "MultipleValueAutocompleteFilterField";
@@ -0,0 +1,17 @@
1
+ import React from "react";
2
+
3
+ export interface CircleProps {
4
+ className?: string;
5
+ }
6
+
7
+ export const Circle = ({ className }: CircleProps) => {
8
+ return (
9
+ <path
10
+ fill-rule="evenodd"
11
+ clip-rule="evenodd"
12
+ d="M12 24C18.6274 24 24 18.6274 24 12C24 5.37258 18.6274 0 12 0C5.37258 0 0 5.37258 0 12C0 18.6274 5.37258 24 12 24ZM12 21C16.9706 21 21 16.9706 21 12C21 7.02944 16.9706 3 12 3C7.02944 3 3 7.02944 3 12C3 16.9706 7.02944 21 12 21Z"
13
+ fill="currentColor"
14
+ className={className}
15
+ />
16
+ );
17
+ };
@@ -0,0 +1,16 @@
1
+ import React from "react";
2
+
3
+ import { IndicatorProps } from "./Indicator";
4
+
5
+ interface CircleFilledProps {
6
+ size?: IndicatorProps["size"];
7
+ className: string;
8
+ }
9
+
10
+ export const CircleFilled = ({ className, size }: CircleFilledProps) => {
11
+ if (size === "small") {
12
+ return <circle cx={8} cy={8} r={8} className={className} />;
13
+ }
14
+
15
+ return <circle cx={12} cy={12} r={12} className={className} />;
16
+ };
@@ -0,0 +1,34 @@
1
+ import React from "react";
2
+
3
+ import { IndicatorProps } from "./Indicator";
4
+
5
+ interface CircleOutlineProps {
6
+ size: IndicatorProps["size"];
7
+ className: string;
8
+ }
9
+
10
+ export const CircleOutline = ({ className, size }: CircleOutlineProps) => {
11
+ if (size === "small") {
12
+ return (
13
+ <circle
14
+ cx={8}
15
+ cy={8}
16
+ r={7.25}
17
+ strokeWidth={1.5}
18
+ stroke="currentColor"
19
+ className={className}
20
+ />
21
+ );
22
+ }
23
+
24
+ return (
25
+ <circle
26
+ cx={12}
27
+ cy={12}
28
+ r={11.25}
29
+ strokeWidth={1.5}
30
+ stroke="currentColor"
31
+ className={className}
32
+ />
33
+ );
34
+ };
@@ -0,0 +1,49 @@
1
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import React from "react";
3
+
4
+ import { Indicator } from "./Indicator";
5
+
6
+ export default {
7
+ title: "Indicator / Regular",
8
+ component: Indicator,
9
+ } as ComponentMeta<typeof Indicator>;
10
+
11
+ const Template: ComponentStory<typeof Indicator> = (args) => {
12
+ console.log(args);
13
+ return <Indicator {...args} />;
14
+ };
15
+
16
+ export const Warning = Template.bind({});
17
+ Warning.args = {
18
+ icon: "warning",
19
+ };
20
+ export const WarningSmall = Template.bind({});
21
+ WarningSmall.args = {
22
+ icon: "warning",
23
+ size: "small",
24
+ };
25
+
26
+ export const Error = Template.bind({});
27
+ Error.args = {
28
+ icon: "error",
29
+ };
30
+ export const ErrorSmall = Template.bind({});
31
+ ErrorSmall.args = {
32
+ icon: "error",
33
+ size: "small",
34
+ };
35
+
36
+ export const Fail = Template.bind({});
37
+ Fail.args = {
38
+ icon: "fail",
39
+ };
40
+
41
+ export const Success = Template.bind({});
42
+ Success.args = {
43
+ icon: "success",
44
+ };
45
+ export const SuccessSmall = Template.bind({});
46
+ SuccessSmall.args = {
47
+ icon: "success",
48
+ size: "small",
49
+ };
@@ -0,0 +1,65 @@
1
+ import clsx from "clsx";
2
+ import React from "react";
3
+
4
+ import {
5
+ ErrorIndicatorIcon,
6
+ ErrorSmallIndicatorIcon,
7
+ FailIndicatorIcon,
8
+ SuccessIndicatorIcon,
9
+ SuccessSmallIndicatorIcon,
10
+ WarningIndicatorIcon,
11
+ WarningSmallIndicatorIcon,
12
+ } from "../icons/indicator";
13
+ import { CircleFilled } from "./CircleFilled";
14
+ import { getSizeDimension, useStyles } from "./styles";
15
+
16
+ export type IndicatorIcon = "warning" | "error" | "success" | "fail";
17
+
18
+ export type IndicatorSize = "regular" | "small";
19
+
20
+ export type IndicatorCombinations = `${IndicatorIcon}-${IndicatorSize}`;
21
+
22
+ export interface IndicatorProps {
23
+ icon: IndicatorIcon;
24
+ variant?: "outline" | "filled" | "text" | "icon";
25
+ size?: IndicatorSize;
26
+ className?: string;
27
+ }
28
+
29
+ export const mapVariantToIcon: Record<
30
+ IndicatorCombinations,
31
+ React.FunctionComponent<{ className?: string }>
32
+ > = {
33
+ "warning-regular": WarningIndicatorIcon,
34
+ "warning-small": WarningSmallIndicatorIcon,
35
+ "fail-regular": FailIndicatorIcon,
36
+ "fail-small": FailIndicatorIcon,
37
+ "error-regular": ErrorIndicatorIcon,
38
+ "error-small": ErrorSmallIndicatorIcon,
39
+ "success-regular": SuccessIndicatorIcon,
40
+ "success-small": SuccessSmallIndicatorIcon,
41
+ };
42
+
43
+ export const Indicator = React.forwardRef<HTMLSpanElement, IndicatorProps>(
44
+ ({ icon, size = "regular", className }, ref) => {
45
+ const classes = useStyles({ icon, size });
46
+
47
+ const Icon = mapVariantToIcon[`${icon}-${size}` as IndicatorCombinations];
48
+
49
+ const viewBoxSize = getSizeDimension(size);
50
+
51
+ return (
52
+ <span className={clsx(classes.wrapper, className)} ref={ref}>
53
+ <svg
54
+ viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
55
+ fill="none"
56
+ xmlns="http://www.w3.org/2000/svg"
57
+ className={classes.absolute}
58
+ >
59
+ <CircleFilled size={size} className={classes.circlePath} />
60
+ </svg>
61
+ <Icon className={classes.absolute} />
62
+ </span>
63
+ );
64
+ }
65
+ );
@@ -0,0 +1,28 @@
1
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import React from "react";
3
+
4
+ import { IndicatorCircle } from "./IndicatorCircle";
5
+
6
+ export default {
7
+ title: "Indicator / Circle",
8
+ component: IndicatorCircle,
9
+ } as ComponentMeta<typeof IndicatorCircle>;
10
+
11
+ const Template: ComponentStory<typeof IndicatorCircle> = (args) => (
12
+ <IndicatorCircle {...args} />
13
+ );
14
+
15
+ export const Warning = Template.bind({});
16
+ Warning.args = {
17
+ icon: "warning",
18
+ };
19
+
20
+ export const Error = Template.bind({});
21
+ Error.args = {
22
+ icon: "error",
23
+ };
24
+
25
+ export const Success = Template.bind({});
26
+ Success.args = {
27
+ icon: "success",
28
+ };
@@ -0,0 +1,45 @@
1
+ import clsx from "clsx";
2
+ import React from "react";
3
+
4
+ import { Circle } from "./Circle";
5
+ import { IndicatorIcon } from "./Indicator";
6
+ import { getSizeDimension, useStyles } from "./styles";
7
+
8
+ export interface IndicatorCircleProps {
9
+ icon: IndicatorIcon;
10
+ className?: string;
11
+ }
12
+
13
+ export const IndicatorCircle = ({ icon, className }: IndicatorCircleProps) => {
14
+ const classes = useStyles({ size: "regular", icon });
15
+
16
+ const viewBoxSize = getSizeDimension("regular");
17
+
18
+ return (
19
+ <span className={clsx(classes.wrapper, classes.wrapperCircle, className)}>
20
+ <svg
21
+ viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
22
+ fill="none"
23
+ xmlns="http://www.w3.org/2000/svg"
24
+ className={classes.absolute}
25
+ >
26
+ <Circle className={classes.circlePath} />
27
+ </svg>
28
+ {icon === "success" && (
29
+ <svg
30
+ viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
31
+ fill="none"
32
+ className={classes.absolute}
33
+ >
34
+ <path
35
+ d="M8 12.8571L10.1053 15L16 9"
36
+ stroke="currentColor"
37
+ stroke-width="1.5"
38
+ stroke-linecap="round"
39
+ stroke-linejoin="round"
40
+ />
41
+ </svg>
42
+ )}
43
+ </span>
44
+ );
45
+ };
@@ -0,0 +1,86 @@
1
+ import { ComponentMeta, ComponentStory } from "@storybook/react";
2
+ import React from "react";
3
+
4
+ import { IndicatorOutlined } from "./IndicatorOutlined";
5
+
6
+ export default {
7
+ title: "Indicator / Outlined",
8
+ component: IndicatorOutlined,
9
+ } as ComponentMeta<typeof IndicatorOutlined>;
10
+
11
+ const Template: ComponentStory<typeof IndicatorOutlined> = (args) => (
12
+ <IndicatorOutlined {...args} />
13
+ );
14
+
15
+ export const Warning = Template.bind({});
16
+ Warning.args = {
17
+ icon: "warning",
18
+ };
19
+ export const WarningSmall = Template.bind({});
20
+ WarningSmall.args = {
21
+ icon: "warning",
22
+ size: "small",
23
+ };
24
+ export const WarningText = Template.bind({});
25
+ WarningText.args = {
26
+ icon: "warning",
27
+ color: "text",
28
+ };
29
+ export const WarningSmallText = Template.bind({});
30
+ WarningSmallText.args = {
31
+ icon: "warning",
32
+ color: "text",
33
+ size: "small",
34
+ };
35
+
36
+ export const Error = Template.bind({});
37
+ Error.args = {
38
+ icon: "error",
39
+ };
40
+ export const ErrorSmall = Template.bind({});
41
+ ErrorSmall.args = {
42
+ icon: "error",
43
+ size: "small",
44
+ };
45
+ export const ErrorText = Template.bind({});
46
+ ErrorText.args = {
47
+ icon: "error",
48
+ color: "text",
49
+ };
50
+ export const ErrorSmallText = Template.bind({});
51
+ ErrorSmallText.args = {
52
+ icon: "error",
53
+ color: "text",
54
+ size: "small",
55
+ };
56
+
57
+ export const Fail = Template.bind({});
58
+ Fail.args = {
59
+ icon: "fail",
60
+ };
61
+ export const FailText = Template.bind({});
62
+ FailText.args = {
63
+ icon: "fail",
64
+ color: "text",
65
+ };
66
+
67
+ export const Success = Template.bind({});
68
+ Success.args = {
69
+ icon: "success",
70
+ };
71
+ export const SuccessSmall = Template.bind({});
72
+ SuccessSmall.args = {
73
+ icon: "success",
74
+ size: "small",
75
+ };
76
+ export const SuccessText = Template.bind({});
77
+ SuccessText.args = {
78
+ icon: "success",
79
+ color: "text",
80
+ };
81
+ export const SuccessSmallText = Template.bind({});
82
+ SuccessSmallText.args = {
83
+ icon: "success",
84
+ color: "text",
85
+ size: "small",
86
+ };
@@ -0,0 +1,63 @@
1
+ import clsx from "clsx";
2
+ import React from "react";
3
+
4
+ import { FailOutlineIndicatorIcon } from "../icons/indicator";
5
+ import { CircleOutline } from "./CircleOutline";
6
+ import {
7
+ IndicatorCombinations,
8
+ IndicatorIcon,
9
+ IndicatorSize,
10
+ mapVariantToIcon,
11
+ } from "./Indicator";
12
+ import { getSizeDimension, useStyles } from "./styles";
13
+
14
+ export interface IndicatorOutlinedProps {
15
+ icon: IndicatorIcon;
16
+ size?: IndicatorSize;
17
+ color?: "default" | "text";
18
+ className?: string;
19
+ }
20
+
21
+ const getIconComponent = (icon: IndicatorIcon, size: IndicatorSize) => {
22
+ if (icon === "fail") {
23
+ return FailOutlineIndicatorIcon;
24
+ }
25
+ return mapVariantToIcon[`${icon}-${size}` as IndicatorCombinations];
26
+ };
27
+
28
+ export const IndicatorOutlined = ({
29
+ icon,
30
+ size = "regular",
31
+ color = "default",
32
+ className,
33
+ }: IndicatorOutlinedProps) => {
34
+ const classes = useStyles({ icon, size });
35
+
36
+ const Icon = getIconComponent(icon, size);
37
+ const viewBoxSize = getSizeDimension(size);
38
+
39
+ const hasColor = color === "default";
40
+
41
+ return (
42
+ <span
43
+ className={clsx(
44
+ classes.wrapper,
45
+ hasColor && classes.wrapperOutline,
46
+ className
47
+ )}
48
+ >
49
+ <svg
50
+ viewBox={`0 0 ${viewBoxSize} ${viewBoxSize}`}
51
+ fill="none"
52
+ xmlns="http://www.w3.org/2000/svg"
53
+ className={classes.absolute}
54
+ >
55
+ <CircleOutline
56
+ size={size}
57
+ className={clsx(classes.absolute, hasColor && classes.circleOutline)}
58
+ />
59
+ </svg>
60
+ <Icon />
61
+ </span>
62
+ );
63
+ };
@@ -0,0 +1,3 @@
1
+ export * from "./Indicator";
2
+ export * from "./IndicatorCircle";
3
+ export * from "./IndicatorOutlined";
@@ -0,0 +1,61 @@
1
+ import { makeStyles, SaleorTheme } from "../theme";
2
+ import { IndicatorProps, IndicatorSize } from "./Indicator";
3
+
4
+ export const getIconColor =
5
+ (theme: SaleorTheme, type: "mid" | "dark") =>
6
+ (props: Pick<IndicatorProps, "icon">) => {
7
+ switch (props.icon) {
8
+ case "warning":
9
+ return theme.palette.saleor.warning[type];
10
+ case "success":
11
+ return theme.palette.saleor.success[type];
12
+ case "fail":
13
+ case "error":
14
+ return theme.palette.saleor.fail[type];
15
+ default:
16
+ return "inherit";
17
+ }
18
+ };
19
+
20
+ export const getSizeDimension = (size: IndicatorSize) =>
21
+ size === "regular" ? 24 : 16;
22
+
23
+ export const useStyles = makeStyles<
24
+ Required<Pick<IndicatorProps, "icon" | "size">>,
25
+ | "wrapper"
26
+ | "wrapperCircle"
27
+ | "wrapperOutline"
28
+ | "absolute"
29
+ | "circlePath"
30
+ | "circleOutline"
31
+ >(
32
+ (theme) => ({
33
+ wrapper: {
34
+ position: "relative",
35
+ display: "inline-block",
36
+ width: (props) => `${getSizeDimension(props.size)}px`,
37
+ height: (props) => `${getSizeDimension(props.size)}px`,
38
+ color: theme.palette.saleor.main[1],
39
+ },
40
+ wrapperCircle: {
41
+ color: getIconColor(theme, "mid"),
42
+ },
43
+ wrapperOutline: {
44
+ color: getIconColor(theme, "dark"),
45
+ },
46
+ absolute: {
47
+ position: "absolute",
48
+ top: 0,
49
+ bottom: 0,
50
+ left: 0,
51
+ right: 0,
52
+ },
53
+ circlePath: {
54
+ fill: getIconColor(theme, "mid"),
55
+ },
56
+ circleOutline: {
57
+ stroke: getIconColor(theme, "dark"),
58
+ },
59
+ }),
60
+ { name: "Indicator" }
61
+ );