@woovi/ui 4.0.942

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 (737) hide show
  1. package/.eslintrc.js +1 -0
  2. package/README.md +1 -0
  3. package/babel.config.js +3 -0
  4. package/babel.rollup.config.js +20 -0
  5. package/jest-eslint.config.js +7 -0
  6. package/jest.config.js +17 -0
  7. package/lib/index.cjs.js +1 -0
  8. package/package.json +107 -0
  9. package/rollup.config.js +96 -0
  10. package/src/BackButton.tsx +25 -0
  11. package/src/Badge.tsx +17 -0
  12. package/src/Banner.stories.tsx +108 -0
  13. package/src/Banner.tsx +44 -0
  14. package/src/CashbackTagStatus.tsx +31 -0
  15. package/src/Circle.tsx +10 -0
  16. package/src/CircleButton.tsx +51 -0
  17. package/src/ClockIcon.tsx +41 -0
  18. package/src/Column.tsx +6 -0
  19. package/src/CopyInput.tsx +40 -0
  20. package/src/EmptyMessage.stories.tsx +19 -0
  21. package/src/EmptyMessage.tsx +23 -0
  22. package/src/EncryptedText.tsx +23 -0
  23. package/src/FloatingMenu.tsx +88 -0
  24. package/src/LayoutRoot.tsx +14 -0
  25. package/src/LinearProgress.tsx +79 -0
  26. package/src/Link.tsx +9 -0
  27. package/src/Loading.stories.tsx +29 -0
  28. package/src/Loading.tsx +44 -0
  29. package/src/Logo.tsx +8 -0
  30. package/src/LoremIpsum.tsx +4 -0
  31. package/src/Modal/Modal.stories.tsx +38 -0
  32. package/src/Modal/Modal.tsx +93 -0
  33. package/src/OverflowDiv.tsx +25 -0
  34. package/src/ProgressBar.tsx +58 -0
  35. package/src/ProgressBarText.tsx +34 -0
  36. package/src/QuestionTooltip.tsx +40 -0
  37. package/src/RadioCard/RadioCard.tsx +101 -0
  38. package/src/RadioCard/__stories__/RadioCard.stories.tsx +235 -0
  39. package/src/Row.tsx +8 -0
  40. package/src/SafeTextTooltip.tsx +35 -0
  41. package/src/SearchField.tsx +71 -0
  42. package/src/Step.tsx +32 -0
  43. package/src/TagWebhookStatus.tsx +20 -0
  44. package/src/ToggleButtonGroup.stories.tsx +65 -0
  45. package/src/ToggleButtonGroup.tsx +114 -0
  46. package/src/ToggleButtonGroupMobile.tsx +56 -0
  47. package/src/TransactionTagEntryTypes.tsx +18 -0
  48. package/src/TransactionTagStatus.tsx +27 -0
  49. package/src/UnsupportedBrowserWarning.tsx +76 -0
  50. package/src/__visual__/CopyInput.spec.tsx +12 -0
  51. package/src/__visual__/__image_snapshots__/copy-input-spec-tsx-match-image-snapshot-copy-input-1-snap.png +0 -0
  52. package/src/auth/LoginWrapper.tsx +21 -0
  53. package/src/avatar/Avatar.tsx +66 -0
  54. package/src/avatar/AvatarGroup.tsx +103 -0
  55. package/src/avatar/AvatarGroupArray.tsx +67 -0
  56. package/src/avatar/AvatarGroupSelectedAll.tsx +76 -0
  57. package/src/avatar/stories/Avatar.stories.tsx +24 -0
  58. package/src/buttons/ActionButton.tsx +111 -0
  59. package/src/buttons/DangerButton.tsx +35 -0
  60. package/src/buttons/PayWithPixButton.tsx +75 -0
  61. package/src/buttons/SplitButton.tsx +112 -0
  62. package/src/buttons/__stories__/PayWithPixButton.stories.tsx +19 -0
  63. package/src/buttons/__visual__/ActionButton.spec.tsx +12 -0
  64. package/src/buttons/__visual__/PayWithPixButton.spec.tsx +12 -0
  65. package/src/buttons/__visual__/__image_snapshots__/action-button-spec-tsx-match-image-snapshot-action-button-1-snap.png +0 -0
  66. package/src/buttons/__visual__/__image_snapshots__/pay-with-pix-button-spec-tsx-match-image-snapshot-pay-with-pix-button-1-snap.png +0 -0
  67. package/src/buttons/getLoadingIconProp.tsx +7 -0
  68. package/src/buttons/stories/ActionButton.stories.tsx +196 -0
  69. package/src/buttons/stories/SplitButton.stories.tsx +28 -0
  70. package/src/card/Card.tsx +91 -0
  71. package/src/card/CardActions.tsx +13 -0
  72. package/src/card/CardContent.tsx +26 -0
  73. package/src/card/CardForm.tsx +80 -0
  74. package/src/card/CardList.tsx +67 -0
  75. package/src/card/CardRadio.tsx +0 -0
  76. package/src/card/CardSkeleton.tsx +25 -0
  77. package/src/card/CardWithLink.tsx +49 -0
  78. package/src/card/CardWithLinkSkeleton.tsx +14 -0
  79. package/src/card/basicContext/CardBasicContext.tsx +190 -0
  80. package/src/card/cardWithActions/CardFooter.tsx +13 -0
  81. package/src/card/cardWithActions/CardHeader.tsx +15 -0
  82. package/src/card/cardWithActions/CardWithActions.stories.tsx +53 -0
  83. package/src/card/cardWithActions/CardWithActions.tsx +161 -0
  84. package/src/card/stories/Card.stories.tsx +91 -0
  85. package/src/card/stories/CardContent.stories.tsx +28 -0
  86. package/src/card/stories/CardForm.stories.tsx +49 -0
  87. package/src/card/stories/CardWithLink.stories.tsx +64 -0
  88. package/src/cardAnalytics/CardAnalytics.stories.tsx +83 -0
  89. package/src/cardAnalytics/CardAnalytics.tsx +78 -0
  90. package/src/cardAnalytics/CardAnalyticsSkeleton.tsx +26 -0
  91. package/src/cardGrid/CardField.tsx +44 -0
  92. package/src/cardGrid/CardFieldCentered.tsx +28 -0
  93. package/src/cardGrid/CardGrid.stories.tsx +102 -0
  94. package/src/cardGrid/CardGrid.tsx +38 -0
  95. package/src/cardGrid/Grid.tsx +27 -0
  96. package/src/cardWithImage/CardWithImage.tsx +66 -0
  97. package/src/cardWithImage/__stories__/CardWithImage.stories.tsx +25 -0
  98. package/src/cardWithImage/__stories__/__assets__/WooviCashback.png +0 -0
  99. package/src/code/Code.stories.tsx +25 -0
  100. package/src/code/Code.tsx +20 -0
  101. package/src/collapsible/Collapse.tsx +73 -0
  102. package/src/collapsible/Collapsible.tsx +214 -0
  103. package/src/collapsible/CollapsibleActions.tsx +162 -0
  104. package/src/collapsible/CollapsibleDetails.tsx +37 -0
  105. package/src/collapsible/CollapsibleFillWrapper.tsx +6 -0
  106. package/src/collapsible/CollapsibleGroup.tsx +6 -0
  107. package/src/collapsible/CollapsibleInfinityActions.tsx +238 -0
  108. package/src/collapsible/CollapsiblePanelActions.tsx +57 -0
  109. package/src/collapsible/CollapsibleStep.tsx +118 -0
  110. package/src/collapsible/CollapsibleStepHeader.tsx +90 -0
  111. package/src/collapsible/CollapsibleSummary.tsx +54 -0
  112. package/src/collapsible/CollapsibleTree.tsx +236 -0
  113. package/src/collapsible/ExpandMoreIcon.tsx +12 -0
  114. package/src/collapsible/LeafCollapsible.tsx +17 -0
  115. package/src/collapsible/TransparencyCollapsibleWrapper.tsx +28 -0
  116. package/src/collapsible/stories/CollapisbleStep.stories.tsx +121 -0
  117. package/src/collapsible/stories/Collapse.stories.tsx +50 -0
  118. package/src/collapsible/stories/Collapsible.stories.tsx +121 -0
  119. package/src/collapsible/stories/CollapsibleGroup.stories.tsx +110 -0
  120. package/src/collapsible/stories/CollapsibleOld.stories.tsx +582 -0
  121. package/src/collapsible/stories/CollapsibleStepHeader.stories.tsx +37 -0
  122. package/src/company/CompanyLogo.tsx +38 -0
  123. package/src/company/stories/CompanyLogo.stories.tsx +18 -0
  124. package/src/content/ActionMargin.stories.tsx +21 -0
  125. package/src/content/ActionMargin.tsx +40 -0
  126. package/src/content/ActionMarginText.tsx +8 -0
  127. package/src/content/Content.tsx +18 -0
  128. package/src/content/IntroText.tsx +23 -0
  129. package/src/countdown/Countdown.stories.tsx +32 -0
  130. package/src/countdown/Countdown.tsx +41 -0
  131. package/src/countdown/ShowCounter.tsx +36 -0
  132. package/src/countdown/useCountdown.tsx +34 -0
  133. package/src/datagrid/DataGrid.stories.tsx +146 -0
  134. package/src/datagrid/DataGrid.tsx +263 -0
  135. package/src/datagrid/DataGridDetailContainer.tsx +23 -0
  136. package/src/datagrid/DataGridRow.tsx +30 -0
  137. package/src/datagrid/__tests__/DataGrid.spec.tsx +33 -0
  138. package/src/datagrid/cellTypeBasisToPercentage.tsx +18 -0
  139. package/src/datagrid/cellTypeBoolean.tsx +21 -0
  140. package/src/datagrid/cellTypeCurrency.ts +18 -0
  141. package/src/datagrid/cellTypeDate.ts +8 -0
  142. package/src/datagrid/cellTypeDatetime.ts +8 -0
  143. package/src/datagrid/cellTypeDatetimeSeconds.ts +8 -0
  144. package/src/datagrid/cellTypeExpand.tsx +77 -0
  145. package/src/datagrid/cellTypeLink.tsx +22 -0
  146. package/src/datagrid/cellTypePhone.tsx +22 -0
  147. package/src/datagrid/cellTypeTag.tsx +28 -0
  148. package/src/datagrid/cellTypeTaxID.tsx +12 -0
  149. package/src/datagrid/cellTypeTime.ts +8 -0
  150. package/src/datagrid/columnTypes.ts +21 -0
  151. package/src/datagrid/useTableView.tsx +26 -0
  152. package/src/deprecated/VirtualizedMobileList.tsx +71 -0
  153. package/src/deprecated/VirtualizedTable.tsx +165 -0
  154. package/src/deprecated/VirtualizedTableHeader.tsx +103 -0
  155. package/src/device/Phone.stories.tsx +34 -0
  156. package/src/device/Phone.tsx +62 -0
  157. package/src/dialog/DialogContext.tsx +22 -0
  158. package/src/dialog/DialogProvider.tsx +141 -0
  159. package/src/dialog/__tests__/useDialog.spec.tsx +73 -0
  160. package/src/dialog/index.tsx +6 -0
  161. package/src/dialog/useDialog.tsx +14 -0
  162. package/src/drawer/DrawerCard.tsx +70 -0
  163. package/src/drawer/DrawerResponsiveWrapper.tsx +12 -0
  164. package/src/drawer/swipable/SwipeableDrawer.stories.tsx +35 -0
  165. package/src/drawer/swipable/SwipeableDrawer.tsx +40 -0
  166. package/src/error/ErrorBoundaryWithRetry.tsx +50 -0
  167. package/src/error/ErrorView.tsx +61 -0
  168. package/src/file/FileDrop.tsx +73 -0
  169. package/src/file/IconButton.tsx +57 -0
  170. package/src/file/MaterialIcon.tsx +35 -0
  171. package/src/filter/Filter.tsx +108 -0
  172. package/src/filter/FilterRelayFormik.tsx +53 -0
  173. package/src/filter/FormikFilter.tsx +39 -0
  174. package/src/filter/__tests__/FieldDecoding.spec.tsx +68 -0
  175. package/src/filter/__tests__/FieldEncoding.spec.tsx +68 -0
  176. package/src/filter/__tests__/Filter.spec.tsx +35 -0
  177. package/src/filter/__tests__/FilterRelayFormik.spec.tsx +43 -0
  178. package/src/filter/decodeQueryParamsFromLocation.tsx +19 -0
  179. package/src/filter/fieldToParamConfigMap.tsx +31 -0
  180. package/src/filter/formatFilterValue.tsx +36 -0
  181. package/src/filter/formatFilters.tsx +27 -0
  182. package/src/filter/isValidDatetime.tsx +4 -0
  183. package/src/filter/orderBy/OrderBySelect.tsx +81 -0
  184. package/src/filter/stringToBoolean.ts +15 -0
  185. package/src/filter/useFilterFormik.tsx +372 -0
  186. package/src/form/FieldRow.tsx +28 -0
  187. package/src/form/__stories__/FieldRow.stories.tsx +27 -0
  188. package/src/heading/SectionHeading.tsx +18 -0
  189. package/src/heading/__stories__/SectionHeading.stories.tsx +23 -0
  190. package/src/helpers/Divider.tsx +27 -0
  191. package/src/helpers/HorizontalStack.tsx +12 -0
  192. package/src/helpers/HoverPopper.tsx +57 -0
  193. package/src/helpers/stories/HorizontalStack.stories.tsx +82 -0
  194. package/src/helpers.ts +133 -0
  195. package/src/icons/AssineOnlineIcon.tsx +123 -0
  196. package/src/icons/BotConversaIcon.tsx +39 -0
  197. package/src/icons/CheckIconLabel.tsx +34 -0
  198. package/src/icons/CheckboxChecked.tsx +34 -0
  199. package/src/icons/CheckboxIndeterminate.tsx +27 -0
  200. package/src/icons/CheckboxUnchecked.tsx +36 -0
  201. package/src/icons/Icon.tsx +8 -0
  202. package/src/icons/N8nIcon.tsx +40 -0
  203. package/src/icons/NuvemshopIcon.tsx +25 -0
  204. package/src/icons/RightTopDiagonalVector.tsx +22 -0
  205. package/src/icons/SVG.tsx +9 -0
  206. package/src/icons/SocPanelIcon.tsx +48 -0
  207. package/src/icons/WabizIcon.tsx +42 -0
  208. package/src/icons/WakeIcon.tsx +45 -0
  209. package/src/import/Dropzone.tsx +13 -0
  210. package/src/import/DropzoneFile.tsx +278 -0
  211. package/src/import/xlsx/Import.tsx +161 -0
  212. package/src/import/xlsx/ImportDropzone.tsx +120 -0
  213. package/src/import/xlsx/ImportProcessData.tsx +92 -0
  214. package/src/import/xlsx/ImportProcessQueue.tsx +176 -0
  215. package/src/import/xlsx/ImportStepper.tsx +247 -0
  216. package/src/import/xlsx/ImportTable.tsx +72 -0
  217. package/src/import/xlsx/ImportUtils.tsx +726 -0
  218. package/src/index.tsx +328 -0
  219. package/src/layoutWrapper/LayoutWrapper.tsx +48 -0
  220. package/src/layoutWrapper/LayoutWrapperFluid.tsx +38 -0
  221. package/src/logo/OpenPixLogoColor.tsx +137 -0
  222. package/src/logo/WooviLogo.tsx +46 -0
  223. package/src/mui/BoxFlex.tsx +27 -0
  224. package/src/mui/Typography.tsx +8 -0
  225. package/src/mui/__stories__/Typography.stories.tsx +14 -0
  226. package/src/mui/__stories__/TypographyExample.tsx +29 -0
  227. package/src/multifactor/MultiFactorConfirmModal.tsx +67 -0
  228. package/src/multifactor/__stories__/MultiFactorConfirmModal.stories.tsx +30 -0
  229. package/src/openpix/charge/ChargeTagStatus.tsx +21 -0
  230. package/src/openpix/images/GiftbackEnvelopeSvg.tsx +152 -0
  231. package/src/openpix/images/WooviLogoInMobile.tsx +35 -0
  232. package/src/openpix/order/CheckIcon.tsx +20 -0
  233. package/src/openpix/order/ConfirmedIcon.tsx +189 -0
  234. package/src/openpix/order/EarnCashback.tsx +39 -0
  235. package/src/openpix/order/EarnCashbackExclusive.tsx +42 -0
  236. package/src/openpix/order/GiftbackRedeem.tsx +38 -0
  237. package/src/openpix/order/PayPixValueCompany.tsx +85 -0
  238. package/src/openpix/order/PixPaymentWoovi.tsx +82 -0
  239. package/src/openpix/order/RedeemCashbackExclusiveScheduled.tsx +52 -0
  240. package/src/openpix/order/ShopperSeeMyGiftback.tsx +51 -0
  241. package/src/openpix/order/__generated__/RedeemCashbackExclusiveScheduled_charge.graphql.ts +55 -0
  242. package/src/openpix/order/discount/EarnDiscount.tsx +34 -0
  243. package/src/openpix/order/giftback/EarnGiftback.tsx +53 -0
  244. package/src/openpix/order/giftback/GiftbackRule.tsx +32 -0
  245. package/src/openpix/paymentLink/AdditionalInfo.tsx +60 -0
  246. package/src/openpix/paymentLink/BrCodeInput.tsx +48 -0
  247. package/src/openpix/paymentLink/ChargeInfo.tsx +76 -0
  248. package/src/openpix/paymentLink/CopyQRCode.stories.tsx +21 -0
  249. package/src/openpix/paymentLink/CopyQRCode.tsx +75 -0
  250. package/src/openpix/paymentLink/ErrorIcon.tsx +18 -0
  251. package/src/openpix/paymentLink/InfoSide.tsx +174 -0
  252. package/src/openpix/paymentLink/InterestsInfo.tsx +60 -0
  253. package/src/openpix/paymentLink/NotFound.tsx +16 -0
  254. package/src/openpix/paymentLink/PaymentDeleted.tsx +172 -0
  255. package/src/openpix/paymentLink/PaymentExpired.tsx +170 -0
  256. package/src/openpix/paymentLink/PaymentFooter.tsx +13 -0
  257. package/src/openpix/paymentLink/PaymentLink.stories.tsx +57 -0
  258. package/src/openpix/paymentLink/PaymentLink.tsx +97 -0
  259. package/src/openpix/paymentLink/PaymentLinkActive.tsx +36 -0
  260. package/src/openpix/paymentLink/PaymentLinkTestAccountBanner.tsx +47 -0
  261. package/src/openpix/paymentLink/PaymentLinkWrapper.tsx +60 -0
  262. package/src/openpix/paymentLink/PaymentLogo.tsx +56 -0
  263. package/src/openpix/paymentLink/QrCodeResponsive.tsx +77 -0
  264. package/src/openpix/paymentLink/QrCodeSectionHeaderInfo.tsx +45 -0
  265. package/src/openpix/paymentLink/QrCodeShowButton.tsx +44 -0
  266. package/src/openpix/paymentLink/QrCodeSide.tsx +200 -0
  267. package/src/openpix/paymentLink/ShareButton.tsx +133 -0
  268. package/src/openpix/paymentLink/__generated__/PaymentLinkActive_charge.graphql.ts +40 -0
  269. package/src/openpix/paymentLink/__generated__/PaymentLink_charge.graphql.ts +45 -0
  270. package/src/openpix/paymentLink/__generated__/QrCodeSide_charge.graphql.ts +40 -0
  271. package/src/openpix/paymentLink/types/ChargeDataType.tsx +119 -0
  272. package/src/openpix/paymentSuccess/PaymentSuccess.tsx +213 -0
  273. package/src/openpix/paymentSuccess/PaymentSuccessRewards.tsx +229 -0
  274. package/src/openpix/paymentSuccess/__generated__/PaymentSuccessRewards_charge.graphql.ts +195 -0
  275. package/src/openpix/paymentSuccess/__generated__/PaymentSuccess_charge.graphql.ts +40 -0
  276. package/src/openpix/shopper/WooviAuthForm.tsx +225 -0
  277. package/src/openpix/transaction/PixTransactionTypeTag.tsx +22 -0
  278. package/src/paymentLinkRow/PaymentLinkRow.tsx +37 -0
  279. package/src/paymentLinkRow/__stories__/PaymentLinkRow.stories.tsx +40 -0
  280. package/src/pinInput/PinInput.stories.tsx +48 -0
  281. package/src/pinInput/PinInput.tsx +246 -0
  282. package/src/pinInput/PinInputFormik.tsx +18 -0
  283. package/src/pinInput/createPinArray.ts +17 -0
  284. package/src/pinInput/pinInputRegex.ts +4 -0
  285. package/src/relay/RefreshButtonRelay.tsx +45 -0
  286. package/src/relay/RefreshIconButton.tsx +15 -0
  287. package/src/relay/SearchInputRelay.tsx +101 -0
  288. package/src/relay/TopPagination.tsx +68 -0
  289. package/src/rewardTicket/RewardTicket.tsx +68 -0
  290. package/src/rewardTicket/__stories__/RewardTicket.stories.tsx +40 -0
  291. package/src/ribbon/Ribbon.tsx +31 -0
  292. package/src/ribbon/__stories__/Ribbon.stories.tsx +34 -0
  293. package/src/ribbon/__visual__/Ribbon.spec.tsx +23 -0
  294. package/src/ribbon/__visual__/__image_snapshots__/ribbon-spec-tsx-match-image-snapshot-ribbon-1-snap.png +0 -0
  295. package/src/root/ContentBoundary.tsx +45 -0
  296. package/src/routed/RoutedTabs.tsx +166 -0
  297. package/src/routed/TabbedContent.tsx +41 -0
  298. package/src/routed/__tests__/RoutedTabs.spec.tsx +50 -0
  299. package/src/screenHeader/ScreenHeader.stories.tsx +106 -0
  300. package/src/screenHeader/ScreenHeaderUI.tsx +149 -0
  301. package/src/screenHeader/components/ScreenHeaderSubtitle.tsx +10 -0
  302. package/src/screenHeader/components/ScreenHeaderTitle.tsx +32 -0
  303. package/src/screenHeaderCard/ScreenHeaderCard.stories.tsx +49 -0
  304. package/src/screenHeaderCard/ScreenHeaderCard.tsx +93 -0
  305. package/src/search/GlobalSearchField.tsx +148 -0
  306. package/src/select/Select.tsx +22 -0
  307. package/src/select/SelectAll.tsx +64 -0
  308. package/src/select/__stories__/Select.stories.tsx +40 -0
  309. package/src/sidebar/Group.tsx +135 -0
  310. package/src/sidebar/Item.tsx +52 -0
  311. package/src/sidebar/MenuList.tsx +95 -0
  312. package/src/sidebar/Sidebar.stories.tsx +148 -0
  313. package/src/sidebar/Sidebar.tsx +58 -0
  314. package/src/sidebar/SidebarContext.tsx +32 -0
  315. package/src/sidebar/index.tsx +7 -0
  316. package/src/sidebar/useSidebar.tsx +28 -0
  317. package/src/sidebar/utils.ts +6 -0
  318. package/src/snackbar/Snackbar.tsx +117 -0
  319. package/src/snackbar/SnackbarContext.tsx +22 -0
  320. package/src/snackbar/__tests__/Snackbar.spec.tsx +19 -0
  321. package/src/snackbar/fixtures/ShowSnackbar.tsx +38 -0
  322. package/src/snackbar/index.tsx +6 -0
  323. package/src/snackbar/useSnackbar.tsx +16 -0
  324. package/src/statement/TransactionTypeText.tsx +7 -0
  325. package/src/statement/statementColors.ts +6 -0
  326. package/src/stepper/Stepper.stories.tsx +25 -0
  327. package/src/stepper/Stepper.tsx +74 -0
  328. package/src/swipeableModal/SwipeableModal.stories.tsx +47 -0
  329. package/src/swipeableModal/SwipeableModal.tsx +68 -0
  330. package/src/swipeableModal/SwipeableModalTransition.tsx +33 -0
  331. package/src/table/CardColumn.tsx +34 -0
  332. package/src/table/CardListVirtualized.tsx +217 -0
  333. package/src/table/TableToggleViewModel.tsx +49 -0
  334. package/src/table/cells/ActionCellNode.tsx +80 -0
  335. package/src/table/cells/Cell.tsx +26 -0
  336. package/src/table/cells/CheckboxCellNode.tsx +47 -0
  337. package/src/table/cells/IconCellNode.tsx +53 -0
  338. package/src/table/cells/LinkCellNode.tsx +76 -0
  339. package/src/table/cells/RenderCell.tsx +17 -0
  340. package/src/table/cells/__tests__/LinkCellNode.spec.tsx +40 -0
  341. package/src/table/cells/cellTypes.ts +16 -0
  342. package/src/table/cells/getCellCurrency.tsx +17 -0
  343. package/src/table/cells/getCellDate.tsx +29 -0
  344. package/src/table/cells/getCellLink.tsx +20 -0
  345. package/src/table/cells/getCellValue.tsx +79 -0
  346. package/src/table/cells/index.ts +1 -0
  347. package/src/table/stories/TableToggleViewModel.stories.tsx +10 -0
  348. package/src/tag/Tag.tsx +62 -0
  349. package/src/tag/TagsContainer.tsx +19 -0
  350. package/src/tag/stories/Tag.stories.tsx +148 -0
  351. package/src/term/Terms.tsx +8 -0
  352. package/src/term/TermsLink.tsx +7 -0
  353. package/src/term/TermsModal.stories.tsx +19 -0
  354. package/src/term/TermsModal.tsx +40 -0
  355. package/src/term/useTerms.tsx +57 -0
  356. package/src/text/TextMultiline.tsx +24 -0
  357. package/src/textDialog/TextDialog.tsx +86 -0
  358. package/src/theme/Themes.tsx +223 -0
  359. package/src/theme/stories/Theme.stories.tsx +13 -0
  360. package/src/theme/stories/ThemeExample.tsx +193 -0
  361. package/src/timeline/Timeline.tsx +23 -0
  362. package/src/timeline/TimelineAppEventDomainIcon.tsx +21 -0
  363. package/src/timeline/TimelineAppEventItem.tsx +70 -0
  364. package/src/timeline/TimelineAppEventTypeColor.tsx +33 -0
  365. package/src/timeline/TimelineItem.tsx +57 -0
  366. package/src/timeline/__stories__/Timeline.stories.tsx +39 -0
  367. package/src/timeline/__stories__/TimelineAppEvent.stories.tsx +43 -0
  368. package/src/unSupportedBrowser/UnsupportedBrowserWarning.tsx +78 -0
  369. package/src/unSupportedBrowser/index.tsx +2 -0
  370. package/src/unSupportedBrowser/isUnSupportedBrowser.tsx +15 -0
  371. package/src/user/chip/UserChip.tsx +25 -0
  372. package/src/user/chip/stories/UserChip.stories.tsx +26 -0
  373. package/src/utils/BrowserOnly.tsx +21 -0
  374. package/src/utils/DesktopOnly.tsx +27 -0
  375. package/src/utils/MobileOnly.tsx +27 -0
  376. package/src/windowPopper/WindowPopper.stories.tsx +52 -0
  377. package/src/windowPopper/WindowPopper.tsx +109 -0
  378. package/src/windowPopper/WindowPopperTransition.tsx +22 -0
  379. package/test/ImageReporter.js +41 -0
  380. package/test/babel-transformer.js +7 -0
  381. package/test/convertHtmlToImage.tsx +25 -0
  382. package/test/jest.setup.js +31 -0
  383. package/test/testUtils.tsx +37 -0
  384. package/tsconfig.build.json +25 -0
  385. package/tsconfig.json +4 -0
  386. package/types/form/test/i18n.d.ts +1 -0
  387. package/types/ui/src/BackButton.d.ts +5 -0
  388. package/types/ui/src/Badge.d.ts +2 -0
  389. package/types/ui/src/Banner.d.ts +10 -0
  390. package/types/ui/src/Banner.stories.d.ts +6 -0
  391. package/types/ui/src/CashbackTagStatus.d.ts +5 -0
  392. package/types/ui/src/Circle.d.ts +5 -0
  393. package/types/ui/src/CircleButton.d.ts +8 -0
  394. package/types/ui/src/ClockIcon.d.ts +5 -0
  395. package/types/ui/src/Column.d.ts +2 -0
  396. package/types/ui/src/CopyInput.d.ts +5 -0
  397. package/types/ui/src/EmptyMessage.d.ts +6 -0
  398. package/types/ui/src/EmptyMessage.stories.d.ts +3 -0
  399. package/types/ui/src/EncryptedText.d.ts +2 -0
  400. package/types/ui/src/FloatingMenu.d.ts +13 -0
  401. package/types/ui/src/LayoutRoot.d.ts +1 -0
  402. package/types/ui/src/LinearProgress.d.ts +7 -0
  403. package/types/ui/src/Link.d.ts +3 -0
  404. package/types/ui/src/Loading.d.ts +8 -0
  405. package/types/ui/src/Loading.stories.d.ts +5 -0
  406. package/types/ui/src/Logo.d.ts +1 -0
  407. package/types/ui/src/LoremIpsum.d.ts +2 -0
  408. package/types/ui/src/Modal/Modal.d.ts +19 -0
  409. package/types/ui/src/Modal/Modal.stories.d.ts +6 -0
  410. package/types/ui/src/OverflowDiv.d.ts +2 -0
  411. package/types/ui/src/ProgressBar.d.ts +9 -0
  412. package/types/ui/src/ProgressBarText.d.ts +6 -0
  413. package/types/ui/src/QuestionTooltip.d.ts +11 -0
  414. package/types/ui/src/RadioCard/RadioCard.d.ts +11 -0
  415. package/types/ui/src/RadioCard/__stories__/RadioCard.stories.d.ts +8 -0
  416. package/types/ui/src/Row.d.ts +2 -0
  417. package/types/ui/src/SafeTextTooltip.d.ts +8 -0
  418. package/types/ui/src/SearchField.d.ts +13 -0
  419. package/types/ui/src/Step.d.ts +9 -0
  420. package/types/ui/src/TagWebhookStatus.d.ts +7 -0
  421. package/types/ui/src/ToggleButtonGroup.d.ts +23 -0
  422. package/types/ui/src/ToggleButtonGroup.stories.d.ts +7 -0
  423. package/types/ui/src/ToggleButtonGroupMobile.d.ts +7 -0
  424. package/types/ui/src/TransactionTagEntryTypes.d.ts +4 -0
  425. package/types/ui/src/TransactionTagStatus.d.ts +8 -0
  426. package/types/ui/src/UnsupportedBrowserWarning.d.ts +2 -0
  427. package/types/ui/src/auth/LoginWrapper.d.ts +8 -0
  428. package/types/ui/src/avatar/Avatar.d.ts +11 -0
  429. package/types/ui/src/avatar/AvatarGroup.d.ts +12 -0
  430. package/types/ui/src/avatar/AvatarGroupArray.d.ts +7 -0
  431. package/types/ui/src/avatar/AvatarGroupSelectedAll.d.ts +8 -0
  432. package/types/ui/src/avatar/stories/Avatar.stories.d.ts +6 -0
  433. package/types/ui/src/buttons/ActionButton.d.ts +13 -0
  434. package/types/ui/src/buttons/DangerButton.d.ts +2 -0
  435. package/types/ui/src/buttons/PayWithPixButton.d.ts +12 -0
  436. package/types/ui/src/buttons/SplitButton.d.ts +18 -0
  437. package/types/ui/src/buttons/__stories__/PayWithPixButton.stories.d.ts +5 -0
  438. package/types/ui/src/buttons/getLoadingIconProp.d.ts +3 -0
  439. package/types/ui/src/buttons/stories/ActionButton.stories.d.ts +12 -0
  440. package/types/ui/src/buttons/stories/SplitButton.stories.d.ts +3 -0
  441. package/types/ui/src/card/Card.d.ts +16 -0
  442. package/types/ui/src/card/CardActions.d.ts +3 -0
  443. package/types/ui/src/card/CardContent.d.ts +6 -0
  444. package/types/ui/src/card/CardForm.d.ts +9 -0
  445. package/types/ui/src/card/CardList.d.ts +13 -0
  446. package/types/ui/src/card/CardRadio.d.ts +0 -0
  447. package/types/ui/src/card/CardSkeleton.d.ts +2 -0
  448. package/types/ui/src/card/CardWithLink.d.ts +8 -0
  449. package/types/ui/src/card/CardWithLinkSkeleton.d.ts +2 -0
  450. package/types/ui/src/card/basicContext/CardBasicContext.d.ts +35 -0
  451. package/types/ui/src/card/cardWithActions/CardFooter.d.ts +3 -0
  452. package/types/ui/src/card/cardWithActions/CardHeader.d.ts +6 -0
  453. package/types/ui/src/card/cardWithActions/CardWithActions.d.ts +27 -0
  454. package/types/ui/src/card/cardWithActions/CardWithActions.stories.d.ts +6 -0
  455. package/types/ui/src/card/stories/Card.stories.d.ts +9 -0
  456. package/types/ui/src/card/stories/CardContent.stories.d.ts +4 -0
  457. package/types/ui/src/card/stories/CardForm.stories.d.ts +5 -0
  458. package/types/ui/src/card/stories/CardWithLink.stories.d.ts +5 -0
  459. package/types/ui/src/cardAnalytics/CardAnalytics.d.ts +11 -0
  460. package/types/ui/src/cardAnalytics/CardAnalytics.stories.d.ts +5 -0
  461. package/types/ui/src/cardAnalytics/CardAnalyticsSkeleton.d.ts +2 -0
  462. package/types/ui/src/cardGrid/CardField.d.ts +9 -0
  463. package/types/ui/src/cardGrid/CardFieldCentered.d.ts +8 -0
  464. package/types/ui/src/cardGrid/CardGrid.d.ts +12 -0
  465. package/types/ui/src/cardGrid/CardGrid.stories.d.ts +8 -0
  466. package/types/ui/src/cardGrid/Grid.d.ts +12 -0
  467. package/types/ui/src/cardWithImage/CardWithImage.d.ts +9 -0
  468. package/types/ui/src/cardWithImage/__stories__/CardWithImage.stories.d.ts +4 -0
  469. package/types/ui/src/code/Code.d.ts +7 -0
  470. package/types/ui/src/code/Code.stories.d.ts +3 -0
  471. package/types/ui/src/collapsible/Collapse.d.ts +7 -0
  472. package/types/ui/src/collapsible/Collapsible.d.ts +59 -0
  473. package/types/ui/src/collapsible/CollapsibleActions.d.ts +6 -0
  474. package/types/ui/src/collapsible/CollapsibleDetails.d.ts +7 -0
  475. package/types/ui/src/collapsible/CollapsibleFillWrapper.d.ts +1 -0
  476. package/types/ui/src/collapsible/CollapsibleGroup.d.ts +2 -0
  477. package/types/ui/src/collapsible/CollapsibleInfinityActions.d.ts +57 -0
  478. package/types/ui/src/collapsible/CollapsiblePanelActions.d.ts +3 -0
  479. package/types/ui/src/collapsible/CollapsibleStep.d.ts +15 -0
  480. package/types/ui/src/collapsible/CollapsibleStepHeader.d.ts +11 -0
  481. package/types/ui/src/collapsible/CollapsibleSummary.d.ts +9 -0
  482. package/types/ui/src/collapsible/CollapsibleTree.d.ts +12 -0
  483. package/types/ui/src/collapsible/ExpandMoreIcon.d.ts +7 -0
  484. package/types/ui/src/collapsible/LeafCollapsible.d.ts +5 -0
  485. package/types/ui/src/collapsible/TransparencyCollapsibleWrapper.d.ts +2 -0
  486. package/types/ui/src/collapsible/stories/CollapisbleStep.stories.d.ts +8 -0
  487. package/types/ui/src/collapsible/stories/Collapse.stories.d.ts +4 -0
  488. package/types/ui/src/collapsible/stories/Collapsible.stories.d.ts +13 -0
  489. package/types/ui/src/collapsible/stories/CollapsibleGroup.stories.d.ts +4 -0
  490. package/types/ui/src/collapsible/stories/CollapsibleOld.stories.d.ts +50 -0
  491. package/types/ui/src/collapsible/stories/CollapsibleStepHeader.stories.d.ts +5 -0
  492. package/types/ui/src/company/CompanyLogo.d.ts +15 -0
  493. package/types/ui/src/company/stories/CompanyLogo.stories.d.ts +5 -0
  494. package/types/ui/src/content/ActionMargin.d.ts +7 -0
  495. package/types/ui/src/content/ActionMargin.stories.d.ts +3 -0
  496. package/types/ui/src/content/ActionMarginText.d.ts +2 -0
  497. package/types/ui/src/content/Content.d.ts +6 -0
  498. package/types/ui/src/content/IntroText.d.ts +6 -0
  499. package/types/ui/src/countdown/Countdown.d.ts +5 -0
  500. package/types/ui/src/countdown/Countdown.stories.d.ts +5 -0
  501. package/types/ui/src/countdown/ShowCounter.d.ts +8 -0
  502. package/types/ui/src/countdown/useCountdown.d.ts +2 -0
  503. package/types/ui/src/datagrid/DataGrid.d.ts +14 -0
  504. package/types/ui/src/datagrid/DataGrid.stories.d.ts +3 -0
  505. package/types/ui/src/datagrid/DataGridDetailContainer.d.ts +6 -0
  506. package/types/ui/src/datagrid/DataGridRow.d.ts +10 -0
  507. package/types/ui/src/datagrid/cellTypeBasisToPercentage.d.ts +2 -0
  508. package/types/ui/src/datagrid/cellTypeBoolean.d.ts +6 -0
  509. package/types/ui/src/datagrid/cellTypeCurrency.d.ts +2 -0
  510. package/types/ui/src/datagrid/cellTypeDate.d.ts +2 -0
  511. package/types/ui/src/datagrid/cellTypeDatetime.d.ts +2 -0
  512. package/types/ui/src/datagrid/cellTypeDatetimeSeconds.d.ts +2 -0
  513. package/types/ui/src/datagrid/cellTypeExpand.d.ts +45 -0
  514. package/types/ui/src/datagrid/cellTypeLink.d.ts +2 -0
  515. package/types/ui/src/datagrid/cellTypePhone.d.ts +2 -0
  516. package/types/ui/src/datagrid/cellTypeTag.d.ts +2 -0
  517. package/types/ui/src/datagrid/cellTypeTaxID.d.ts +2 -0
  518. package/types/ui/src/datagrid/cellTypeTime.d.ts +2 -0
  519. package/types/ui/src/datagrid/columnTypes.d.ts +11 -0
  520. package/types/ui/src/datagrid/useTableView.d.ts +8 -0
  521. package/types/ui/src/deprecated/VirtualizedMobileList.d.ts +8 -0
  522. package/types/ui/src/deprecated/VirtualizedTable.d.ts +3 -0
  523. package/types/ui/src/deprecated/VirtualizedTableHeader.d.ts +8 -0
  524. package/types/ui/src/device/Phone.d.ts +6 -0
  525. package/types/ui/src/device/Phone.stories.d.ts +4 -0
  526. package/types/ui/src/dialog/DialogContext.d.ts +18 -0
  527. package/types/ui/src/dialog/DialogProvider.d.ts +7 -0
  528. package/types/ui/src/dialog/index.d.ts +5 -0
  529. package/types/ui/src/dialog/useDialog.d.ts +5 -0
  530. package/types/ui/src/drawer/DrawerCard.d.ts +11 -0
  531. package/types/ui/src/drawer/DrawerResponsiveWrapper.d.ts +1 -0
  532. package/types/ui/src/drawer/swipable/SwipeableDrawer.d.ts +8 -0
  533. package/types/ui/src/drawer/swipable/SwipeableDrawer.stories.d.ts +3 -0
  534. package/types/ui/src/error/ErrorBoundaryWithRetry.d.ts +26 -0
  535. package/types/ui/src/error/ErrorView.d.ts +9 -0
  536. package/types/ui/src/file/FileDrop.d.ts +12 -0
  537. package/types/ui/src/file/MaterialIcon.d.ts +14 -0
  538. package/types/ui/src/filter/Filter.d.ts +15 -0
  539. package/types/ui/src/filter/FilterRelayFormik.d.ts +26 -0
  540. package/types/ui/src/filter/FormikFilter.d.ts +9 -0
  541. package/types/ui/src/filter/decodeQueryParamsFromLocation.d.ts +2 -0
  542. package/types/ui/src/filter/fieldToParamConfigMap.d.ts +2 -0
  543. package/types/ui/src/filter/formatFilterValue.d.ts +1 -0
  544. package/types/ui/src/filter/formatFilters.d.ts +1 -0
  545. package/types/ui/src/filter/isValidDatetime.d.ts +1 -0
  546. package/types/ui/src/filter/orderBy/OrderBySelect.d.ts +15 -0
  547. package/types/ui/src/filter/stringToBoolean.d.ts +1 -0
  548. package/types/ui/src/filter/useFilterFormik.d.ts +91 -0
  549. package/types/ui/src/form/FieldRow.d.ts +6 -0
  550. package/types/ui/src/form/__stories__/FieldRow.stories.d.ts +3 -0
  551. package/types/ui/src/heading/SectionHeading.d.ts +6 -0
  552. package/types/ui/src/heading/__stories__/SectionHeading.stories.d.ts +4 -0
  553. package/types/ui/src/helpers/Divider.d.ts +8 -0
  554. package/types/ui/src/helpers/HorizontalStack.d.ts +3 -0
  555. package/types/ui/src/helpers/HoverPopper.d.ts +10 -0
  556. package/types/ui/src/helpers/stories/HorizontalStack.stories.d.ts +5 -0
  557. package/types/ui/src/helpers.d.ts +10 -0
  558. package/types/ui/src/icons/AssineOnlineIcon.d.ts +14 -0
  559. package/types/ui/src/icons/BotConversaIcon.d.ts +14 -0
  560. package/types/ui/src/icons/CheckIconLabel.d.ts +5 -0
  561. package/types/ui/src/icons/CheckboxChecked.d.ts +7 -0
  562. package/types/ui/src/icons/CheckboxIndeterminate.d.ts +14 -0
  563. package/types/ui/src/icons/CheckboxUnchecked.d.ts +14 -0
  564. package/types/ui/src/icons/Icon.d.ts +3 -0
  565. package/types/ui/src/icons/N8nIcon.d.ts +13 -0
  566. package/types/ui/src/icons/NuvemshopIcon.d.ts +14 -0
  567. package/types/ui/src/icons/RightTopDiagonalVector.d.ts +4 -0
  568. package/types/ui/src/icons/SVG.d.ts +32 -0
  569. package/types/ui/src/icons/SocPanelIcon.d.ts +12 -0
  570. package/types/ui/src/icons/WabizIcon.d.ts +13 -0
  571. package/types/ui/src/icons/WakeIcon.d.ts +14 -0
  572. package/types/ui/src/import/Dropzone.d.ts +2 -0
  573. package/types/ui/src/import/DropzoneFile.d.ts +19 -0
  574. package/types/ui/src/import/xlsx/Import.d.ts +19 -0
  575. package/types/ui/src/import/xlsx/ImportDropzone.d.ts +15 -0
  576. package/types/ui/src/import/xlsx/ImportProcessData.d.ts +7 -0
  577. package/types/ui/src/import/xlsx/ImportProcessQueue.d.ts +20 -0
  578. package/types/ui/src/import/xlsx/ImportStepper.d.ts +23 -0
  579. package/types/ui/src/import/xlsx/ImportTable.d.ts +7 -0
  580. package/types/ui/src/import/xlsx/ImportUtils.d.ts +89 -0
  581. package/types/ui/src/index.d.ts +212 -0
  582. package/types/ui/src/layoutWrapper/LayoutWrapper.d.ts +8 -0
  583. package/types/ui/src/layoutWrapper/LayoutWrapperFluid.d.ts +8 -0
  584. package/types/ui/src/logo/OpenPixLogoColor.d.ts +7 -0
  585. package/types/ui/src/logo/WooviLogo.d.ts +7 -0
  586. package/types/ui/src/mui/BoxFlex.d.ts +10 -0
  587. package/types/ui/src/mui/Typography.d.ts +3 -0
  588. package/types/ui/src/mui/__stories__/Typography.stories.d.ts +3 -0
  589. package/types/ui/src/mui/__stories__/TypographyExample.d.ts +2 -0
  590. package/types/ui/src/multifactor/MultiFactorConfirmModal.d.ts +11 -0
  591. package/types/ui/src/multifactor/__stories__/MultiFactorConfirmModal.stories.d.ts +5 -0
  592. package/types/ui/src/openpix/charge/ChargeTagStatus.d.ts +11 -0
  593. package/types/ui/src/openpix/images/GiftbackEnvelopeSvg.d.ts +6 -0
  594. package/types/ui/src/openpix/images/WooviLogoInMobile.d.ts +4 -0
  595. package/types/ui/src/openpix/order/CheckIcon.d.ts +2 -0
  596. package/types/ui/src/openpix/order/ConfirmedIcon.d.ts +2 -0
  597. package/types/ui/src/openpix/order/EarnCashback.d.ts +6 -0
  598. package/types/ui/src/openpix/order/EarnCashbackExclusive.d.ts +6 -0
  599. package/types/ui/src/openpix/order/GiftbackRedeem.d.ts +5 -0
  600. package/types/ui/src/openpix/order/PayPixValueCompany.d.ts +7 -0
  601. package/types/ui/src/openpix/order/PixPaymentWoovi.d.ts +6 -0
  602. package/types/ui/src/openpix/order/RedeemCashbackExclusiveScheduled.d.ts +6 -0
  603. package/types/ui/src/openpix/order/ShopperSeeMyGiftback.d.ts +8 -0
  604. package/types/ui/src/openpix/order/__generated__/RedeemCashbackExclusiveScheduled_charge.graphql.d.ts +19 -0
  605. package/types/ui/src/openpix/order/discount/EarnDiscount.d.ts +6 -0
  606. package/types/ui/src/openpix/order/giftback/EarnGiftback.d.ts +6 -0
  607. package/types/ui/src/openpix/order/giftback/GiftbackRule.d.ts +6 -0
  608. package/types/ui/src/openpix/paymentLink/AdditionalInfo.d.ts +12 -0
  609. package/types/ui/src/openpix/paymentLink/BrCodeInput.d.ts +5 -0
  610. package/types/ui/src/openpix/paymentLink/ChargeInfo.d.ts +7 -0
  611. package/types/ui/src/openpix/paymentLink/CopyQRCode.d.ts +6 -0
  612. package/types/ui/src/openpix/paymentLink/CopyQRCode.stories.d.ts +3 -0
  613. package/types/ui/src/openpix/paymentLink/ErrorIcon.d.ts +2 -0
  614. package/types/ui/src/openpix/paymentLink/InfoSide.d.ts +7 -0
  615. package/types/ui/src/openpix/paymentLink/InterestsInfo.d.ts +11 -0
  616. package/types/ui/src/openpix/paymentLink/NotFound.d.ts +2 -0
  617. package/types/ui/src/openpix/paymentLink/PaymentDeleted.d.ts +30 -0
  618. package/types/ui/src/openpix/paymentLink/PaymentExpired.d.ts +35 -0
  619. package/types/ui/src/openpix/paymentLink/PaymentFooter.d.ts +5 -0
  620. package/types/ui/src/openpix/paymentLink/PaymentLink.d.ts +15 -0
  621. package/types/ui/src/openpix/paymentLink/PaymentLink.stories.d.ts +4 -0
  622. package/types/ui/src/openpix/paymentLink/PaymentLinkActive.d.ts +8 -0
  623. package/types/ui/src/openpix/paymentLink/PaymentLinkTestAccountBanner.d.ts +6 -0
  624. package/types/ui/src/openpix/paymentLink/PaymentLinkWrapper.d.ts +8 -0
  625. package/types/ui/src/openpix/paymentLink/PaymentLogo.d.ts +7 -0
  626. package/types/ui/src/openpix/paymentLink/QrCodeResponsive.d.ts +12 -0
  627. package/types/ui/src/openpix/paymentLink/QrCodeSectionHeaderInfo.d.ts +2 -0
  628. package/types/ui/src/openpix/paymentLink/QrCodeShowButton.d.ts +6 -0
  629. package/types/ui/src/openpix/paymentLink/QrCodeSide.d.ts +10 -0
  630. package/types/ui/src/openpix/paymentLink/ShareButton.d.ts +9 -0
  631. package/types/ui/src/openpix/paymentLink/__generated__/PaymentLinkActive_charge.graphql.d.ts +17 -0
  632. package/types/ui/src/openpix/paymentLink/__generated__/PaymentLink_charge.graphql.d.ts +17 -0
  633. package/types/ui/src/openpix/paymentLink/__generated__/QrCodeSide_charge.graphql.d.ts +17 -0
  634. package/types/ui/src/openpix/paymentLink/types/ChargeDataType.d.ts +106 -0
  635. package/types/ui/src/openpix/paymentSuccess/PaymentSuccess.d.ts +17 -0
  636. package/types/ui/src/openpix/paymentSuccess/PaymentSuccessRewards.d.ts +8 -0
  637. package/types/ui/src/openpix/paymentSuccess/__generated__/PaymentSuccessRewards_charge.graphql.d.ts +55 -0
  638. package/types/ui/src/openpix/paymentSuccess/__generated__/PaymentSuccess_charge.graphql.d.ts +17 -0
  639. package/types/ui/src/openpix/shopper/WooviAuthForm.d.ts +21 -0
  640. package/types/ui/src/openpix/transaction/PixTransactionTypeTag.d.ts +6 -0
  641. package/types/ui/src/paymentLinkRow/PaymentLinkRow.d.ts +9 -0
  642. package/types/ui/src/paymentLinkRow/__stories__/PaymentLinkRow.stories.d.ts +7 -0
  643. package/types/ui/src/pinInput/PinInput.d.ts +62 -0
  644. package/types/ui/src/pinInput/PinInput.stories.d.ts +6 -0
  645. package/types/ui/src/pinInput/PinInputFormik.d.ts +6 -0
  646. package/types/ui/src/pinInput/createPinArray.d.ts +1 -0
  647. package/types/ui/src/pinInput/pinInputRegex.d.ts +4 -0
  648. package/types/ui/src/relay/RefreshButtonRelay.d.ts +8 -0
  649. package/types/ui/src/relay/RefreshIconButton.d.ts +5 -0
  650. package/types/ui/src/relay/SearchInputRelay.d.ts +17 -0
  651. package/types/ui/src/relay/TopPagination.d.ts +9 -0
  652. package/types/ui/src/rewardTicket/RewardTicket.d.ts +8 -0
  653. package/types/ui/src/rewardTicket/__stories__/RewardTicket.stories.d.ts +5 -0
  654. package/types/ui/src/ribbon/Ribbon.d.ts +7 -0
  655. package/types/ui/src/ribbon/__stories__/Ribbon.stories.d.ts +4 -0
  656. package/types/ui/src/root/ContentBoundary.d.ts +4 -0
  657. package/types/ui/src/routed/RoutedTabs.d.ts +19 -0
  658. package/types/ui/src/routed/TabbedContent.d.ts +8 -0
  659. package/types/ui/src/screenHeader/ScreenHeader.stories.d.ts +9 -0
  660. package/types/ui/src/screenHeader/ScreenHeaderUI.d.ts +14 -0
  661. package/types/ui/src/screenHeader/components/ScreenHeaderSubtitle.d.ts +2 -0
  662. package/types/ui/src/screenHeader/components/ScreenHeaderTitle.d.ts +6 -0
  663. package/types/ui/src/screenHeaderCard/ScreenHeaderCard.d.ts +12 -0
  664. package/types/ui/src/screenHeaderCard/ScreenHeaderCard.stories.d.ts +5 -0
  665. package/types/ui/src/search/GlobalSearchField.d.ts +12 -0
  666. package/types/ui/src/select/Select.d.ts +7 -0
  667. package/types/ui/src/select/SelectAll.d.ts +13 -0
  668. package/types/ui/src/select/__stories__/Select.stories.d.ts +7 -0
  669. package/types/ui/src/sidebar/Group.d.ts +7 -0
  670. package/types/ui/src/sidebar/Item.d.ts +7 -0
  671. package/types/ui/src/sidebar/MenuList.d.ts +13 -0
  672. package/types/ui/src/sidebar/Sidebar.d.ts +14 -0
  673. package/types/ui/src/sidebar/Sidebar.stories.d.ts +5 -0
  674. package/types/ui/src/sidebar/SidebarContext.d.ts +9 -0
  675. package/types/ui/src/sidebar/index.d.ts +6 -0
  676. package/types/ui/src/sidebar/useSidebar.d.ts +7 -0
  677. package/types/ui/src/sidebar/utils.d.ts +2 -0
  678. package/types/ui/src/snackbar/Snackbar.d.ts +6 -0
  679. package/types/ui/src/snackbar/SnackbarContext.d.ts +15 -0
  680. package/types/ui/src/snackbar/fixtures/ShowSnackbar.d.ts +2 -0
  681. package/types/ui/src/snackbar/index.d.ts +5 -0
  682. package/types/ui/src/snackbar/useSnackbar.d.ts +6 -0
  683. package/types/ui/src/statement/TransactionTypeText.d.ts +2 -0
  684. package/types/ui/src/statement/statementColors.d.ts +3 -0
  685. package/types/ui/src/stepper/Stepper.d.ts +9 -0
  686. package/types/ui/src/stepper/Stepper.stories.d.ts +3 -0
  687. package/types/ui/src/swipeableModal/SwipeableModal.d.ts +12 -0
  688. package/types/ui/src/swipeableModal/SwipeableModal.stories.d.ts +3 -0
  689. package/types/ui/src/swipeableModal/SwipeableModalTransition.d.ts +7 -0
  690. package/types/ui/src/table/CardColumn.d.ts +9 -0
  691. package/types/ui/src/table/CardListVirtualized.d.ts +20 -0
  692. package/types/ui/src/table/TableToggleViewModel.d.ts +6 -0
  693. package/types/ui/src/table/cells/ActionCellNode.d.ts +5 -0
  694. package/types/ui/src/table/cells/Cell.d.ts +9 -0
  695. package/types/ui/src/table/cells/CheckboxCellNode.d.ts +15 -0
  696. package/types/ui/src/table/cells/IconCellNode.d.ts +5 -0
  697. package/types/ui/src/table/cells/LinkCellNode.d.ts +7 -0
  698. package/types/ui/src/table/cells/cellTypes.d.ts +15 -0
  699. package/types/ui/src/table/cells/getCellCurrency.d.ts +3 -0
  700. package/types/ui/src/table/cells/getCellDate.d.ts +8 -0
  701. package/types/ui/src/table/cells/getCellLink.d.ts +3 -0
  702. package/types/ui/src/table/cells/getCellValue.d.ts +1 -0
  703. package/types/ui/src/table/cells/index.d.ts +1 -0
  704. package/types/ui/src/table/stories/TableToggleViewModel.stories.d.ts +3 -0
  705. package/types/ui/src/tag/Tag.d.ts +9 -0
  706. package/types/ui/src/tag/TagsContainer.d.ts +6 -0
  707. package/types/ui/src/tag/stories/Tag.stories.d.ts +10 -0
  708. package/types/ui/src/term/Terms.d.ts +1 -0
  709. package/types/ui/src/term/TermsLink.d.ts +1 -0
  710. package/types/ui/src/term/TermsModal.d.ts +12 -0
  711. package/types/ui/src/term/TermsModal.stories.d.ts +3 -0
  712. package/types/ui/src/term/useTerms.d.ts +5 -0
  713. package/types/ui/src/text/TextMultiline.d.ts +6 -0
  714. package/types/ui/src/textDialog/TextDialog.d.ts +8 -0
  715. package/types/ui/src/theme/Themes.d.ts +22 -0
  716. package/types/ui/src/theme/stories/Theme.stories.d.ts +3 -0
  717. package/types/ui/src/theme/stories/ThemeExample.d.ts +2 -0
  718. package/types/ui/src/timeline/Timeline.d.ts +6 -0
  719. package/types/ui/src/timeline/TimelineAppEventDomainIcon.d.ts +3 -0
  720. package/types/ui/src/timeline/TimelineAppEventItem.d.ts +9 -0
  721. package/types/ui/src/timeline/TimelineAppEventTypeColor.d.ts +3 -0
  722. package/types/ui/src/timeline/TimelineItem.d.ts +11 -0
  723. package/types/ui/src/timeline/__stories__/Timeline.stories.d.ts +3 -0
  724. package/types/ui/src/timeline/__stories__/TimelineAppEvent.stories.d.ts +3 -0
  725. package/types/ui/src/unSupportedBrowser/UnsupportedBrowserWarning.d.ts +2 -0
  726. package/types/ui/src/unSupportedBrowser/index.d.ts +2 -0
  727. package/types/ui/src/unSupportedBrowser/isUnSupportedBrowser.d.ts +4 -0
  728. package/types/ui/src/user/chip/UserChip.d.ts +6 -0
  729. package/types/ui/src/user/chip/stories/UserChip.stories.d.ts +4 -0
  730. package/types/ui/src/utils/BrowserOnly.d.ts +7 -0
  731. package/types/ui/src/utils/DesktopOnly.d.ts +8 -0
  732. package/types/ui/src/utils/MobileOnly.d.ts +8 -0
  733. package/types/ui/src/windowPopper/WindowPopper.d.ts +16 -0
  734. package/types/ui/src/windowPopper/WindowPopper.stories.d.ts +3 -0
  735. package/types/ui/src/windowPopper/WindowPopperTransition.d.ts +7 -0
  736. package/types/ui/test/convertHtmlToImage.d.ts +1 -0
  737. package/types/ui/test/testUtils.d.ts +9 -0
@@ -0,0 +1,48 @@
1
+ type Props = {
2
+ size: number;
3
+ viewBox?: string;
4
+ };
5
+
6
+ const SocPanelIcon = ({ size, viewBox }: Props) => (
7
+ <svg
8
+ xmlns='http://www.w3.org/2000/svg'
9
+ xmlSpace='preserve'
10
+ style={{
11
+ enableBackground: `new ${viewBox}`,
12
+ }}
13
+ viewBox={viewBox}
14
+ height={size}
15
+ >
16
+ <path
17
+ d='M269.9 197.9 220.3 229l-105.8 41.5h-14.1L188 55l14.5 11.1 66.6 99.3z'
18
+ style={{
19
+ fillRule: 'evenodd',
20
+ clipRule: 'evenodd',
21
+ fill: '#ff3600',
22
+ }}
23
+ />
24
+ <path
25
+ d='m188 55-2.8-12.6L110 11.3 78.9 37.2 10.7 216.4l5.2 19.3 20 15.5 37 14.1 27.5 5.2z'
26
+ style={{
27
+ fillRule: 'evenodd',
28
+ clipRule: 'evenodd',
29
+ fill: '#0063ff',
30
+ }}
31
+ />
32
+ <path
33
+ d='M114.7 3.6c-5.3-.2-10.5.8-15.4 2.7-4.9 1.9-9.4 4.8-13.1 8.5-3.7 3.7-6.7 8.1-8.7 13L6.4 203.9c-3.7 9.1-3.7 19.4-.1 28.5C10 241.6 17 249 26 253.1l44.2 20.4c8.6 4 18 6.1 27.5 6.3s18.9-1.6 27.7-5.2L256 220.8c2.9-1.2 5.6-2.7 8.1-4.6 1.9-1.4 3.8-3 5.4-4.8 3.8-4.1 6.7-8.9 8.4-14.1 1.7-5.3 2.3-10.8 1.7-16.3-.6-5.5-2.4-10.8-5.3-15.5L208.1 56.1c-7-11.6-17.4-20.8-29.7-26.5L129.9 7.2c-4.8-2.2-9.9-3.4-15.2-3.6zM106 23.4c2.6-1 5.4-1.5 8.1-1.4 2.8.1 5.5.7 8 1.9l48.4 22.4c2.9 1.3 5.6 2.9 8.2 4.7l-85 210.1c-5.5-.6-10.8-2.1-15.8-4.4l-44.2-20.4c-4.7-2.2-8.4-6.1-10.3-10.8-1.9-4.7-1.9-10 0-14.8l71.2-176c1-2.5 2.6-4.8 4.5-6.8 2-1.9 4.3-3.5 6.9-4.5zm8.5 235.6 78.1-193 66 108.9c1.1 1.7 1.8 3.6 2.3 5.6.2.8.3 1.6.4 2.5.3 2.9 0 5.7-.9 8.5-.9 2.7-2.4 5.2-4.4 7.4a20.5 20.5 0 0 1-5 3.9c-.7.4-1.4.7-2.1 1l-130.6 53.9c-1.2.5-2.5.9-3.8 1.3z'
34
+ style={{
35
+ fillRule: 'evenodd',
36
+ clipRule: 'evenodd',
37
+ fill: '#010005',
38
+ }}
39
+ />
40
+ </svg>
41
+ )
42
+
43
+ SocPanelIcon.defaultProps = {
44
+ viewBox: '0 0 283.5 283.5',
45
+ size: 24,
46
+ };
47
+
48
+ export default SocPanelIcon
@@ -0,0 +1,42 @@
1
+
2
+ /* eslint-disable @woovi/no-hex-colors */
3
+ type Props = {
4
+ size: number;
5
+ color?: string;
6
+ viewBox?: string;
7
+ };
8
+
9
+ const WabizIcon = (props: Props) => {
10
+ return (
11
+ <svg
12
+ xmlns='http://www.w3.org/2000/svg'
13
+ xmlSpace='preserve'
14
+ id='Layer_1'
15
+ x={0}
16
+ y={0}
17
+ width={props.size}
18
+ height={props.size}
19
+ viewBox='0 0 393 393'
20
+ {...props}
21
+ >
22
+ <style>{'.st1{fill:#fff}'}</style>
23
+ <path
24
+ d='M331.4 393H61.6C27.6 393 0 365.5 0 331.4V61.6C0 27.6 27.6 0 61.6 0h269.9c34 0 61.6 27.6 61.6 61.6v269.9c-.1 34-27.6 61.5-61.7 61.5z'
25
+ style={{
26
+ fill: props.color,
27
+ }}
28
+ />
29
+ <path
30
+ d='m131.8 204.8 43.4-43.4c5.7-5.7 5.7-15 0-20.7l-13-13c-5.7-5.7-15-5.7-20.7 0l-34.8 34.8-34.8-34.8c-5.7-5.7-15-5.7-20.7 0l-13 13c-5.7 5.7-5.7 15 0 20.7l43.4 43.4c.5.7 1 1.4 1.6 2l13 13c2.9 2.9 6.7 4.3 10.5 4.3s7.6-1.4 10.5-4.3l13-13c.6-.6 1.2-1.3 1.6-2M258.5 146.7l-13-13c-5.7-5.7-15-5.7-20.7 0L127 231.5c-5.7 5.7-5.7 15 0 20.7l13 13c5.7 5.7 15 5.7 20.7 0l97.8-97.8c5.7-5.7 5.7-14.9 0-20.7M354.9 231.6l-43.4-43.4c-.5-.7-1-1.4-1.6-2l-13-13c-2.9-2.9-6.7-4.3-10.5-4.3s-7.6 1.4-10.5 4.3l-13 13c-.6.6-1.2 1.3-1.6 2l-43.4 43.4c-5.7 5.7-5.7 15 0 20.7l13 13c5.7 5.7 15 5.7 20.7 0l34.8-34.8 34.8 34.8c5.7 5.7 15 5.7 20.7 0l13-13c5.7-5.7 5.7-15 0-20.7'
31
+ className='st1'
32
+ />
33
+ </svg>
34
+ );
35
+ }
36
+
37
+ WabizIcon.defaultProps = {
38
+ color: '#72ba00',
39
+ size: 32,
40
+ };
41
+
42
+ export default WabizIcon;
@@ -0,0 +1,45 @@
1
+ type Props = {
2
+ size: number;
3
+ color?: string;
4
+ viewBox?: string;
5
+ };
6
+
7
+ const WakeIcon = ({ size, color, viewBox }: Props) => (
8
+ <svg
9
+ xmlns='http://www.w3.org/2000/svg'
10
+ width={size}
11
+ height={size}
12
+ viewBox={viewBox}
13
+ color={color}
14
+ >
15
+ <path d='M51.2762 0H46.1914V22.4778H51.2762V0Z' fill='#1A1A1A' />
16
+ <path
17
+ d='M60.8644 16.775V22.5842L46.2188 14.151V8.34351L60.8644 16.775Z'
18
+ fill='#1A1A1A'
19
+ />
20
+ <path
21
+ d='M46.1914 13.9701V19.9918L60.9556 11.5587V5.53857L46.1914 13.9701Z'
22
+ fill='#C505F2'
23
+ />
24
+ <path
25
+ d='M20.2774 4.8313L17.6222 14.417L14.9914 4.91932L15.0157 4.8313H14.9654H10.163H10.1143L10.1387 4.91932L7.50785 14.417L4.85268 4.8313H0L2.22996 12.9489L2.25268 12.8725L4.88838 22.4781H5.34768H5.36716H9.88063H9.90011H10.1257L12.5764 13.6364L15.0027 22.4781H15.462H15.4799H19.995H20.0145H20.24L25.1284 4.8313H20.2774Z'
26
+ fill='#1A1A1A'
27
+ />
28
+ <path
29
+ d='M31.1741 16.9577C32.0261 17.8611 33.0665 18.3129 34.36 18.3129C35.6535 18.3129 36.6938 17.8611 37.5442 16.9245C38.3963 15.9895 38.8377 14.8918 38.8377 13.6014C38.8377 12.311 38.3963 11.2133 37.5442 10.3098C36.6938 9.40641 35.6518 8.95469 34.36 8.95469C33.0665 8.95469 32.0261 9.40641 31.1741 10.3098C30.3545 11.2133 29.9439 12.311 29.9439 13.6014C29.9422 14.925 30.3529 16.0227 31.1741 16.9577ZM38.8377 4.84275H43.5054V22.4763H38.8377V20.6678C37.356 22.1857 35.5885 22.9263 33.5079 22.9263C31.0475 22.9263 28.9977 22.0229 27.3893 20.2476C25.781 18.4407 24.9922 16.2137 24.9922 13.535C24.9922 10.8878 25.8118 8.69396 27.4218 6.95187C29.0301 5.20977 31.0799 4.33789 33.5079 4.33789C35.5902 4.33789 37.356 5.11345 38.8377 6.66124V4.84275Z'
30
+ fill='#1A1A1A'
31
+ />
32
+ <path
33
+ d='M67.0985 11.763H75.2361C74.7622 9.73024 73.3112 8.47141 71.2614 8.47141C69.2441 8.47141 67.6357 9.69703 67.0985 11.763ZM79.8404 15.3767H67.131C67.7298 17.6037 69.3074 18.7015 71.8295 18.7015C73.7851 18.7015 75.5818 18.1219 77.2226 16.9909L79.1782 20.4435C77.0651 22.0893 74.543 22.8964 71.6103 22.8964C68.551 22.8964 66.2172 21.993 64.5764 20.2177C62.968 18.4424 62.1484 16.2486 62.1484 13.6346C62.1484 10.9558 62.9989 8.76204 64.6722 7.01828C66.3438 5.24297 68.5511 4.37109 71.263 4.37109C73.8176 4.37109 75.8999 5.1782 77.5391 6.75921C79.1783 8.34022 79.9995 10.5025 79.9995 13.246C79.9978 13.8604 79.9362 14.5712 79.8404 15.3767Z'
34
+ fill='#1A1A1A'
35
+ />
36
+ </svg>
37
+ );
38
+
39
+ WakeIcon.defaultProps = {
40
+ viewBox: '0 0 80 23',
41
+ color: '#C505F2',
42
+ size: 50,
43
+ };
44
+
45
+ export default WakeIcon;
@@ -0,0 +1,13 @@
1
+ import styled from 'styled-components';
2
+
3
+ const Dropzone = styled.div`
4
+ padding: 20px 8px;
5
+ display: flex;
6
+ align-items: center;
7
+ justify-content: center;
8
+ background-color: rgba(96, 115, 137, 0.05);
9
+ border: 1px dashed #ccc;
10
+ border-radius: 8px;
11
+ `;
12
+
13
+ export default Dropzone;
@@ -0,0 +1,278 @@
1
+ import CloudUploadIcon from '@mui/icons-material/CloudUpload';
2
+ import _Icon from '@mui/material/Icon';
3
+ import _IconButton from '@mui/material/IconButton';
4
+ import { getTime } from 'date-fns';
5
+ import mime from 'mime-types';
6
+ import type { ReactNode } from 'react';
7
+ import { useState } from 'react';
8
+ import { useDropzone } from 'react-dropzone';
9
+ import { useTranslation } from 'react-i18next';
10
+ import { Text } from 'rebass';
11
+ import styled from 'styled-components';
12
+
13
+ import _Dropzone from './Dropzone';
14
+ import BoxFlex from '../mui/BoxFlex';
15
+ import Typography from '../mui/Typography';
16
+
17
+ const Dropzone = styled(_Dropzone)`
18
+ flex-direction: column;
19
+ gap: 10px;
20
+ `;
21
+
22
+ const RemovePreviewIcon = styled(_Icon).attrs({
23
+ children: 'close',
24
+ })`
25
+ color: ${(props) => props.theme.primaryDarkerColor};
26
+ `;
27
+
28
+ const IconButton = styled(_IconButton)`
29
+ width: 30px;
30
+ height: 30px;
31
+ `;
32
+
33
+ const FilePreview = styled.div`
34
+ display: flex;
35
+ max-width: 265px;
36
+ justify-content: space-between;
37
+ align-items: center;
38
+ font-size: 14px;
39
+ font-weight: 600;
40
+ color: ${(props) => props.theme.primaryDarkerColor};
41
+ `;
42
+
43
+ const FileName = styled.p`
44
+ margin: 0;
45
+ white-space: nowrap;
46
+ overflow: hidden;
47
+ text-overflow: ellipsis;
48
+ `;
49
+
50
+ const TextHover = styled(Text)`
51
+ && {
52
+ cursor: pointer;
53
+ color: ${(props) => props.theme.primaryLighterColor};
54
+ }
55
+ `;
56
+
57
+ export const allowedMimeTypes = [
58
+ 'audio/mp3',
59
+ 'audio/ogg',
60
+ 'audio/wav',
61
+ 'video/mp4',
62
+ 'image/*',
63
+ 'application/pdf',
64
+ 'text/plain',
65
+ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document',
66
+ 'application/msword',
67
+ 'text/csv',
68
+ 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
69
+ ];
70
+
71
+ type OnDropFileArgs = {
72
+ files: File[];
73
+ multiple?: boolean;
74
+ onChange: (files: File | File[]) => void;
75
+ };
76
+
77
+ type RenderPreviewArgs = {
78
+ file?: File;
79
+ files: File[];
80
+ multiple: boolean | null;
81
+ onRemoveFile?: (index?: number) => void;
82
+ allowRemoval: boolean | null;
83
+ };
84
+
85
+ type File = any;
86
+
87
+ type Props = {
88
+ file?: File;
89
+ files?: File[];
90
+ multiple?: boolean;
91
+ onChange: (files: File | File[]) => void;
92
+ onRemoveFile: (index?: number) => void;
93
+ isImagePreview?: boolean;
94
+ allowRemoval?: boolean;
95
+ isLoading?: boolean;
96
+ dataComplete?: boolean;
97
+ shouldUseOriginalName?: boolean;
98
+ allowedTypes?: string[];
99
+ description?: ReactNode;
100
+ };
101
+
102
+ const DropzoneFile = ({
103
+ file,
104
+ files = [],
105
+ multiple = true,
106
+ onRemoveFile: onRemoveFileProp,
107
+ onChange,
108
+ isImagePreview = false,
109
+ allowRemoval = true,
110
+ isLoading,
111
+ dataComplete,
112
+ shouldUseOriginalName,
113
+ allowedTypes = allowedMimeTypes,
114
+ ...props
115
+ }: Props) => {
116
+ const { t } = useTranslation();
117
+ const [imagePreview, setImagePreview] = useState<File | string>(() => {
118
+ if (!!file?.url) {
119
+ return file?.url.split('/smart/')[1];
120
+ }
121
+
122
+ return file;
123
+ });
124
+
125
+ const onRemoveFile = (e) => {
126
+ e.stopPropagation();
127
+ onRemoveFileProp();
128
+ };
129
+
130
+ const generateFileName = (file: File, index: number): string => {
131
+ const extension = mime.extension(file.type);
132
+
133
+ return `${getTime(new Date())}-${index}.${extension}`;
134
+ };
135
+
136
+ const secureFiles = (files: File[]): File[] => {
137
+ return files.map((file, index) => {
138
+ const fileName = shouldUseOriginalName
139
+ ? file.name
140
+ : generateFileName(file, index);
141
+
142
+ const options = {
143
+ lastModified: file.lastModified,
144
+ lastModifiedDate: file.lastModifiedDate,
145
+ type: file.type,
146
+ };
147
+
148
+ return new File([file], fileName, options);
149
+ });
150
+ };
151
+
152
+ const onDropAccepted = ({ multiple, onChange, files }: OnDropFileArgs) => {
153
+ const securedFiles = secureFiles(files);
154
+
155
+ if (multiple) {
156
+ return onChange(securedFiles);
157
+ }
158
+
159
+ return onChange(securedFiles[0]);
160
+ };
161
+
162
+ const renderPreview = ({
163
+ file,
164
+ files,
165
+ multiple,
166
+ onRemoveFile,
167
+ allowRemoval,
168
+ }: RenderPreviewArgs) => {
169
+ if (multiple && files.length) {
170
+ return files.map((file, index) => (
171
+ <BoxFlex key={index}>
172
+ <Typography>{file.name}</Typography>
173
+ {onRemoveFile && (
174
+ <IconButton onClick={() => onRemoveFile(index)} size='large'>
175
+ <RemovePreviewIcon />
176
+ </IconButton>
177
+ )}
178
+ </BoxFlex>
179
+ ));
180
+ }
181
+
182
+ if (file) {
183
+ if (file instanceof File && isImagePreview) {
184
+ const reader = new FileReader();
185
+
186
+ reader.addEventListener('load', () => {
187
+ setImagePreview(reader.result);
188
+ });
189
+ reader.readAsDataURL(file);
190
+ }
191
+
192
+ return (
193
+ <BoxFlex
194
+ sx={{
195
+ alignItems: 'center',
196
+ flexDirection: 'column',
197
+ img: {
198
+ width: 'auto',
199
+ height: 'auto',
200
+ maxWidth: '265px',
201
+ },
202
+ backgroundColor: 'rgba(96, 115, 137, 0.19)',
203
+ p: isImagePreview ? '10px' : '0 10px',
204
+ }}
205
+ >
206
+ {isImagePreview ? <img src={imagePreview} alt='preview' /> : null}
207
+ <FilePreview>
208
+ <FileName>{file.name}</FileName>
209
+
210
+ {onRemoveFile && !!allowRemoval && (
211
+ <IconButton onClick={onRemoveFile} size='large'>
212
+ <RemovePreviewIcon />
213
+ </IconButton>
214
+ )}
215
+ </FilePreview>
216
+ </BoxFlex>
217
+ );
218
+ }
219
+
220
+ return null;
221
+ };
222
+
223
+ const accept = allowedTypes.reduce(
224
+ (acc, key) => ({
225
+ ...acc,
226
+ [key]: [],
227
+ }),
228
+ {},
229
+ );
230
+
231
+ const { getRootProps, getInputProps } = useDropzone({
232
+ onDropAccepted: (files) => {
233
+ onDropAccepted({
234
+ multiple,
235
+ onChange,
236
+ files,
237
+ });
238
+ },
239
+ accept,
240
+ });
241
+
242
+ const description = props.description ?? (
243
+ <BoxFlex sx={{ alignItems: 'center', gap: '15px' }}>
244
+ <CloudUploadIcon color='secondary' fontSize='large' />
245
+ <Typography>
246
+ {t('Drag and drop or')}{' '}
247
+ <TextHover as='span'>{t('choose a file')}</TextHover>{' '}
248
+ {t('to upload your data')}
249
+ </Typography>
250
+ </BoxFlex>
251
+ );
252
+
253
+ return (
254
+ <Dropzone {...getRootProps()} {...props}>
255
+ <input data-testid='input-drop' {...getInputProps()} />
256
+ {description}
257
+ {dataComplete && (
258
+ <Typography sx={{ fontSize: '12px', padding: '15px' }}>
259
+ {t('File uploaded successfully. Click the go forward button')}
260
+ </Typography>
261
+ )}
262
+ {isLoading && (
263
+ <Typography sx={{ fontSize: '12px', padding: '15px' }}>
264
+ {t('We are analyzing your file, this may take a while...')}
265
+ </Typography>
266
+ )}
267
+ {renderPreview({
268
+ file,
269
+ files,
270
+ multiple,
271
+ onRemoveFile,
272
+ allowRemoval,
273
+ })}
274
+ </Dropzone>
275
+ );
276
+ };
277
+
278
+ export default DropzoneFile;
@@ -0,0 +1,161 @@
1
+ import type { Dispatch, SetStateAction } from 'react';
2
+ import { useMemo, useCallback } from 'react';
3
+ import 'react-datasheet/lib/react-datasheet.css';
4
+ import type { TFunction } from 'react-i18next';
5
+ import { useTranslation } from 'react-i18next';
6
+ import type { Row } from 'react-table';
7
+ import { Flex, Text } from 'rebass';
8
+
9
+ import { IMPORT_STATUS, ImportTable } from '@woovi/table';
10
+
11
+ import { EditableCell, getColumnType } from './ImportUtils';
12
+
13
+ type Props = {
14
+ isProcessing: boolean;
15
+ setShowReport: (v: boolean) => void;
16
+ data: any[];
17
+ setData: Dispatch<SetStateAction<any[]>>;
18
+ setSelectedData: Dispatch<SetStateAction<Array<Row<any>>>>;
19
+ firstImport: boolean;
20
+ selectedData: Array<Row<any>>;
21
+ dataImportTable: any[];
22
+ getInvalidFieldsMessage: (field: any, t: TFunction) => string[];
23
+ getReferences: (row: any) => any;
24
+ setIsNextEnabled: (isNextEnabled: boolean) => void;
25
+ };
26
+ const Import = ({
27
+ data,
28
+ setData,
29
+ isProcessing,
30
+ setSelectedData,
31
+ firstImport,
32
+ selectedData,
33
+ dataImportTable,
34
+ getInvalidFieldsMessage,
35
+ getReferences,
36
+ setIsNextEnabled,
37
+ customColumnValidation = {},
38
+ }: Props) => {
39
+ const { t } = useTranslation();
40
+
41
+ const updateMyData = async (rowIndex, columnId, value) => {
42
+ const updateRowData = {
43
+ ...data[rowIndex],
44
+ [columnId]: value,
45
+ };
46
+
47
+ const getNewData = async () => {
48
+ const newDataRow = await getReferences(updateRowData, t, data);
49
+
50
+ const invalidFields = Object.values(newDataRow).filter(
51
+ (item) => typeof item?.isValid === 'boolean' && !item?.isValid,
52
+ );
53
+
54
+ const getValueMessage = () => {
55
+ if (!newDataRow.importStatus?.value?.message.length) {
56
+ return [];
57
+ }
58
+
59
+ return newDataRow.importStatus?.value?.message;
60
+ };
61
+
62
+ if (!!invalidFields?.length) {
63
+ return {
64
+ ...newDataRow,
65
+ importStatus: {
66
+ ...newDataRow.importStatus,
67
+ value: {
68
+ status: IMPORT_STATUS.ERROR,
69
+ message: [
70
+ ...getInvalidFieldsMessage(invalidFields, t),
71
+ ...getValueMessage(),
72
+ ],
73
+ },
74
+ },
75
+ };
76
+ }
77
+
78
+ return newDataRow;
79
+ };
80
+
81
+ const updatedData = await getNewData();
82
+
83
+ setData((old) =>
84
+ old.map((row, index) => {
85
+ if (index === rowIndex) {
86
+ return updatedData;
87
+ }
88
+
89
+ return row;
90
+ }),
91
+ );
92
+ };
93
+
94
+ const renderRowSubComponent = useCallback(({ row }) => {
95
+ const importStatus = row.original.importStatus;
96
+
97
+ return (
98
+ <Flex flexDirection='column'>
99
+ <Text fontSize='12px' fontWeight='600' mr='5px'>
100
+ {t('Status')}:
101
+ </Text>
102
+ {importStatus.value?.message?.map((message, index) => {
103
+ return (
104
+ <Text fontSize='12px' mr='5px' key={index}>
105
+ {`- ${message}`}
106
+ </Text>
107
+ );
108
+ })}
109
+ </Flex>
110
+ );
111
+ }, []);
112
+
113
+ const columns = useMemo(() => {
114
+ return dataImportTable.map(({ name, requiredMessage }) => ({
115
+ Header: name,
116
+ accessor: name,
117
+ columnType: getColumnType(name),
118
+ customColumnValidation,
119
+ requiredMessage,
120
+ Cell: EditableCell,
121
+ }));
122
+ }, []);
123
+
124
+ const setSelectedDataFn = (selectedData: any[]) => {
125
+ if (selectedData.length === 0) {
126
+ setIsNextEnabled(false);
127
+ setSelectedData(selectedData);
128
+
129
+ return;
130
+ }
131
+
132
+ setIsNextEnabled(true);
133
+ setSelectedData(selectedData);
134
+ };
135
+
136
+ return (
137
+ <Flex flexDirection='column' mt='20px'>
138
+ <Flex justifyContent='flex-end' height='19px' mb='20px'>
139
+ {!!selectedData.length && (
140
+ <Text fontSize='14px' fontWeight='600'>
141
+ {selectedData.length}{' '}
142
+ {t('Row selected', { count: selectedData.length })}
143
+ </Text>
144
+ )}
145
+ </Flex>
146
+ <ImportTable
147
+ columns={columns}
148
+ data={data}
149
+ updateMyData={updateMyData}
150
+ setSelectedData={setSelectedDataFn}
151
+ renderRowSubComponent={renderRowSubComponent}
152
+ setData={setData}
153
+ isProcessing={isProcessing}
154
+ firstImport={firstImport}
155
+ dataImportTable={dataImportTable}
156
+ />
157
+ </Flex>
158
+ );
159
+ };
160
+
161
+ export default Import;
@@ -0,0 +1,120 @@
1
+ import { useSnackbar } from 'notistack';
2
+ import { useTranslation } from 'react-i18next';
3
+ import * as XLSX from 'xlsx';
4
+
5
+ import { DropzoneFile } from '@woovi/ui';
6
+
7
+ import { getData, validateHeader } from './ImportUtils';
8
+
9
+ type Props = {
10
+ isLoading: boolean;
11
+ setIsLoading: (v: boolean) => void;
12
+ setShowReport: (v: boolean) => void;
13
+ clearData: () => void;
14
+ dataComplete: boolean;
15
+ sheet: File;
16
+ setSheet: (file: File) => void;
17
+ setData: (data: any[]) => void;
18
+ setFirstData: (data: any[]) => void;
19
+ setFirstImport: (firstImport: boolean) => void;
20
+ dataImportTable: any[];
21
+ };
22
+ const ImportDropzone = ({
23
+ isLoading,
24
+ setIsLoading,
25
+ setSheet,
26
+ setData,
27
+ clearData,
28
+ sheet,
29
+ dataComplete,
30
+ setShowReport,
31
+ setFirstData,
32
+ setFirstImport,
33
+ dataImportTable,
34
+ }: Props) => {
35
+ const { t } = useTranslation();
36
+ const { enqueueSnackbar } = useSnackbar();
37
+
38
+ const onChangeFile = (file: File | File[]) => {
39
+ setData([]);
40
+ setShowReport(false);
41
+ setIsLoading(true);
42
+ setSheet(file);
43
+ setFirstImport(false);
44
+
45
+ const reader = new FileReader();
46
+ const rABS = !!reader.readAsBinaryString;
47
+
48
+ reader.onload = async (e) => {
49
+ /* Parse data */
50
+ const bstr = e.target.result;
51
+
52
+ const wb = XLSX.read(bstr, {
53
+ type: rABS ? 'binary' : 'array',
54
+ cellDates: true,
55
+ });
56
+
57
+ /* Get first worksheet */
58
+ const wsname = wb.SheetNames[0];
59
+ const ws = wb.Sheets[wsname];
60
+ /* Convert array of arrays */
61
+ const dataRaw = XLSX.utils.sheet_to_json(ws, {
62
+ header: 1,
63
+ raw: true,
64
+ });
65
+
66
+ const [header, ...excelData] = dataRaw;
67
+
68
+ const headerMatch = validateHeader({
69
+ header,
70
+ defaultHeader: dataImportTable,
71
+ });
72
+
73
+ if (!headerMatch) {
74
+ setIsLoading(false);
75
+ setSheet(null);
76
+ enqueueSnackbar(
77
+ t(
78
+ 'Error: excel out of the template. Do not remove columns or edit titles.',
79
+ ),
80
+ {
81
+ variant: 'error',
82
+ },
83
+ );
84
+
85
+ return null;
86
+ }
87
+
88
+ const newData = getData({
89
+ excelData: excelData,
90
+ dataImportTable,
91
+ header,
92
+ t,
93
+ });
94
+
95
+ setFirstData(newData);
96
+ setIsLoading(false);
97
+ };
98
+
99
+ if (rABS) {
100
+ reader.readAsBinaryString(file);
101
+ } else {
102
+ reader.readAsArrayBuffer(file);
103
+ }
104
+ };
105
+
106
+ return (
107
+ <DropzoneFile
108
+ file={sheet}
109
+ onChange={onChangeFile}
110
+ onRemoveFile={(e) => clearData(e)}
111
+ allowRemoval={!!sheet}
112
+ multiple={false}
113
+ isLoading={isLoading}
114
+ dataComplete={dataComplete}
115
+ shouldUseOriginalName
116
+ />
117
+ );
118
+ };
119
+
120
+ export default ImportDropzone;